factom: github.com/Factom-Asset-Tokens/factom/fat1 Index | Files

package fat1

import "github.com/Factom-Asset-Tokens/factom/fat1"

Index

Package Files

addressnftokensmap.go nftokenid.go nftokenidrange.go nftokenmetadata.go nftokens.go transaction.go

Constants

const MaxCapacity = 4e5
const Type = fat.TypeFAT1

Variables

var ErrorCapacity = fmt.Errorf("NFTokenID max capacity (%v) exceeded", maxCapacity)

type AddressNFTokensMap Uses

type AddressNFTokensMap map[factom.FAAddress]NFTokens

AddressTokenMap relates the RCDHash of an address to its NFTokenIDs.

func (AddressNFTokensMap) AllNFTokens Uses

func (m AddressNFTokensMap) AllNFTokens() (NFTokens, error)

func (AddressNFTokensMap) MarshalJSON Uses

func (m AddressNFTokensMap) MarshalJSON() ([]byte, error)

func (AddressNFTokensMap) Owner Uses

func (m AddressNFTokensMap) Owner(tknID NFTokenID) factom.FAAddress

func (AddressNFTokensMap) Sum Uses

func (m AddressNFTokensMap) Sum() uint64

func (*AddressNFTokensMap) UnmarshalJSON Uses

func (m *AddressNFTokensMap) UnmarshalJSON(data []byte) error

type NFTokenID Uses

type NFTokenID uint64

NFTokenID is a Non-Fungible Token ID.

type NFTokenIDMetadataMap Uses

type NFTokenIDMetadataMap map[NFTokenID]json.RawMessage

func (NFTokenIDMetadataMap) MarshalJSON Uses

func (m NFTokenIDMetadataMap) MarshalJSON() ([]byte, error)

func (*NFTokenIDMetadataMap) UnmarshalJSON Uses

func (m *NFTokenIDMetadataMap) UnmarshalJSON(data []byte) error

type NFTokens Uses

type NFTokens map[NFTokenID]struct{}

NFTokens are a set of unique NFTokenIDs. A map[NFTokenID]struct{} is used to guarantee uniqueness of NFTokenIDs.

func (NFTokens) ContainsAll Uses

func (tkns NFTokens) ContainsAll(tknsSub NFTokens) error

func (NFTokens) MarshalJSON Uses

func (tkns NFTokens) MarshalJSON() ([]byte, error)

func (NFTokens) Slice Uses

func (tkns NFTokens) Slice() []NFTokenID

Slice returns a sorted slice of tkns' NFTokenIDs.

func (NFTokens) String Uses

func (tkns NFTokens) String() string

func (*NFTokens) UnmarshalJSON Uses

func (tkns *NFTokens) UnmarshalJSON(data []byte) error

func (*NFTokens) UnmarshalText Uses

func (tkns *NFTokens) UnmarshalText(text []byte) error

type Transaction Uses

type Transaction struct {
    Inputs  AddressNFTokensMap `json:"inputs"`
    Outputs AddressNFTokensMap `json:"outputs"`

    TokenMetadata NFTokenIDMetadataMap `json:"tokenmetadata,omitempty"`
    Metadata      json.RawMessage      `json:"metadata,omitempty"`

    Entry factom.Entry `json:"-"`
}

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 Uses

func NewTransaction(e factom.Entry, idKey *factom.Bytes32) (Transaction, error)

func (Transaction) IsCoinbase Uses

func (t Transaction) IsCoinbase() bool

func (Transaction) Sign Uses

func (t Transaction) Sign(signingSet ...factom.RCDSigner) (factom.Entry, error)

func (Transaction) String Uses

func (t Transaction) String() string

func (*Transaction) UnmarshalJSON Uses

func (t *Transaction) UnmarshalJSON(data []byte) error

Package fat1 imports 9 packages (graph) and is imported by 6 packages. Updated 2020-01-02. Refresh now. Tools for package owners.