fat

package
v0.0.0-...-d06cbcf Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2020 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

View Source
const MaxPrecision = 18

Variables

This section is empty.

Functions

func Coinbase

func Coinbase() factom.FAAddress

func ComputeChainID

func ComputeChainID(tokenID string, issuerChainID *factom.Bytes32) factom.Bytes32

ComputeChainID returns the ChainID for a given tokenID and issuerChainID.

func NameIDs

func NameIDs(tokenID string, issuerChainID *factom.Bytes32) []factom.Bytes

NameIDs returns valid NameIDs

func ParseTokenIssuer

func ParseTokenIssuer(nameIDs []factom.Bytes) (string, factom.Bytes32)

ParseTokenIssuer returns the tokenID and identityChainID for a given set of nameIDs.

The caller must ensure that ValidNameIDs(nameIDs) returns true or else TokenIssuer will return garbage data or may panic.

func ValidNameIDs

func ValidNameIDs(nameIDs []factom.Bytes) bool

ValidNameIDs returns true if the nameIDs match the pattern for a valid token chain.

Types

type Issuance

type Issuance struct {
	Type      Type  `json:"type"`
	Supply    int64 `json:"supply"`
	Precision uint  `json:"precision,omitempty"`

	Symbol string `json:"symbol,omitempty"`

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

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

func NewIssuance

func NewIssuance(e factom.Entry, idKey *factom.Bytes32) (Issuance, error)

func (Issuance) Sign

func (i Issuance) Sign(idKey factom.RCDSigner) (factom.Entry, error)

func (*Issuance) UnmarshalJSON

func (i *Issuance) UnmarshalJSON(data []byte) error

type Type

type Type uint
const (
	TypeFAT0 Type = iota
	TypeFAT1
)

func (Type) IsValid

func (t Type) IsValid() bool

func (Type) MarshalText

func (t Type) MarshalText() ([]byte, error)

func (*Type) Set

func (t *Type) Set(s string) error

func (Type) String

func (t Type) String() string

func (*Type) UnmarshalText

func (t *Type) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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