Versions in this module Expand all Collapse all v1 v1.0.0-rc2 Dec 17, 2024 v1.0.0-rc1 Nov 29, 2024 v0 v0.5.0-rc1 Oct 15, 2024 v0.4.0 Mar 25, 2024 Changes in this version + var DustCollectorPredicate = templates.NewP2pkh256BytesFromKeyHash(hash.Sum256([]byte("dust collector"))) + func PredicateRunner(executor PredicateExecutor, state *state.State) func(predicate, args []byte, txo *types.TransactionOrder) error + type PredicateExecutor func(ctx context.Context, p types.PredicateBytes, args []byte, ...) (bool, error) v0.3.0 Feb 28, 2024 Changes in this version + const DefaultSystemIdentifier + const ErrStrInvalidIconDataLength + const ErrStrInvalidIconTypeLength + const ErrStrInvalidNameLength + const ErrStrInvalidParentTypeID + const ErrStrInvalidSymbolLength + const ErrStrInvalidSystemID + const ErrStrInvalidTypeID + const ErrStrInvalidUnitID + const ErrStrStateIsNil + const PayloadTypeBurnFungibleToken + const PayloadTypeCreateFungibleTokenType + const PayloadTypeCreateNFTType + const PayloadTypeJoinFungibleToken + const PayloadTypeLockToken + const PayloadTypeMintFungibleToken + const PayloadTypeMintNFT + const PayloadTypeSplitFungibleToken + const PayloadTypeTransferFungibleToken + const PayloadTypeTransferNFT + const PayloadTypeUnlockToken + const PayloadTypeUpdateNFT + const TypePartLength + const UnitIDLength + const UnitPartLength + var FeeCreditRecordUnitType = []byte + var FungibleTokenTypeUnitType = []byte + var FungibleTokenUnitType = []byte + var NonFungibleTokenTypeUnitType = []byte + var NonFungibleTokenUnitType = []byte + func HashForIDCalculation(tx *types.TransactionOrder, hashFunc crypto.Hash) []byte + func NewFeeCreditRecordID(shardPart []byte, unitPart []byte) types.UnitID + func NewFungibleTokenID(shardPart []byte, unitPart []byte) types.UnitID + func NewFungibleTokenTypeID(shardPart []byte, unitPart []byte) types.UnitID + func NewNonFungibleTokenID(shardPart []byte, unitPart []byte) types.UnitID + 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 NewTxSystem(observe txsystem.Observability, opts ...Option) (*txsystem.GenericTxSystem, error) + func NewUnitData(unitID types.UnitID) (state.UnitData, error) + type BurnFungibleTokenAttributes struct + Backlink []byte + InvariantPredicateSignatures [][]byte + TargetTokenBacklink []byte + TargetTokenID types.UnitID + TypeID types.UnitID + Value uint64 + func (b *BurnFungibleTokenAttributes) GetBacklink() []byte + func (b *BurnFungibleTokenAttributes) GetInvariantPredicateSignatures() [][]byte + func (b *BurnFungibleTokenAttributes) GetTargetTokenBacklink() []byte + func (b *BurnFungibleTokenAttributes) GetTargetTokenID() []byte + func (b *BurnFungibleTokenAttributes) GetTypeID() types.UnitID + func (b *BurnFungibleTokenAttributes) GetValue() uint64 + func (b *BurnFungibleTokenAttributes) SetBacklink(backlink []byte) + func (b *BurnFungibleTokenAttributes) SetInvariantPredicateSignatures(signatures [][]byte) + func (b *BurnFungibleTokenAttributes) SetTargetTokenBacklink(targetTokenBacklink []byte) + func (b *BurnFungibleTokenAttributes) SetTargetTokenID(targetTokenID []byte) + func (b *BurnFungibleTokenAttributes) SetTypeID(typeID types.UnitID) + func (b *BurnFungibleTokenAttributes) SetValue(value uint64) + func (b *BurnFungibleTokenAttributes) SigBytes() ([]byte, error) + type CreateFungibleTokenTypeAttributes struct + DecimalPlaces uint32 + Icon *Icon + InvariantPredicate []byte + Name string + ParentTypeID types.UnitID + SubTypeCreationPredicate []byte + SubTypeCreationPredicateSignatures [][]byte + Symbol string + TokenCreationPredicate []byte + func (c *CreateFungibleTokenTypeAttributes) GetDecimalPlaces() uint32 + func (c *CreateFungibleTokenTypeAttributes) GetIcon() *Icon + func (c *CreateFungibleTokenTypeAttributes) GetInvariantPredicate() []byte + func (c *CreateFungibleTokenTypeAttributes) GetName() string + func (c *CreateFungibleTokenTypeAttributes) GetParentTypeID() types.UnitID + func (c *CreateFungibleTokenTypeAttributes) GetSubTypeCreationPredicate() []byte + func (c *CreateFungibleTokenTypeAttributes) GetSubTypeCreationPredicateSignatures() [][]byte + func (c *CreateFungibleTokenTypeAttributes) GetSymbol() string + func (c *CreateFungibleTokenTypeAttributes) GetTokenCreationPredicate() []byte + func (c *CreateFungibleTokenTypeAttributes) SetDecimalPlaces(decimalPlaces uint32) + func (c *CreateFungibleTokenTypeAttributes) SetIcon(icon *Icon) + func (c *CreateFungibleTokenTypeAttributes) SetInvariantPredicate(predicate []byte) + func (c *CreateFungibleTokenTypeAttributes) SetName(name string) + func (c *CreateFungibleTokenTypeAttributes) SetParentTypeID(parentTypeID types.UnitID) + func (c *CreateFungibleTokenTypeAttributes) SetSubTypeCreationPredicate(predicate []byte) + func (c *CreateFungibleTokenTypeAttributes) SetSubTypeCreationPredicateSignatures(signatures [][]byte) + func (c *CreateFungibleTokenTypeAttributes) SetSymbol(symbol string) + func (c *CreateFungibleTokenTypeAttributes) SetTokenCreationPredicate(predicate []byte) + func (c *CreateFungibleTokenTypeAttributes) SigBytes() ([]byte, error) + type CreateNonFungibleTokenTypeAttributes struct + DataUpdatePredicate []byte + Icon *Icon + InvariantPredicate []byte + Name string + ParentTypeID types.UnitID + SubTypeCreationPredicate []byte + SubTypeCreationPredicateSignatures [][]byte + Symbol string + TokenCreationPredicate []byte + func (c *CreateNonFungibleTokenTypeAttributes) GetDataUpdatePredicate() []byte + func (c *CreateNonFungibleTokenTypeAttributes) GetIcon() *Icon + func (c *CreateNonFungibleTokenTypeAttributes) GetInvariantPredicate() []byte + func (c *CreateNonFungibleTokenTypeAttributes) GetName() string + func (c *CreateNonFungibleTokenTypeAttributes) GetParentTypeID() types.UnitID + func (c *CreateNonFungibleTokenTypeAttributes) GetSubTypeCreationPredicate() []byte + func (c *CreateNonFungibleTokenTypeAttributes) GetSubTypeCreationPredicateSignatures() [][]byte + func (c *CreateNonFungibleTokenTypeAttributes) GetSymbol() string + func (c *CreateNonFungibleTokenTypeAttributes) GetTokenCreationPredicate() []byte + func (c *CreateNonFungibleTokenTypeAttributes) SetDataUpdatePredicate(predicate []byte) + func (c *CreateNonFungibleTokenTypeAttributes) SetIcon(icon *Icon) + func (c *CreateNonFungibleTokenTypeAttributes) SetInvariantPredicate(predicate []byte) + func (c *CreateNonFungibleTokenTypeAttributes) SetName(name string) + func (c *CreateNonFungibleTokenTypeAttributes) SetParentTypeID(parentTypeID types.UnitID) + func (c *CreateNonFungibleTokenTypeAttributes) SetSubTypeCreationPredicate(predicate []byte) + func (c *CreateNonFungibleTokenTypeAttributes) SetSubTypeCreationPredicateSignatures(signatures [][]byte) + func (c *CreateNonFungibleTokenTypeAttributes) SetSymbol(symbol string) + func (c *CreateNonFungibleTokenTypeAttributes) SetTokenCreationPredicate(predicate []byte) + func (c *CreateNonFungibleTokenTypeAttributes) SigBytes() ([]byte, error) + type FungibleTokenData struct + Backlink []byte + Locked uint64 + T uint64 + TokenType types.UnitID + Value uint64 + func (f *FungibleTokenData) Copy() state.UnitData + func (f *FungibleTokenData) GetBacklink() []byte + func (f *FungibleTokenData) IsLocked() uint64 + func (f *FungibleTokenData) SummaryValueInput() uint64 + func (f *FungibleTokenData) Write(hasher hash.Hash) error + type FungibleTokenTypeData struct + DecimalPlaces uint32 + Icon *Icon + InvariantPredicate []byte + Name string + ParentTypeId types.UnitID + SubTypeCreationPredicate []byte + Symbol string + TokenCreationPredicate []byte + func (f *FungibleTokenTypeData) Copy() state.UnitData + func (f *FungibleTokenTypeData) SummaryValueInput() uint64 + func (f *FungibleTokenTypeData) Write(hasher hash.Hash) error + type FungibleTokensModule struct + func NewFungibleTokensModule(options *Options) (*FungibleTokensModule, error) + func (n *FungibleTokensModule) TxExecutors() map[string]txsystem.ExecuteFunc + type Icon struct + Data []byte + Type string + func (i *Icon) Copy() *Icon + type JoinFungibleTokenAttributes struct + Backlink []byte + BurnTransactions []*types.TransactionRecord + InvariantPredicateSignatures [][]byte + Proofs []*types.TxProof + func (j *JoinFungibleTokenAttributes) GetBacklink() []byte + func (j *JoinFungibleTokenAttributes) GetBurnTransactions() []*types.TransactionRecord + func (j *JoinFungibleTokenAttributes) GetInvariantPredicateSignatures() [][]byte + func (j *JoinFungibleTokenAttributes) GetProofs() []*types.TxProof + func (j *JoinFungibleTokenAttributes) SetBacklink(backlink []byte) + func (j *JoinFungibleTokenAttributes) SetBurnTransactions(burnTransactions []*types.TransactionRecord) + func (j *JoinFungibleTokenAttributes) SetInvariantPredicateSignatures(signatures [][]byte) + func (j *JoinFungibleTokenAttributes) SetProofs(proofs []*types.TxProof) + func (j *JoinFungibleTokenAttributes) SigBytes() ([]byte, error) + type LockTokenAttributes struct + Backlink []byte + InvariantPredicateSignatures [][]byte + LockStatus uint64 + func (l *LockTokenAttributes) SigBytes() ([]byte, error) + type LockTokensModule struct + func NewLockTokensModule(options *Options) (*LockTokensModule, error) + func (n *LockTokensModule) TxExecutors() map[string]txsystem.ExecuteFunc + type MintFungibleTokenAttributes struct + Bearer []byte + TokenCreationPredicateSignatures [][]byte + TypeID types.UnitID + Value uint64 + func (m *MintFungibleTokenAttributes) GetBearer() []byte + func (m *MintFungibleTokenAttributes) GetTokenCreationPredicateSignatures() [][]byte + func (m *MintFungibleTokenAttributes) GetTypeID() types.UnitID + func (m *MintFungibleTokenAttributes) GetValue() uint64 + func (m *MintFungibleTokenAttributes) SetBearer(bearer []byte) + func (m *MintFungibleTokenAttributes) SetTokenCreationPredicateSignatures(signatures [][]byte) + func (m *MintFungibleTokenAttributes) SetTypeID(typeID types.UnitID) + func (m *MintFungibleTokenAttributes) SetValue(value uint64) + func (m *MintFungibleTokenAttributes) SigBytes() ([]byte, error) + type MintNonFungibleTokenAttributes struct + Bearer []byte + Data []byte + DataUpdatePredicate []byte + NFTTypeID types.UnitID + Name string + TokenCreationPredicateSignatures [][]byte + URI string + func (m *MintNonFungibleTokenAttributes) GetBearer() []byte + func (m *MintNonFungibleTokenAttributes) GetData() []byte + func (m *MintNonFungibleTokenAttributes) GetDataUpdatePredicate() []byte + func (m *MintNonFungibleTokenAttributes) GetNFTTypeID() types.UnitID + func (m *MintNonFungibleTokenAttributes) GetName() string + func (m *MintNonFungibleTokenAttributes) GetTokenCreationPredicateSignatures() [][]byte + func (m *MintNonFungibleTokenAttributes) GetURI() string + func (m *MintNonFungibleTokenAttributes) SetBearer(bearer []byte) + func (m *MintNonFungibleTokenAttributes) SetData(data []byte) + func (m *MintNonFungibleTokenAttributes) SetDataUpdatePredicate(predicate []byte) + func (m *MintNonFungibleTokenAttributes) SetNFTTypeID(nftTypeID types.UnitID) + func (m *MintNonFungibleTokenAttributes) SetName(name string) + func (m *MintNonFungibleTokenAttributes) SetTokenCreationPredicateSignatures(signatures [][]byte) + func (m *MintNonFungibleTokenAttributes) SetURI(uri string) + func (m *MintNonFungibleTokenAttributes) SigBytes() ([]byte, error) + type NFTDataUpdateProver interface + GetDataUpdateSignatures func() [][]byte + type NonFungibleTokenData struct + Backlink []byte + Data []byte + DataUpdatePredicate []byte + Locked uint64 + Name string + NftType types.UnitID + T uint64 + URI string + func (n *NonFungibleTokenData) Copy() state.UnitData + func (n *NonFungibleTokenData) GetBacklink() []byte + func (n *NonFungibleTokenData) IsLocked() uint64 + func (n *NonFungibleTokenData) SummaryValueInput() uint64 + func (n *NonFungibleTokenData) Write(hasher hash.Hash) error + type NonFungibleTokenTypeData struct + DataUpdatePredicate []byte + Icon *Icon + InvariantPredicate []byte + Name string + ParentTypeId types.UnitID + SubTypeCreationPredicate []byte + Symbol string + TokenCreationPredicate []byte + func (n *NonFungibleTokenTypeData) Copy() state.UnitData + func (n *NonFungibleTokenTypeData) SummaryValueInput() uint64 + func (n *NonFungibleTokenTypeData) Write(hasher hash.Hash) error + type NonFungibleTokensModule struct + func NewNonFungibleTokensModule(options *Options) (*NonFungibleTokensModule, error) + func (n *NonFungibleTokensModule) TxExecutors() map[string]txsystem.ExecuteFunc + type Option func(*Options) + func WithFeeCalculator(calc fc.FeeCalculator) Option + func WithHashAlgorithm(algorithm gocrypto.Hash) Option + func WithMoneyTXSystemIdentifier(moneySystemIdentifier types.SystemID) Option + func WithState(s *state.State) Option + func WithSystemIdentifier(systemIdentifier types.SystemID) Option + func WithTrustBase(trustBase map[string]crypto.Verifier) Option + type Options struct + type SplitFungibleTokenAttributes struct + Backlink []byte + InvariantPredicateSignatures [][]byte + NewBearer []byte + Nonce []byte + RemainingValue uint64 + TargetValue uint64 + TypeID types.UnitID + func (s *SplitFungibleTokenAttributes) GetBacklink() []byte + func (s *SplitFungibleTokenAttributes) GetInvariantPredicateSignatures() [][]byte + func (s *SplitFungibleTokenAttributes) GetNewBearer() []byte + func (s *SplitFungibleTokenAttributes) GetNonce() []byte + func (s *SplitFungibleTokenAttributes) GetRemainingValue() uint64 + func (s *SplitFungibleTokenAttributes) GetTargetValue() uint64 + func (s *SplitFungibleTokenAttributes) GetTypeID() types.UnitID + func (s *SplitFungibleTokenAttributes) SetBacklink(backlink []byte) + func (s *SplitFungibleTokenAttributes) SetInvariantPredicateSignatures(signatures [][]byte) + func (s *SplitFungibleTokenAttributes) SetNewBearer(newBearer []byte) + func (s *SplitFungibleTokenAttributes) SetNonce(nonce []byte) + func (s *SplitFungibleTokenAttributes) SetRemainingValue(remainingValue uint64) + func (s *SplitFungibleTokenAttributes) SetTargetValue(targetValue uint64) + func (s *SplitFungibleTokenAttributes) SetTypeID(typeID types.UnitID) + func (s *SplitFungibleTokenAttributes) SigBytes() ([]byte, error) + type TokenCreationProver interface + GetTokenCreationPredicateSignatures func() [][]byte + type TokenOwnershipProver interface + InvariantPredicateSignatures func() [][]byte + OwnerProof func() []byte + type TokenSubtypeCreationProver interface + GetSubTypeCreationPredicateSignatures func() [][]byte + type TransferFungibleTokenAttributes struct + Backlink []byte + InvariantPredicateSignatures [][]byte + NewBearer []byte + Nonce []byte + TypeID types.UnitID + Value uint64 + func (t *TransferFungibleTokenAttributes) GetBacklink() []byte + func (t *TransferFungibleTokenAttributes) GetInvariantPredicateSignatures() [][]byte + func (t *TransferFungibleTokenAttributes) GetNewBearer() []byte + func (t *TransferFungibleTokenAttributes) GetNonce() []byte + func (t *TransferFungibleTokenAttributes) GetTypeID() types.UnitID + func (t *TransferFungibleTokenAttributes) GetValue() uint64 + func (t *TransferFungibleTokenAttributes) SetBacklink(backlink []byte) + func (t *TransferFungibleTokenAttributes) SetInvariantPredicateSignatures(signatures [][]byte) + func (t *TransferFungibleTokenAttributes) SetNewBearer(newBearer []byte) + func (t *TransferFungibleTokenAttributes) SetNonce(nonce []byte) + func (t *TransferFungibleTokenAttributes) SetTypeID(typeID types.UnitID) + func (t *TransferFungibleTokenAttributes) SetValue(value uint64) + func (t *TransferFungibleTokenAttributes) SigBytes() ([]byte, error) + type TransferNonFungibleTokenAttributes struct + Backlink []byte + InvariantPredicateSignatures [][]byte + NFTTypeID types.UnitID + NewBearer []byte + Nonce []byte + func (t *TransferNonFungibleTokenAttributes) GetBacklink() []byte + func (t *TransferNonFungibleTokenAttributes) GetInvariantPredicateSignatures() [][]byte + func (t *TransferNonFungibleTokenAttributes) GetNFTTypeID() types.UnitID + func (t *TransferNonFungibleTokenAttributes) GetNewBearer() []byte + func (t *TransferNonFungibleTokenAttributes) GetNonce() []byte + func (t *TransferNonFungibleTokenAttributes) SetBacklink(backlink []byte) + func (t *TransferNonFungibleTokenAttributes) SetInvariantPredicateSignatures(signatures [][]byte) + func (t *TransferNonFungibleTokenAttributes) SetNFTTypeID(nftTypeID types.UnitID) + func (t *TransferNonFungibleTokenAttributes) SetNewBearer(newBearer []byte) + func (t *TransferNonFungibleTokenAttributes) SetNonce(nonce []byte) + func (t *TransferNonFungibleTokenAttributes) SigBytes() ([]byte, error) + type UnlockTokenAttributes struct + Backlink []byte + InvariantPredicateSignatures [][]byte + func (l *UnlockTokenAttributes) SigBytes() ([]byte, error) + type UpdateNonFungibleTokenAttributes struct + Backlink []byte + Data []byte + DataUpdateSignatures [][]byte + func (u *UpdateNonFungibleTokenAttributes) GetBacklink() []byte + func (u *UpdateNonFungibleTokenAttributes) GetData() []byte + func (u *UpdateNonFungibleTokenAttributes) GetDataUpdateSignatures() [][]byte + func (u *UpdateNonFungibleTokenAttributes) SetBacklink(backlink []byte) + func (u *UpdateNonFungibleTokenAttributes) SetData(data []byte) + func (u *UpdateNonFungibleTokenAttributes) SetDataUpdateSignatures(signatures [][]byte) + func (u *UpdateNonFungibleTokenAttributes) SigBytes() ([]byte, error)