Documentation ¶
Index ¶
- Constants
- Variables
- func BearerPredicateFromPubKey(receiverPubKey wallet.PubKey) wallet.Predicate
- func DecodeHexOrEmpty(input string) ([]byte, error)
- func FeeCreditRecordIDFromPublicKey(shardPart, pubKey []byte) types.UnitID
- func ParsePredicateClause(clause string, keyNr uint64, am account.Manager) ([]byte, error)
- type AttrWithInvariantPredicateInputs
- type AttrWithSubTypeCreationInputs
- type CreateFungibleTokenTypeAttributes
- type CreateNonFungibleTokenTypeAttributes
- type Icon
- type MintAttr
- type MintNonFungibleTokenAttributes
- type MoneyDataProvider
- type PredicateInput
- type SubmissionResult
- type TokenBackend
- type TxPublisher
- type Wallet
- func (w *Wallet) AddFeeCredit(ctx context.Context, cmd fees.AddFeeCmd) (*fees.AddFeeCmdResponse, error)
- func (w *Wallet) CollectDust(ctx context.Context, accountNumber uint64, allowedTokenTypes []twb.TokenTypeID, ...) ([]*SubmissionResult, error)
- func (w *Wallet) GetAccountManager() account.Manager
- func (w *Wallet) GetFeeCredit(ctx context.Context, cmd fees.GetFeeCreditCmd) (*wallet.Bill, error)
- func (w *Wallet) GetFeeCreditBill(ctx context.Context, unitID []byte) (*wallet.Bill, error)
- func (w *Wallet) GetRoundNumber(ctx context.Context) (uint64, error)
- func (w *Wallet) GetToken(ctx context.Context, owner wallet.PubKey, kind backend.Kind, ...) (*backend.TokenUnit, error)
- func (w *Wallet) GetTokenType(ctx context.Context, typeId backend.TokenTypeID) (*backend.TokenUnitType, error)
- func (w *Wallet) ListTokenTypes(ctx context.Context, accountNumber uint64, kind backend.Kind) ([]*backend.TokenUnitType, error)
- func (w *Wallet) ListTokens(ctx context.Context, kind backend.Kind, accountNumber uint64) (map[uint64][]*backend.TokenUnit, error)
- func (w *Wallet) NewFungibleToken(ctx context.Context, accNr uint64, typeId backend.TokenTypeID, amount uint64, ...) (*SubmissionResult, error)
- func (w *Wallet) NewFungibleType(ctx context.Context, accNr uint64, attrs CreateFungibleTokenTypeAttributes, ...) (*SubmissionResult, error)
- func (w *Wallet) NewNFT(ctx context.Context, accNr uint64, attrs MintNonFungibleTokenAttributes, ...) (*SubmissionResult, error)
- func (w *Wallet) NewNonFungibleType(ctx context.Context, accNr uint64, attrs CreateNonFungibleTokenTypeAttributes, ...) (*SubmissionResult, error)
- func (w *Wallet) ReclaimFeeCredit(ctx context.Context, cmd fees.ReclaimFeeCmd) (*fees.ReclaimFeeCmdResponse, error)
- func (w *Wallet) SendFungible(ctx context.Context, accountNumber uint64, typeId backend.TokenTypeID, ...) (*SubmissionResult, error)
- func (w *Wallet) Shutdown()
- func (w *Wallet) TransferNFT(ctx context.Context, accountNumber uint64, tokenId backend.TokenID, ...) (*SubmissionResult, error)
- func (w *Wallet) UpdateNFTData(ctx context.Context, accountNumber uint64, tokenId []byte, data []byte, ...) (*SubmissionResult, error)
Constants ¶
View Source
const (
AllAccounts uint64 = 0
)
Variables ¶
View Source
var ( ErrNoFeeCredit = errors.New("no fee credit in token wallet") ErrInsufficientFeeCredit = errors.New("insufficient fee credit balance for transaction(s)") )
Functions ¶
func BearerPredicateFromPubKey ¶ added in v0.1.4
func DecodeHexOrEmpty ¶ added in v0.2.0
func FeeCreditRecordIDFromPublicKey ¶ added in v0.2.0
Types ¶
type AttrWithInvariantPredicateInputs ¶
type AttrWithInvariantPredicateInputs interface { types.SigBytesProvider SetInvariantPredicateSignatures([][]byte) }
type AttrWithSubTypeCreationInputs ¶
type AttrWithSubTypeCreationInputs interface { types.SigBytesProvider SetSubTypeCreationPredicateSignatures([][]byte) }
type CreateFungibleTokenTypeAttributes ¶ added in v0.1.4
type CreateNonFungibleTokenTypeAttributes ¶ added in v0.1.4
type MintAttr ¶
type MintAttr interface { types.SigBytesProvider SetBearer([]byte) SetTokenCreationPredicateSignatures([][]byte) }
type MintNonFungibleTokenAttributes ¶ added in v0.1.4
type MoneyDataProvider ¶ added in v0.2.0
type MoneyDataProvider interface { SystemID() []byte fees.TxPublisher }
type PredicateInput ¶
type PredicateInput struct { // first priority Argument state.Predicate // if Argument empty, check AccountNumber AccountNumber uint64 }
func ParsePredicates ¶ added in v0.1.3
type SubmissionResult ¶ added in v0.2.0
type TokenBackend ¶ added in v0.1.3
type TokenBackend interface { GetToken(ctx context.Context, id backend.TokenID) (*backend.TokenUnit, error) GetTokens(ctx context.Context, kind backend.Kind, owner wallet.PubKey, offset string, limit int) ([]*backend.TokenUnit, string, error) GetTokenTypes(ctx context.Context, kind backend.Kind, creator wallet.PubKey, offset string, limit int) ([]*backend.TokenUnitType, string, error) GetTypeHierarchy(ctx context.Context, id backend.TokenTypeID) ([]*backend.TokenUnitType, error) GetRoundNumber(ctx context.Context) (uint64, error) PostTransactions(ctx context.Context, pubKey wallet.PubKey, txs *wallet.Transactions) error GetTxProof(ctx context.Context, unitID types.UnitID, txHash wallet.TxHash) (*wallet.Proof, error) GetFeeCreditBill(ctx context.Context, unitID types.UnitID) (*wallet.Bill, error) }
type TxPublisher ¶ added in v0.2.0
type TxPublisher struct {
// contains filtered or unexported fields
}
func NewTxPublisher ¶ added in v0.2.0
func NewTxPublisher(backendClient *client.TokenBackend) *TxPublisher
func (*TxPublisher) Close ¶ added in v0.2.0
func (w *TxPublisher) Close()
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
func (*Wallet) AddFeeCredit ¶ added in v0.2.0
func (*Wallet) CollectDust ¶ added in v0.2.0
func (w *Wallet) CollectDust(ctx context.Context, accountNumber uint64, allowedTokenTypes []twb.TokenTypeID, invariantPredicateArgs []*PredicateInput) ([]*SubmissionResult, error)
func (*Wallet) GetAccountManager ¶
func (*Wallet) GetFeeCredit ¶ added in v0.2.0
GetFeeCredit returns fee credit bill for given account, can return nil if fee credit bill has not been created yet.
func (*Wallet) GetFeeCreditBill ¶ added in v0.2.0
GetFeeCreditBill returns fee credit bill for given unitID can return nil if fee credit bill has not been created yet.
func (*Wallet) GetRoundNumber ¶ added in v0.2.0
func (*Wallet) GetTokenType ¶
func (w *Wallet) GetTokenType(ctx context.Context, typeId backend.TokenTypeID) (*backend.TokenUnitType, error)
GetTokenType returns non-nil TokenUnitType or error if not found or other issues
func (*Wallet) ListTokenTypes ¶
func (*Wallet) ListTokens ¶
func (w *Wallet) ListTokens(ctx context.Context, kind backend.Kind, accountNumber uint64) (map[uint64][]*backend.TokenUnit, error)
ListTokens specify accountNumber=0 to list tokens from all accounts
func (*Wallet) NewFungibleToken ¶
func (w *Wallet) NewFungibleToken(ctx context.Context, accNr uint64, typeId backend.TokenTypeID, amount uint64, bearerPredicate wallet.Predicate, mintPredicateArgs []*PredicateInput) (*SubmissionResult, error)
func (*Wallet) NewFungibleType ¶
func (w *Wallet) NewFungibleType(ctx context.Context, accNr uint64, attrs CreateFungibleTokenTypeAttributes, typeId backend.TokenTypeID, subtypePredicateArgs []*PredicateInput) (*SubmissionResult, error)
func (*Wallet) NewNFT ¶
func (w *Wallet) NewNFT(ctx context.Context, accNr uint64, attrs MintNonFungibleTokenAttributes, tokenId backend.TokenID, mintPredicateArgs []*PredicateInput) (*SubmissionResult, error)
func (*Wallet) NewNonFungibleType ¶
func (w *Wallet) NewNonFungibleType(ctx context.Context, accNr uint64, attrs CreateNonFungibleTokenTypeAttributes, typeId backend.TokenTypeID, subtypePredicateArgs []*PredicateInput) (*SubmissionResult, error)
func (*Wallet) ReclaimFeeCredit ¶ added in v0.2.0
func (w *Wallet) ReclaimFeeCredit(ctx context.Context, cmd fees.ReclaimFeeCmd) (*fees.ReclaimFeeCmdResponse, error)
func (*Wallet) SendFungible ¶
func (w *Wallet) SendFungible(ctx context.Context, accountNumber uint64, typeId backend.TokenTypeID, targetAmount uint64, receiverPubKey []byte, invariantPredicateArgs []*PredicateInput) (*SubmissionResult, error)
func (*Wallet) TransferNFT ¶
func (*Wallet) UpdateNFTData ¶
func (w *Wallet) UpdateNFTData(ctx context.Context, accountNumber uint64, tokenId []byte, data []byte, updatePredicateArgs []*PredicateInput) (*SubmissionResult, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.