TokenProgram class
Token Program
Properties
hashCode
→ int
The hash code for this object.
no setter inherited
pubkey
→ Pubkey
The public key that identifies this program (i.e. program id).
final inherited
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
Static Methods
approve ({required Pubkey source , required Pubkey delegate , required Pubkey owner , List <Pubkey > signers = const [] , required bu64 amount })
→ TransactionInstruction
Approves a delegate. A delegate is given the authority over tokens on behalf of the source
account's owner.
approveChecked ({required Pubkey source , required Pubkey mint , required Pubkey delegate , required Pubkey owner , List <Pubkey > signers = const [] , required bu64 amount , required u8 decimals })
→ TransactionInstruction
Approves a delegate. A delegate is given the authority over tokens on behalf of the source
account's owner.
burn ({required Pubkey account , required Pubkey mint , required Pubkey authority , List <Pubkey > signers = const [] , required bu64 amount })
→ TransactionInstruction
Burns tokens by removing them from an account. Burn
does not support
accounts associated with the native mint, use CloseAccount
instead.
burnChecked ({required Pubkey account , required Pubkey mint , required Pubkey authority , List <Pubkey > signers = const [] , required bu64 amount , required u8 decimals })
→ TransactionInstruction
Burns tokens by removing them from an account. BurnChecked
does not support accounts
associated with the native mint, use closeAccount
instead.
closeAccount ({required Pubkey account , required Pubkey destination , required Pubkey owner , List <Pubkey > signers = const [] })
→ TransactionInstruction
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.
freezeAccount ({required Pubkey account , required Pubkey mint , required Pubkey authority , List <Pubkey > signers = const [] })
→ TransactionInstruction
Freeze an Initialized account using the Mint's freeze_authority (if
set).
initializeAccount ({required Pubkey account , required Pubkey mint , required Pubkey owner })
→ TransactionInstruction
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.
initializeAccount2 ({required Pubkey account , required Pubkey mint , required Pubkey owner })
→ TransactionInstruction
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.
initializeAccount3 ({required Pubkey account , required Pubkey mint , required Pubkey owner })
→ TransactionInstruction
Like InitializeAccount2, but does not require the Rent sysvar to be provided.
initializeImmutableOwner ({required Pubkey account })
→ TransactionInstruction
Initialize the Immutable Owner extension for the given token account.
initializeMint ({required Pubkey mint , required u8 decimals , required Pubkey mintAuthority , Pubkey ? freezeAuthority })
→ TransactionInstruction
Initializes a new mint and optionally deposits all the newly minted tokens in an account.
initializeMint2 ({required Pubkey mint , required u8 decimals , required Pubkey mintAuthority , Pubkey ? freezeAuthority })
→ TransactionInstruction
Like InitializeMint, but does not require the Rent sysvar to be provided.
initializeMultisig ({required Pubkey account , required List <Pubkey > signers , required u8 numberOfSigners })
→ TransactionInstruction
Initializes a multisignature account with N provided signers.
initializeMultisig2 ({required Pubkey account , required List <Pubkey > signers , required u8 numberOfSigners })
→ TransactionInstruction
Like InitializeMultisig, but does not require the Rent sysvar to be provided.
mintTo ({required Pubkey mint , required Pubkey account , required Pubkey mintAuthority , List <Pubkey > signers = const [] , required bu64 amount })
→ TransactionInstruction
Mints new tokens to an account. The native mint does not support minting.
mintToChecked ({required Pubkey mint , required Pubkey account , required Pubkey mintAuthority , List <Pubkey > signers = const [] , required bu64 amount , required u8 decimals })
→ TransactionInstruction
Mints new tokens to an account. The native mint does not support minting.
revoke ({required Pubkey source , required Pubkey owner , List <Pubkey > signers = const [] })
→ TransactionInstruction
Revokes the delegate's authority.
setAuthority ({required Pubkey account , required Pubkey authority , List <Pubkey > signers = const [] , required AuthorityType authorityType , required Pubkey ? newAuthority })
→ TransactionInstruction
Sets a new authority of a mint or account.
syncNative ({required Pubkey account })
→ TransactionInstruction
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.
thawAccount ({required Pubkey account , required Pubkey mint , required Pubkey authority , List <Pubkey > signers = const [] })
→ TransactionInstruction
Thaw a Frozen account using the Mint's freeze_authority (if set).
transfer ({required Pubkey source , required Pubkey destination , required Pubkey owner , List <Pubkey > signers = const [] , required bu64 amount })
→ TransactionInstruction
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.
transferChecked ({required Pubkey source , required Pubkey mint , required Pubkey destination , required Pubkey owner , List <Pubkey > signers = const [] , required bu64 amount , required u8 decimals })
→ TransactionInstruction
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.
Constants
maxSigners
→ const int
Maximum number of multisignature signers.
minSigners
→ const int
Minimum number of multisignature signers.
reown_appkit 1.4.2-beta02