token

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Initializes a new mint and optionally deposits all the newly minted
	// tokens in an account.
	//
	// The `InitializeMint` instruction requires no signers and MUST be
	// included within the same Transaction as the system program's
	// `CreateAccount` instruction that creates the account being initialized.
	// Otherwise another party can acquire ownership of the uninitialized
	// account.
	Instruction_InitializeMint uint8 = iota

	// Initializes a new account to hold tokens.  If this account is associated
	// with the native mint then the token balance of the initialized account
	// will be equal to the amount of SOL in the account. If this account is
	// associated with another mint, that mint must be initialized before this
	// command can succeed.
	//
	// The `InitializeAccount` instruction requires no signers and MUST be
	// included within the same Transaction as the system program's
	// `CreateAccount` instruction that creates the account being initialized.
	// Otherwise another party can acquire ownership of the uninitialized
	// account.
	Instruction_InitializeAccount

	// Initializes a multisignature account with N provided signers.
	//
	// Multisignature accounts can used in place of any single owner/delegate
	// accounts in any token instruction that require an owner/delegate to be
	// present.  The variant field represents the number of signers (M)
	// required to validate this multisignature account.
	//
	// The `InitializeMultisig` instruction requires no signers and MUST be
	// included within the same Transaction as the system program's
	// `CreateAccount` instruction that creates the account being initialized.
	// Otherwise another party can acquire ownership of the uninitialized
	// account.
	Instruction_InitializeMultisig

	// Transfers tokens from one account to another either directly or via a
	// delegate.  If this account is associated with the native mint then equal
	// amounts of SOL and Tokens will be transferred to the destination
	// account.
	Instruction_Transfer

	// Approves a delegate.  A delegate is given the authority over tokens on
	// behalf of the source account's owner.
	Instruction_Approve

	// Revokes the delegate's authority.
	Instruction_Revoke

	// Sets a new authority of a mint or account.
	Instruction_SetAuthority

	// Mints new tokens to an account.  The native mint does not support
	// minting.
	Instruction_MintTo

	// Burns tokens by removing them from an account.  `Burn` does not support
	// accounts associated with the native mint, use `CloseAccount` instead.
	Instruction_Burn

	// Close an account by transferring all its SOL to the destination account.
	// Non-native accounts may only be closed if its token amount is zero.
	Instruction_CloseAccount

	// Freeze an Initialized account using the Mint's freeze_authority (if set).
	Instruction_FreezeAccount

	// Thaw a Frozen account using the Mint's freeze_authority (if set).
	Instruction_ThawAccount

	// Transfers tokens from one account to another either directly or via a
	// delegate.  If this account is associated with the native mint then equal
	// amounts of SOL and Tokens will be transferred to the destination
	// account.
	//
	// This instruction differs from Transfer in that the token mint and
	// decimals value is checked by the caller.  This may be useful when
	// creating transactions offline or within a hardware wallet.
	Instruction_TransferChecked

	// Approves a delegate.  A delegate is given the authority over tokens on
	// behalf of the source account's owner.
	//
	// This instruction differs from Approve in that the token mint and
	// decimals value is checked by the caller.  This may be useful when
	// creating transactions offline or within a hardware wallet.
	Instruction_ApproveChecked

	// Mints new tokens to an account.  The native mint does not support minting.
	//
	// This instruction differs from MintTo in that the decimals value is
	// checked by the caller.  This may be useful when creating transactions
	// offline or within a hardware wallet.
	Instruction_MintToChecked

	// Burns tokens by removing them from an account.  `BurnChecked` does not
	// support accounts associated with the native mint, use `CloseAccount`
	// instead.
	//
	// This instruction differs from Burn in that the decimals value is checked
	// by the caller. This may be useful when creating transactions offline or
	// within a hardware wallet.
	Instruction_BurnChecked

	// Like InitializeAccount, but the owner pubkey is passed via instruction data
	// rather than the accounts list. This variant may be preferable when using
	// Cross Program Invocation from an instruction that does not need the owner's
	// `AccountInfo` otherwise.
	Instruction_InitializeAccount2

	// Given a wrapped / native token account (a token account containing SOL)
	// updates its amount field based on the account's underlying `lamports`.
	// This is useful if a non-wrapped SOL account uses `system_instruction::transfer`
	// to move lamports to a wrapped token account, and needs to have its token
	// `amount` field updated.
	Instruction_SyncNative

	// Like InitializeAccount2, but does not require the Rent sysvar to be provided.
	Instruction_InitializeAccount3

	// Like InitializeMultisig, but does not require the Rent sysvar to be provided.
	Instruction_InitializeMultisig2

	// Like InitializeMint, but does not require the Rent sysvar to be provided.
	Instruction_InitializeMint2
)
View Source
const MAX_SIGNERS = 11

Maximum number of multisignature signers (max N)

View Source
const MINT_SIZE = 82

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	// The mint associated with this account
	Mint base.PublicKey

	// The owner of this account.
	Owner base.PublicKey

	// The amount of tokens this account holds.
	Amount uint64

	// If `delegate` is `Some` then `delegated_amount` represents
	// the amount authorized by the delegate
	Delegate *base.PublicKey `bin:"optional"`

	// The account's state
	State AccountState

	// If is_some, this is a native token, and the value logs the rent-exempt reserve. An Account
	// is required to be rent-exempt, so the value is used by the Processor to ensure that wrapped
	// SOL accounts do not drop below this threshold.
	IsNative *uint64 `bin:"optional"`

	// The amount delegated
	DelegatedAmount uint64

	// Optional authority to close the account.
	CloseAuthority *base.PublicKey `bin:"optional"`
}

func (Account) MarshalWithEncoder

func (mint Account) MarshalWithEncoder(encoder *base.Encoder) (err error)

type AccountState

type AccountState uint8
const (
	// Account is not yet initialized
	Uninitialized AccountState = iota

	// Account is initialized; the account owner and/or delegate may perform permitted operations
	// on this account
	Initialized

	// Account has been frozen by the mint freeze authority. Neither the account owner nor
	// the delegate are able to perform operations on this account.
	Frozen
)

type Approve

type Approve struct {
	// The amount of tokens the delegate is approved for.
	Amount *uint64

	// [0] = [WRITE] source
	// ··········· The source account.
	//
	// [1] = [] delegate
	// ··········· The delegate.
	//
	// [2] = [] owner
	// ··········· The source account owner.
	//
	// [3...] = [SIGNER] signers
	// ··········· M signer accounts.
	Accounts base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
	Signers  base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Approves a delegate. A delegate is given the authority over tokens on behalf of the source account's owner.

func NewApproveInstruction

func NewApproveInstruction(

	amount uint64,

	source base.PublicKey,
	delegate base.PublicKey,
	owner base.PublicKey,
	multisigSigners []base.PublicKey,
) *Approve

NewApproveInstruction declares a new Approve instruction with the provided parameters and accounts.

func NewApproveInstructionBuilder

func NewApproveInstructionBuilder() *Approve

NewApproveInstructionBuilder creates a new `Approve` instruction builder.

func (Approve) Build

func (inst Approve) Build() *Instruction

func (Approve) GetAccounts

func (slice Approve) GetAccounts() (accounts []*base.AccountMeta)

func (*Approve) GetDelegateAccount

func (inst *Approve) GetDelegateAccount() *base.AccountMeta

GetDelegateAccount gets the "delegate" account. The delegate.

func (*Approve) GetOwnerAccount

func (inst *Approve) GetOwnerAccount() *base.AccountMeta

GetOwnerAccount gets the "owner" account. The source account owner.

func (*Approve) GetSourceAccount

func (inst *Approve) GetSourceAccount() *base.AccountMeta

GetSourceAccount gets the "source" account. The source account.

func (Approve) MarshalWithEncoder

func (obj Approve) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*Approve) SetAccounts

func (obj *Approve) SetAccounts(accounts []*base.AccountMeta) error

func (*Approve) SetAmount

func (inst *Approve) SetAmount(amount uint64) *Approve

SetAmount sets the "amount" parameter. The amount of tokens the delegate is approved for.

func (*Approve) SetDelegateAccount

func (inst *Approve) SetDelegateAccount(delegate base.PublicKey) *Approve

SetDelegateAccount sets the "delegate" account. The delegate.

func (*Approve) SetOwnerAccount

func (inst *Approve) SetOwnerAccount(owner base.PublicKey, multisigSigners ...base.PublicKey) *Approve

SetOwnerAccount sets the "owner" account. The source account owner.

func (*Approve) SetSourceAccount

func (inst *Approve) SetSourceAccount(source base.PublicKey) *Approve

SetSourceAccount sets the "source" account. The source account.

func (*Approve) Validate

func (inst *Approve) Validate() error

func (Approve) ValidateAndBuild

func (inst Approve) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type ApproveChecked

type ApproveChecked struct {
	// The amount of tokens the delegate is approved for.
	Amount *uint64

	// Expected number of base 10 digits to the right of the decimal place.
	Decimals *uint8

	// [0] = [WRITE] source
	// ··········· The source account.
	//
	// [1] = [] mint
	// ··········· The token mint.
	//
	// [2] = [] delegate
	// ··········· The delegate.
	//
	// [3] = [] owner
	// ··········· The source account owner.
	//
	// [4...] = [SIGNER] signers
	// ··········· M signer accounts.
	Accounts base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
	Signers  base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Approves a delegate. A delegate is given the authority over tokens on behalf of the source account's owner.

This instruction differs from Approve in that the token mint and decimals value is checked by the caller. This may be useful when creating transactions offline or within a hardware wallet.

func NewApproveCheckedInstruction

func NewApproveCheckedInstruction(

	amount uint64,
	decimals uint8,

	source base.PublicKey,
	mint base.PublicKey,
	delegate base.PublicKey,
	owner base.PublicKey,
	multisigSigners []base.PublicKey,
) *ApproveChecked

NewApproveCheckedInstruction declares a new ApproveChecked instruction with the provided parameters and accounts.

func NewApproveCheckedInstructionBuilder

func NewApproveCheckedInstructionBuilder() *ApproveChecked

NewApproveCheckedInstructionBuilder creates a new `ApproveChecked` instruction builder.

func (ApproveChecked) Build

func (inst ApproveChecked) Build() *Instruction

func (ApproveChecked) GetAccounts

func (slice ApproveChecked) GetAccounts() (accounts []*base.AccountMeta)

func (*ApproveChecked) GetDelegateAccount

func (inst *ApproveChecked) GetDelegateAccount() *base.AccountMeta

GetDelegateAccount gets the "delegate" account. The delegate.

func (*ApproveChecked) GetMintAccount

func (inst *ApproveChecked) GetMintAccount() *base.AccountMeta

GetMintAccount gets the "mint" account. The token mint.

func (*ApproveChecked) GetOwnerAccount

func (inst *ApproveChecked) GetOwnerAccount() *base.AccountMeta

GetOwnerAccount gets the "owner" account. The source account owner.

func (*ApproveChecked) GetSourceAccount

func (inst *ApproveChecked) GetSourceAccount() *base.AccountMeta

GetSourceAccount gets the "source" account. The source account.

func (ApproveChecked) MarshalWithEncoder

func (obj ApproveChecked) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*ApproveChecked) SetAccounts

func (obj *ApproveChecked) SetAccounts(accounts []*base.AccountMeta) error

func (*ApproveChecked) SetAmount

func (inst *ApproveChecked) SetAmount(amount uint64) *ApproveChecked

SetAmount sets the "amount" parameter. The amount of tokens the delegate is approved for.

func (*ApproveChecked) SetDecimals

func (inst *ApproveChecked) SetDecimals(decimals uint8) *ApproveChecked

SetDecimals sets the "decimals" parameter. Expected number of base 10 digits to the right of the decimal place.

func (*ApproveChecked) SetDelegateAccount

func (inst *ApproveChecked) SetDelegateAccount(delegate base.PublicKey) *ApproveChecked

SetDelegateAccount sets the "delegate" account. The delegate.

func (*ApproveChecked) SetMintAccount

func (inst *ApproveChecked) SetMintAccount(mint base.PublicKey) *ApproveChecked

SetMintAccount sets the "mint" account. The token mint.

func (*ApproveChecked) SetOwnerAccount

func (inst *ApproveChecked) SetOwnerAccount(owner base.PublicKey, multisigSigners ...base.PublicKey) *ApproveChecked

SetOwnerAccount sets the "owner" account. The source account owner.

func (*ApproveChecked) SetSourceAccount

func (inst *ApproveChecked) SetSourceAccount(source base.PublicKey) *ApproveChecked

SetSourceAccount sets the "source" account. The source account.

func (*ApproveChecked) Validate

func (inst *ApproveChecked) Validate() error

func (ApproveChecked) ValidateAndBuild

func (inst ApproveChecked) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type AuthorityType

type AuthorityType uint8
const (
	// Authority to mint new tokens
	AuthorityMintTokens AuthorityType = iota

	// Authority to freeze any account associated with the Mint
	AuthorityFreezeAccount

	// Owner of a given token account
	AuthorityAccountOwner

	// Authority to close a token account
	AuthorityCloseAccount
)

type Burn

type Burn struct {
	// The amount of tokens to burn.
	Amount *uint64

	// [0] = [WRITE] source
	// ··········· The account to burn from.
	//
	// [1] = [WRITE] mint
	// ··········· The token mint.
	//
	// [2] = [] owner
	// ··········· The account's owner/delegate.
	//
	// [3...] = [SIGNER] signers
	// ··········· M signer accounts.
	Accounts base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
	Signers  base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Burns tokens by removing them from an account. `Burn` does not support accounts associated with the native mint, use `CloseAccount` instead.

func NewBurnInstruction

func NewBurnInstruction(

	amount uint64,

	source base.PublicKey,
	mint base.PublicKey,
	owner base.PublicKey,
	multisigSigners []base.PublicKey,
) *Burn

NewBurnInstruction declares a new Burn instruction with the provided parameters and accounts.

func NewBurnInstructionBuilder

func NewBurnInstructionBuilder() *Burn

NewBurnInstructionBuilder creates a new `Burn` instruction builder.

func (Burn) Build

func (inst Burn) Build() *Instruction

func (Burn) GetAccounts

func (slice Burn) GetAccounts() (accounts []*base.AccountMeta)

func (*Burn) GetMintAccount

func (inst *Burn) GetMintAccount() *base.AccountMeta

GetMintAccount gets the "mint" account. The token mint.

func (*Burn) GetOwnerAccount

func (inst *Burn) GetOwnerAccount() *base.AccountMeta

GetOwnerAccount gets the "owner" account. The account's owner/delegate.

func (*Burn) GetSourceAccount

func (inst *Burn) GetSourceAccount() *base.AccountMeta

GetSourceAccount gets the "source" account. The account to burn from.

func (Burn) MarshalWithEncoder

func (obj Burn) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*Burn) SetAccounts

func (obj *Burn) SetAccounts(accounts []*base.AccountMeta) error

func (*Burn) SetAmount

func (inst *Burn) SetAmount(amount uint64) *Burn

SetAmount sets the "amount" parameter. The amount of tokens to burn.

func (*Burn) SetMintAccount

func (inst *Burn) SetMintAccount(mint base.PublicKey) *Burn

SetMintAccount sets the "mint" account. The token mint.

func (*Burn) SetOwnerAccount

func (inst *Burn) SetOwnerAccount(owner base.PublicKey, multisigSigners ...base.PublicKey) *Burn

SetOwnerAccount sets the "owner" account. The account's owner/delegate.

func (*Burn) SetSourceAccount

func (inst *Burn) SetSourceAccount(source base.PublicKey) *Burn

SetSourceAccount sets the "source" account. The account to burn from.

func (*Burn) Validate

func (inst *Burn) Validate() error

func (Burn) ValidateAndBuild

func (inst Burn) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type BurnChecked

type BurnChecked struct {
	// The amount of tokens to burn.
	Amount *uint64

	// Expected number of base 10 digits to the right of the decimal place.
	Decimals *uint8

	// [0] = [WRITE] source
	// ··········· The account to burn from.
	//
	// [1] = [WRITE] mint
	// ··········· The token mint.
	//
	// [2] = [] owner
	// ··········· The account's owner/delegate.
	//
	// [3...] = [SIGNER] signers
	// ··········· M signer accounts.
	Accounts base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
	Signers  base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Burns tokens by removing them from an account. `BurnChecked` does not support accounts associated with the native mint, use `CloseAccount` instead.

This instruction differs from Burn in that the decimals value is checked by the caller. This may be useful when creating transactions offline or within a hardware wallet.

func NewBurnCheckedInstruction

func NewBurnCheckedInstruction(

	amount uint64,
	decimals uint8,

	source base.PublicKey,
	mint base.PublicKey,
	owner base.PublicKey,
	multisigSigners []base.PublicKey,
) *BurnChecked

NewBurnCheckedInstruction declares a new BurnChecked instruction with the provided parameters and accounts.

func NewBurnCheckedInstructionBuilder

func NewBurnCheckedInstructionBuilder() *BurnChecked

NewBurnCheckedInstructionBuilder creates a new `BurnChecked` instruction builder.

func (BurnChecked) Build

func (inst BurnChecked) Build() *Instruction

func (BurnChecked) GetAccounts

func (slice BurnChecked) GetAccounts() (accounts []*base.AccountMeta)

func (*BurnChecked) GetMintAccount

func (inst *BurnChecked) GetMintAccount() *base.AccountMeta

GetMintAccount gets the "mint" account. The token mint.

func (*BurnChecked) GetOwnerAccount

func (inst *BurnChecked) GetOwnerAccount() *base.AccountMeta

GetOwnerAccount gets the "owner" account. The account's owner/delegate.

func (*BurnChecked) GetSourceAccount

func (inst *BurnChecked) GetSourceAccount() *base.AccountMeta

GetSourceAccount gets the "source" account. The account to burn from.

func (BurnChecked) MarshalWithEncoder

func (obj BurnChecked) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*BurnChecked) SetAccounts

func (obj *BurnChecked) SetAccounts(accounts []*base.AccountMeta) error

func (*BurnChecked) SetAmount

func (inst *BurnChecked) SetAmount(amount uint64) *BurnChecked

SetAmount sets the "amount" parameter. The amount of tokens to burn.

func (*BurnChecked) SetDecimals

func (inst *BurnChecked) SetDecimals(decimals uint8) *BurnChecked

SetDecimals sets the "decimals" parameter. Expected number of base 10 digits to the right of the decimal place.

func (*BurnChecked) SetMintAccount

func (inst *BurnChecked) SetMintAccount(mint base.PublicKey) *BurnChecked

SetMintAccount sets the "mint" account. The token mint.

func (*BurnChecked) SetOwnerAccount

func (inst *BurnChecked) SetOwnerAccount(owner base.PublicKey, multisigSigners ...base.PublicKey) *BurnChecked

SetOwnerAccount sets the "owner" account. The account's owner/delegate.

func (*BurnChecked) SetSourceAccount

func (inst *BurnChecked) SetSourceAccount(source base.PublicKey) *BurnChecked

SetSourceAccount sets the "source" account. The account to burn from.

func (*BurnChecked) Validate

func (inst *BurnChecked) Validate() error

func (BurnChecked) ValidateAndBuild

func (inst BurnChecked) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type CloseAccount

type CloseAccount struct {

	// [0] = [WRITE] account
	// ··········· The account to close.
	//
	// [1] = [WRITE] destination
	// ··········· The destination account.
	//
	// [2] = [] owner
	// ··········· The account's owner.
	//
	// [3...] = [SIGNER] signers
	// ··········· M signer accounts.
	Accounts base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
	Signers  base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Close an account by transferring all its SOL to the destination account. Non-native accounts may only be closed if its token amount is zero.

func NewCloseAccountInstruction

func NewCloseAccountInstruction(

	account base.PublicKey,
	destination base.PublicKey,
	owner base.PublicKey,
	multisigSigners []base.PublicKey,
) *CloseAccount

NewCloseAccountInstruction declares a new CloseAccount instruction with the provided parameters and accounts.

func NewCloseAccountInstructionBuilder

func NewCloseAccountInstructionBuilder() *CloseAccount

NewCloseAccountInstructionBuilder creates a new `CloseAccount` instruction builder.

func (CloseAccount) Build

func (inst CloseAccount) Build() *Instruction

func (*CloseAccount) GetAccount

func (inst *CloseAccount) GetAccount() *base.AccountMeta

GetAccount gets the "account" account. The account to close.

func (CloseAccount) GetAccounts

func (slice CloseAccount) GetAccounts() (accounts []*base.AccountMeta)

func (*CloseAccount) GetDestinationAccount

func (inst *CloseAccount) GetDestinationAccount() *base.AccountMeta

GetDestinationAccount gets the "destination" account. The destination account.

func (*CloseAccount) GetOwnerAccount

func (inst *CloseAccount) GetOwnerAccount() *base.AccountMeta

GetOwnerAccount gets the "owner" account. The account's owner.

func (CloseAccount) MarshalWithEncoder

func (obj CloseAccount) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*CloseAccount) SetAccount

func (inst *CloseAccount) SetAccount(account base.PublicKey) *CloseAccount

SetAccount sets the "account" account. The account to close.

func (*CloseAccount) SetAccounts

func (obj *CloseAccount) SetAccounts(accounts []*base.AccountMeta) error

func (*CloseAccount) SetDestinationAccount

func (inst *CloseAccount) SetDestinationAccount(destination base.PublicKey) *CloseAccount

SetDestinationAccount sets the "destination" account. The destination account.

func (*CloseAccount) SetOwnerAccount

func (inst *CloseAccount) SetOwnerAccount(owner base.PublicKey, multisigSigners ...base.PublicKey) *CloseAccount

SetOwnerAccount sets the "owner" account. The account's owner.

func (*CloseAccount) Validate

func (inst *CloseAccount) Validate() error

func (CloseAccount) ValidateAndBuild

func (inst CloseAccount) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type FreezeAccount

type FreezeAccount struct {

	// [0] = [WRITE] account
	// ··········· The account to freeze.
	//
	// [1] = [] mint
	// ··········· The token mint.
	//
	// [2] = [] authority
	// ··········· The mint freeze authority.
	//
	// [3...] = [SIGNER] signers
	// ··········· M signer accounts.
	Accounts base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
	Signers  base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Freeze an Initialized account using the Mint's freeze_authority (if set).

func NewFreezeAccountInstruction

func NewFreezeAccountInstruction(

	account base.PublicKey,
	mint base.PublicKey,
	authority base.PublicKey,
	multisigSigners []base.PublicKey,
) *FreezeAccount

NewFreezeAccountInstruction declares a new FreezeAccount instruction with the provided parameters and accounts.

func NewFreezeAccountInstructionBuilder

func NewFreezeAccountInstructionBuilder() *FreezeAccount

NewFreezeAccountInstructionBuilder creates a new `FreezeAccount` instruction builder.

func (FreezeAccount) Build

func (inst FreezeAccount) Build() *Instruction

func (*FreezeAccount) GetAccount

func (inst *FreezeAccount) GetAccount() *base.AccountMeta

GetAccount gets the "account" account. The account to freeze.

func (FreezeAccount) GetAccounts

func (slice FreezeAccount) GetAccounts() (accounts []*base.AccountMeta)

func (*FreezeAccount) GetAuthorityAccount

func (inst *FreezeAccount) GetAuthorityAccount() *base.AccountMeta

GetAuthorityAccount gets the "authority" account. The mint freeze authority.

func (*FreezeAccount) GetMintAccount

func (inst *FreezeAccount) GetMintAccount() *base.AccountMeta

GetMintAccount gets the "mint" account. The token mint.

func (FreezeAccount) MarshalWithEncoder

func (obj FreezeAccount) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*FreezeAccount) SetAccount

func (inst *FreezeAccount) SetAccount(account base.PublicKey) *FreezeAccount

SetAccount sets the "account" account. The account to freeze.

func (*FreezeAccount) SetAccounts

func (obj *FreezeAccount) SetAccounts(accounts []*base.AccountMeta) error

func (*FreezeAccount) SetAuthorityAccount

func (inst *FreezeAccount) SetAuthorityAccount(authority base.PublicKey, multisigSigners ...base.PublicKey) *FreezeAccount

SetAuthorityAccount sets the "authority" account. The mint freeze authority.

func (*FreezeAccount) SetMintAccount

func (inst *FreezeAccount) SetMintAccount(mint base.PublicKey) *FreezeAccount

SetMintAccount sets the "mint" account. The token mint.

func (*FreezeAccount) Validate

func (inst *FreezeAccount) Validate() error

func (FreezeAccount) ValidateAndBuild

func (inst FreezeAccount) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type InitializeAccount

type InitializeAccount struct {

	// [0] = [WRITE] account
	// ··········· The account to initialize.
	//
	// [1] = [] mint
	// ··········· The mint this account will be associated with.
	//
	// [2] = [] owner
	// ··········· The new account's owner/multisignature.
	//
	// [3] = [] $(SysVarRentPubkey)
	// ··········· Rent sysvar.
	base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Initializes a new account to hold tokens. If this account is associated with the native mint then the token balance of the initialized account will be equal to the amount of SOL in the account. If this account is associated with another mint, that mint must be initialized before this command can succeed.

The `InitializeAccount` instruction requires no signers and MUST be included within the same Transaction as the system program's `CreateAccount` instruction that creates the account being initialized. Otherwise another party can acquire ownership of the uninitialized account.

func NewInitializeAccountInstruction

func NewInitializeAccountInstruction(

	account base.PublicKey,
	mint base.PublicKey,
	owner base.PublicKey) *InitializeAccount

NewInitializeAccountInstruction declares a new InitializeAccount instruction with the provided parameters and accounts.

func NewInitializeAccountInstructionBuilder

func NewInitializeAccountInstructionBuilder() *InitializeAccount

NewInitializeAccountInstructionBuilder creates a new `InitializeAccount` instruction builder.

func (InitializeAccount) Build

func (inst InitializeAccount) Build() *Instruction

func (*InitializeAccount) GetAccount

func (inst *InitializeAccount) GetAccount() *base.AccountMeta

GetAccount gets the "account" account. The account to initialize.

func (*InitializeAccount) GetMintAccount

func (inst *InitializeAccount) GetMintAccount() *base.AccountMeta

GetMintAccount gets the "mint" account. The mint this account will be associated with.

func (*InitializeAccount) GetOwnerAccount

func (inst *InitializeAccount) GetOwnerAccount() *base.AccountMeta

GetOwnerAccount gets the "owner" account. The new account's owner/multisignature.

func (*InitializeAccount) GetSysVarRentPubkeyAccount

func (inst *InitializeAccount) GetSysVarRentPubkeyAccount() *base.AccountMeta

GetSysVarRentPubkeyAccount gets the "$(SysVarRentPubkey)" account. Rent sysvar.

func (InitializeAccount) MarshalWithEncoder

func (obj InitializeAccount) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*InitializeAccount) SetAccount

func (inst *InitializeAccount) SetAccount(account base.PublicKey) *InitializeAccount

SetAccount sets the "account" account. The account to initialize.

func (*InitializeAccount) SetMintAccount

func (inst *InitializeAccount) SetMintAccount(mint base.PublicKey) *InitializeAccount

SetMintAccount sets the "mint" account. The mint this account will be associated with.

func (*InitializeAccount) SetOwnerAccount

func (inst *InitializeAccount) SetOwnerAccount(owner base.PublicKey) *InitializeAccount

SetOwnerAccount sets the "owner" account. The new account's owner/multisignature.

func (*InitializeAccount) SetSysVarRentPubkeyAccount

func (inst *InitializeAccount) SetSysVarRentPubkeyAccount(SysVarRentPubkey base.PublicKey) *InitializeAccount

SetSysVarRentPubkeyAccount sets the "$(SysVarRentPubkey)" account. Rent sysvar.

func (*InitializeAccount) Validate

func (inst *InitializeAccount) Validate() error

func (InitializeAccount) ValidateAndBuild

func (inst InitializeAccount) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type InitializeAccount2

type InitializeAccount2 struct {
	// The new account's owner/multisignature.
	Owner *base.PublicKey

	// [0] = [WRITE] account
	// ··········· The account to initialize.
	//
	// [1] = [] mint
	// ··········· The mint this account will be associated with.
	//
	// [2] = [] $(SysVarRentPubkey)
	// ··········· Rent sysvar.
	base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Like InitializeAccount, but the owner pubkey is passed via instruction data rather than the accounts list. This variant may be preferable when using Cross Program Invocation from an instruction that does not need the owner's `AccountInfo` otherwise.

func NewInitializeAccount2Instruction

func NewInitializeAccount2Instruction(

	owner base.PublicKey,

	account base.PublicKey,
	mint base.PublicKey) *InitializeAccount2

NewInitializeAccount2Instruction declares a new InitializeAccount2 instruction with the provided parameters and accounts.

func NewInitializeAccount2InstructionBuilder

func NewInitializeAccount2InstructionBuilder() *InitializeAccount2

NewInitializeAccount2InstructionBuilder creates a new `InitializeAccount2` instruction builder.

func (InitializeAccount2) Build

func (inst InitializeAccount2) Build() *Instruction

func (*InitializeAccount2) GetAccount

func (inst *InitializeAccount2) GetAccount() *base.AccountMeta

GetAccount gets the "account" account. The account to initialize.

func (*InitializeAccount2) GetMintAccount

func (inst *InitializeAccount2) GetMintAccount() *base.AccountMeta

GetMintAccount gets the "mint" account. The mint this account will be associated with.

func (*InitializeAccount2) GetSysVarRentPubkeyAccount

func (inst *InitializeAccount2) GetSysVarRentPubkeyAccount() *base.AccountMeta

GetSysVarRentPubkeyAccount gets the "$(SysVarRentPubkey)" account. Rent sysvar.

func (InitializeAccount2) MarshalWithEncoder

func (obj InitializeAccount2) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*InitializeAccount2) SetAccount

func (inst *InitializeAccount2) SetAccount(account base.PublicKey) *InitializeAccount2

SetAccount sets the "account" account. The account to initialize.

func (*InitializeAccount2) SetMintAccount

func (inst *InitializeAccount2) SetMintAccount(mint base.PublicKey) *InitializeAccount2

SetMintAccount sets the "mint" account. The mint this account will be associated with.

func (*InitializeAccount2) SetOwner

func (inst *InitializeAccount2) SetOwner(owner base.PublicKey) *InitializeAccount2

SetOwner sets the "owner" parameter. The new account's owner/multisignature.

func (*InitializeAccount2) SetSysVarRentPubkeyAccount

func (inst *InitializeAccount2) SetSysVarRentPubkeyAccount(SysVarRentPubkey base.PublicKey) *InitializeAccount2

SetSysVarRentPubkeyAccount sets the "$(SysVarRentPubkey)" account. Rent sysvar.

func (*InitializeAccount2) Validate

func (inst *InitializeAccount2) Validate() error

func (InitializeAccount2) ValidateAndBuild

func (inst InitializeAccount2) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type InitializeAccount3

type InitializeAccount3 struct {
	// The new account's owner/multisignature.
	Owner *base.PublicKey

	// [0] = [WRITE] account
	// ··········· The account to initialize.
	//
	// [1] = [] mint
	// ··········· The mint this account will be associated with.
	base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Like InitializeAccount2, but does not require the Rent sysvar to be provided.

func NewInitializeAccount3Instruction

func NewInitializeAccount3Instruction(

	owner base.PublicKey,

	account base.PublicKey,
	mint base.PublicKey) *InitializeAccount3

NewInitializeAccount3Instruction declares a new InitializeAccount3 instruction with the provided parameters and accounts.

func NewInitializeAccount3InstructionBuilder

func NewInitializeAccount3InstructionBuilder() *InitializeAccount3

NewInitializeAccount3InstructionBuilder creates a new `InitializeAccount3` instruction builder.

func (InitializeAccount3) Build

func (inst InitializeAccount3) Build() *Instruction

func (*InitializeAccount3) GetAccount

func (inst *InitializeAccount3) GetAccount() *base.AccountMeta

GetAccount gets the "account" account. The account to initialize.

func (*InitializeAccount3) GetMintAccount

func (inst *InitializeAccount3) GetMintAccount() *base.AccountMeta

GetMintAccount gets the "mint" account. The mint this account will be associated with.

func (InitializeAccount3) MarshalWithEncoder

func (obj InitializeAccount3) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*InitializeAccount3) SetAccount

func (inst *InitializeAccount3) SetAccount(account base.PublicKey) *InitializeAccount3

SetAccount sets the "account" account. The account to initialize.

func (*InitializeAccount3) SetMintAccount

func (inst *InitializeAccount3) SetMintAccount(mint base.PublicKey) *InitializeAccount3

SetMintAccount sets the "mint" account. The mint this account will be associated with.

func (*InitializeAccount3) SetOwner

func (inst *InitializeAccount3) SetOwner(owner base.PublicKey) *InitializeAccount3

SetOwner sets the "owner" parameter. The new account's owner/multisignature.

func (*InitializeAccount3) Validate

func (inst *InitializeAccount3) Validate() error

func (InitializeAccount3) ValidateAndBuild

func (inst InitializeAccount3) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type InitializeMint

type InitializeMint struct {
	// Number of base 10 digits to the right of the decimal place.
	Decimals *uint8

	// The authority/multisignature to mint tokens.
	MintAuthority *base.PublicKey

	// The freeze authority/multisignature of the mint.
	FreezeAuthority *base.PublicKey `bin:"optional"`

	// [0] = [WRITE] mint
	// ··········· The mint to initialize.
	//
	// [1] = [] $(SysVarRentPubkey)
	// ··········· Rent sysvar.
	base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Initializes a new mint and optionally deposits all the newly minted tokens in an account.

The `InitializeMint` instruction requires no signers and MUST be included within the same Transaction as the system program's `CreateAccount` instruction that creates the account being initialized. Otherwise another party can acquire ownership of the uninitialized account.

func NewInitializeMintInstruction

func NewInitializeMintInstruction(

	decimals uint8,
	mint_authority base.PublicKey,
	freeze_authority base.PublicKey,

	mint base.PublicKey) *InitializeMint

NewInitializeMintInstruction declares a new InitializeMint instruction with the provided parameters and accounts.

func NewInitializeMintInstructionBuilder

func NewInitializeMintInstructionBuilder() *InitializeMint

NewInitializeMintInstructionBuilder creates a new `InitializeMint` instruction builder.

func (InitializeMint) Build

func (inst InitializeMint) Build() *Instruction

func (*InitializeMint) GetMintAccount

func (inst *InitializeMint) GetMintAccount() *base.AccountMeta

GetMintAccount gets the "mint" account. The mint to initialize.

func (*InitializeMint) GetSysVarRentPubkeyAccount

func (inst *InitializeMint) GetSysVarRentPubkeyAccount() *base.AccountMeta

GetSysVarRentPubkeyAccount gets the "$(SysVarRentPubkey)" account. Rent sysvar.

func (InitializeMint) MarshalWithEncoder

func (obj InitializeMint) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*InitializeMint) SetDecimals

func (inst *InitializeMint) SetDecimals(decimals uint8) *InitializeMint

SetDecimals sets the "decimals" parameter. Number of base 10 digits to the right of the decimal place.

func (*InitializeMint) SetFreezeAuthority

func (inst *InitializeMint) SetFreezeAuthority(freeze_authority base.PublicKey) *InitializeMint

SetFreezeAuthority sets the "freeze_authority" parameter. The freeze authority/multisignature of the mint.

func (*InitializeMint) SetMintAccount

func (inst *InitializeMint) SetMintAccount(mint base.PublicKey) *InitializeMint

SetMintAccount sets the "mint" account. The mint to initialize.

func (*InitializeMint) SetMintAuthority

func (inst *InitializeMint) SetMintAuthority(mint_authority base.PublicKey) *InitializeMint

SetMintAuthority sets the "mint_authority" parameter. The authority/multisignature to mint tokens.

func (*InitializeMint) SetSysVarRentPubkeyAccount

func (inst *InitializeMint) SetSysVarRentPubkeyAccount(SysVarRentPubkey base.PublicKey) *InitializeMint

SetSysVarRentPubkeyAccount sets the "$(SysVarRentPubkey)" account. Rent sysvar.

func (*InitializeMint) Validate

func (inst *InitializeMint) Validate() error

func (InitializeMint) ValidateAndBuild

func (inst InitializeMint) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type InitializeMint2

type InitializeMint2 struct {
	// Number of base 10 digits to the right of the decimal place.
	Decimals *uint8

	// The authority/multisignature to mint tokens.
	MintAuthority *base.PublicKey

	// The freeze authority/multisignature of the mint.
	FreezeAuthority *base.PublicKey `bin:"optional"`

	// [0] = [WRITE] mint
	// ··········· The mint to initialize.
	base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Like InitializeMint, but does not require the Rent sysvar to be provided.

func NewInitializeMint2Instruction

func NewInitializeMint2Instruction(

	decimals uint8,
	mint_authority base.PublicKey,
	freeze_authority base.PublicKey,

	mint base.PublicKey) *InitializeMint2

NewInitializeMint2Instruction declares a new InitializeMint2 instruction with the provided parameters and accounts.

func NewInitializeMint2InstructionBuilder

func NewInitializeMint2InstructionBuilder() *InitializeMint2

NewInitializeMint2InstructionBuilder creates a new `InitializeMint2` instruction builder.

func (InitializeMint2) Build

func (inst InitializeMint2) Build() *Instruction

func (*InitializeMint2) GetMintAccount

func (inst *InitializeMint2) GetMintAccount() *base.AccountMeta

GetMintAccount gets the "mint" account. The mint to initialize.

func (InitializeMint2) MarshalWithEncoder

func (obj InitializeMint2) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*InitializeMint2) SetDecimals

func (inst *InitializeMint2) SetDecimals(decimals uint8) *InitializeMint2

SetDecimals sets the "decimals" parameter. Number of base 10 digits to the right of the decimal place.

func (*InitializeMint2) SetFreezeAuthority

func (inst *InitializeMint2) SetFreezeAuthority(freeze_authority base.PublicKey) *InitializeMint2

SetFreezeAuthority sets the "freeze_authority" parameter. The freeze authority/multisignature of the mint.

func (*InitializeMint2) SetMintAccount

func (inst *InitializeMint2) SetMintAccount(mint base.PublicKey) *InitializeMint2

SetMintAccount sets the "mint" account. The mint to initialize.

func (*InitializeMint2) SetMintAuthority

func (inst *InitializeMint2) SetMintAuthority(mint_authority base.PublicKey) *InitializeMint2

SetMintAuthority sets the "mint_authority" parameter. The authority/multisignature to mint tokens.

func (*InitializeMint2) Validate

func (inst *InitializeMint2) Validate() error

func (InitializeMint2) ValidateAndBuild

func (inst InitializeMint2) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type InitializeMultisig

type InitializeMultisig struct {
	// The number of signers (M) required to validate this multisignature
	// account.
	M *uint8

	// [0] = [WRITE] account
	// ··········· The multisignature account to initialize.
	//
	// [1] = [] $(SysVarRentPubkey)
	// ··········· Rent sysvar.
	//
	// [2...] = [SIGNER] signers
	// ··········· ..2+N The signer accounts, must equal to N where 1 <= N <=11
	Accounts base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
	Signers  base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Initializes a multisignature account with N provided signers.

Multisignature accounts can used in place of any single owner/delegate accounts in any token instruction that require an owner/delegate to be present. The variant field represents the number of signers (M) required to validate this multisignature account.

The `InitializeMultisig` instruction requires no signers and MUST be included within the same Transaction as the system program's `CreateAccount` instruction that creates the account being initialized. Otherwise another party can acquire ownership of the uninitialized account.

func NewInitializeMultisigInstruction

func NewInitializeMultisigInstruction(

	m uint8,

	account base.PublicKey,
	SysVarRentPubkey base.PublicKey,
	signers []base.PublicKey,
) *InitializeMultisig

NewInitializeMultisigInstruction declares a new InitializeMultisig instruction with the provided parameters and accounts.

func NewInitializeMultisigInstructionBuilder

func NewInitializeMultisigInstructionBuilder() *InitializeMultisig

NewInitializeMultisigInstructionBuilder creates a new `InitializeMultisig` instruction builder.

func (*InitializeMultisig) AddSigners

func (inst *InitializeMultisig) AddSigners(signers ...base.PublicKey) *InitializeMultisig

AddSigners adds the "signers" accounts. ..2+N The signer accounts, must equal to N where 1 <= N <=11

func (InitializeMultisig) Build

func (inst InitializeMultisig) Build() *Instruction

func (*InitializeMultisig) GetAccount

func (inst *InitializeMultisig) GetAccount() *base.AccountMeta

GetAccount gets the "account" account. The multisignature account to initialize.

func (InitializeMultisig) GetAccounts

func (slice InitializeMultisig) GetAccounts() (accounts []*base.AccountMeta)

func (*InitializeMultisig) GetSysVarRentPubkeyAccount

func (inst *InitializeMultisig) GetSysVarRentPubkeyAccount() *base.AccountMeta

GetSysVarRentPubkeyAccount gets the "$(SysVarRentPubkey)" account. Rent sysvar.

func (InitializeMultisig) MarshalWithEncoder

func (obj InitializeMultisig) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*InitializeMultisig) SetAccount

func (inst *InitializeMultisig) SetAccount(account base.PublicKey) *InitializeMultisig

SetAccount sets the "account" account. The multisignature account to initialize.

func (*InitializeMultisig) SetAccounts

func (obj *InitializeMultisig) SetAccounts(accounts []*base.AccountMeta) error

func (*InitializeMultisig) SetM

SetM sets the "m" parameter. The number of signers (M) required to validate this multisignature account.

func (*InitializeMultisig) SetSysVarRentPubkeyAccount

func (inst *InitializeMultisig) SetSysVarRentPubkeyAccount(SysVarRentPubkey base.PublicKey) *InitializeMultisig

SetSysVarRentPubkeyAccount sets the "$(SysVarRentPubkey)" account. Rent sysvar.

func (*InitializeMultisig) Validate

func (inst *InitializeMultisig) Validate() error

func (InitializeMultisig) ValidateAndBuild

func (inst InitializeMultisig) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type InitializeMultisig2

type InitializeMultisig2 struct {
	// The number of signers (M) required to validate this multisignature account.
	M *uint8

	// [0] = [WRITE] account
	// ··········· The multisignature account to initialize.
	//
	// [1] = [SIGNER] signers
	// ··········· The signer accounts, must equal to N where 1 <= N <= 11.
	Accounts base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
	Signers  base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Like InitializeMultisig, but does not require the Rent sysvar to be provided.

func NewInitializeMultisig2Instruction

func NewInitializeMultisig2Instruction(

	m uint8,

	account base.PublicKey,
	signers []base.PublicKey,
) *InitializeMultisig2

NewInitializeMultisig2Instruction declares a new InitializeMultisig2 instruction with the provided parameters and accounts.

func NewInitializeMultisig2InstructionBuilder

func NewInitializeMultisig2InstructionBuilder() *InitializeMultisig2

NewInitializeMultisig2InstructionBuilder creates a new `InitializeMultisig2` instruction builder.

func (*InitializeMultisig2) AddSigners

func (inst *InitializeMultisig2) AddSigners(signers ...base.PublicKey) *InitializeMultisig2

AddSigners adds the "signers" accounts. The signer accounts, must equal to N where 1 <= N <= 11.

func (InitializeMultisig2) Build

func (inst InitializeMultisig2) Build() *Instruction

func (*InitializeMultisig2) GetAccount

func (inst *InitializeMultisig2) GetAccount() *base.AccountMeta

GetAccount gets the "account" account. The multisignature account to initialize.

func (InitializeMultisig2) GetAccounts

func (slice InitializeMultisig2) GetAccounts() (accounts []*base.AccountMeta)

func (InitializeMultisig2) MarshalWithEncoder

func (obj InitializeMultisig2) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*InitializeMultisig2) SetAccount

func (inst *InitializeMultisig2) SetAccount(account base.PublicKey) *InitializeMultisig2

SetAccount sets the "account" account. The multisignature account to initialize.

func (*InitializeMultisig2) SetAccounts

func (obj *InitializeMultisig2) SetAccounts(accounts []*base.AccountMeta) error

func (*InitializeMultisig2) SetM

SetM sets the "m" parameter. The number of signers (M) required to validate this multisignature account.

func (*InitializeMultisig2) Validate

func (inst *InitializeMultisig2) Validate() error

func (InitializeMultisig2) ValidateAndBuild

func (inst InitializeMultisig2) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type Instruction

type Instruction struct {
	base.BaseVariant
	TokenProgramID base.PublicKey
}

func (*Instruction) Accounts

func (inst *Instruction) Accounts() (out []*base.AccountMeta)

func (*Instruction) Data

func (inst *Instruction) Data() ([]byte, error)

func (*Instruction) MarshalWithEncoder

func (inst *Instruction) MarshalWithEncoder(encoder *base.Encoder) error

func (*Instruction) ProgramID

func (inst *Instruction) ProgramID() base.PublicKey

func (*Instruction) SetProgramID

func (inst *Instruction) SetProgramID(tokenProgramID base.PublicKey)

type Mint

type Mint struct {
	// Optional authority used to mint new tokens. The mint authority may only be provided during
	// mint creation. If no mint authority is present then the mint has a fixed supply and no
	// further tokens may be minted.
	MintAuthority *base.PublicKey `bin:"optional"`

	// Total supply of tokens.
	Supply uint64

	// Number of base 10 digits to the right of the decimal place.
	Decimals uint8

	// Is `true` if this structure has been initialized
	IsInitialized bool

	// Optional authority to freeze token accounts.
	FreezeAuthority *base.PublicKey `bin:"optional"`
}

func (Mint) MarshalWithEncoder

func (mint Mint) MarshalWithEncoder(encoder *base.Encoder) (err error)

type MintTo

type MintTo struct {
	// The amount of new tokens to mint.
	Amount *uint64

	// [0] = [WRITE] mint
	// ··········· The mint.
	//
	// [1] = [WRITE] destination
	// ··········· The account to mint tokens to.
	//
	// [2] = [] authority
	// ··········· The mint's minting authority.
	//
	// [3...] = [SIGNER] signers
	// ··········· M signer accounts.
	Accounts base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
	Signers  base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Mints new tokens to an account. The native mint does not support minting.

func NewMintToInstruction

func NewMintToInstruction(

	amount uint64,

	mint base.PublicKey,
	destination base.PublicKey,
	authority base.PublicKey,
	multisigSigners []base.PublicKey,
) *MintTo

NewMintToInstruction declares a new MintTo instruction with the provided parameters and accounts.

func NewMintToInstructionBuilder

func NewMintToInstructionBuilder() *MintTo

NewMintToInstructionBuilder creates a new `MintTo` instruction builder.

func (MintTo) Build

func (inst MintTo) Build() *Instruction

func (MintTo) GetAccounts

func (slice MintTo) GetAccounts() (accounts []*base.AccountMeta)

func (*MintTo) GetAuthorityAccount

func (inst *MintTo) GetAuthorityAccount() *base.AccountMeta

GetAuthorityAccount gets the "authority" account. The mint's minting authority.

func (*MintTo) GetDestinationAccount

func (inst *MintTo) GetDestinationAccount() *base.AccountMeta

GetDestinationAccount gets the "destination" account. The account to mint tokens to.

func (*MintTo) GetMintAccount

func (inst *MintTo) GetMintAccount() *base.AccountMeta

GetMintAccount gets the "mint" account. The mint.

func (MintTo) MarshalWithEncoder

func (obj MintTo) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*MintTo) SetAccounts

func (obj *MintTo) SetAccounts(accounts []*base.AccountMeta) error

func (*MintTo) SetAmount

func (inst *MintTo) SetAmount(amount uint64) *MintTo

SetAmount sets the "amount" parameter. The amount of new tokens to mint.

func (*MintTo) SetAuthorityAccount

func (inst *MintTo) SetAuthorityAccount(authority base.PublicKey, multisigSigners ...base.PublicKey) *MintTo

SetAuthorityAccount sets the "authority" account. The mint's minting authority.

func (*MintTo) SetDestinationAccount

func (inst *MintTo) SetDestinationAccount(destination base.PublicKey) *MintTo

SetDestinationAccount sets the "destination" account. The account to mint tokens to.

func (*MintTo) SetMintAccount

func (inst *MintTo) SetMintAccount(mint base.PublicKey) *MintTo

SetMintAccount sets the "mint" account. The mint.

func (*MintTo) Validate

func (inst *MintTo) Validate() error

func (MintTo) ValidateAndBuild

func (inst MintTo) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type MintToChecked

type MintToChecked struct {
	// The amount of new tokens to mint.
	Amount *uint64

	// Expected number of base 10 digits to the right of the decimal place.
	Decimals *uint8

	// [0] = [WRITE] mint
	// ··········· The mint.
	//
	// [1] = [WRITE] destination
	// ··········· The account to mint tokens to.
	//
	// [2] = [] authority
	// ··········· The mint's minting authority.
	//
	// [3...] = [SIGNER] signers
	// ··········· M signer accounts.
	Accounts base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
	Signers  base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Mints new tokens to an account. The native mint does not support minting.

This instruction differs from MintTo in that the decimals value is checked by the caller. This may be useful when creating transactions offline or within a hardware wallet.

func NewMintToCheckedInstruction

func NewMintToCheckedInstruction(

	amount uint64,
	decimals uint8,

	mint base.PublicKey,
	destination base.PublicKey,
	authority base.PublicKey,
	multisigSigners []base.PublicKey,
) *MintToChecked

NewMintToCheckedInstruction declares a new MintToChecked instruction with the provided parameters and accounts.

func NewMintToCheckedInstructionBuilder

func NewMintToCheckedInstructionBuilder() *MintToChecked

NewMintToCheckedInstructionBuilder creates a new `MintToChecked` instruction builder.

func (MintToChecked) Build

func (inst MintToChecked) Build() *Instruction

func (MintToChecked) GetAccounts

func (slice MintToChecked) GetAccounts() (accounts []*base.AccountMeta)

func (*MintToChecked) GetAuthorityAccount

func (inst *MintToChecked) GetAuthorityAccount() *base.AccountMeta

GetAuthorityAccount gets the "authority" account. The mint's minting authority.

func (*MintToChecked) GetDestinationAccount

func (inst *MintToChecked) GetDestinationAccount() *base.AccountMeta

GetDestinationAccount gets the "destination" account. The account to mint tokens to.

func (*MintToChecked) GetMintAccount

func (inst *MintToChecked) GetMintAccount() *base.AccountMeta

GetMintAccount gets the "mint" account. The mint.

func (MintToChecked) MarshalWithEncoder

func (obj MintToChecked) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*MintToChecked) SetAccounts

func (obj *MintToChecked) SetAccounts(accounts []*base.AccountMeta) error

func (*MintToChecked) SetAmount

func (inst *MintToChecked) SetAmount(amount uint64) *MintToChecked

SetAmount sets the "amount" parameter. The amount of new tokens to mint.

func (*MintToChecked) SetAuthorityAccount

func (inst *MintToChecked) SetAuthorityAccount(authority base.PublicKey, multisigSigners ...base.PublicKey) *MintToChecked

SetAuthorityAccount sets the "authority" account. The mint's minting authority.

func (*MintToChecked) SetDecimals

func (inst *MintToChecked) SetDecimals(decimals uint8) *MintToChecked

SetDecimals sets the "decimals" parameter. Expected number of base 10 digits to the right of the decimal place.

func (*MintToChecked) SetDestinationAccount

func (inst *MintToChecked) SetDestinationAccount(destination base.PublicKey) *MintToChecked

SetDestinationAccount sets the "destination" account. The account to mint tokens to.

func (*MintToChecked) SetMintAccount

func (inst *MintToChecked) SetMintAccount(mint base.PublicKey) *MintToChecked

SetMintAccount sets the "mint" account. The mint.

func (*MintToChecked) Validate

func (inst *MintToChecked) Validate() error

func (MintToChecked) ValidateAndBuild

func (inst MintToChecked) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type Multisig

type Multisig struct {
	// Number of signers required
	M uint8
	// Number of valid signers
	N uint8
	// Is `true` if this structure has been initialized
	IsInitialized bool
	// Signer public keys
	Signers [MAX_SIGNERS]base.PublicKey
}

type Revoke

type Revoke struct {

	// [0] = [WRITE] source
	// ··········· The source account.
	//
	// [1] = [] owner
	// ··········· The source account's owner.
	//
	// [2...] = [SIGNER] signers
	// ··········· M signer accounts.
	Accounts base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
	Signers  base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Revokes the delegate's authority.

func NewRevokeInstruction

func NewRevokeInstruction(

	source base.PublicKey,
	owner base.PublicKey,
	multisigSigners []base.PublicKey,
) *Revoke

NewRevokeInstruction declares a new Revoke instruction with the provided parameters and accounts.

func NewRevokeInstructionBuilder

func NewRevokeInstructionBuilder() *Revoke

NewRevokeInstructionBuilder creates a new `Revoke` instruction builder.

func (Revoke) Build

func (inst Revoke) Build() *Instruction

func (Revoke) GetAccounts

func (slice Revoke) GetAccounts() (accounts []*base.AccountMeta)

func (*Revoke) GetOwnerAccount

func (inst *Revoke) GetOwnerAccount() *base.AccountMeta

GetOwnerAccount gets the "owner" account. The source account's owner.

func (*Revoke) GetSourceAccount

func (inst *Revoke) GetSourceAccount() *base.AccountMeta

GetSourceAccount gets the "source" account. The source account.

func (Revoke) MarshalWithEncoder

func (obj Revoke) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*Revoke) SetAccounts

func (obj *Revoke) SetAccounts(accounts []*base.AccountMeta) error

func (*Revoke) SetOwnerAccount

func (inst *Revoke) SetOwnerAccount(owner base.PublicKey, multisigSigners ...base.PublicKey) *Revoke

SetOwnerAccount sets the "owner" account. The source account's owner.

func (*Revoke) SetSourceAccount

func (inst *Revoke) SetSourceAccount(source base.PublicKey) *Revoke

SetSourceAccount sets the "source" account. The source account.

func (*Revoke) Validate

func (inst *Revoke) Validate() error

func (Revoke) ValidateAndBuild

func (inst Revoke) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type SetAuthority

type SetAuthority struct {
	// The type of authority to update.
	AuthorityType *AuthorityType

	// The new authority.
	NewAuthority *base.PublicKey `bin:"optional"`

	// [0] = [WRITE] subject
	// ··········· The mint or account to change the authority of.
	//
	// [1] = [] authority
	// ··········· The current authority of the mint or account.
	//
	// [2...] = [SIGNER] signers
	// ··········· M signer accounts.
	Accounts base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
	Signers  base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Sets a new authority of a mint or account.

func NewSetAuthorityInstruction

func NewSetAuthorityInstruction(

	authority_type AuthorityType,
	new_authority base.PublicKey,

	subject base.PublicKey,
	authority base.PublicKey,
	multisigSigners []base.PublicKey,
) *SetAuthority

NewSetAuthorityInstruction declares a new SetAuthority instruction with the provided parameters and accounts.

func NewSetAuthorityInstructionBuilder

func NewSetAuthorityInstructionBuilder() *SetAuthority

NewSetAuthorityInstructionBuilder creates a new `SetAuthority` instruction builder.

func (SetAuthority) Build

func (inst SetAuthority) Build() *Instruction

func (SetAuthority) GetAccounts

func (slice SetAuthority) GetAccounts() (accounts []*base.AccountMeta)

func (*SetAuthority) GetAuthorityAccount

func (inst *SetAuthority) GetAuthorityAccount() *base.AccountMeta

GetAuthorityAccount gets the "authority" account. The current authority of the mint or account.

func (*SetAuthority) GetSubjectAccount

func (inst *SetAuthority) GetSubjectAccount() *base.AccountMeta

GetSubjectAccount gets the "subject" account. The mint or account to change the authority of.

func (SetAuthority) MarshalWithEncoder

func (obj SetAuthority) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*SetAuthority) SetAccounts

func (obj *SetAuthority) SetAccounts(accounts []*base.AccountMeta) error

func (*SetAuthority) SetAuthorityAccount

func (inst *SetAuthority) SetAuthorityAccount(authority base.PublicKey, multisigSigners ...base.PublicKey) *SetAuthority

SetAuthorityAccount sets the "authority" account. The current authority of the mint or account.

func (*SetAuthority) SetAuthorityType

func (inst *SetAuthority) SetAuthorityType(authority_type AuthorityType) *SetAuthority

SetAuthorityType sets the "authority_type" parameter. The type of authority to update.

func (*SetAuthority) SetNewAuthority

func (inst *SetAuthority) SetNewAuthority(new_authority base.PublicKey) *SetAuthority

SetNewAuthority sets the "new_authority" parameter. The new authority.

func (*SetAuthority) SetSubjectAccount

func (inst *SetAuthority) SetSubjectAccount(subject base.PublicKey) *SetAuthority

SetSubjectAccount sets the "subject" account. The mint or account to change the authority of.

func (*SetAuthority) Validate

func (inst *SetAuthority) Validate() error

func (SetAuthority) ValidateAndBuild

func (inst SetAuthority) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type SyncNative

type SyncNative struct {

	// [0] = [WRITE] tokenAccount
	// ··········· The native token account to sync with its underlying lamports.
	base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Given a wrapped / native token account (a token account containing SOL) updates its amount field based on the account's underlying `lamports`. This is useful if a non-wrapped SOL account uses `system_instruction::transfer` to move lamports to a wrapped token account, and needs to have its token `amount` field updated.

func NewSyncNativeInstruction

func NewSyncNativeInstruction(

	tokenAccount base.PublicKey) *SyncNative

NewSyncNativeInstruction declares a new SyncNative instruction with the provided parameters and accounts.

func NewSyncNativeInstructionBuilder

func NewSyncNativeInstructionBuilder() *SyncNative

NewSyncNativeInstructionBuilder creates a new `SyncNative` instruction builder.

func (SyncNative) Build

func (inst SyncNative) Build() *Instruction

func (*SyncNative) GetTokenAccount

func (inst *SyncNative) GetTokenAccount() *base.AccountMeta

GetTokenAccount gets the "tokenAccount" account. The native token account to sync with its underlying lamports.

func (SyncNative) MarshalWithEncoder

func (obj SyncNative) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*SyncNative) SetTokenAccount

func (inst *SyncNative) SetTokenAccount(tokenAccount base.PublicKey) *SyncNative

SetTokenAccount sets the "tokenAccount" account. The native token account to sync with its underlying lamports.

func (*SyncNative) Validate

func (inst *SyncNative) Validate() error

func (SyncNative) ValidateAndBuild

func (inst SyncNative) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type ThawAccount

type ThawAccount struct {

	// [0] = [WRITE] account
	// ··········· The account to thaw.
	//
	// [1] = [] mint
	// ··········· The token mint.
	//
	// [2] = [] authority
	// ··········· The mint freeze authority.
	//
	// [3...] = [SIGNER] signers
	// ··········· M signer accounts.
	Accounts base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
	Signers  base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Thaw a Frozen account using the Mint's freeze_authority (if set).

func NewThawAccountInstruction

func NewThawAccountInstruction(

	account base.PublicKey,
	mint base.PublicKey,
	authority base.PublicKey,
	multisigSigners []base.PublicKey,
) *ThawAccount

NewThawAccountInstruction declares a new ThawAccount instruction with the provided parameters and accounts.

func NewThawAccountInstructionBuilder

func NewThawAccountInstructionBuilder() *ThawAccount

NewThawAccountInstructionBuilder creates a new `ThawAccount` instruction builder.

func (ThawAccount) Build

func (inst ThawAccount) Build() *Instruction

func (*ThawAccount) GetAccount

func (inst *ThawAccount) GetAccount() *base.AccountMeta

GetAccount gets the "account" account. The account to thaw.

func (ThawAccount) GetAccounts

func (slice ThawAccount) GetAccounts() (accounts []*base.AccountMeta)

func (*ThawAccount) GetAuthorityAccount

func (inst *ThawAccount) GetAuthorityAccount() *base.AccountMeta

GetAuthorityAccount gets the "authority" account. The mint freeze authority.

func (*ThawAccount) GetMintAccount

func (inst *ThawAccount) GetMintAccount() *base.AccountMeta

GetMintAccount gets the "mint" account. The token mint.

func (ThawAccount) MarshalWithEncoder

func (obj ThawAccount) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*ThawAccount) SetAccount

func (inst *ThawAccount) SetAccount(account base.PublicKey) *ThawAccount

SetAccount sets the "account" account. The account to thaw.

func (*ThawAccount) SetAccounts

func (obj *ThawAccount) SetAccounts(accounts []*base.AccountMeta) error

func (*ThawAccount) SetAuthorityAccount

func (inst *ThawAccount) SetAuthorityAccount(authority base.PublicKey, multisigSigners ...base.PublicKey) *ThawAccount

SetAuthorityAccount sets the "authority" account. The mint freeze authority.

func (*ThawAccount) SetMintAccount

func (inst *ThawAccount) SetMintAccount(mint base.PublicKey) *ThawAccount

SetMintAccount sets the "mint" account. The token mint.

func (*ThawAccount) Validate

func (inst *ThawAccount) Validate() error

func (ThawAccount) ValidateAndBuild

func (inst ThawAccount) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type Transfer

type Transfer struct {
	// The amount of tokens to transfer.
	Amount *uint64

	// [0] = [WRITE] source
	// ··········· The source account.
	//
	// [1] = [WRITE] destination
	// ··········· The destination account.
	//
	// [2] = [] owner
	// ··········· The source account owner/delegate.
	//
	// [3...] = [SIGNER] signers
	// ··········· M signer accounts.
	Accounts base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
	Signers  base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Transfers tokens from one account to another either directly or via a delegate. If this account is associated with the native mint then equal amounts of SOL and Tokens will be transferred to the destination account.

func NewTransferInstruction

func NewTransferInstruction(

	amount uint64,

	source base.PublicKey,
	destination base.PublicKey,
	owner base.PublicKey,
	multisigSigners []base.PublicKey) *Transfer

NewTransferInstruction declares a new Transfer instruction with the provided parameters and accounts.

func NewTransferInstructionBuilder

func NewTransferInstructionBuilder() *Transfer

NewTransferInstructionBuilder creates a new `Transfer` instruction builder.

func (Transfer) Build

func (inst Transfer) Build() *Instruction

func (Transfer) GetAccounts

func (slice Transfer) GetAccounts() (accounts []*base.AccountMeta)

func (*Transfer) GetDestinationAccount

func (inst *Transfer) GetDestinationAccount() *base.AccountMeta

GetDestinationAccount gets the "destination" account. The destination account.

func (*Transfer) GetOwnerAccount

func (inst *Transfer) GetOwnerAccount() *base.AccountMeta

GetOwnerAccount gets the "owner" account. The source account owner/delegate.

func (*Transfer) GetSourceAccount

func (inst *Transfer) GetSourceAccount() *base.AccountMeta

GetSourceAccount gets the "source" account. The source account.

func (Transfer) MarshalWithEncoder

func (obj Transfer) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*Transfer) SetAccounts

func (obj *Transfer) SetAccounts(accounts []*base.AccountMeta) error

func (*Transfer) SetAmount

func (inst *Transfer) SetAmount(amount uint64) *Transfer

SetAmount sets the "amount" parameter. The amount of tokens to transfer.

func (*Transfer) SetDestinationAccount

func (inst *Transfer) SetDestinationAccount(destination base.PublicKey) *Transfer

SetDestinationAccount sets the "destination" account. The destination account.

func (*Transfer) SetOwnerAccount

func (inst *Transfer) SetOwnerAccount(owner base.PublicKey, multisigSigners ...base.PublicKey) *Transfer

SetOwnerAccount sets the "owner" account. The source account owner/delegate.

func (*Transfer) SetSourceAccount

func (inst *Transfer) SetSourceAccount(source base.PublicKey) *Transfer

SetSourceAccount sets the "source" account. The source account.

func (*Transfer) Validate

func (inst *Transfer) Validate() error

func (Transfer) ValidateAndBuild

func (inst Transfer) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type TransferChecked

type TransferChecked struct {
	// The amount of tokens to transfer.
	Amount *uint64

	// Expected number of base 10 digits to the right of the decimal place.
	Decimals *uint8

	// [0] = [WRITE] source
	// ··········· The source account.
	//
	// [1] = [] mint
	// ··········· The token mint.
	//
	// [2] = [WRITE] destination
	// ··········· The destination account.
	//
	// [3] = [] owner
	// ··········· The source account's owner/delegate.
	//
	// [4...] = [SIGNER] signers
	// ··········· M signer accounts.
	Accounts base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
	Signers  base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Transfers tokens from one account to another either directly or via a delegate. If this account is associated with the native mint then equal amounts of SOL and Tokens will be transferred to the destination account.

This instruction differs from Transfer in that the token mint and decimals value is checked by the caller. This may be useful when creating transactions offline or within a hardware wallet.

func NewTransferCheckedInstruction

func NewTransferCheckedInstruction(

	amount uint64,
	decimals uint8,

	source base.PublicKey,
	mint base.PublicKey,
	destination base.PublicKey,
	owner base.PublicKey,
	multisigSigners []base.PublicKey,
) *TransferChecked

NewTransferCheckedInstruction declares a new TransferChecked instruction with the provided parameters and accounts.

func NewTransferCheckedInstructionBuilder

func NewTransferCheckedInstructionBuilder() *TransferChecked

NewTransferCheckedInstructionBuilder creates a new `TransferChecked` instruction builder.

func (TransferChecked) Build

func (inst TransferChecked) Build() *Instruction

func (TransferChecked) GetAccounts

func (slice TransferChecked) GetAccounts() (accounts []*base.AccountMeta)

func (*TransferChecked) GetDestinationAccount

func (inst *TransferChecked) GetDestinationAccount() *base.AccountMeta

GetDestinationAccount gets the "destination" account. The destination account.

func (*TransferChecked) GetMintAccount

func (inst *TransferChecked) GetMintAccount() *base.AccountMeta

GetMintAccount gets the "mint" account. The token mint.

func (*TransferChecked) GetOwnerAccount

func (inst *TransferChecked) GetOwnerAccount() *base.AccountMeta

GetOwnerAccount gets the "owner" account. The source account's owner/delegate.

func (*TransferChecked) GetSourceAccount

func (inst *TransferChecked) GetSourceAccount() *base.AccountMeta

GetSourceAccount gets the "source" account. The source account.

func (TransferChecked) MarshalWithEncoder

func (obj TransferChecked) MarshalWithEncoder(encoder *base.Encoder) (err error)

func (*TransferChecked) SetAccounts

func (obj *TransferChecked) SetAccounts(accounts []*base.AccountMeta) error

func (*TransferChecked) SetAmount

func (inst *TransferChecked) SetAmount(amount uint64) *TransferChecked

SetAmount sets the "amount" parameter. The amount of tokens to transfer.

func (*TransferChecked) SetDecimals

func (inst *TransferChecked) SetDecimals(decimals uint8) *TransferChecked

SetDecimals sets the "decimals" parameter. Expected number of base 10 digits to the right of the decimal place.

func (*TransferChecked) SetDestinationAccount

func (inst *TransferChecked) SetDestinationAccount(destination base.PublicKey) *TransferChecked

SetDestinationAccount sets the "destination" account. The destination account.

func (*TransferChecked) SetMintAccount

func (inst *TransferChecked) SetMintAccount(mint base.PublicKey) *TransferChecked

SetMintAccount sets the "mint" account. The token mint.

func (*TransferChecked) SetOwnerAccount

func (inst *TransferChecked) SetOwnerAccount(owner base.PublicKey, multisigSigners ...base.PublicKey) *TransferChecked

SetOwnerAccount sets the "owner" account. The source account's owner/delegate.

func (*TransferChecked) SetSourceAccount

func (inst *TransferChecked) SetSourceAccount(source base.PublicKey) *TransferChecked

SetSourceAccount sets the "source" account. The source account.

Jump to

Keyboard shortcuts

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