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

package fat0

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

Package fat0 provides data types corresponding to valid FAT-0 entries for Transaction and Issuance as well as methods for validating the structure and content of the factom entry.

Index

Package Files

addressamountmap.go doc.go transaction.go

Constants

const Type = fat.TypeFAT0

type AddressAmountMap Uses

type AddressAmountMap map[factom.FAAddress]uint64

AddressAmountMap relates a factom.FAAddress to its amount for the Inputs and Outputs of a Transaction.

func (AddressAmountMap) MarshalJSON Uses

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

MarshalJSON marshals a list of addresses and amounts used in the inputs or outputs of a transaction. Addresses with a 0 amount are omitted.

func (AddressAmountMap) Sum Uses

func (m AddressAmountMap) Sum() uint64

Sum returns the sum of all amount values.

func (*AddressAmountMap) UnmarshalJSON Uses

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

UnmarshalJSON unmarshals a list of addresses and amounts used in the inputs or outputs of a transaction. Duplicate addresses or addresses with a 0 amount cause an error.

type Transaction Uses

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

    Metadata json.RawMessage `json:"metadata,omitempty"`

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

Transaction represents a fat0 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 fat0 imports 6 packages (graph) and is imported by 3 packages. Updated 2020-01-02. Refresh now. Tools for package owners.