Documentation
¶
Index ¶
- Constants
- func GetOutpointHash(txid string, vout uint32) (string, error)
- func Sign(privKey btcec.PrivateKey, channel Helper, claim Helper, k string) (*keys.Signature, error)
- type Fee
- type FeeInfo
- type Helper
- func DecodeClaimBytes(serialized []byte, blockchainName string) (*Helper, error)
- func DecodeClaimHex(serialized string, blockchainName string) (*Helper, error)
- func DecodeClaimProtoBytes(serialized []byte, blockchainName string) (*Helper, error)
- func DecodeSupportBytes(serialized []byte, blockchainName string) (*Helper, error)
- func DecodeSupportProtoBytes(serialized []byte, blockchainName string) (*Helper, error)
- func (c *Helper) CompileValue() ([]byte, error)
- func (c *Helper) GetPublicKey() (*btcec.PublicKey, error)
- func (c *Helper) GetStream() *v2PB.Stream
- func (c *Helper) IsClaim() bool
- func (c *Helper) IsSupport() bool
- func (c *Helper) LoadFromBytes(rawClaim []byte, blockchainName string) error
- func (c *Helper) LoadFromHexString(claim_hex string, blockchainName string) error
- func (c *Helper) LoadSupportFromBytes(rawClaim []byte, blockchainName string) error
- func (c *Helper) LoadSupportFromHexString(claim_hex string, blockchainName string) error
- func (c *Helper) RenderJSON() (string, error)
- func (c *Helper) ValidateAddresses(blockchainName string) error
- func (c *Helper) ValidateCertificate() error
- func (c *Helper) ValidateClaimSignature(certificate *Helper, k string, certificateId string, blockchainName string) (bool, error)
- func (c *Helper) VerifyDigest(certificate *Helper, signature [64]byte, digest [32]byte) bool
- type Sources
- type V1Claim
- type V2Claim
- type V3Claim
Constants ¶
View Source
const ( NoSig = version(byte(0)) //Signature using ECDSA SECP256k1 key and SHA-256 hash. WithSig = version(byte(1)) UNKNOWN = version(byte(2)) )
View Source
const SECP256k1 = "SECP256k1"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Fee ¶
type Fee struct { LBC *FeeInfo `json:"LBC,omitempty"` BTC *FeeInfo `json:"BTC,omitempty"` USD *FeeInfo `json:"USD,omitempty"` }
Fee is the structure used for different currencies allowed for claims.
type FeeInfo ¶
type FeeInfo struct { Amount float32 `json:"amount"` //Required Address string `json:"address"` //Required }
FeeInfo is the structure of fee information used by lbry.
type Helper ¶
type Helper struct { Claim *v2PB.Claim Support *v2PB.Support LegacyClaim *v1PB.Claim ClaimID []byte Version version Signature []byte Payload []byte }
func DecodeClaimBytes ¶
DecodeClaimBytes take a byte array and tries to decode it to a protobuf claim or migrate it from either json v1,2,3 or pb v1
func DecodeClaimHex ¶
func DecodeClaimProtoBytes ¶
func DecodeSupportBytes ¶
DecodeSupportBytes take a byte array and tries to decode it to a protobuf support
func DecodeSupportProtoBytes ¶
func (*Helper) CompileValue ¶
func (*Helper) LoadFromBytes ¶
func (*Helper) LoadFromHexString ¶
func (*Helper) LoadSupportFromBytes ¶
func (*Helper) LoadSupportFromHexString ¶
func (*Helper) RenderJSON ¶
func (*Helper) ValidateAddresses ¶
func (*Helper) ValidateCertificate ¶
func (*Helper) ValidateClaimSignature ¶
type Sources ¶
type Sources struct { LbrySDHash string `json:"lbry_sd_hash"` //Required BTIH string `json:"btih"` //Required URL string `json:"url"` //Required }
Sources is the structure of Sources that can be used for a claim. Sources mainly include lbrysdhash but could be from elsewhere in the future.
type V1Claim ¶
type V1Claim struct { Version string `json:"ver,omitempty"` Title string `json:"title"` //Required Description string `json:"description"` //Required Author string `json:"author"` //Required Language string `json:"language"` //Required License string `json:"license"` //Required Sources Sources `json:"sources"` //Required ContentType string `json:"content-type"` //Required Thumbnail *string `json:"thumbnail,omitempty"` Fee *Fee `json:"fee,omitempty"` Contact *int `json:"contact,omitempty"` PubKey *string `json:"pubkey,omitempty"` }
V1Claim is the first version of claim metadata used by lbry.
type V2Claim ¶
type V2Claim struct { Version string `json:"ver"` //Required Title string `json:"title"` //Required Description string `json:"description"` //Required Author string `json:"author"` //Required Language string `json:"language"` //Required License string `json:"license"` //Required Sources Sources `json:"sources"` //Required ContentType string `json:"content-type"` //Required Thumbnail *string `json:"thumbnail,omitempty"` Fee *Fee `json:"fee,omitempty"` Contact *int `json:"contact,omitempty"` PubKey *string `json:"pubkey,omitempty"` LicenseURL *string `json:"license_url,omitempty"` NSFW bool `json:"nsfw"` //Required }
V2Claim is the second version of claim metadata used by lbry.
type V3Claim ¶
type V3Claim struct { Version string `json:"ver"` //Required Title string `json:"title"` //Required Description string `json:"description"` //Required Author string `json:"author"` //Required Language string `json:"language"` //Required License string `json:"license"` //Required Sources Sources `json:"sources"` //Required ContentType string `json:"content_type"` //Required Thumbnail *string `json:"thumbnail,omitempty"` Fee *Fee `json:"fee,omitempty"` Contact *int `json:"contact,omitempty"` PubKey *string `json:"pubkey,omitempty"` LicenseURL *string `json:"license_url,omitempty"` NSFW bool `json:"nsfw"` //Required Sig *string `json:"sig"` }
V3Claim is the third version of claim metadata used by lbry.
Click to show internal directories.
Click to hide internal directories.