Documentation
¶
Index ¶
- func ChainID(tokenID string, issuerChainID *factom.Bytes32) factom.Bytes32
- func NameIDs(tokenID string, issuerChainID *factom.Bytes32) []factom.Bytes
- func ValidIdentityChainID(chainID factom.Bytes) bool
- func ValidIdentityNameIDs(nameIDs []factom.Bytes) bool
- func ValidTokenNameIDs(nameIDs []factom.Bytes) bool
- type Entry
- type Identity
- type Issuance
- func (i *Issuance) MarshalEntry() error
- func (i Issuance) MarshalJSON() ([]byte, error)
- func (i *Issuance) UnmarshalEntry() error
- func (i *Issuance) UnmarshalJSON(data []byte) error
- func (i *Issuance) Valid(idKey *factom.RCDHash) error
- func (i Issuance) ValidData() error
- func (i Issuance) ValidExtIDs() error
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidIdentityChainID ¶
ValidIdentityChainID returns true if the chainID matches the pattern for an Identity Chain ID.
The Identity Chain specification can be found here: https://github.com/FactomProject/FactomDocs/blob/master/Identity.md#factom-identity-chain-creation
func ValidIdentityNameIDs ¶
ValidIdentityNameIDs returns true if the nameIDs match the pattern for a valid Identity Chain. The nameIDs for a chain are the ExtIDs of the first entry in the chain.
The Identity Chain specification can be found here: https://github.com/FactomProject/FactomDocs/blob/master/Identity.md#factom-identity-chain-creation
func ValidTokenNameIDs ¶
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) MarshalEntry ¶
func (Entry) MetadataJSONLen ¶
func (Entry) RCDHash ¶
RCDHash returns the SHA256d hash of the first external ID of the entry, which should be the RCD of the IDKey of the issuing Identity.
func (*Entry) Sign ¶
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 ¶
UnmarshalEntry unmarshals the content of the factom.Entry into the provided variable v, disallowing all unknown fields.
func (Entry) ValidExtIDs ¶
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 Identity ¶
type Identity struct {
ChainID *factom.Bytes32
IDKey *factom.RCDHash
Height uint64
Timestamp time.Time
}
Identity represents the Token Issuer's Identity Chain and the public IDKey used to sign Issuance and coinbase Transaction Entries.
func (*Identity) Get ¶
Get validates i.ChainID as an Identity Chain and parses out the IDKey.
Get returns any networking or marshaling errors, but not JSON RPC or chain parsing errors. To check if the Identity has been successfully populated, call IsPopulated().
func (Identity) IsPopulated ¶
IsPopulated returns true if the Identity has been populated with an IDKey.
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 ¶
NewIssuance returns an Issuance initialized with the given entry.
func (*Issuance) MarshalEntry ¶
MarshalEntry marshals the entry content as an Issuance.
func (Issuance) MarshalJSON ¶
func (*Issuance) UnmarshalEntry ¶
UnmarshalEntry unmarshals the entry content as an Issuance.
func (*Issuance) UnmarshalJSON ¶
func (*Issuance) Valid ¶
Valid performs all validation checks and returns nil if i is a valid Issuance.
func (Issuance) ValidData ¶
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 ¶
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.
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. |