fat0

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: 6 Imported by: 0 modules, 1 package

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

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

View Source
const Type = fat.TypeFAT0

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressAmountMap

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

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 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