Documentation ¶
Index ¶
- Constants
- func GetOutpointHash(txid string, vout uint32) (string, error)
- type Fee
- type FeeInfo
- type Signature
- type Sources
- type StakeHelper
- func DecodeClaimBytes(serialized []byte, blockchainName string) (*StakeHelper, error)
- func DecodeClaimHex(serialized string, blockchainName string) (*StakeHelper, error)
- func DecodeClaimProtoBytes(serialized []byte, blockchainName string) (*StakeHelper, error)
- func DecodeSupportBytes(serialized []byte, blockchainName string) (*StakeHelper, error)
- func DecodeSupportProtoBytes(serialized []byte, blockchainName string) (*StakeHelper, error)
- func (c *StakeHelper) CompileValue() ([]byte, error)
- func (c *StakeHelper) GetPublicKey() (*btcec.PublicKey, error)
- func (c *StakeHelper) GetStream() *pb.Stream
- func (c *StakeHelper) IsClaim() bool
- func (c *StakeHelper) IsSupport() bool
- func (c *StakeHelper) LoadFromBytes(raw_claim []byte, blockchainName string) error
- func (c *StakeHelper) LoadFromHexString(claim_hex string, blockchainName string) error
- func (c *StakeHelper) LoadSupportFromBytes(raw_claim []byte, blockchainName string) error
- func (c *StakeHelper) LoadSupportFromHexString(claim_hex string, blockchainName string) error
- func (c *StakeHelper) RenderJSON() (string, error)
- func (c *StakeHelper) ValidateAddresses(blockchainName string) error
- func (c *StakeHelper) ValidateCertificate() error
- func (c *StakeHelper) ValidateClaimSignature(certificate *StakeHelper, k string, certificateId string, ...) (bool, error)
- func (c *StakeHelper) VerifyDigest(certificate *StakeHelper, signature [64]byte, digest [32]byte) bool
- 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 Signature ¶
func Sign ¶
func Sign(privKey btcec.PrivateKey, channel StakeHelper, claim StakeHelper, k string) (*Signature, error)
func (*Signature) LBRYSDKEncode ¶
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 StakeHelper ¶
type StakeHelper struct { Claim *pb.Claim Support *pb.Support LegacyClaim *legacy_pb.Claim ClaimID []byte Version version Signature []byte Payload []byte }
func DecodeClaimBytes ¶
func DecodeClaimBytes(serialized []byte, blockchainName string) (*StakeHelper, error)
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 DecodeClaimHex(serialized string, blockchainName string) (*StakeHelper, error)
func DecodeClaimProtoBytes ¶
func DecodeClaimProtoBytes(serialized []byte, blockchainName string) (*StakeHelper, error)
func DecodeSupportBytes ¶
func DecodeSupportBytes(serialized []byte, blockchainName string) (*StakeHelper, error)
DecodeSupportBytes take a byte array and tries to decode it to a protobuf support
func DecodeSupportProtoBytes ¶
func DecodeSupportProtoBytes(serialized []byte, blockchainName string) (*StakeHelper, error)
func (*StakeHelper) CompileValue ¶
func (c *StakeHelper) CompileValue() ([]byte, error)
func (*StakeHelper) GetPublicKey ¶
func (c *StakeHelper) GetPublicKey() (*btcec.PublicKey, error)
func (*StakeHelper) GetStream ¶
func (c *StakeHelper) GetStream() *pb.Stream
func (*StakeHelper) IsClaim ¶
func (c *StakeHelper) IsClaim() bool
func (*StakeHelper) IsSupport ¶
func (c *StakeHelper) IsSupport() bool
func (*StakeHelper) LoadFromBytes ¶
func (c *StakeHelper) LoadFromBytes(raw_claim []byte, blockchainName string) error
func (*StakeHelper) LoadFromHexString ¶
func (c *StakeHelper) LoadFromHexString(claim_hex string, blockchainName string) error
func (*StakeHelper) LoadSupportFromBytes ¶
func (c *StakeHelper) LoadSupportFromBytes(raw_claim []byte, blockchainName string) error
func (*StakeHelper) LoadSupportFromHexString ¶
func (c *StakeHelper) LoadSupportFromHexString(claim_hex string, blockchainName string) error
func (*StakeHelper) RenderJSON ¶
func (c *StakeHelper) RenderJSON() (string, error)
func (*StakeHelper) ValidateAddresses ¶
func (c *StakeHelper) ValidateAddresses(blockchainName string) error
func (*StakeHelper) ValidateCertificate ¶
func (c *StakeHelper) ValidateCertificate() error
func (*StakeHelper) ValidateClaimSignature ¶
func (c *StakeHelper) ValidateClaimSignature(certificate *StakeHelper, k string, certificateId string, blockchainName string) (bool, error)
func (*StakeHelper) VerifyDigest ¶
func (c *StakeHelper) VerifyDigest(certificate *StakeHelper, signature [64]byte, digest [32]byte) bool
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.