fat1

package
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2020 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const MaxCapacity = 4e5
View Source
const Type = fat.TypeFAT1

Variables

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

Functions

This section is empty.

Types

type AddressNFTokensMap

type AddressNFTokensMap map[factom.FAAddress]NFTokens

AddressTokenMap relates the RCDHash of an address to its NFTokenIDs.

func (AddressNFTokensMap) AllNFTokens

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

func (AddressNFTokensMap) MarshalJSON

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

func (AddressNFTokensMap) Owner

func (AddressNFTokensMap) Sum

func (m AddressNFTokensMap) Sum() uint64

func (*AddressNFTokensMap) UnmarshalJSON

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

type NFTokenID

type NFTokenID uint64

NFTokenID is a Non-Fungible Token ID.

type NFTokenIDMetadataMap

type NFTokenIDMetadataMap map[NFTokenID]json.RawMessage

func (NFTokenIDMetadataMap) MarshalJSON

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

func (*NFTokenIDMetadataMap) UnmarshalJSON

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

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 (NFTokens) ContainsAll

func (tkns NFTokens) ContainsAll(tknsSub NFTokens) error

func (NFTokens) MarshalJSON

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

func (NFTokens) Slice

func (tkns NFTokens) Slice() []NFTokenID

Slice returns a sorted slice of tkns' NFTokenIDs.

func (NFTokens) String

func (tkns NFTokens) String() string

func (*NFTokens) UnmarshalJSON

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

func (*NFTokens) UnmarshalText

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

type Transaction

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

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

func (Transaction) IsCoinbase

func (t Transaction) IsCoinbase() bool

func (Transaction) Sign

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

func (Transaction) String

func (t Transaction) String() string

func (*Transaction) UnmarshalJSON

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL