Documentation ¶
Overview ¶
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 ¶
Constants ¶
const Type = fat.TypeFAT0
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressAmountMap ¶
AddressAmountMap relates a factom.FAAddress to its amount for the Inputs and Outputs of a Transaction.
func (AddressAmountMap) MarshalJSON ¶
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 ¶
func (m AddressAmountMap) Sum() uint64
Sum returns the sum of all amount values.
func (*AddressAmountMap) UnmarshalJSON ¶
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 ¶
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 ¶
func (Transaction) IsCoinbase ¶
func (t Transaction) IsCoinbase() bool
func (Transaction) String ¶
func (t Transaction) String() string
func (*Transaction) UnmarshalJSON ¶
func (t *Transaction) UnmarshalJSON(data []byte) error