Documentation ¶
Index ¶
- Constants
- Variables
- func HashForNewTokenID(tx *types.TransactionOrder, hashFunc crypto.Hash) ([]byte, error)
- func NewFeeCreditRecordID(shardPart []byte, unitPart []byte) types.UnitID
- func NewFeeCreditRecordIDFromOwnerPredicate(shardPart []byte, ownerPredicate []byte, latestAdditionTime uint64) (types.UnitID, error)
- func NewFeeCreditRecordIDFromPublicKey(shardPart, pubKey []byte, latestAdditionTime uint64) (types.UnitID, error)
- func NewFeeCreditRecordIDFromPublicKeyHash(shardPart, pubKeyHash []byte, latestAdditionTime uint64) (types.UnitID, error)
- func NewFungibleTokenData(typeID types.UnitID, value uint64, ownerPredicate []byte, timeout uint64) types.UnitData
- func NewFungibleTokenID(shardPart []byte, unitPart []byte) types.UnitID
- func NewFungibleTokenTypeData(attr *DefineFungibleTokenAttributes) types.UnitData
- func NewFungibleTokenTypeID(shardPart []byte, unitPart []byte) types.UnitID
- func NewNonFungibleTokenData(typeID types.UnitID, attr *MintNonFungibleTokenAttributes) types.UnitData
- func NewNonFungibleTokenID(shardPart []byte, unitPart []byte) types.UnitID
- func NewNonFungibleTokenTypeData(attr *DefineNonFungibleTokenAttributes) types.UnitData
- func NewNonFungibleTokenTypeID(shardPart []byte, unitPart []byte) types.UnitID
- func NewRandomFungibleTokenID(shardPart []byte) (types.UnitID, error)
- func NewRandomFungibleTokenTypeID(shardPart []byte) (types.UnitID, error)
- func NewRandomNonFungibleTokenID(shardPart []byte) (types.UnitID, error)
- func NewRandomNonFungibleTokenTypeID(shardPart []byte) (types.UnitID, error)
- func NewUnitData(unitID types.UnitID) (types.UnitData, error)
- type BurnFungibleTokenAttributes
- type BurnFungibleTokenAuthProof
- type DefineFungibleTokenAttributes
- type DefineFungibleTokenAuthProof
- type DefineNonFungibleTokenAttributes
- type DefineNonFungibleTokenAuthProof
- type FungibleTokenData
- type FungibleTokenTypeData
- type Icon
- type JoinFungibleTokenAttributes
- type JoinFungibleTokenAuthProof
- type LockTokenAttributes
- type LockTokenAuthProof
- type MintFungibleTokenAttributes
- type MintFungibleTokenAuthProof
- type MintNonFungibleTokenAttributes
- type MintNonFungibleTokenAuthProof
- type NonFungibleTokenData
- func (n *NonFungibleTokenData) Copy() types.UnitData
- func (n *NonFungibleTokenData) GetCounter() uint64
- func (n *NonFungibleTokenData) IsLocked() uint64
- func (n *NonFungibleTokenData) Owner() []byte
- func (n *NonFungibleTokenData) SummaryValueInput() uint64
- func (n *NonFungibleTokenData) Write(hasher abhash.Hasher)
- type NonFungibleTokenTypeData
- type SplitFungibleTokenAttributes
- type SplitFungibleTokenAuthProof
- type TransferFungibleTokenAttributes
- type TransferFungibleTokenAuthProof
- type TransferNonFungibleTokenAttributes
- type TransferNonFungibleTokenAuthProof
- type UnlockTokenAttributes
- type UnlockTokenAuthProof
- type UpdateNonFungibleTokenAttributes
- type UpdateNonFungibleTokenAuthProof
Constants ¶
View Source
const ( TransactionTypeDefineFT uint16 = 1 TransactionTypeDefineNFT uint16 = 2 TransactionTypeMintFT uint16 = 3 TransactionTypeMintNFT uint16 = 4 TransactionTypeTransferFT uint16 = 5 TransactionTypeTransferNFT uint16 = 6 TransactionTypeLockToken uint16 = 7 TransactionTypeUnlockToken uint16 = 8 TransactionTypeSplitFT uint16 = 9 TransactionTypeBurnFT uint16 = 10 TransactionTypeJoinFT uint16 = 11 TransactionTypeUpdateNFT uint16 = 12 )
View Source
const ( UnitIDLength = UnitPartLength + TypePartLength UnitPartLength = 32 TypePartLength = 1 )
View Source
const DefaultPartitionID types.PartitionID = 2
Variables ¶
Functions ¶
func HashForNewTokenID ¶
HashForNewTokenID generates new token ID (unit part of the extended identifier) from the transaction order. Use NewFungibleTokenID or NewNonFungibleTokenID to generate the extended identifier from the unit part.
func NewFeeCreditRecordID ¶
func NewFungibleTokenData ¶
func NewFungibleTokenTypeData ¶
func NewFungibleTokenTypeData(attr *DefineFungibleTokenAttributes) types.UnitData
func NewFungibleTokenTypeID ¶
func NewNonFungibleTokenData ¶
func NewNonFungibleTokenData(typeID types.UnitID, attr *MintNonFungibleTokenAttributes) types.UnitData
func NewNonFungibleTokenID ¶
func NewNonFungibleTokenTypeData ¶
func NewNonFungibleTokenTypeData(attr *DefineNonFungibleTokenAttributes) types.UnitData
Types ¶
type BurnFungibleTokenAttributes ¶
type BurnFungibleTokenAttributes struct { TypeID types.UnitID // identifies the type of the token to burn Value uint64 // the value to burn TargetTokenID types.UnitID // the target token identifier in join step TargetTokenCounter uint64 // the current counter value of the target token Counter uint64 // the transaction counter of this token // contains filtered or unexported fields }
type DefineFungibleTokenAttributes ¶
type DefineFungibleTokenAttributes struct { Symbol string // the symbol (short name) of this token type; note that the symbols are not guaranteed to be unique Name string // the long name of this token type Icon *Icon // the icon of this token type ParentTypeID types.UnitID // identifies the parent type that this type derives from; nil indicates there is no parent type DecimalPlaces uint32 // the number of decimal places to display for values of tokens of the new type SubTypeCreationPredicate []byte // the predicate clause that controls defining new subtypes of this type TokenMintingPredicate []byte // the predicate clause that controls minting new tokens of this type TokenTypeOwnerPredicate []byte // the predicate clause that all tokens of this type (and of subtypes of this type) inherit into their owner predicates // contains filtered or unexported fields }
type DefineFungibleTokenAuthProof ¶
type DefineFungibleTokenAuthProof struct { SubTypeCreationProofs [][]byte // inputs to satisfy the subtype creation predicates of all parents // contains filtered or unexported fields }
type DefineNonFungibleTokenAttributes ¶
type DefineNonFungibleTokenAttributes struct { Symbol string // the symbol (short name) of this token type; note that the symbols are not guaranteed to be unique Name string // the long name of this token type Icon *Icon // the optional icon of this token type ParentTypeID types.UnitID // identifies the parent type that this type derives from; nil indicates there is no parent type SubTypeCreationPredicate []byte // the predicate clause that controls defining new subtypes of this type TokenMintingPredicate []byte // the predicate clause that controls minting new tokens of this type TokenTypeOwnerPredicate []byte // the predicate clause that all tokens of the new type (and of subtypes of it) inherit into their owner predicates DataUpdatePredicate []byte // the clause that all tokens of this type (and of subtypes of this type) inherit into their data update predicates // contains filtered or unexported fields }
type DefineNonFungibleTokenAuthProof ¶
type DefineNonFungibleTokenAuthProof struct { SubTypeCreationProofs [][]byte // inputs to satisfy the subtype predicates of the parent types // contains filtered or unexported fields }
type FungibleTokenData ¶
type FungibleTokenData struct { TokenType types.UnitID `json:"tokenType"` // the type of this token Value uint64 `json:"value,string"` // the value of this token OwnerPredicate hex.Bytes `json:"ownerPredicate"` // the owner predicate of this token Locked uint64 `json:"locked,string"` // the lock status of this token (non-zero value means locked) Counter uint64 `json:"counter,string"` // the transaction counter of this token Timeout uint64 `json:"timeout,string"` // the earliest round number when this token may be deleted if the balance goes to zero // contains filtered or unexported fields }
func (*FungibleTokenData) Copy ¶
func (f *FungibleTokenData) Copy() types.UnitData
func (*FungibleTokenData) GetCounter ¶
func (f *FungibleTokenData) GetCounter() uint64
func (*FungibleTokenData) IsLocked ¶
func (f *FungibleTokenData) IsLocked() uint64
func (*FungibleTokenData) Owner ¶
func (f *FungibleTokenData) Owner() []byte
func (*FungibleTokenData) SummaryValueInput ¶
func (f *FungibleTokenData) SummaryValueInput() uint64
func (*FungibleTokenData) Write ¶
func (f *FungibleTokenData) Write(hasher abhash.Hasher)
type FungibleTokenTypeData ¶
type FungibleTokenTypeData struct { Symbol string `json:"symbol"` Name string `json:"name"` Icon *Icon `json:"icon"` ParentTypeID types.UnitID `json:"parentTypeId"` // identifies the parent type that this type derives from; nil indicates there is no parent type DecimalPlaces uint32 `json:"decimalPlaces"` // is the number of decimal places to display for values of tokens of this type SubTypeCreationPredicate hex.Bytes `json:"subTypeCreationPredicate"` // the predicate clause that controls defining new subtypes of this type TokenMintingPredicate hex.Bytes `json:"tokenMintingPredicate"` // the predicate clause that controls minting new tokens of this type TokenTypeOwnerPredicate hex.Bytes `json:"tokenTypeOwnerPredicate"` // the predicate clause that all tokens of this type (and of subtypes of this type) inherit into their owner predicates // contains filtered or unexported fields }
func (*FungibleTokenTypeData) Copy ¶
func (f *FungibleTokenTypeData) Copy() types.UnitData
func (*FungibleTokenTypeData) Owner ¶
func (f *FungibleTokenTypeData) Owner() []byte
func (*FungibleTokenTypeData) SummaryValueInput ¶
func (f *FungibleTokenTypeData) SummaryValueInput() uint64
func (*FungibleTokenTypeData) Write ¶
func (f *FungibleTokenTypeData) Write(hasher abhash.Hasher)
type Icon ¶
type JoinFungibleTokenAttributes ¶
type JoinFungibleTokenAttributes struct { BurnTokenProofs []*types.TxRecordProof // the transaction records and proofs that burned the source tokens // contains filtered or unexported fields }
type LockTokenAttributes ¶
type LockTokenAuthProof ¶
type LockTokenAuthProof struct { OwnerProof []byte // input to satisfy the owner predicate of the target token // contains filtered or unexported fields }
type MintFungibleTokenAuthProof ¶
type MintFungibleTokenAuthProof struct { TokenMintingProof []byte // input to satisfy the token minting predicate of the type // contains filtered or unexported fields }
type MintNonFungibleTokenAttributes ¶
type MintNonFungibleTokenAttributes struct { TypeID types.UnitID // the type of the new token Name string // the name of the new token URI string // the optional URI of an external resource associated with the new token Data []byte // the optional data associated with the new token OwnerPredicate []byte // the initial owner predicate of the new token DataUpdatePredicate []byte // the data update predicate of the new token Nonce uint64 // optional nonce // contains filtered or unexported fields }
type MintNonFungibleTokenAuthProof ¶
type MintNonFungibleTokenAuthProof struct { TokenMintingProof []byte // the input to satisfy the token minting predicate of the type // contains filtered or unexported fields }
type NonFungibleTokenData ¶
type NonFungibleTokenData struct { TypeID types.UnitID `json:"typeID"` // the type of this token Name string `json:"name"` // the optional long name of this token URI string `json:"uri"` // the optional URI of an external resource associated with this token Data hex.Bytes `json:"data"` // the optional data associated with this token OwnerPredicate hex.Bytes `json:"ownerPredicate"` // the owner predicate of this token DataUpdatePredicate hex.Bytes `json:"dataUpdatePredicate"` // the data update predicate; Locked uint64 `json:"locked,string"` // the lock status of this token (non-zero value means locked) Counter uint64 `json:"counter,string"` // the transaction counter of this token // contains filtered or unexported fields }
func (*NonFungibleTokenData) Copy ¶
func (n *NonFungibleTokenData) Copy() types.UnitData
func (*NonFungibleTokenData) GetCounter ¶
func (n *NonFungibleTokenData) GetCounter() uint64
func (*NonFungibleTokenData) IsLocked ¶
func (n *NonFungibleTokenData) IsLocked() uint64
func (*NonFungibleTokenData) Owner ¶
func (n *NonFungibleTokenData) Owner() []byte
func (*NonFungibleTokenData) SummaryValueInput ¶
func (n *NonFungibleTokenData) SummaryValueInput() uint64
func (*NonFungibleTokenData) Write ¶
func (n *NonFungibleTokenData) Write(hasher abhash.Hasher)
type NonFungibleTokenTypeData ¶
type NonFungibleTokenTypeData struct { Symbol string `json:"symbol"` Name string `json:"name"` Icon *Icon `json:"icon"` ParentTypeID types.UnitID `json:"parentTypeId"` // identifies the parent type that this type derives from; nil indicates there is no parent type SubTypeCreationPredicate hex.Bytes `json:"subTypeCreationPredicate"` // the predicate clause that controls defining new subtypes of this type TokenMintingPredicate hex.Bytes `json:"tokenMintingPredicate"` // the predicate clause that controls minting new tokens of this type TokenTypeOwnerPredicate hex.Bytes `json:"tokenTypeOwnerPredicate"` // the predicate clause that all tokens of this type (and of subtypes of this type) inherit into their owner predicates DataUpdatePredicate hex.Bytes `json:"dataUpdatePredicate"` // the predicate clause that all tokens of this type (and of subtypes of this type) inherit into their data update predicates // contains filtered or unexported fields }
func (*NonFungibleTokenTypeData) Copy ¶
func (n *NonFungibleTokenTypeData) Copy() types.UnitData
func (*NonFungibleTokenTypeData) Owner ¶
func (n *NonFungibleTokenTypeData) Owner() []byte
func (*NonFungibleTokenTypeData) SummaryValueInput ¶
func (n *NonFungibleTokenTypeData) SummaryValueInput() uint64
func (*NonFungibleTokenTypeData) Write ¶
func (n *NonFungibleTokenTypeData) Write(hasher abhash.Hasher)
type SplitFungibleTokenAttributes ¶
type SplitFungibleTokenAttributes struct { TypeID types.UnitID // identifies the type of the token TargetValue uint64 // the value of the new token NewOwnerPredicate []byte // the owner predicate of the new token Counter uint64 // the transaction counter of this token // contains filtered or unexported fields }
type TransferFungibleTokenAttributes ¶
type TransferFungibleTokenAttributes struct { TypeID types.UnitID // identifies the type of the token Value uint64 // the value to transfer NewOwnerPredicate []byte // the initial owner predicate of the new token Counter uint64 // the transaction counter of this token // contains filtered or unexported fields }
type UnlockTokenAttributes ¶
type UnlockTokenAttributes struct { Counter uint64 // the transaction counter of this token // contains filtered or unexported fields }
type UnlockTokenAuthProof ¶
type UnlockTokenAuthProof struct { OwnerProof []byte // input to satisfy the owner predicate of the target token // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.