fat

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2019 License: MIT Imports: 11 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

This section is empty.

Variables

This section is empty.

Functions

func ChainID

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

ChainID returns the chain ID for a given token ID and issuer Chain ID.

func Coinbase added in v0.4.0

func Coinbase() factom.FAAddress

func NameIDs

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

NameIDs returns valid NameIDs

func ValidTokenNameIDs

func ValidTokenNameIDs(nameIDs []factom.Bytes) bool

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

Types

type Entry

type Entry struct {
	Metadata json.RawMessage `json:"metadata,omitempty"`

	factom.Entry `json:"-"`
}

Entry has variables and methods common to all fat0 entries.

func (Entry) FAAddress added in v0.4.0

func (e Entry) FAAddress(rcdSigID int) factom.FAAddress

FAAddress computes the FAAddress corresponding to the rcdSigID'th RCD/Sig pair.

func (*Entry) MarshalEntry

func (e *Entry) MarshalEntry(v interface{}) error

func (Entry) MetadataJSONLen

func (e Entry) MetadataJSONLen() int

func (*Entry) Sign

func (e *Entry) Sign(signingSet ...factom.RCDPrivateKey)

Sign the RCD/Sig ID Salt + Timestamp Salt + Chain ID Salt + Content of the factom.Entry and add the RCD + signature pairs for the given addresses to the ExtIDs. This clears any existing ExtIDs.

func (Entry) UnmarshalEntry

func (e Entry) UnmarshalEntry(v interface{}) error

UnmarshalEntry unmarshals the content of the factom.Entry into the provided variable v, disallowing all unknown fields.

func (Entry) ValidExtIDs

func (e Entry) ValidExtIDs(numRCDSigPairs int) error

ValidExtIDs validates the structure of the ExtIDs of the factom.Entry to make sure that it has a valid timestamp salt and a valid set of RCD/signature pairs.

type Issuance

type Issuance struct {
	Type   Type  `json:"type"`
	Supply int64 `json:"supply"`

	Symbol string `json:"symbol,omitempty"`
	Entry
}

Issuance represents the Issuance of a token.

func NewIssuance

func NewIssuance(entry factom.Entry) Issuance

NewIssuance returns an Issuance initialized with the given entry.

func (*Issuance) MarshalEntry

func (i *Issuance) MarshalEntry() error

MarshalEntry marshals the entry content as an Issuance.

func (Issuance) MarshalJSON

func (i Issuance) MarshalJSON() ([]byte, error)

func (*Issuance) UnmarshalEntry

func (i *Issuance) UnmarshalEntry() error

UnmarshalEntry unmarshals the entry content as an Issuance.

func (*Issuance) UnmarshalJSON

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

func (*Issuance) Valid

func (i *Issuance) Valid(idKey factom.IDKey) error

Valid performs all validation checks and returns nil if i is a valid Issuance.

func (Issuance) ValidData

func (i Issuance) ValidData() error

ValidData validates the Issuance data and returns nil if no errors are present. ValidData assumes that the entry content has been unmarshaled.

func (Issuance) ValidExtIDs

func (i Issuance) ValidExtIDs() error

ValidExtIDs validates the structure of the external IDs of the entry to make sure that it has an RCD and signature. It does not validate the content of the RCD or signature.

type Type

type Type uint64
const (
	TypeFAT0 Type = iota
	TypeFAT1
)

func (Type) IsValid

func (t Type) IsValid() bool

func (Type) MarshalJSON

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

func (*Type) Set

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

func (Type) String

func (t Type) String() string

func (*Type) UnmarshalJSON

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

Directories

Path Synopsis
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.
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.

Jump to

Keyboard shortcuts

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