Documentation ¶
Index ¶
Constants ¶
const ( OP_0 = 0x00 // 0 OP_PUSHDATA1 = 0x4c // 76 OP_PUSHDATA2 = 0x4d // 77 OP_PUSHDATA4 = 0x4e // 78 OP_RETURN = 0x6a // 106 )
Variables ¶
var ( // ErrUnsupportedSlpVersion is an error that indicates the parsed slp metadata is // an unsupported version ErrUnsupportedSlpVersion = errors.New("token_type not token-type1, nft1-group, or nft1-child") )
Functions ¶
Types ¶
type ParseResult ¶
type ParseResult interface { TokenType() TokenType TokenID() []byte GetVoutValue(vout int) (*big.Int, bool) TotalSlpMsgOutputValue() (*big.Int, error) }
ParseResult returns the parsed result.
func ParseSLP ¶
func ParseSLP(scriptPubKey []byte) (ParseResult, error)
ParseSLP unmarshals an SLP message from a transaction scriptPubKey.
type SlpGenesis ¶
type SlpGenesis struct {
Ticker, Name, DocumentURI, DocumentHash []byte
Decimals, MintBatonVout int
Qty uint64
// contains filtered or unexported fields
}
SlpGenesis is an unmarshalled Genesis ParseResult
func (SlpGenesis) GetVoutValue ¶
func (r SlpGenesis) GetVoutValue(vout int) (*big.Int, bool)
GetVoutValue returns the output amount or boolean flag indicating the index is a mint baton for a given transaction output index. Out of range vout returns nil.
func (SlpGenesis) TokenID ¶
func (r SlpGenesis) TokenID() []byte
TokenID returns the TokenID per the ParserResult interface
func (SlpGenesis) TokenType ¶
func (r SlpGenesis) TokenType() TokenType
TokenType returns the TokenType per the ParserResult interface
func (SlpGenesis) TotalSlpMsgOutputValue ¶
func (r SlpGenesis) TotalSlpMsgOutputValue() (*big.Int, error)
TotalSlpMsgOutputValue computes the output amount transferred in a transaction
type SlpMint ¶
SlpMint is an unmarshalled Mint ParseResult
func (SlpMint) GetVoutValue ¶
GetVoutValue returns the output amount or boolean flag indicating the index is a mint baton for a given transaction output index. Out of range vout returns nil.
type SlpSend ¶
type SlpSend struct { Amounts []uint64 // contains filtered or unexported fields }
SlpSend is an unmarshalled Send ParseResult
func (SlpSend) GetVoutValue ¶
GetVoutValue returns the output amount or boolean flag indicating the index is a mint baton for a given transaction output index. Out of range vout returns nil.
type TokenType ¶
type TokenType uint16
TokenType is an uint16 representing the slp version type
const ( // TokenTypeFungible01 version type used for ParseResult.TokenType TokenTypeFungible01 TokenType = 0x01 // TokenTypeNft1Child41 version type used for ParseResult.TokenType TokenTypeNft1Child41 TokenType = 0x41 // TokenTypeNft1Group81 version type used for ParseResult.TokenType TokenTypeNft1Group81 TokenType = 0x81 )