Documentation ¶
Index ¶
- Constants
- Variables
- type AddressNFTokensMap
- func (m AddressNFTokensMap) AllNFTokens() NFTokens
- func (m AddressNFTokensMap) MarshalJSON() ([]byte, error)
- func (m AddressNFTokensMap) NFTokenIDsConserved(n AddressNFTokensMap) error
- func (m AddressNFTokensMap) NoAddressIntersection(n AddressNFTokensMap) error
- func (m AddressNFTokensMap) NoInternalNFTokensIntersection() error
- func (m AddressNFTokensMap) NoNFTokensIntersection(newTkns NFTokens) error
- func (m AddressNFTokensMap) NumNFTokenIDs() int
- func (m AddressNFTokensMap) Owner(tknID NFTokenID) factom.FAAddress
- func (m *AddressNFTokensMap) UnmarshalJSON(data []byte) error
- type ErrorMissingNFTokenID
- type ErrorNFTokenIDIntersection
- type NFTokenID
- type NFTokenIDMetadataMap
- type NFTokenIDRange
- func (idRange NFTokenIDRange) IsJSONEfficient() bool
- func (idRange NFTokenIDRange) IsStringEfficient() bool
- func (idRange NFTokenIDRange) Len() int
- func (idRange NFTokenIDRange) MarshalJSON() ([]byte, error)
- func (idRange NFTokenIDRange) Set(tkns NFTokens) error
- func (idRange NFTokenIDRange) Slice() []NFTokenID
- func (idRange NFTokenIDRange) String() string
- func (idRange *NFTokenIDRange) UnmarshalJSON(data []byte) error
- func (idRange NFTokenIDRange) Valid() error
- type NFTokenMetadata
- type NFTokens
- func (tkns NFTokens) Append(newTkns NFTokens) error
- func (tkns NFTokens) ContainsAll(tknsSub NFTokens) error
- func (tkns NFTokens) MarshalJSON() ([]byte, error)
- func (tkns NFTokens) NoIntersection(tknsCmp NFTokens) error
- func (tkns NFTokens) Set(ids ...NFTokensSetter) error
- func (tkns NFTokens) Slice() []NFTokenID
- func (tkns NFTokens) String() string
- func (tkns *NFTokens) UnmarshalJSON(data []byte) error
- type NFTokensSetter
- type Transaction
- func (t Transaction) IsCoinbase() bool
- func (t *Transaction) MarshalEntry() error
- func (t Transaction) MarshalJSON() ([]byte, error)
- func (t Transaction) String() string
- func (t *Transaction) UnmarshalEntry() error
- func (t *Transaction) UnmarshalJSON(data []byte) error
- func (t *Transaction) Valid(idKey factom.IDKey) error
- func (t Transaction) ValidData() error
- func (t Transaction) ValidExtIDs() error
- func (t Transaction) ValidRCDs() bool
Constants ¶
const MaxCapacity = 4e5
const Type = fat.Type(1)
Variables ¶
var ErrorCapacity = fmt.Errorf("NFTokenID max capacity (%v) exceeded", maxCapacity)
Functions ¶
This section is empty.
Types ¶
type AddressNFTokensMap ¶
AddressTokenMap relates the RCDHash of an address to its NFTokenIDs.
func (AddressNFTokensMap) AllNFTokens ¶ added in v0.5.0
func (m AddressNFTokensMap) AllNFTokens() NFTokens
func (AddressNFTokensMap) MarshalJSON ¶
func (m AddressNFTokensMap) MarshalJSON() ([]byte, error)
func (AddressNFTokensMap) NFTokenIDsConserved ¶
func (m AddressNFTokensMap) NFTokenIDsConserved(n AddressNFTokensMap) error
func (AddressNFTokensMap) NoAddressIntersection ¶
func (m AddressNFTokensMap) NoAddressIntersection(n AddressNFTokensMap) error
func (AddressNFTokensMap) NoInternalNFTokensIntersection ¶
func (m AddressNFTokensMap) NoInternalNFTokensIntersection() error
func (AddressNFTokensMap) NoNFTokensIntersection ¶
func (m AddressNFTokensMap) NoNFTokensIntersection(newTkns NFTokens) error
func (AddressNFTokensMap) NumNFTokenIDs ¶
func (m AddressNFTokensMap) NumNFTokenIDs() int
func (AddressNFTokensMap) Owner ¶
func (m AddressNFTokensMap) Owner(tknID NFTokenID) factom.FAAddress
func (*AddressNFTokensMap) UnmarshalJSON ¶
func (m *AddressNFTokensMap) UnmarshalJSON(data []byte) error
type ErrorMissingNFTokenID ¶ added in v0.5.0
type ErrorMissingNFTokenID NFTokenID
func (ErrorMissingNFTokenID) Error ¶ added in v0.5.0
func (id ErrorMissingNFTokenID) Error() string
type ErrorNFTokenIDIntersection ¶ added in v0.5.0
type ErrorNFTokenIDIntersection NFTokenID
func (ErrorNFTokenIDIntersection) Error ¶ added in v0.5.0
func (id ErrorNFTokenIDIntersection) Error() string
type NFTokenIDMetadataMap ¶
type NFTokenIDMetadataMap map[NFTokenID]json.RawMessage
func (NFTokenIDMetadataMap) IsSubsetOf ¶
func (m NFTokenIDMetadataMap) IsSubsetOf(tkns NFTokens) error
func (NFTokenIDMetadataMap) MarshalJSON ¶
func (m NFTokenIDMetadataMap) MarshalJSON() ([]byte, error)
func (NFTokenIDMetadataMap) Set ¶
func (m NFTokenIDMetadataMap) Set(md NFTokenMetadata)
func (*NFTokenIDMetadataMap) UnmarshalJSON ¶
func (m *NFTokenIDMetadataMap) UnmarshalJSON(data []byte) error
type NFTokenIDRange ¶
NFTokenIDRange represents a contiguous range of NFTokenIDs.
func NewNFTokenIDRange ¶
func NewNFTokenIDRange(minMax ...NFTokenID) NFTokenIDRange
func (NFTokenIDRange) IsJSONEfficient ¶ added in v0.5.0
func (idRange NFTokenIDRange) IsJSONEfficient() bool
func (NFTokenIDRange) IsStringEfficient ¶ added in v0.5.0
func (idRange NFTokenIDRange) IsStringEfficient() bool
func (NFTokenIDRange) Len ¶
func (idRange NFTokenIDRange) Len() int
func (NFTokenIDRange) MarshalJSON ¶
func (idRange NFTokenIDRange) MarshalJSON() ([]byte, error)
func (NFTokenIDRange) Set ¶
func (idRange NFTokenIDRange) Set(tkns NFTokens) error
func (NFTokenIDRange) Slice ¶ added in v0.5.0
func (idRange NFTokenIDRange) Slice() []NFTokenID
Slice returns a sorted slice of tkns' NFTokenIDs.
func (NFTokenIDRange) String ¶ added in v0.5.0
func (idRange NFTokenIDRange) String() string
func (*NFTokenIDRange) UnmarshalJSON ¶
func (idRange *NFTokenIDRange) UnmarshalJSON(data []byte) error
func (NFTokenIDRange) Valid ¶
func (idRange NFTokenIDRange) Valid() error
type NFTokenMetadata ¶
type NFTokenMetadata struct { Tokens NFTokens `json:"ids"` Metadata json.RawMessage `json:"metadata,omitempty"` }
type NFTokens ¶
type NFTokens map[NFTokenID]struct{}
NFTokens are a set of unique NFTokenIDs. A map[NFTokenID]struct{} is used to guarantee uniqueness of NFTokenIDs.
func NewNFTokens ¶
func NewNFTokens(ids ...NFTokensSetter) (NFTokens, error)
NewNFTokens returns an NFTokens initialized with ids. If ids contains any duplicate NFTokenIDs.
func (NFTokens) ContainsAll ¶ added in v0.5.0
func (NFTokens) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. MarshalJSON will always produce the most efficient representation of tkns using NFTokenIDRanges over individual NFTokenIDs where appropriate. MarshalJSON will return an error if tkns is empty.
func (NFTokens) NoIntersection ¶
func (NFTokens) Set ¶
func (tkns NFTokens) Set(ids ...NFTokensSetter) error
Set all ids in tkns. Return an error if ids contains any duplicate or previously set NFTokenIDs.
func (*NFTokens) UnmarshalJSON ¶
type NFTokensSetter ¶
type NFTokensSetter interface { // Set the NFTokenIDs in tkns. Return an error if tkns already // contains one of the NFTokenIDs. Set(tkns NFTokens) error // Len returns number of NFTokenIDs that will be set. Len() int }
NFTokensSetter is an interface implemented by types that can set the NFTokenIDs they represent in a given NFTokens.
type Transaction ¶
type Transaction struct { Inputs AddressNFTokensMap `json:"inputs"` Outputs AddressNFTokensMap `json:"outputs"` TokenMetadata NFTokenIDMetadataMap `json:"tokenmetadata,omitempty"` fat.Entry }
Transaction represents a fat1 transaction, which can be a normal account transaction or a coinbase transaction depending on the Inputs and the RCD/signature pair.
func NewTransaction ¶
func NewTransaction(entry factom.Entry) Transaction
NewTransaction returns a Transaction initialized with the given entry.
func (Transaction) IsCoinbase ¶
func (t Transaction) IsCoinbase() bool
IsCoinbase returns true if the coinbase address is in t.Input. This does not necessarily mean that t is a valid coinbase transaction.
func (*Transaction) MarshalEntry ¶
func (t *Transaction) MarshalEntry() error
MarshalEntry marshals the Transaction into the Entry content.
func (Transaction) MarshalJSON ¶
func (t Transaction) MarshalJSON() ([]byte, error)
func (Transaction) String ¶ added in v0.5.0
func (t Transaction) String() string
func (*Transaction) UnmarshalEntry ¶
func (t *Transaction) UnmarshalEntry() error
UnmarshalEntry unmarshals the entry content as a Transaction.
func (*Transaction) UnmarshalJSON ¶
func (t *Transaction) UnmarshalJSON(data []byte) error
func (Transaction) ValidData ¶
func (t Transaction) ValidData() error
func (Transaction) ValidExtIDs ¶
func (t Transaction) ValidExtIDs() error
func (Transaction) ValidRCDs ¶
func (t Transaction) ValidRCDs() bool