solana_kit_token library
SPL Token client for the Solana Kit Dart SDK.
This package provides a generated low-level client for the SPL Token program plus handwritten ergonomic helpers for common workflows like creating mints, minting to ATAs, and transferring to ATAs.
Associated Token Account APIs are shared from
solana_kit_associated_token_account and re-exported here for
convenience.
Generated layer
The generated code under src/generated/ is produced from the upstream
Codama IDL at solana-program/token. It includes typed account structs,
instruction builders, codec functions, error definitions, PDA helpers,
and program address constants.
import 'package:solana_kit_token/solana_kit_token.dart';
// Use generated instruction builders directly
final ix = getTransferInstruction(
programAddress: tokenProgramAddress,
source: sourceAccount,
destination: destAccount,
owner: ownerAddress,
amount: BigInt.from(1000),
);
Ergonomic helpers
Higher-level functions compose generated instructions into common workflows:
getCreateMintInstructionPlan: create a new token mintgetMintToAtaInstructionPlan: mint tokens to an ATA (created if needed)getTransferToAtaInstructionPlan: transfer to a recipient's ATA
Classes
- AmountToUiAmountInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- ApproveCheckedInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- ApproveInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- AssociatedTokenSeeds
- Seeds used to derive an associated token account PDA.
- BatchInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- BurnCheckedInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- BurnInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- CloseAccountInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- CreateAssociatedTokenIdempotentInstructionData
- Data for the ATA idempotent create instruction.
- CreateAssociatedTokenInstructionData
- Data for the ATA create instruction.
- CreateMintConfig
- Configuration for getCreateMintInstructionPlan.
- CreateMintInput
- Input for getCreateMintInstructionPlan.
- FreezeAccountInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- GetAccountDataSizeInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- InitializeAccount2InstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- InitializeAccount3InstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- InitializeAccountInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- InitializeImmutableOwnerInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- InitializeMint2InstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- InitializeMintInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- InitializeMultisig2InstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- InitializeMultisigInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- Mint
- MintToAtaConfig
- Configuration for mint-to-ATA helpers.
- MintToAtaInput
- Input for getMintToAtaInstructionPlan.
- MintToCheckedInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- MintToInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- Multisig
- RecoverNestedAssociatedTokenInstructionData
- Data for the nested ATA recovery instruction.
- RevokeInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- SetAuthorityInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- SyncNativeInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- ThawAccountInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- Token
- TransferCheckedInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- TransferInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- TransferToAtaConfig
- Configuration for transfer-to-ATA helpers.
- TransferToAtaInput
- Input for getTransferToAtaInstructionPlan.
- UiAmountToAmountInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- UnwrapLamportsInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
- WithdrawExcessLamportsInstructionData
- The discriminator field name: 'discriminator'. Offset: 0.
Enums
- AccountState
- AssociatedTokenInstruction
- Known instructions for the Associated Token Account program.
- AuthorityType
- TokenAccount
- Known accounts for the Token program.
- TokenInstruction
- Known instructions for the Token program.
Constants
- associatedTokenErrorInvalidOwner → const int
- ATA program error code for an owner that does not match PDA derivation.
- associatedTokenProgramAddress → const Address
- The address of the SPL Associated Token Account program.
- ataProgramAddress → const Address
- Backward-compatible alias for associatedTokenProgramAddress.
- mintSize → const int
- The size of the Mint account data in bytes.
- multisigSize → const int
- The size of the Multisig account data in bytes.
- tokenErrorAccountFrozen → const int
- AccountFrozen: Account is frozen Message: "Account is frozen"
- tokenErrorAlreadyInUse → const int
- AlreadyInUse: Already in use Message: "Already in use"
- tokenErrorAuthorityTypeNotSupported → const int
- AuthorityTypeNotSupported: Account does not support specified authority type Message: "Account does not support specified authority type"
- tokenErrorFixedSupply → const int
- FixedSupply: Fixed supply Message: "Fixed supply"
- tokenErrorInsufficientFunds → const int
- InsufficientFunds: Insufficient funds Message: "Insufficient funds"
- tokenErrorInvalidInstruction → const int
- InvalidInstruction: Invalid instruction Message: "Invalid instruction"
- tokenErrorInvalidMint → const int
- InvalidMint: Invalid Mint Message: "Invalid Mint"
- tokenErrorInvalidNumberOfProvidedSigners → const int
- InvalidNumberOfProvidedSigners: Invalid number of provided signers Message: "Invalid number of provided signers"
- tokenErrorInvalidNumberOfRequiredSigners → const int
- InvalidNumberOfRequiredSigners: Invalid number of required signers Message: "Invalid number of required signers"
- tokenErrorInvalidState → const int
- InvalidState: State is invalid for requested operation Message: "State is invalid for requested operation"
- tokenErrorMintCannotFreeze → const int
- MintCannotFreeze: This token mint cannot freeze accounts Message: "This token mint cannot freeze accounts"
- tokenErrorMintDecimalsMismatch → const int
- MintDecimalsMismatch: The provided decimals value different from the Mint decimals Message: "The provided decimals value different from the Mint decimals"
- tokenErrorMintMismatch → const int
- MintMismatch: Account not associated with this Mint Message: "Account not associated with this Mint"
- tokenErrorNativeNotSupported → const int
- NativeNotSupported: Instruction does not support native tokens Message: "Instruction does not support native tokens"
- tokenErrorNonNativeHasBalance → const int
- NonNativeHasBalance: Non-native account can only be closed if its balance is zero Message: "Non-native account can only be closed if its balance is zero"
- tokenErrorNonNativeNotSupported → const int
- NonNativeNotSupported: Instruction does not support non-native tokens Message: "Instruction does not support non-native tokens"
- tokenErrorNotRentExempt → const int
- Error codes for the Token program. NotRentExempt: Lamport balance below rent-exempt threshold Message: "Lamport balance below rent-exempt threshold"
- tokenErrorOverflow → const int
- Overflow: Operation overflowed Message: "Operation overflowed"
- tokenErrorOwnerMismatch → const int
- OwnerMismatch: Owner does not match Message: "Owner does not match"
- tokenErrorUninitializedState → const int
- UninitializedState: State is unititialized Message: "State is unititialized"
- tokenProgramAddress → const Address
- The address of the SPL Token program.
- tokenSize → const int
- The size of the Token account data in bytes.
Functions
-
decodeMint(
EncodedAccount encodedAccount) → Account< Mint> -
decodeMultisig(
EncodedAccount encodedAccount) → Account< Multisig> -
decodeToken(
EncodedAccount encodedAccount) → Account< Token> -
findAssociatedTokenPda(
{required AssociatedTokenSeeds seeds, Address programAddress = ataProgramAddress}) → Future< (Address, int)> - Finds the ATA program-derived address asynchronously.
-
findAssociatedTokenPdaSync(
{required AssociatedTokenSeeds seeds, Address programAddress = ataProgramAddress}) → (Address, int) - Finds the ATA program-derived address synchronously.
-
getAccountStateCodec(
) → Codec< AccountState, AccountState> -
getAccountStateDecoder(
) → Decoder< AccountState> -
getAccountStateEncoder(
) → Encoder< AccountState> -
getAmountToUiAmountInstruction(
{required Address programAddress, required Address mint, required BigInt amount}) → Instruction -
Creates a
AmountToUiAmountinstruction. -
getAmountToUiAmountInstructionDataCodec(
) → Codec< AmountToUiAmountInstructionData, AmountToUiAmountInstructionData> -
getAmountToUiAmountInstructionDataDecoder(
) → Decoder< AmountToUiAmountInstructionData> -
getAmountToUiAmountInstructionDataEncoder(
) → Encoder< AmountToUiAmountInstructionData> -
getApproveCheckedInstruction(
{required Address programAddress, required Address source, required Address mint, required Address delegate, required Address owner, required BigInt amount, required int decimals}) → Instruction -
Creates a
ApproveCheckedinstruction. -
getApproveCheckedInstructionDataCodec(
) → Codec< ApproveCheckedInstructionData, ApproveCheckedInstructionData> -
getApproveCheckedInstructionDataDecoder(
) → Decoder< ApproveCheckedInstructionData> -
getApproveCheckedInstructionDataEncoder(
) → Encoder< ApproveCheckedInstructionData> -
getApproveInstruction(
{required Address programAddress, required Address source, required Address delegate, required Address owner, required BigInt amount}) → Instruction -
Creates a
Approveinstruction. -
getApproveInstructionDataCodec(
) → Codec< ApproveInstructionData, ApproveInstructionData> -
getApproveInstructionDataDecoder(
) → Decoder< ApproveInstructionData> -
getApproveInstructionDataEncoder(
) → Encoder< ApproveInstructionData> -
getAssociatedTokenAddressSync(
{required Address owner, required Address tokenProgram, required Address mint, Address programAddress = ataProgramAddress}) → Address - Returns the associated token account address synchronously.
-
getAssociatedTokenErrorMessage(
int code) → String? -
Returns the message for an ATA program error
code, if known. -
getAuthorityTypeCodec(
) → Codec< AuthorityType, AuthorityType> -
getAuthorityTypeDecoder(
) → Decoder< AuthorityType> -
getAuthorityTypeEncoder(
) → Encoder< AuthorityType> -
getBatchInstruction(
{required Address programAddress, required List< Map< data}) → InstructionString, Object?> > -
Creates a
Batchinstruction. -
getBatchInstructionDataCodec(
) → Codec< BatchInstructionData, BatchInstructionData> -
getBatchInstructionDataDecoder(
) → Decoder< BatchInstructionData> -
getBatchInstructionDataEncoder(
) → Encoder< BatchInstructionData> -
getBurnCheckedInstruction(
{required Address programAddress, required Address account, required Address mint, required Address authority, required BigInt amount, required int decimals}) → Instruction -
Creates a
BurnCheckedinstruction. -
getBurnCheckedInstructionDataCodec(
) → Codec< BurnCheckedInstructionData, BurnCheckedInstructionData> -
getBurnCheckedInstructionDataDecoder(
) → Decoder< BurnCheckedInstructionData> -
getBurnCheckedInstructionDataEncoder(
) → Encoder< BurnCheckedInstructionData> -
getBurnInstruction(
{required Address programAddress, required Address account, required Address mint, required Address authority, required BigInt amount}) → Instruction -
Creates a
Burninstruction. -
getBurnInstructionDataCodec(
) → Codec< BurnInstructionData, BurnInstructionData> -
getBurnInstructionDataDecoder(
) → Decoder< BurnInstructionData> -
getBurnInstructionDataEncoder(
) → Encoder< BurnInstructionData> -
getCloseAccountInstruction(
{required Address programAddress, required Address account, required Address destination, required Address owner}) → Instruction -
Creates a
CloseAccountinstruction. -
getCloseAccountInstructionDataCodec(
) → Codec< CloseAccountInstructionData, CloseAccountInstructionData> -
getCloseAccountInstructionDataDecoder(
) → Decoder< CloseAccountInstructionData> -
getCloseAccountInstructionDataEncoder(
) → Encoder< CloseAccountInstructionData> -
getCreateAssociatedTokenAccountIdempotentInstruction(
{required Address programAddress, required Address payer, required Address ata, required Address owner, required Address mint, required Address systemProgram, required Address tokenProgram}) → Instruction - Backwards-compatible alias with the explicit “Account” noun included.
-
getCreateAssociatedTokenAccountInstruction(
{required Address programAddress, required Address payer, required Address ata, required Address owner, required Address mint, required Address systemProgram, required Address tokenProgram}) → Instruction - Backwards-compatible alias with the explicit “Account” noun included.
-
getCreateAssociatedTokenIdempotentInstruction(
{required Address programAddress, required Address payer, required Address ata, required Address owner, required Address mint, required Address systemProgram, required Address tokenProgram}) → Instruction - Creates the ATA idempotent create instruction.
-
getCreateAssociatedTokenIdempotentInstructionDataCodec(
) → Codec< CreateAssociatedTokenIdempotentInstructionData, CreateAssociatedTokenIdempotentInstructionData> - Returns the codec for CreateAssociatedTokenIdempotentInstructionData.
-
getCreateAssociatedTokenIdempotentInstructionDataDecoder(
) → Decoder< CreateAssociatedTokenIdempotentInstructionData> - Returns the decoder for CreateAssociatedTokenIdempotentInstructionData.
-
getCreateAssociatedTokenIdempotentInstructionDataEncoder(
) → Encoder< CreateAssociatedTokenIdempotentInstructionData> - Returns the encoder for CreateAssociatedTokenIdempotentInstructionData.
-
getCreateAssociatedTokenInstruction(
{required Address programAddress, required Address payer, required Address ata, required Address owner, required Address mint, required Address systemProgram, required Address tokenProgram}) → Instruction - Creates the ATA create instruction.
-
getCreateAssociatedTokenInstructionDataCodec(
) → Codec< CreateAssociatedTokenInstructionData, CreateAssociatedTokenInstructionData> - Returns the codec for CreateAssociatedTokenInstructionData.
-
getCreateAssociatedTokenInstructionDataDecoder(
) → Decoder< CreateAssociatedTokenInstructionData> - Returns the decoder for CreateAssociatedTokenInstructionData.
-
getCreateAssociatedTokenInstructionDataEncoder(
) → Encoder< CreateAssociatedTokenInstructionData> - Returns the encoder for CreateAssociatedTokenInstructionData.
-
getCreateMintInstructionPlan(
CreateMintInput input, [CreateMintConfig config = const CreateMintConfig()]) → InstructionPlan - Creates an instruction plan that creates and initialises a new SPL Token mint.
-
getFreezeAccountInstruction(
{required Address programAddress, required Address account, required Address mint, required Address owner}) → Instruction -
Creates a
FreezeAccountinstruction. -
getFreezeAccountInstructionDataCodec(
) → Codec< FreezeAccountInstructionData, FreezeAccountInstructionData> -
getFreezeAccountInstructionDataDecoder(
) → Decoder< FreezeAccountInstructionData> -
getFreezeAccountInstructionDataEncoder(
) → Encoder< FreezeAccountInstructionData> -
getGetAccountDataSizeInstruction(
{required Address programAddress, required Address mint}) → Instruction -
Creates a
GetAccountDataSizeinstruction. -
getGetAccountDataSizeInstructionDataCodec(
) → Codec< GetAccountDataSizeInstructionData, GetAccountDataSizeInstructionData> -
getGetAccountDataSizeInstructionDataDecoder(
) → Decoder< GetAccountDataSizeInstructionData> -
getGetAccountDataSizeInstructionDataEncoder(
) → Encoder< GetAccountDataSizeInstructionData> -
getInitializeAccount2Instruction(
{required Address programAddress, required Address account, required Address mint, required Address rent, required Address owner}) → Instruction -
Creates a
InitializeAccount2instruction. -
getInitializeAccount2InstructionDataCodec(
) → Codec< InitializeAccount2InstructionData, InitializeAccount2InstructionData> -
getInitializeAccount2InstructionDataDecoder(
) → Decoder< InitializeAccount2InstructionData> -
getInitializeAccount2InstructionDataEncoder(
) → Encoder< InitializeAccount2InstructionData> -
getInitializeAccount3Instruction(
{required Address programAddress, required Address account, required Address mint, required Address owner}) → Instruction -
Creates a
InitializeAccount3instruction. -
getInitializeAccount3InstructionDataCodec(
) → Codec< InitializeAccount3InstructionData, InitializeAccount3InstructionData> -
getInitializeAccount3InstructionDataDecoder(
) → Decoder< InitializeAccount3InstructionData> -
getInitializeAccount3InstructionDataEncoder(
) → Encoder< InitializeAccount3InstructionData> -
getInitializeAccountInstruction(
{required Address programAddress, required Address account, required Address mint, required Address owner, required Address rent}) → Instruction -
Creates a
InitializeAccountinstruction. -
getInitializeAccountInstructionDataCodec(
) → Codec< InitializeAccountInstructionData, InitializeAccountInstructionData> -
getInitializeAccountInstructionDataDecoder(
) → Decoder< InitializeAccountInstructionData> -
getInitializeAccountInstructionDataEncoder(
) → Encoder< InitializeAccountInstructionData> -
getInitializeImmutableOwnerInstruction(
{required Address programAddress, required Address account}) → Instruction -
Creates a
InitializeImmutableOwnerinstruction. -
getInitializeImmutableOwnerInstructionDataCodec(
) → Codec< InitializeImmutableOwnerInstructionData, InitializeImmutableOwnerInstructionData> -
getInitializeImmutableOwnerInstructionDataDecoder(
) → Decoder< InitializeImmutableOwnerInstructionData> -
getInitializeImmutableOwnerInstructionDataEncoder(
) → Encoder< InitializeImmutableOwnerInstructionData> -
getInitializeMint2Instruction(
{required Address programAddress, required Address mint, required int decimals, required Address mintAuthority, Address? freezeAuthority}) → Instruction -
Creates a
InitializeMint2instruction. -
getInitializeMint2InstructionDataCodec(
) → Codec< InitializeMint2InstructionData, InitializeMint2InstructionData> -
getInitializeMint2InstructionDataDecoder(
) → Decoder< InitializeMint2InstructionData> -
getInitializeMint2InstructionDataEncoder(
) → Encoder< InitializeMint2InstructionData> -
getInitializeMintInstruction(
{required Address programAddress, required Address mint, required Address rent, required int decimals, required Address mintAuthority, Address? freezeAuthority}) → Instruction -
Creates a
InitializeMintinstruction. -
getInitializeMintInstructionDataCodec(
) → Codec< InitializeMintInstructionData, InitializeMintInstructionData> -
getInitializeMintInstructionDataDecoder(
) → Decoder< InitializeMintInstructionData> -
getInitializeMintInstructionDataEncoder(
) → Encoder< InitializeMintInstructionData> -
getInitializeMultisig2Instruction(
{required Address programAddress, required Address multisig, required int m}) → Instruction -
Creates a
InitializeMultisig2instruction. -
getInitializeMultisig2InstructionDataCodec(
) → Codec< InitializeMultisig2InstructionData, InitializeMultisig2InstructionData> -
getInitializeMultisig2InstructionDataDecoder(
) → Decoder< InitializeMultisig2InstructionData> -
getInitializeMultisig2InstructionDataEncoder(
) → Encoder< InitializeMultisig2InstructionData> -
getInitializeMultisigInstruction(
{required Address programAddress, required Address multisig, required Address rent, required int m}) → Instruction -
Creates a
InitializeMultisiginstruction. -
getInitializeMultisigInstructionDataCodec(
) → Codec< InitializeMultisigInstructionData, InitializeMultisigInstructionData> -
getInitializeMultisigInstructionDataDecoder(
) → Decoder< InitializeMultisigInstructionData> -
getInitializeMultisigInstructionDataEncoder(
) → Encoder< InitializeMultisigInstructionData> -
getMintCodec(
) → Codec< Mint, Mint> -
getMintDecoder(
) → Decoder< Mint> -
getMintEncoder(
) → Encoder< Mint> - This account has a size discriminator of 82 bytes.
-
getMintToAtaInstructionPlan(
MintToAtaInput input, [MintToAtaConfig config = const MintToAtaConfig()]) → InstructionPlan - Creates an instruction plan that:
-
getMintToAtaInstructionPlanAsync(
{required Address payer, required Address owner, required Address mint, required Address mintAuthority, required BigInt amount, required int decimals, MintToAtaConfig config = const MintToAtaConfig()}) → Future< InstructionPlan> -
Like getMintToAtaInstructionPlan, but derives the ATA address
automatically from
ownerandmint. -
getMintToCheckedInstruction(
{required Address programAddress, required Address mint, required Address token, required Address mintAuthority, required BigInt amount, required int decimals}) → Instruction -
Creates a
MintToCheckedinstruction. -
getMintToCheckedInstructionDataCodec(
) → Codec< MintToCheckedInstructionData, MintToCheckedInstructionData> -
getMintToCheckedInstructionDataDecoder(
) → Decoder< MintToCheckedInstructionData> -
getMintToCheckedInstructionDataEncoder(
) → Encoder< MintToCheckedInstructionData> -
getMintToInstruction(
{required Address programAddress, required Address mint, required Address token, required Address mintAuthority, required BigInt amount}) → Instruction -
Creates a
MintToinstruction. -
getMintToInstructionDataCodec(
) → Codec< MintToInstructionData, MintToInstructionData> -
getMintToInstructionDataDecoder(
) → Decoder< MintToInstructionData> -
getMintToInstructionDataEncoder(
) → Encoder< MintToInstructionData> -
getMultisigCodec(
) → Codec< Multisig, Multisig> -
getMultisigDecoder(
) → Decoder< Multisig> -
getMultisigEncoder(
) → Encoder< Multisig> - This account has a size discriminator of 355 bytes.
-
getRecoverNestedAssociatedTokenInstruction(
{required Address programAddress, required Address nestedAssociatedAccountAddress, required Address nestedTokenMintAddress, required Address destinationAssociatedAccountAddress, required Address ownerAssociatedAccountAddress, required Address ownerTokenMintAddress, required Address walletAddress, required Address tokenProgram}) → Instruction - Creates the nested ATA recovery instruction.
-
getRecoverNestedAssociatedTokenInstructionDataCodec(
) → Codec< RecoverNestedAssociatedTokenInstructionData, RecoverNestedAssociatedTokenInstructionData> - Returns the codec for RecoverNestedAssociatedTokenInstructionData.
-
getRecoverNestedAssociatedTokenInstructionDataDecoder(
) → Decoder< RecoverNestedAssociatedTokenInstructionData> - Returns the decoder for RecoverNestedAssociatedTokenInstructionData.
-
getRecoverNestedAssociatedTokenInstructionDataEncoder(
) → Encoder< RecoverNestedAssociatedTokenInstructionData> - Returns the encoder for RecoverNestedAssociatedTokenInstructionData.
-
getRevokeInstruction(
{required Address programAddress, required Address source, required Address owner}) → Instruction -
Creates a
Revokeinstruction. -
getRevokeInstructionDataCodec(
) → Codec< RevokeInstructionData, RevokeInstructionData> -
getRevokeInstructionDataDecoder(
) → Decoder< RevokeInstructionData> -
getRevokeInstructionDataEncoder(
) → Encoder< RevokeInstructionData> -
getSetAuthorityInstruction(
{required Address programAddress, required Address owned, required Address owner, required AuthorityType authorityType, required Address? newAuthority}) → Instruction -
Creates a
SetAuthorityinstruction. -
getSetAuthorityInstructionDataCodec(
) → Codec< SetAuthorityInstructionData, SetAuthorityInstructionData> -
getSetAuthorityInstructionDataDecoder(
) → Decoder< SetAuthorityInstructionData> -
getSetAuthorityInstructionDataEncoder(
) → Encoder< SetAuthorityInstructionData> -
getSyncNativeInstruction(
{required Address programAddress, required Address account, Address? rent}) → Instruction -
Creates a
SyncNativeinstruction. -
getSyncNativeInstructionDataCodec(
) → Codec< SyncNativeInstructionData, SyncNativeInstructionData> -
getSyncNativeInstructionDataDecoder(
) → Decoder< SyncNativeInstructionData> -
getSyncNativeInstructionDataEncoder(
) → Encoder< SyncNativeInstructionData> -
getThawAccountInstruction(
{required Address programAddress, required Address account, required Address mint, required Address owner}) → Instruction -
Creates a
ThawAccountinstruction. -
getThawAccountInstructionDataCodec(
) → Codec< ThawAccountInstructionData, ThawAccountInstructionData> -
getThawAccountInstructionDataDecoder(
) → Decoder< ThawAccountInstructionData> -
getThawAccountInstructionDataEncoder(
) → Encoder< ThawAccountInstructionData> -
getTokenCodec(
) → Codec< Token, Token> -
getTokenDecoder(
) → Decoder< Token> -
getTokenEncoder(
) → Encoder< Token> - This account has a size discriminator of 165 bytes.
-
getTokenErrorMessage(
int code) → String? - Get the error message for a Token program error code.
-
getTransferCheckedInstruction(
{required Address programAddress, required Address source, required Address mint, required Address destination, required Address authority, required BigInt amount, required int decimals}) → Instruction -
Creates a
TransferCheckedinstruction. -
getTransferCheckedInstructionDataCodec(
) → Codec< TransferCheckedInstructionData, TransferCheckedInstructionData> -
getTransferCheckedInstructionDataDecoder(
) → Decoder< TransferCheckedInstructionData> -
getTransferCheckedInstructionDataEncoder(
) → Encoder< TransferCheckedInstructionData> -
getTransferInstruction(
{required Address programAddress, required Address source, required Address destination, required Address authority, required BigInt amount}) → Instruction -
Creates a
Transferinstruction. -
getTransferInstructionDataCodec(
) → Codec< TransferInstructionData, TransferInstructionData> -
getTransferInstructionDataDecoder(
) → Decoder< TransferInstructionData> -
getTransferInstructionDataEncoder(
) → Encoder< TransferInstructionData> -
getTransferToAtaInstructionPlan(
TransferToAtaInput input, [TransferToAtaConfig config = const TransferToAtaConfig()]) → InstructionPlan - Creates an instruction plan that:
-
getTransferToAtaInstructionPlanAsync(
{required Address payer, required Address mint, required Address authority, required Address recipient, required BigInt amount, required int decimals, TransferToAtaConfig config = const TransferToAtaConfig()}) → Future< InstructionPlan> - Like getTransferToAtaInstructionPlan, but derives source and destination ATA addresses automatically.
-
getUiAmountToAmountInstruction(
{required Address programAddress, required Address mint, required String uiAmount}) → Instruction -
Creates a
UiAmountToAmountinstruction. -
getUiAmountToAmountInstructionDataCodec(
) → Codec< UiAmountToAmountInstructionData, UiAmountToAmountInstructionData> -
getUiAmountToAmountInstructionDataDecoder(
) → Decoder< UiAmountToAmountInstructionData> -
getUiAmountToAmountInstructionDataEncoder(
) → Encoder< UiAmountToAmountInstructionData> -
getUnwrapLamportsInstruction(
{required Address programAddress, required Address source, required Address destination, required Address authority, BigInt? amount}) → Instruction -
Creates a
UnwrapLamportsinstruction. -
getUnwrapLamportsInstructionDataCodec(
) → Codec< UnwrapLamportsInstructionData, UnwrapLamportsInstructionData> -
getUnwrapLamportsInstructionDataDecoder(
) → Decoder< UnwrapLamportsInstructionData> -
getUnwrapLamportsInstructionDataEncoder(
) → Encoder< UnwrapLamportsInstructionData> -
getWithdrawExcessLamportsInstruction(
{required Address programAddress, required Address source, required Address destination, required Address authority}) → Instruction -
Creates a
WithdrawExcessLamportsinstruction. -
getWithdrawExcessLamportsInstructionDataCodec(
) → Codec< WithdrawExcessLamportsInstructionData, WithdrawExcessLamportsInstructionData> -
getWithdrawExcessLamportsInstructionDataDecoder(
) → Decoder< WithdrawExcessLamportsInstructionData> -
getWithdrawExcessLamportsInstructionDataEncoder(
) → Encoder< WithdrawExcessLamportsInstructionData> -
isAssociatedTokenError(
int code) → bool -
Returns
truewhencodeis a known ATA program error. -
isTokenError(
int code) → bool - Check if an error code belongs to the Token program.
-
parseAmountToUiAmountInstruction(
Instruction instruction) → AmountToUiAmountInstructionData -
Parses a
AmountToUiAmountinstruction from raw instruction data. -
parseApproveCheckedInstruction(
Instruction instruction) → ApproveCheckedInstructionData -
Parses a
ApproveCheckedinstruction from raw instruction data. -
parseApproveInstruction(
Instruction instruction) → ApproveInstructionData -
Parses a
Approveinstruction from raw instruction data. -
parseBatchInstruction(
Instruction instruction) → BatchInstructionData -
Parses a
Batchinstruction from raw instruction data. -
parseBurnCheckedInstruction(
Instruction instruction) → BurnCheckedInstructionData -
Parses a
BurnCheckedinstruction from raw instruction data. -
parseBurnInstruction(
Instruction instruction) → BurnInstructionData -
Parses a
Burninstruction from raw instruction data. -
parseCloseAccountInstruction(
Instruction instruction) → CloseAccountInstructionData -
Parses a
CloseAccountinstruction from raw instruction data. -
parseCreateAssociatedTokenIdempotentInstruction(
Instruction instruction) → CreateAssociatedTokenIdempotentInstructionData -
Parses an idempotent create instruction from
instruction. -
parseCreateAssociatedTokenInstruction(
Instruction instruction) → CreateAssociatedTokenInstructionData -
Parses a create instruction from
instruction. -
parseFreezeAccountInstruction(
Instruction instruction) → FreezeAccountInstructionData -
Parses a
FreezeAccountinstruction from raw instruction data. -
parseGetAccountDataSizeInstruction(
Instruction instruction) → GetAccountDataSizeInstructionData -
Parses a
GetAccountDataSizeinstruction from raw instruction data. -
parseInitializeAccount2Instruction(
Instruction instruction) → InitializeAccount2InstructionData -
Parses a
InitializeAccount2instruction from raw instruction data. -
parseInitializeAccount3Instruction(
Instruction instruction) → InitializeAccount3InstructionData -
Parses a
InitializeAccount3instruction from raw instruction data. -
parseInitializeAccountInstruction(
Instruction instruction) → InitializeAccountInstructionData -
Parses a
InitializeAccountinstruction from raw instruction data. -
parseInitializeImmutableOwnerInstruction(
Instruction instruction) → InitializeImmutableOwnerInstructionData -
Parses a
InitializeImmutableOwnerinstruction from raw instruction data. -
parseInitializeMint2Instruction(
Instruction instruction) → InitializeMint2InstructionData -
Parses a
InitializeMint2instruction from raw instruction data. -
parseInitializeMintInstruction(
Instruction instruction) → InitializeMintInstructionData -
Parses a
InitializeMintinstruction from raw instruction data. -
parseInitializeMultisig2Instruction(
Instruction instruction) → InitializeMultisig2InstructionData -
Parses a
InitializeMultisig2instruction from raw instruction data. -
parseInitializeMultisigInstruction(
Instruction instruction) → InitializeMultisigInstructionData -
Parses a
InitializeMultisiginstruction from raw instruction data. -
parseMintToCheckedInstruction(
Instruction instruction) → MintToCheckedInstructionData -
Parses a
MintToCheckedinstruction from raw instruction data. -
parseMintToInstruction(
Instruction instruction) → MintToInstructionData -
Parses a
MintToinstruction from raw instruction data. -
parseRecoverNestedAssociatedTokenInstruction(
Instruction instruction) → RecoverNestedAssociatedTokenInstructionData -
Parses a nested ATA recovery instruction from
instruction. -
parseRevokeInstruction(
Instruction instruction) → RevokeInstructionData -
Parses a
Revokeinstruction from raw instruction data. -
parseSetAuthorityInstruction(
Instruction instruction) → SetAuthorityInstructionData -
Parses a
SetAuthorityinstruction from raw instruction data. -
parseSyncNativeInstruction(
Instruction instruction) → SyncNativeInstructionData -
Parses a
SyncNativeinstruction from raw instruction data. -
parseThawAccountInstruction(
Instruction instruction) → ThawAccountInstructionData -
Parses a
ThawAccountinstruction from raw instruction data. -
parseTransferCheckedInstruction(
Instruction instruction) → TransferCheckedInstructionData -
Parses a
TransferCheckedinstruction from raw instruction data. -
parseTransferInstruction(
Instruction instruction) → TransferInstructionData -
Parses a
Transferinstruction from raw instruction data. -
parseUiAmountToAmountInstruction(
Instruction instruction) → UiAmountToAmountInstructionData -
Parses a
UiAmountToAmountinstruction from raw instruction data. -
parseUnwrapLamportsInstruction(
Instruction instruction) → UnwrapLamportsInstructionData -
Parses a
UnwrapLamportsinstruction from raw instruction data. -
parseWithdrawExcessLamportsInstruction(
Instruction instruction) → WithdrawExcessLamportsInstructionData -
Parses a
WithdrawExcessLamportsinstruction from raw instruction data.