Token-2022 decoder

Decode Token-2022 instructions and accounts in Rust with carbon-token-2022-decoder 2.0.0. Program ID TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb.

On this page

carbon-token-2022-decoder decodes the instructions and accounts of the Token-2022 program (TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb): 91 instructions, 3 account types. It is generated with Codama from the program's IDL; see decoders for how decoders plug into a pipeline.

Cratecarbon-token-2022-decoder 2.0.0
Installcargo add carbon-token-2022-decoder@2.0.0
Program IDTokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb (carbon_token_2022_decoder::PROGRAM_ID)
CategoryCore & SPL
Decodercarbon_token_2022_decoder::Token2022Decoder
Instruction enuminstructions::Token2022Instruction
Account enumaccounts::Token2022Account
Featuresserde, postgres, graphql (none enabled by default)
API docsdocs.rs/carbon-token-2022-decoder/2.0.0
Sourcedecoders/token-2022-decoder

Other core and SPL decoders: Address Lookup Table, Associated Token Account, SPL Memo, SPL Name Service, SPL Token, Stake Program, System Program. To decode several in one pipeline, see core and SPL program decoders.

Guide: Index token transfers.

The serde feature derives Serialize/Deserialize on every type, postgres adds tables and processors for Postgres, and graphql adds a schema for the GraphQL server.

Usage#

This program crawls recent Token-2022 transactions from the public RPC and prints every decoded TransferChecked instruction. Add the dependencies:

Terminal
cargo add carbon-core@2.0.0 carbon-token-2022-decoder@2.0.0 carbon-rpc-transaction-crawler-datasource@2.0.0 carbon-log-metrics@2.0.0 env_logger tokio --features tokio/full
src/main.rs
use {
    carbon_core::{
        error::CarbonResult, instruction::InstructionProcessorInputType, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_token_2022_decoder::{instructions::Token2022Instruction, Token2022Decoder, PROGRAM_ID},
    carbon_rpc_transaction_crawler_datasource::{ConnectionConfig, Filters, RpcTransactionCrawler},
    std::sync::Arc,
};

#[tokio::main]
async fn main() -> CarbonResult<()> {
    env_logger::init();

    // Fetches the program's recent transactions over JSON-RPC, newest first.
    let datasource = RpcTransactionCrawler::new(
        "https://api.mainnet-beta.solana.com".to_string(),
        PROGRAM_ID,
        ConnectionConfig::default(),
        Filters::new(None, None, None),
        None,
    );

    Pipeline::builder()
        .datasource(datasource)
        .metrics(Arc::new(LogMetrics::new()))
        .instruction(Token2022Decoder, InstructionLogger)
        .build()?
        .run()
        .await
}

struct InstructionLogger;

impl Processor<InstructionProcessorInputType<'_, Token2022Instruction>> for InstructionLogger {
    async fn process(
        &mut self,
        input: &InstructionProcessorInputType<'_, Token2022Instruction>,
    ) -> CarbonResult<()> {
        let signature = input.metadata.transaction_metadata.signature;
        if let Token2022Instruction::TransferChecked { data, accounts, .. } = input.decoded_instruction {
            println!("transfer_checked {signature}: {data:?} source={}", accounts.source);
        }
        Ok(())
    }
}
Terminal
RUST_LOG=info cargo run

Each TransferChecked instruction prints one line with the transaction signature and the decoded TransferChecked data. The public endpoint rate-limits requests, so the first lines can take a while; use your own RPC URL for anything beyond a test. See stream with RPC for the crawler options.

Decode accounts#

The transaction crawler emits transactions only. To decode accounts, use a datasource that emits account updates. This program subscribes to the program's accounts with programSubscribe on the public WebSocket endpoint and prints every decoded Mint account as it changes. Add the datasource and the Solana RPC types it takes:

Terminal
cargo add carbon-rpc-program-subscribe-datasource@2.0.0 solana-client@4.2.2
src/main.rs
use {
    carbon_core::{
        account::AccountProcessorInputType, error::CarbonResult, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_token_2022_decoder::{accounts::Token2022Account, Token2022Decoder, PROGRAM_ID},
    carbon_rpc_program_subscribe_datasource::{Filters, RpcProgramSubscribe},
    solana_client::{
        rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig, UiAccountEncoding},
        rpc_filter::{Memcmp, RpcFilterType},
    },
    std::sync::Arc,
};

#[tokio::main]
async fn main() -> CarbonResult<()> {
    env_logger::init();

    // Streams every change to an account owned by the program (programSubscribe).
    let config = RpcProgramAccountsConfig {
        // Byte 165 is the account type (1 = mint) on mints with extensions; 82-byte mints are skipped.
        filters: Some(vec![RpcFilterType::Memcmp(Memcmp::new_raw_bytes(165, vec![1]))]),
        account_config: RpcAccountInfoConfig {
            encoding: Some(UiAccountEncoding::Base64),
            ..Default::default()
        },
        ..Default::default()
    };
    let datasource = RpcProgramSubscribe::new(
        "wss://api.mainnet-beta.solana.com".to_string(),
        Filters::new(PROGRAM_ID, Some(config)),
    );

    Pipeline::builder()
        .datasource(datasource)
        .metrics(Arc::new(LogMetrics::new()))
        .account(Token2022Decoder, AccountLogger)
        .build()?
        .run()
        .await
}

struct AccountLogger;

impl Processor<AccountProcessorInputType<'_, Token2022Account>> for AccountLogger {
    async fn process(
        &mut self,
        input: &AccountProcessorInputType<'_, Token2022Account>,
    ) -> CarbonResult<()> {
        if let Token2022Account::Mint(mint) = &input.decoded_account.data {
            println!("mint {}: {mint:?}", input.metadata.pubkey);
        }
        Ok(())
    }
}
Terminal
RUST_LOG=info cargo run

Each update to a Mint account prints its address and decoded fields; the program runs until you stop it. Cargo resolves solana-client to 4.2.2, the exact version the datasource pins, so both use the same RpcProgramAccountsConfig type. To load every existing account once instead of streaming changes, see load account state.

Instructions#

Variants of Token2022Instruction. Each is Token2022Instruction::<Variant> { program_id, data, accounts }, where data and accounts are the types listed under the variant, exported from carbon_token_2022_decoder::instructions. Discriminators are the leading bytes of the instruction data, in hex.

How an instruction decodes. The decoder returns a variant only when all of these hold; otherwise the instruction is skipped and no processor is called:

  1. The instruction's program ID is TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb.
  2. The data starts with the variant's discriminator, and the rest deserializes into its data type.
  3. The instruction has at least as many accounts as the variant requires (the "Required accounts" count under each variant).

Accounts. They are matched by position, in the order listed. An account marked optional is None only when the instruction ends before it; Anchor programs pass the program ID as a placeholder for an omitted optional account, so check for Some(PROGRAM_ID) too. Accounts after the listed ones are in accounts.remaining as AccountMetas. The decoder doesn't record whether an account signed or was writable: read that from input.raw_instruction.accounts[i].is_signer and .is_writable, which follow the same order. It doesn't check signer, writable, owner or PDA constraints either; the program enforced those when the transaction executed, so a decoded instruction from a successful transaction already satisfied them.

AmountToUiAmount#

From the program's IDL:

Convert an Amount of tokens to a UiAmount string, using the given mint. In this version of the program, the mint can only specify the number of decimals.
Fails on an invalid mint.
Return data can be fetched using sol_get_return_data and deserialized with String::from_utf8.

Discriminator 17 · data AmountToUiAmount · accounts AmountToUiAmountInstructionAccounts.

FieldTypeDescription
amountu64The amount of tokens to reformat.

Required accounts: 1; extras go to remaining.

Fields of AmountToUiAmountInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

ApplyConfidentialPendingBalance#

From the program's IDL:

Applies the pending balance to the available balance, based on the history of Deposit and/or Transfer instructions.
After submitting ApplyPendingBalance, the client should compare ConfidentialTransferAccount::expected_pending_balance_credit_counter with ConfidentialTransferAccount::actual_applied_pending_balance_instructions.
If they are equal then the ConfidentialTransferAccount::decryptable_available_balance is consistent with ConfidentialTransferAccount::available_balance. If they differ then there is more pending balance to be applied.

Discriminator 1b08 · data ApplyConfidentialPendingBalance · accounts ApplyConfidentialPendingBalanceInstructionAccounts.

Known issue: the discriminator is 2 bytes but ApplyConfidentialPendingBalance::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
expected_pending_balance_credit_counteru64The expected number of pending balance credits since the last successful ApplyPendingBalance instruction
new_decryptable_available_balanceDecryptableBalanceThe new decryptable balance if the pending balance is applied successfully

Required accounts: 2; extras go to remaining.

Fields of ApplyConfidentialPendingBalanceInstructionAccounts, in account order:

#FieldType
0tokenPubkey
1authorityPubkey
2…remainingVec<AccountMeta>

Approve#

From the program's IDL:

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

Discriminator 04 · data Approve · accounts ApproveInstructionAccounts.

FieldTypeDescription
amountu64The amount of tokens the delegate is approved for.

Required accounts: 3; extras go to remaining.

Fields of ApproveInstructionAccounts, in account order:

#FieldType
0sourcePubkey
1delegatePubkey
2ownerPubkey
3…remainingVec<AccountMeta>

ApproveChecked#

From the program's IDL:

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.

Discriminator 0d · data ApproveChecked · accounts ApproveCheckedInstructionAccounts.

FieldTypeDescription
amountu64The amount of tokens the delegate is approved for.
decimalsu8Expected number of base 10 digits to the right of the decimal place.

Required accounts: 4; extras go to remaining.

Fields of ApproveCheckedInstructionAccounts, in account order:

#FieldType
0sourcePubkey
1mintPubkey
2delegatePubkey
3ownerPubkey
4…remainingVec<AccountMeta>

ApproveConfidentialTransferAccount#

From the program's IDL:

Approves a token account for confidential transfers.
Approval is only required when the ConfidentialTransferMint::approve_new_accounts field is set in the
SPL Token mint. This instruction must be executed after the account owner configures their account for confidential transfers with ConfidentialTransferInstruction::ConfigureAccount.

Discriminator 1b03 · data ApproveConfidentialTransferAccount · accounts ApproveConfidentialTransferAccountInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of ApproveConfidentialTransferAccountInstructionAccounts, in account order:

#FieldType
0tokenPubkey
1mintPubkey
2authorityPubkey
3…remainingVec<AccountMeta>

Burn#

From the program's IDL:

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

Discriminator 08 · data Burn · accounts BurnInstructionAccounts.

FieldType
amountu64

Required accounts: 3; extras go to remaining.

Fields of BurnInstructionAccounts, in account order:

#FieldType
0accountPubkey
1mintPubkey
2authorityPubkey
3…remainingVec<AccountMeta>

BurnChecked#

From the program's IDL:

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.

Discriminator 0f · data BurnChecked · accounts BurnCheckedInstructionAccounts.

FieldTypeDescription
amountu64The amount of tokens to burn.
decimalsu8Expected number of base 10 digits to the right of the decimal place.

Required accounts: 3; extras go to remaining.

Fields of BurnCheckedInstructionAccounts, in account order:

#FieldType
0accountPubkey
1mintPubkey
2authorityPubkey
3…remainingVec<AccountMeta>

CloseAccount#

From the program's IDL:

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.

Discriminator 09 · data CloseAccount · accounts CloseAccountInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of CloseAccountInstructionAccounts, in account order:

#FieldType
0accountPubkey
1destinationPubkey
2ownerPubkey
3…remainingVec<AccountMeta>

ConfidentialDeposit#

From the program's IDL:

Deposit SPL Tokens into the pending balance of a confidential token account.
The account owner can then invoke the ApplyPendingBalance instruction to roll the deposit into their available balance at a time of their choosing.
Fails if the source or destination accounts are frozen.
Fails if the associated mint is extended as NonTransferable.

Discriminator 1b05 · data ConfidentialDeposit · accounts ConfidentialDepositInstructionAccounts.

Known issue: the discriminator is 2 bytes but ConfidentialDeposit::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
amountu64The amount of tokens to deposit.
decimalsu8Expected number of base 10 digits to the right of the decimal place.

Required accounts: 3; extras go to remaining.

Fields of ConfidentialDepositInstructionAccounts, in account order:

#FieldType
0tokenPubkey
1mintPubkey
2authorityPubkey
3…remainingVec<AccountMeta>

ConfidentialTransfer#

From the program's IDL:

Transfer tokens confidentially.
In order for this instruction to be successfully processed, it must be accompanied by the following list of zk_elgamal_proof program instructions:

  • VerifyCiphertextCommitmentEquality
  • VerifyBatchedGroupedCiphertext3HandlesValidity
  • VerifyBatchedRangeProofU128

These instructions can be accompanied in the same transaction or can be pre-verified into a context state account, in which case, only their context state account addresses need to be provided.
Fails if the associated mint is extended as NonTransferable.

Discriminator 1b07 · data ConfidentialTransfer · accounts ConfidentialTransferInstructionAccounts.

Known issue: the discriminator is 2 bytes but ConfidentialTransfer::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
new_source_decryptable_available_balanceDecryptableBalanceThe new source decryptable balance if the transfer succeeds.
equality_proof_instruction_offseti8Relative location of the ProofInstruction::VerifyCiphertextCommitmentEquality instruction to the Transfer instruction in the transaction. If the offset is 0, then use a context state account for the proof.
ciphertext_validity_proof_instruction_offseti8Relative location of the ProofInstruction::VerifyBatchedGroupedCiphertext3HandlesValidity instruction to the Transfer instruction in the transaction. If the offset is 0, then use a context state account for the proof.
range_proof_instruction_offseti8Relative location of the ProofInstruction::BatchedRangeProofU128Data instruction to the Transfer instruction in the transaction. If the offset is 0, then use a context state account for the proof.

Required accounts: 8; extras go to remaining.

Fields of ConfidentialTransferInstructionAccounts, in account order:

#FieldType
0source_tokenPubkey
1mintPubkey
2destination_tokenPubkey
3instructions_sysvarOption<Pubkey>
4equality_recordOption<Pubkey>
5ciphertext_validity_recordOption<Pubkey>
6range_recordOption<Pubkey>
7authorityPubkey
8…remainingVec<AccountMeta>

ConfidentialTransferWithFee#

From the program's IDL:

Transfer tokens confidentially with fee.
In order for this instruction to be successfully processed, it must be accompanied by the following list of zk_elgamal_proof program instructions:

  • VerifyCiphertextCommitmentEquality
  • VerifyBatchedGroupedCiphertext3HandlesValidity (transfer amount

ciphertext)

  • VerifyPercentageWithFee
  • VerifyBatchedGroupedCiphertext2HandlesValidity (fee ciphertext)
  • VerifyBatchedRangeProofU256

These instructions can be accompanied in the same transaction or can be pre-verified into a context state account, in which case, only their context state account addresses need to be provided.
The same restrictions for the Transfer applies to TransferWithFee. Namely, the instruction fails if the associated mint is extended as NonTransferable.

Discriminator 1b0d · data ConfidentialTransferWithFee · accounts ConfidentialTransferWithFeeInstructionAccounts.

Known issue: the discriminator is 2 bytes but ConfidentialTransferWithFee::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
new_source_decryptable_available_balanceDecryptableBalanceThe new source decryptable balance if the transfer succeeds.
equality_proof_instruction_offseti8Relative location of the ProofInstruction::VerifyCiphertextCommitmentEquality instruction to the TransferWithFee instruction in the transaction. If the offset is 0, then use a context state account for the proof.
transfer_amount_ciphertext_validity_proof_instruction_offseti8Relative location of the ProofInstruction::VerifyBatchedGroupedCiphertext3HandlesValidity instruction to the TransferWithFee instruction in the transaction. If the offset is 0, then use a context state account for the proof.
fee_sigma_proof_instruction_offseti8Relative location of the ProofInstruction::VerifyPercentageWithFee instruction to the TransferWithFee instruction in the transaction. If the offset is 0, then use a context state account for the proof.
fee_ciphertext_validity_proof_instruction_offseti8Relative location of the ProofInstruction::VerifyBatchedGroupedCiphertext2HandlesValidity instruction to the TransferWithFee instruction in the transaction. If the offset is 0, then use a context state account for the proof.
range_proof_instruction_offseti8Relative location of the ProofInstruction::BatchedRangeProofU256Data instruction to the TransferWithFee instruction in the transaction. If the offset is 0, then use a context state account for the proof.

Required accounts: 10; extras go to remaining.

Fields of ConfidentialTransferWithFeeInstructionAccounts, in account order:

#FieldType
0source_tokenPubkey
1mintPubkey
2destination_tokenPubkey
3instructions_sysvarOption<Pubkey>
4equality_recordOption<Pubkey>
5transfer_amount_ciphertext_validity_recordOption<Pubkey>
6fee_sigma_recordOption<Pubkey>
7fee_ciphertext_validity_recordOption<Pubkey>
8range_recordOption<Pubkey>
9authorityPubkey
10…remainingVec<AccountMeta>

ConfidentialWithdraw#

From the program's IDL:

Withdraw SPL Tokens from the available balance of a confidential token account.
In order for this instruction to be successfully processed, it must be accompanied by the following list of zk_elgamal_proof program instructions:

  • VerifyCiphertextCommitmentEquality
  • VerifyBatchedRangeProofU64

These instructions can be accompanied in the same transaction or can be pre-verified into a context state account, in which case, only their context state account address need to be provided.
Fails if the source or destination accounts are frozen.
Fails if the associated mint is extended as NonTransferable.

Discriminator 1b06 · data ConfidentialWithdraw · accounts ConfidentialWithdrawInstructionAccounts.

Known issue: the discriminator is 2 bytes but ConfidentialWithdraw::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
amountu64The amount of tokens to withdraw.
decimalsu8Expected number of base 10 digits to the right of the decimal place.
new_decryptable_available_balanceDecryptableBalanceThe new decryptable balance if the withdrawal succeeds.
equality_proof_instruction_offseti8Relative location of the ProofInstruction::VerifyCiphertextCommitmentEquality instruction to the Withdraw instruction in the transaction. If the offset is 0, then use a context state account for the proof.
range_proof_instruction_offseti8Relative location of the ProofInstruction::BatchedRangeProofU64 instruction to the Withdraw instruction in the transaction. If the offset is 0, then use a context state account for the proof.

Required accounts: 6; extras go to remaining.

Fields of ConfidentialWithdrawInstructionAccounts, in account order:

#FieldType
0tokenPubkey
1mintPubkey
2instructions_sysvarOption<Pubkey>
3equality_recordOption<Pubkey>
4range_recordOption<Pubkey>
5authorityPubkey
6…remainingVec<AccountMeta>

ConfigureConfidentialTransferAccount#

From the program's IDL:

Configures confidential transfers for a token account.
The instruction fails if the confidential transfers are already configured, or if the mint was not initialized with confidential transfer support.
The instruction fails if the TokenInstruction::InitializeAccount instruction has not yet successfully executed for the token account.
Upon success, confidential and non-confidential deposits and transfers are enabled. Use the DisableConfidentialCredits and DisableNonConfidentialCredits instructions to disable.
In order for this instruction to be successfully processed, it must be accompanied by the VerifyPubkeyValidity instruction of the zk_elgamal_proof program in the same transaction or the address of a context state account for the proof must be provided.

Discriminator 1b02 · data ConfigureConfidentialTransferAccount · accounts ConfigureConfidentialTransferAccountInstructionAccounts.

Known issue: the discriminator is 2 bytes but ConfigureConfidentialTransferAccount::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
decryptable_zero_balanceDecryptableBalanceThe decryptable balance (always 0) once the configure account succeeds.
maximum_pending_balance_credit_counteru64The maximum number of despots and transfers that an account can receiver before the ApplyPendingBalance is executed
proof_instruction_offseti8Relative location of the ProofInstruction::ZeroCiphertextProof instruction to the ConfigureAccount instruction in the transaction. If the offset is 0, then use a context state account for the proof.

Required accounts: 5; extras go to remaining.

Fields of ConfigureConfidentialTransferAccountInstructionAccounts, in account order:

#FieldType
0tokenPubkey
1mintPubkey
2instructions_sysvar_or_context_statePubkey
3recordOption<Pubkey>
4authorityPubkey
5…remainingVec<AccountMeta>

CreateNativeMint#

From the program's IDL:

Creates the native mint.
This instruction only needs to be invoked once after deployment and is permissionless. Wrapped SOL (native_mint::id()) will not be available until this instruction is successfully executed.

Discriminator 1f · data CreateNativeMint · accounts CreateNativeMintInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of CreateNativeMintInstructionAccounts, in account order:

#FieldType
0payerPubkey
1native_mintPubkey
2system_programPubkey
3…remainingVec<AccountMeta>

DisableConfidentialCredits#

From the program's IDL:

Configure a confidential extension account to reject any incoming confidential transfers.
If the allow_non_confidential_credits field is true, then the base account can still receive non-confidential transfers.
This instruction can be used to disable confidential payments after a token account has already been extended for confidential transfers.

Discriminator 1b0a · data DisableConfidentialCredits · accounts DisableConfidentialCreditsInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of DisableConfidentialCreditsInstructionAccounts, in account order:

#FieldType
0tokenPubkey
1authorityPubkey
2…remainingVec<AccountMeta>

DisableCpiGuard#

From the program's IDL:

Allow all token operations to happen via CPI as normal.
Implicitly initializes the extension in the case where it is not present.

Discriminator 2201 · data DisableCpiGuard · accounts DisableCpiGuardInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of DisableCpiGuardInstructionAccounts, in account order:

#FieldType
0tokenPubkey
1ownerPubkey
2…remainingVec<AccountMeta>

DisableHarvestToMint#

From the program's IDL:

Configure a confidential transfer fee mint to reject any harvested confidential fees.

Discriminator 2505 · data DisableHarvestToMint · accounts DisableHarvestToMintInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of DisableHarvestToMintInstructionAccounts, in account order:

#FieldType
0mintPubkey
1authorityPubkey
2…remainingVec<AccountMeta>

DisableMemoTransfers#

From the program's IDL:

Stop requiring memos for transfers into this Account.
Implicitly initializes the extension in the case where it is not present.

Discriminator 1e01 · data DisableMemoTransfers · accounts DisableMemoTransfersInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of DisableMemoTransfersInstructionAccounts, in account order:

#FieldType
0tokenPubkey
1ownerPubkey
2…remainingVec<AccountMeta>

DisableNonConfidentialCredits#

From the program's IDL:

Configure an account with the confidential extension to reject any incoming non-confidential transfers.
This instruction can be used to configure a confidential extension account to exclusively receive confidential payments.

Discriminator 1b0c · data DisableNonConfidentialCredits · accounts DisableNonConfidentialCreditsInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of DisableNonConfidentialCreditsInstructionAccounts, in account order:

#FieldType
0tokenPubkey
1authorityPubkey
2…remainingVec<AccountMeta>

EmitTokenMetadata#

From the program's IDL:

Emits the token-metadata as return data
The format of the data emitted follows exactly the TokenMetadata struct, but it's possible that the account data is stored in another format by the program.
With this instruction, a program that implements the token-metadata interface can return TokenMetadata without adhering to the specific byte layout of the TokenMetadata struct in any accounts.

Discriminator faa6b4fa0d0cb846 · data EmitTokenMetadata · accounts EmitTokenMetadataInstructionAccounts.

FieldTypeDescription
startOption<u64>Start of range of data to emit
endOption<u64>End of range of data to emit

Required accounts: 1; extras go to remaining.

Fields of EmitTokenMetadataInstructionAccounts, in account order:

#FieldType
0metadataPubkey
1…remainingVec<AccountMeta>

EmptyConfidentialTransferAccount#

From the program's IDL:

Empty the available balance in a confidential token account.
A token account that is extended for confidential transfers can only be closed if the pending and available balance ciphertexts are emptied.
The pending balance can be emptied via the ConfidentialTransferInstruction::ApplyPendingBalance instruction. Use the ConfidentialTransferInstruction::EmptyAccount instruction to empty the available balance ciphertext.
Note that a newly configured account is always empty, so this instruction is not required prior to account closing if no instructions beyond ConfidentialTransferInstruction::ConfigureAccount have affected the token account.
In order for this instruction to be successfully processed, it must be accompanied by the VerifyZeroCiphertext instruction of the zk_elgamal_proof program in the same transaction or the address of a context state account for the proof must be provided.

Discriminator 1b04 · data EmptyConfidentialTransferAccount · accounts EmptyConfidentialTransferAccountInstructionAccounts.

Known issue: the discriminator is 2 bytes but EmptyConfidentialTransferAccount::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
proof_instruction_offseti8Relative location of the ProofInstruction::VerifyCloseAccount instruction to the EmptyAccount instruction in the transaction. If the offset is 0, then use a context state account for the proof.

Required accounts: 4; extras go to remaining.

Fields of EmptyConfidentialTransferAccountInstructionAccounts, in account order:

#FieldType
0tokenPubkey
1instructions_sysvar_or_context_statePubkey
2recordOption<Pubkey>
3authorityPubkey
4…remainingVec<AccountMeta>

EnableConfidentialCredits#

From the program's IDL:

Configure a confidential extension account to accept incoming confidential transfers.

Discriminator 1b09 · data EnableConfidentialCredits · accounts EnableConfidentialCreditsInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of EnableConfidentialCreditsInstructionAccounts, in account order:

#FieldType
0tokenPubkey
1authorityPubkey
2…remainingVec<AccountMeta>

EnableCpiGuard#

From the program's IDL:

Lock certain token operations from taking place within CPI for this Account, namely:

  • Transfer and Burn must go through a delegate.
  • CloseAccount can only return lamports to owner.
  • SetAuthority can only be used to remove an existing close authority.
  • Approve is disallowed entirely.

In addition, CPI Guard cannot be enabled or disabled via CPI.

Discriminator 2200 · data EnableCpiGuard · accounts EnableCpiGuardInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of EnableCpiGuardInstructionAccounts, in account order:

#FieldType
0tokenPubkey
1ownerPubkey
2…remainingVec<AccountMeta>

EnableHarvestToMint#

From the program's IDL:

Configure a confidential transfer fee mint to accept harvested confidential fees.

Discriminator 2504 · data EnableHarvestToMint · accounts EnableHarvestToMintInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of EnableHarvestToMintInstructionAccounts, in account order:

#FieldType
0mintPubkey
1authorityPubkey
2…remainingVec<AccountMeta>

EnableMemoTransfers#

From the program's IDL:

Require memos for transfers into this Account. Adds the MemoTransfer extension to the Account, if it doesn't already exist.

Discriminator 1e00 · data EnableMemoTransfers · accounts EnableMemoTransfersInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of EnableMemoTransfersInstructionAccounts, in account order:

#FieldType
0tokenPubkey
1ownerPubkey
2…remainingVec<AccountMeta>

EnableNonConfidentialCredits#

From the program's IDL:

Configure an account with the confidential extension to accept incoming non-confidential transfers.

Discriminator 1b0b · data EnableNonConfidentialCredits · accounts EnableNonConfidentialCreditsInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of EnableNonConfidentialCreditsInstructionAccounts, in account order:

#FieldType
0tokenPubkey
1authorityPubkey
2…remainingVec<AccountMeta>

FreezeAccount#

From the program's IDL:

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

Discriminator 0a · data FreezeAccount · accounts FreezeAccountInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of FreezeAccountInstructionAccounts, in account order:

#FieldType
0accountPubkey
1mintPubkey
2ownerPubkey
3…remainingVec<AccountMeta>

GetAccountDataSize#

From the program's IDL:

Gets the required size of an account for the given mint as a little-endian u64.
Return data can be fetched using sol_get_return_data and deserializing the return data as a little-endian u64.

Discriminator 15 · data GetAccountDataSize · accounts GetAccountDataSizeInstructionAccounts.

No data fields.

Required accounts: 1; extras go to remaining.

Fields of GetAccountDataSizeInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

HarvestWithheldTokensToMint#

From the program's IDL:

Permissionless instruction to transfer all withheld tokens to the mint.
Succeeds for frozen accounts.
Accounts provided should include the TransferFeeAmount extension.
If not, the account is skipped.

Discriminator 1a04 · data HarvestWithheldTokensToMint · accounts HarvestWithheldTokensToMintInstructionAccounts.

No data fields.

Required accounts: 1; extras go to remaining.

Fields of HarvestWithheldTokensToMintInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

HarvestWithheldTokensToMintForConfidentialTransferFee#

From the program's IDL:

Permissionless instruction to transfer all withheld confidential tokens to the mint. Succeeds for frozen accounts.
Accounts provided should include both the TransferFeeAmount and ConfidentialTransferAccount extension. If not, the account is skipped.

Discriminator 2503 · data HarvestWithheldTokensToMintForConfidentialTransferFee · accounts HarvestWithheldTokensToMintForConfidentialTransferFeeInstructionAccounts.

No data fields.

Required accounts: 1; extras go to remaining.

Fields of HarvestWithheldTokensToMintForConfidentialTransferFeeInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

InitializeAccount#

From the program's IDL:

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.

Discriminator 01 · data InitializeAccount · accounts InitializeAccountInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of InitializeAccountInstructionAccounts, in account order:

#FieldType
0accountPubkey
1mintPubkey
2ownerPubkey
3rentPubkey
4…remainingVec<AccountMeta>

InitializeAccount2#

From the program's IDL:

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.

Discriminator 10 · data InitializeAccount2 · accounts InitializeAccount2InstructionAccounts.

FieldTypeDescription
ownerPubkeyThe new account's owner/multisignature.

Required accounts: 3; extras go to remaining.

Fields of InitializeAccount2InstructionAccounts, in account order:

#FieldType
0accountPubkey
1mintPubkey
2rentPubkey
3…remainingVec<AccountMeta>

InitializeAccount3#

From the program's IDL:

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

Discriminator 12 · data InitializeAccount3 · accounts InitializeAccount3InstructionAccounts.

FieldTypeDescription
ownerPubkeyThe new account's owner/multisignature.

Required accounts: 2; extras go to remaining.

Fields of InitializeAccount3InstructionAccounts, in account order:

#FieldType
0accountPubkey
1mintPubkey
2…remainingVec<AccountMeta>

InitializeConfidentialTransferFee#

From the program's IDL:

Initializes confidential transfer fees for a mint.
The instruction must be included within the same Transaction as
TokenInstruction::InitializeMint. Otherwise another party can initialize the configuration. The instruction fails if TokenInstruction::InitializeMint has already executed for the mint.

Discriminator 2500 · data InitializeConfidentialTransferFee · accounts InitializeConfidentialTransferFeeInstructionAccounts.

Known issue: the discriminator is 2 bytes but InitializeConfidentialTransferFee::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
authorityOption<Pubkey>Optional authority to set the withdraw withheld authority ElGamal key
withdraw_withheld_authority_el_gamal_pubkeyOption<Pubkey>Withheld fees from accounts must be encrypted with this ElGamal key

Required accounts: 1; extras go to remaining.

Fields of InitializeConfidentialTransferFeeInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

InitializeConfidentialTransferMint#

From the program's IDL:

Initializes confidential transfers for a mint.
The ConfidentialTransferInstruction::InitializeMint instruction requires no signers and MUST be included within the same Transaction as TokenInstruction::InitializeMint. Otherwise another party can initialize the configuration.
The instruction fails if the TokenInstruction::InitializeMint instruction has already executed for the mint.

Discriminator 1b00 · data InitializeConfidentialTransferMint · accounts InitializeConfidentialTransferMintInstructionAccounts.

Known issue: the discriminator is 2 bytes but InitializeConfidentialTransferMint::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
authorityOption<Pubkey>Authority to modify the ConfidentialTransferMint configuration and to approve new accounts.
auto_approve_new_accountsboolDetermines if newly configured accounts must be approved by the authority before they may be used by the user.
auditor_elgamal_pubkeyOption<Pubkey>New authority to decode any transfer amount in a confidential transfer.

Required accounts: 1; extras go to remaining.

Fields of InitializeConfidentialTransferMintInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

InitializeDefaultAccountState#

From the program's IDL:

Initialize a new mint with the default state for new Accounts.
Fails if the mint has already been initialized, so must be called before InitializeMint.
The mint must have exactly enough space allocated for the base mint (82 bytes), plus 83 bytes of padding, 1 byte reserved for the account type, then space required for this extension, plus any others.

Discriminator 1c00 · data InitializeDefaultAccountState · accounts InitializeDefaultAccountStateInstructionAccounts.

Known issue: the discriminator is 2 bytes but InitializeDefaultAccountState::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
stateAccountStateThe state each new token account should start with.

Required accounts: 1; extras go to remaining.

Fields of InitializeDefaultAccountStateInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

InitializeGroupMemberPointer#

From the program's IDL:

Initialize a new mint with a group member pointer
Fails if the mint has already been initialized, so must be called before InitializeMint.
The mint must have exactly enough space allocated for the base mint (82 bytes), plus 83 bytes of padding, 1 byte reserved for the account type, then space required for this extension, plus any others.

Discriminator 2900 · data InitializeGroupMemberPointer · accounts InitializeGroupMemberPointerInstructionAccounts.

Known issue: the discriminator is 2 bytes but InitializeGroupMemberPointer::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
authorityOption<Pubkey>The public key for the account that can update the group member address.
member_addressOption<Pubkey>The account address that holds the member.

Required accounts: 1; extras go to remaining.

Fields of InitializeGroupMemberPointerInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

InitializeGroupPointer#

From the program's IDL:

Initialize a new mint with a group pointer
Fails if the mint has already been initialized, so must be called before InitializeMint.
The mint must have exactly enough space allocated for the base mint (82 bytes), plus 83 bytes of padding, 1 byte reserved for the account type, then space required for this extension, plus any others.

Discriminator 2800 · data InitializeGroupPointer · accounts InitializeGroupPointerInstructionAccounts.

Known issue: the discriminator is 2 bytes but InitializeGroupPointer::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
authorityOption<Pubkey>The public key for the account that can update the group address.
group_addressOption<Pubkey>The account address that holds the group.

Required accounts: 1; extras go to remaining.

Fields of InitializeGroupPointerInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

InitializeImmutableOwner#

From the program's IDL:

Initialize the Immutable Owner extension for the given token account
Fails if the account has already been initialized, so must be called before InitializeAccount.
No-ops in this version of the program, but is included for compatibility with the Associated Token Account program.

Discriminator 16 · data InitializeImmutableOwner · accounts InitializeImmutableOwnerInstructionAccounts.

No data fields.

Required accounts: 1; extras go to remaining.

Fields of InitializeImmutableOwnerInstructionAccounts, in account order:

#FieldType
0accountPubkey
1…remainingVec<AccountMeta>

InitializeInterestBearingMint#

From the program's IDL:

Initialize a new mint with the InterestBearing extension.
Fails if the mint has already been initialized, so must be called before InitializeMint.
The mint must have exactly enough space allocated for the base mint (82 bytes), plus 83 bytes of padding, 1 byte reserved for the account type, then space required for this extension, plus any others.

Discriminator 2100 · data InitializeInterestBearingMint · accounts InitializeInterestBearingMintInstructionAccounts.

Known issue: the discriminator is 2 bytes but InitializeInterestBearingMint::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
rate_authorityOption<Pubkey>The public key for the account that can update the rate
ratei16The initial interest rate

Required accounts: 1; extras go to remaining.

Fields of InitializeInterestBearingMintInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

InitializeMetadataPointer#

From the program's IDL:

Initialize a new mint with a metadata pointer
Fails if the mint has already been initialized, so must be called before InitializeMint.
The mint must have exactly enough space allocated for the base mint (82 bytes), plus 83 bytes of padding, 1 byte reserved for the account type, then space required for this extension, plus any others.

Discriminator 2700 · data InitializeMetadataPointer · accounts InitializeMetadataPointerInstructionAccounts.

Known issue: the discriminator is 2 bytes but InitializeMetadataPointer::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
authorityOption<Pubkey>The public key for the account that can update the metadata address.
metadata_addressOption<Pubkey>The account address that holds the metadata.

Required accounts: 1; extras go to remaining.

Fields of InitializeMetadataPointerInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

InitializeMint#

From the program's IDL:

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.

Discriminator 00 · data InitializeMint · accounts InitializeMintInstructionAccounts.

FieldTypeDescription
decimalsu8Number of decimals in token account amounts.
mint_authorityPubkeyMinting authority.
freeze_authorityOption<Pubkey>Optional authority that can freeze token accounts.

Required accounts: 2; extras go to remaining.

Fields of InitializeMintInstructionAccounts, in account order:

#FieldType
0mintPubkey
1rentPubkey
2…remainingVec<AccountMeta>

InitializeMint2#

From the program's IDL:

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

Discriminator 14 · data InitializeMint2 · accounts InitializeMint2InstructionAccounts.

FieldTypeDescription
decimalsu8Number of base 10 digits to the right of the decimal place.
mint_authorityPubkeyThe authority/multisignature to mint tokens.
freeze_authorityOption<Pubkey>The optional freeze authority/multisignature of the mint.

Required accounts: 1; extras go to remaining.

Fields of InitializeMint2InstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

InitializeMintCloseAuthority#

From the program's IDL:

Initialize the close account authority on a new mint.
Fails if the mint has already been initialized, so must be called before InitializeMint. The mint must have exactly enough space allocated for the base mint (82 bytes), plus 83 bytes of padding, 1 byte reserved for the account type, then space required for this extension, plus any others.

Discriminator 19 · data InitializeMintCloseAuthority · accounts InitializeMintCloseAuthorityInstructionAccounts.

FieldTypeDescription
close_authorityOption<Pubkey>Authority that must sign the CloseAccount instruction on a mint.

Required accounts: 1; extras go to remaining.

Fields of InitializeMintCloseAuthorityInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

InitializeMultisig#

From the program's IDL:

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.

Discriminator 02 · data InitializeMultisig · accounts InitializeMultisigInstructionAccounts.

FieldTypeDescription
mu8The number of signers (M) required to validate this multisignature account.

Required accounts: 2; extras go to remaining.

Fields of InitializeMultisigInstructionAccounts, in account order:

#FieldType
0multisigPubkey
1rentPubkey
2…remainingVec<AccountMeta>

InitializeMultisig2#

From the program's IDL:

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

Discriminator 13 · data InitializeMultisig2 · accounts InitializeMultisig2InstructionAccounts.

FieldTypeDescription
mu8The number of signers (M) required to validate this multisignature account.

Required accounts: 1; extras go to remaining.

Fields of InitializeMultisig2InstructionAccounts, in account order:

#FieldType
0multisigPubkey
1…remainingVec<AccountMeta>

InitializeNonTransferableMint#

From the program's IDL:

Initialize the non transferable extension for the given mint account
Fails if the account has already been initialized, so must be called before InitializeMint.

Discriminator 20 · data InitializeNonTransferableMint · accounts InitializeNonTransferableMintInstructionAccounts.

No data fields.

Required accounts: 1; extras go to remaining.

Fields of InitializeNonTransferableMintInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

InitializePausableConfig#

From the program's IDL:

Initialize a new mint with the Pausable extension.
Fails if the mint has already been initialized, so must be called before InitializeMint.

Discriminator 2c00 · data InitializePausableConfig · accounts InitializePausableConfigInstructionAccounts.

Known issue: the discriminator is 2 bytes but InitializePausableConfig::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
authorityOption<Pubkey>The authority that can pause and resume the mint.

Required accounts: 1; extras go to remaining.

Fields of InitializePausableConfigInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

InitializePermanentDelegate#

From the program's IDL:

Initialize the permanent delegate on a new mint.
Fails if the mint has already been initialized, so must be called before InitializeMint. The mint must have exactly enough space allocated for the base mint (82 bytes), plus 83 bytes of padding, 1 byte reserved for the account type, then space required for this extension, plus any others.

Discriminator 23 · data InitializePermanentDelegate · accounts InitializePermanentDelegateInstructionAccounts.

FieldTypeDescription
delegatePubkeyAuthority that may sign for Transfers and Burns on any account

Required accounts: 1; extras go to remaining.

Fields of InitializePermanentDelegateInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

InitializePermissionedBurn#

From the program's IDL:

Require permissioned burn for the given mint account.
Fails if the mint has already been initialized, so must be called before InitializeMint.

Discriminator 2e00 · data InitializePermissionedBurn · accounts InitializePermissionedBurnInstructionAccounts.

Known issue: the discriminator is 2 bytes but InitializePermissionedBurn::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
authorityPubkeyThe public key for the account that is required for token burning.

Required accounts: 1; extras go to remaining.

Fields of InitializePermissionedBurnInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

InitializeScaledUiAmountMint#

From the program's IDL:

Initialize a new mint with the ScaledUiAmount extension.
Fails if the mint has already been initialized, so must be called before InitializeMint. The mint must have exactly enough space allocated for the base mint (82 bytes), plus 83 bytes of padding, 1 byte reserved for the account type, then space required for this extension, plus any others.

Discriminator 2b00 · data InitializeScaledUiAmountMint · accounts InitializeScaledUiAmountMintInstructionAccounts.

Known issue: the discriminator is 2 bytes but InitializeScaledUiAmountMint::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
authorityOption<Pubkey>The authority that can update the multiplier
multiplierf64The initial multiplier for the scaled UI extension

Required accounts: 1; extras go to remaining.

Fields of InitializeScaledUiAmountMintInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

InitializeTokenGroup#

From the program's IDL:

Initialize a new Group
Assumes one has already initialized a mint for the group.

Discriminator 79716c2736330004 · data InitializeTokenGroup · accounts InitializeTokenGroupInstructionAccounts.

FieldTypeDescription
update_authorityOption<Pubkey>Update authority for the group
max_sizeu64The maximum number of group members

Required accounts: 3; extras go to remaining.

Fields of InitializeTokenGroupInstructionAccounts, in account order:

#FieldType
0groupPubkey
1mintPubkey
2mint_authorityPubkey
3…remainingVec<AccountMeta>

InitializeTokenGroupMember#

From the program's IDL:

Initialize a new Member of a Group
Assumes the Group has already been initialized, as well as the mint for the member.

Discriminator 9820deb0dfed7486 · data InitializeTokenGroupMember · accounts InitializeTokenGroupMemberInstructionAccounts.

No data fields.

Required accounts: 5; extras go to remaining.

Fields of InitializeTokenGroupMemberInstructionAccounts, in account order:

#FieldType
0memberPubkey
1member_mintPubkey
2member_mint_authorityPubkey
3groupPubkey
4group_update_authorityPubkey
5…remainingVec<AccountMeta>

InitializeTokenMetadata#

From the program's IDL:

Initializes a TLV entry with the basic token-metadata fields.
Assumes that the provided mint is an SPL token mint, that the metadata account is allocated and assigned to the program, and that the metadata account has enough lamports to cover the rent-exempt reserve.

Discriminator d2e11ea258b84d8d · data InitializeTokenMetadata · accounts InitializeTokenMetadataInstructionAccounts.

FieldTypeDescription
nameStringLonger name of the token.
symbolStringShortened symbol of the token.
uriStringURI pointing to more metadata (image, video, etc.).

Required accounts: 4; extras go to remaining.

Fields of InitializeTokenMetadataInstructionAccounts, in account order:

#FieldType
0metadataPubkey
1update_authorityPubkey
2mintPubkey
3mint_authorityPubkey
4…remainingVec<AccountMeta>

InitializeTransferFeeConfig#

From the program's IDL:

Initialize the transfer fee on a new mint.
Fails if the mint has already been initialized, so must be called before InitializeMint. The mint must have exactly enough space allocated for the base mint (82 bytes), plus 83 bytes of padding, 1 byte reserved for the account type, then space required for this extension, plus any others.

Discriminator 1a00 · data InitializeTransferFeeConfig · accounts InitializeTransferFeeConfigInstructionAccounts.

Known issue: the discriminator is 2 bytes but InitializeTransferFeeConfig::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
transfer_fee_config_authorityOption<Pubkey>Pubkey that may update the fees.
withdraw_withheld_authorityOption<Pubkey>Withdraw instructions must be signed by this key.
transfer_fee_basis_pointsu16Amount of transfer collected as fees, expressed as basis points of the transfer amount.
maximum_feeu64Maximum fee assessed on transfers.

Required accounts: 1; extras go to remaining.

Fields of InitializeTransferFeeConfigInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

InitializeTransferHook#

From the program's IDL:

Initialize a new mint with a transfer hook program.
Fails if the mint has already been initialized, so must be called before InitializeMint. The mint must have exactly enough space allocated for the base mint (82 bytes), plus 83 bytes of padding, 1 byte reserved for the account type, then space required for this extension, plus any others.

Discriminator 2400 · data InitializeTransferHook · accounts InitializeTransferHookInstructionAccounts.

Known issue: the discriminator is 2 bytes but InitializeTransferHook::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
authorityOption<Pubkey>The public key for the account that can update the program id
program_idOption<Pubkey>The program id that performs logic during transfers

Required accounts: 1; extras go to remaining.

Fields of InitializeTransferHookInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

MintTo#

From the program's IDL:

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

Discriminator 07 · data MintTo · accounts MintToInstructionAccounts.

FieldTypeDescription
amountu64The amount of new tokens to mint.

Required accounts: 3; extras go to remaining.

Fields of MintToInstructionAccounts, in account order:

#FieldType
0mintPubkey
1tokenPubkey
2mint_authorityPubkey
3…remainingVec<AccountMeta>

MintToChecked#

From the program's IDL:

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.

Discriminator 0e · data MintToChecked · accounts MintToCheckedInstructionAccounts.

FieldTypeDescription
amountu64The amount of new tokens to mint.
decimalsu8Expected number of base 10 digits to the right of the decimal place.

Required accounts: 3; extras go to remaining.

Fields of MintToCheckedInstructionAccounts, in account order:

#FieldType
0mintPubkey
1tokenPubkey
2mint_authorityPubkey
3…remainingVec<AccountMeta>

Pause#

From the program's IDL:

Pause the mint.
Fails if the mint is not pausable.

Discriminator 2c01 · data Pause · accounts PauseInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of PauseInstructionAccounts, in account order:

#FieldType
0mintPubkey
1authorityPubkey
2…remainingVec<AccountMeta>

PermissionedBurn#

From the program's IDL:

Burn tokens when the mint has the permissioned burn extension enabled.

Discriminator 2e01 · data PermissionedBurn · accounts PermissionedBurnInstructionAccounts.

Known issue: the discriminator is 2 bytes but PermissionedBurn::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
amountu64The amount of tokens to burn.

Required accounts: 4; extras go to remaining.

Fields of PermissionedBurnInstructionAccounts, in account order:

#FieldType
0accountPubkey
1mintPubkey
2permissioned_burn_authorityPubkey
3authorityPubkey
4…remainingVec<AccountMeta>

PermissionedBurnChecked#

From the program's IDL:

Burn tokens with expected decimals when the mint has the permissioned burn extension enabled.

Discriminator 2e02 · data PermissionedBurnChecked · accounts PermissionedBurnCheckedInstructionAccounts.

Known issue: the discriminator is 2 bytes but PermissionedBurnChecked::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
amountu64The amount of tokens to burn.
decimalsu8Expected number of base 10 digits to the right of the decimal place.

Required accounts: 4; extras go to remaining.

Fields of PermissionedBurnCheckedInstructionAccounts, in account order:

#FieldType
0accountPubkey
1mintPubkey
2permissioned_burn_authorityPubkey
3authorityPubkey
4…remainingVec<AccountMeta>

Reallocate#

From the program's IDL:

Check to see if a token account is large enough for a list of
ExtensionTypes, and if not, use reallocation to increase the data size.

Discriminator 1d · data Reallocate · accounts ReallocateInstructionAccounts.

FieldTypeDescription
new_extension_typesVec<ExtensionType>New extension types to include in the reallocated account.

Required accounts: 4; extras go to remaining.

Fields of ReallocateInstructionAccounts, in account order:

#FieldType
0tokenPubkey
1payerPubkey
2system_programPubkey
3ownerPubkey
4…remainingVec<AccountMeta>

RemoveTokenMetadataKey#

From the program's IDL:

Removes a key-value pair in a token-metadata account.
This only applies to additional fields, and not the base name / symbol /
URI fields.
By the end of the instruction, the metadata account must be properly resized at the end based on the new size of the TLV entry.

Discriminator ea122038598d25b5 · data RemoveTokenMetadataKey · accounts RemoveTokenMetadataKeyInstructionAccounts.

FieldTypeDescription
idempotentboolIf the idempotent flag is set to true, then the instruction will not error if the key does not exist
keyStringKey to remove in the additional metadata portion.

Required accounts: 2; extras go to remaining.

Fields of RemoveTokenMetadataKeyInstructionAccounts, in account order:

#FieldType
0metadataPubkey
1update_authorityPubkey
2…remainingVec<AccountMeta>

Resume#

From the program's IDL:

Resume the mint.
Fails if the mint is not pausable.

Discriminator 2c02 · data Resume · accounts ResumeInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of ResumeInstructionAccounts, in account order:

#FieldType
0mintPubkey
1authorityPubkey
2…remainingVec<AccountMeta>

Revoke#

From the program's IDL:

Revokes the delegate's authority.

Discriminator 05 · data Revoke · accounts RevokeInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of RevokeInstructionAccounts, in account order:

#FieldType
0sourcePubkey
1ownerPubkey
2…remainingVec<AccountMeta>

SetAuthority#

From the program's IDL:

Sets a new authority of a mint or account.

Discriminator 06 · data SetAuthority · accounts SetAuthorityInstructionAccounts.

FieldTypeDescription
authority_typeAuthorityTypeThe type of authority to update.
new_authorityOption<Pubkey>The new authority

Required accounts: 2; extras go to remaining.

Fields of SetAuthorityInstructionAccounts, in account order:

#FieldType
0ownedPubkey
1ownerPubkey
2…remainingVec<AccountMeta>

SetTransferFee#

From the program's IDL:

Set transfer fee. Only supported for mints that include the TransferFeeConfig extension.

Discriminator 1a05 · data SetTransferFee · accounts SetTransferFeeInstructionAccounts.

Known issue: the discriminator is 2 bytes but SetTransferFee::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
transfer_fee_basis_pointsu16Amount of transfer collected as fees, expressed as basis points of the transfer amount.
maximum_feeu64Maximum fee assessed on transfers.

Required accounts: 2; extras go to remaining.

Fields of SetTransferFeeInstructionAccounts, in account order:

#FieldType
0mintPubkey
1transfer_fee_config_authorityPubkey
2…remainingVec<AccountMeta>

SyncNative#

From the program's IDL:

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.

Discriminator 11 · data SyncNative · accounts SyncNativeInstructionAccounts.

No data fields.

Required accounts: 1; extras go to remaining.

Fields of SyncNativeInstructionAccounts, in account order:

#FieldType
0accountPubkey
1…remainingVec<AccountMeta>

ThawAccount#

From the program's IDL:

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

Discriminator 0b · data ThawAccount · accounts ThawAccountInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of ThawAccountInstructionAccounts, in account order:

#FieldType
0accountPubkey
1mintPubkey
2ownerPubkey
3…remainingVec<AccountMeta>

Transfer#

From the program's IDL:

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.

Discriminator 03 · data Transfer · accounts TransferInstructionAccounts.

FieldTypeDescription
amountu64The amount of tokens to transfer.

Required accounts: 3; extras go to remaining.

Fields of TransferInstructionAccounts, in account order:

#FieldType
0sourcePubkey
1destinationPubkey
2authorityPubkey
3…remainingVec<AccountMeta>

TransferChecked#

From the program's IDL:

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.

Discriminator 0c · data TransferChecked · accounts TransferCheckedInstructionAccounts.

FieldTypeDescription
amountu64The amount of tokens to transfer.
decimalsu8Expected number of base 10 digits to the right of the decimal place.

Required accounts: 4; extras go to remaining.

Fields of TransferCheckedInstructionAccounts, in account order:

#FieldType
0sourcePubkey
1mintPubkey
2destinationPubkey
3authorityPubkey
4…remainingVec<AccountMeta>

TransferCheckedWithFee#

From the program's IDL:

Transfer, providing expected mint information and fees.
This instruction succeeds if the mint has no configured transfer fee and the provided fee is 0. This allows applications to use TransferCheckedWithFee with any mint.

Discriminator 1a01 · data TransferCheckedWithFee · accounts TransferCheckedWithFeeInstructionAccounts.

Known issue: the discriminator is 2 bytes but TransferCheckedWithFee::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
amountu64The amount of tokens to transfer.
decimalsu8Expected number of base 10 digits to the right of the decimal place.
feeu64Expected fee assessed on this transfer, calculated off-chain based on the transfer_fee_basis_points and maximum_fee of the mint. May be 0 for a mint without a configured transfer fee.

Required accounts: 4; extras go to remaining.

Fields of TransferCheckedWithFeeInstructionAccounts, in account order:

#FieldType
0sourcePubkey
1mintPubkey
2destinationPubkey
3authorityPubkey
4…remainingVec<AccountMeta>

UiAmountToAmount#

From the program's IDL:

Convert a UiAmount of tokens to a little-endian u64 raw Amount, using the given mint. In this version of the program, the mint can only specify the number of decimals.
Return data can be fetched using sol_get_return_data and deserializing the return data as a little-endian u64.

Discriminator 18 · data UiAmountToAmount · accounts UiAmountToAmountInstructionAccounts.

FieldTypeDescription
ui_amountStringThe ui_amount of tokens to reformat.

Required accounts: 1; extras go to remaining.

Fields of UiAmountToAmountInstructionAccounts, in account order:

#FieldType
0mintPubkey
1…remainingVec<AccountMeta>

UnwrapLamports#

From the program's IDL:

Transfer lamports from a native SOL account to a destination account.

Discriminator 2d · data UnwrapLamports · accounts UnwrapLamportsInstructionAccounts.

FieldTypeDescription
amountOption<u64>The amount of lamports to transfer.

Required accounts: 3; extras go to remaining.

Fields of UnwrapLamportsInstructionAccounts, in account order:

#FieldType
0sourcePubkey
1destinationPubkey
2authorityPubkey
3…remainingVec<AccountMeta>

UpdateConfidentialTransferMint#

From the program's IDL:

Updates the confidential transfer mint configuration for a mint.
Use TokenInstruction::SetAuthority to update the confidential transfer mint authority.

Discriminator 1b01 · data UpdateConfidentialTransferMint · accounts UpdateConfidentialTransferMintInstructionAccounts.

Known issue: the discriminator is 2 bytes but UpdateConfidentialTransferMint::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
auto_approve_new_accountsboolDetermines if newly configured accounts must be approved by the authority before they may be used by the user.
auditor_elgamal_pubkeyOption<Pubkey>New authority to decode any transfer amount in a confidential transfer.

Required accounts: 2; extras go to remaining.

Fields of UpdateConfidentialTransferMintInstructionAccounts, in account order:

#FieldType
0mintPubkey
1authorityPubkey
2…remainingVec<AccountMeta>

UpdateDefaultAccountState#

From the program's IDL:

Update the default state for new Accounts. Only supported for mints that include the DefaultAccountState extension.

Discriminator 1c01 · data UpdateDefaultAccountState · accounts UpdateDefaultAccountStateInstructionAccounts.

Known issue: the discriminator is 2 bytes but UpdateDefaultAccountState::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
stateAccountStateThe state each new token account should start with.

Required accounts: 2; extras go to remaining.

Fields of UpdateDefaultAccountStateInstructionAccounts, in account order:

#FieldType
0mintPubkey
1freeze_authorityPubkey
2…remainingVec<AccountMeta>

UpdateGroupMemberPointer#

From the program's IDL:

Update the group member pointer address. Only supported for mints that include the GroupMemberPointer extension.

Discriminator 2901 · data UpdateGroupMemberPointer · accounts UpdateGroupMemberPointerInstructionAccounts.

Known issue: the discriminator is 2 bytes but UpdateGroupMemberPointer::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
member_addressOption<Pubkey>The new account address that holds the member.

Required accounts: 2; extras go to remaining.

Fields of UpdateGroupMemberPointerInstructionAccounts, in account order:

#FieldType
0mintPubkey
1group_member_pointer_authorityPubkey
2…remainingVec<AccountMeta>

UpdateGroupPointer#

From the program's IDL:

Update the group pointer address. Only supported for mints that include the GroupPointer extension.

Discriminator 2801 · data UpdateGroupPointer · accounts UpdateGroupPointerInstructionAccounts.

Known issue: the discriminator is 2 bytes but UpdateGroupPointer::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
group_addressOption<Pubkey>The new account address that holds the group configurations.

Required accounts: 2; extras go to remaining.

Fields of UpdateGroupPointerInstructionAccounts, in account order:

#FieldType
0mintPubkey
1group_pointer_authorityPubkey
2…remainingVec<AccountMeta>

UpdateMetadataPointer#

From the program's IDL:

Update the metadata pointer address. Only supported for mints that include the MetadataPointer extension.

Discriminator 2701 · data UpdateMetadataPointer · accounts UpdateMetadataPointerInstructionAccounts.

Known issue: the discriminator is 2 bytes but UpdateMetadataPointer::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
metadata_addressOption<Pubkey>The new account address that holds the metadata.

Required accounts: 2; extras go to remaining.

Fields of UpdateMetadataPointerInstructionAccounts, in account order:

#FieldType
0mintPubkey
1metadata_pointer_authorityPubkey
2…remainingVec<AccountMeta>

UpdateMultiplierScaledUiMint#

From the program's IDL:

Update the multiplier. Only supported for mints that include the ScaledUiAmountConfig extension.
You can set a specific timestamp for the multiplier to take effect.

Discriminator 2b01 · data UpdateMultiplierScaledUiMint · accounts UpdateMultiplierScaledUiMintInstructionAccounts.

Known issue: the discriminator is 2 bytes but UpdateMultiplierScaledUiMint::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
multiplierf64The new multiplier for the scaled UI extension
effective_timestampi64The timestamp at which the new multiplier will take effect

Required accounts: 2; extras go to remaining.

Fields of UpdateMultiplierScaledUiMintInstructionAccounts, in account order:

#FieldType
0mintPubkey
1authorityPubkey
2…remainingVec<AccountMeta>

UpdateRateInterestBearingMint#

From the program's IDL:

Update the interest rate. Only supported for mints that include the InterestBearingConfig extension.

Discriminator 2101 · data UpdateRateInterestBearingMint · accounts UpdateRateInterestBearingMintInstructionAccounts.

Known issue: the discriminator is 2 bytes but UpdateRateInterestBearingMint::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
ratei16The interest rate to update.

Required accounts: 2; extras go to remaining.

Fields of UpdateRateInterestBearingMintInstructionAccounts, in account order:

#FieldType
0mintPubkey
1rate_authorityPubkey
2…remainingVec<AccountMeta>

UpdateTokenGroupMaxSize#

From the program's IDL:

Update the max size of a Group.

Discriminator 6c25ab8ff81e126e · data UpdateTokenGroupMaxSize · accounts UpdateTokenGroupMaxSizeInstructionAccounts.

FieldTypeDescription
max_sizeu64New max size for the group

Required accounts: 2; extras go to remaining.

Fields of UpdateTokenGroupMaxSizeInstructionAccounts, in account order:

#FieldType
0groupPubkey
1update_authorityPubkey
2…remainingVec<AccountMeta>

UpdateTokenGroupUpdateAuthority#

From the program's IDL:

Update the authority of a Group.

Discriminator a1695801edddd8cb · data UpdateTokenGroupUpdateAuthority · accounts UpdateTokenGroupUpdateAuthorityInstructionAccounts.

FieldTypeDescription
new_update_authorityOption<Pubkey>New authority for the group, or unset if None

Required accounts: 2; extras go to remaining.

Fields of UpdateTokenGroupUpdateAuthorityInstructionAccounts, in account order:

#FieldType
0groupPubkey
1update_authorityPubkey
2…remainingVec<AccountMeta>

UpdateTokenMetadataField#

From the program's IDL:

Updates a field in a token-metadata account.
The field can be one of the required fields (name, symbol, URI), or a totally new field denoted by a "key" string.
By the end of the instruction, the metadata account must be properly resized based on the new size of the TLV entry.

  • If the new size is larger, the program must first reallocate to

avoid overwriting other TLV entries.

  • If the new size is smaller, the program must reallocate at the end

so that it's possible to iterate over TLV entries

Discriminator dde9312db5cadcc8 · data UpdateTokenMetadataField · accounts UpdateTokenMetadataFieldInstructionAccounts.

FieldTypeDescription
fieldTokenMetadataFieldField to update in the metadata.
valueStringValue to write for the field.

Required accounts: 2; extras go to remaining.

Fields of UpdateTokenMetadataFieldInstructionAccounts, in account order:

#FieldType
0metadataPubkey
1update_authorityPubkey
2…remainingVec<AccountMeta>

UpdateTokenMetadataUpdateAuthority#

From the program's IDL:

Updates the token-metadata authority.

Discriminator d7e4a6e45464567b · data UpdateTokenMetadataUpdateAuthority · accounts UpdateTokenMetadataUpdateAuthorityInstructionAccounts.

FieldTypeDescription
new_update_authorityOption<Pubkey>New authority for the token metadata, or unset if None

Required accounts: 2; extras go to remaining.

Fields of UpdateTokenMetadataUpdateAuthorityInstructionAccounts, in account order:

#FieldType
0metadataPubkey
1update_authorityPubkey
2…remainingVec<AccountMeta>

UpdateTransferHook#

From the program's IDL:

Update the transfer hook program id. Only supported for mints that include the TransferHook extension.
Accounts expected by this instruction: 0. [writable] The mint.

  1. [signer] The transfer hook authority.

Discriminator 2401 · data UpdateTransferHook · accounts UpdateTransferHookInstructionAccounts.

Known issue: the discriminator is 2 bytes but UpdateTransferHook::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
program_idOption<Pubkey>The program id that performs logic during transfers

Required accounts: 2; extras go to remaining.

Fields of UpdateTransferHookInstructionAccounts, in account order:

#FieldType
0mintPubkey
1authorityPubkey
2…remainingVec<AccountMeta>

WithdrawExcessLamports#

From the program's IDL:

This instruction is to be used to rescue SOLs sent to any TokenProgram owned account by sending them to any other account, leaving behind only lamports for rent exemption.

Discriminator 26 · data WithdrawExcessLamports · accounts WithdrawExcessLamportsInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of WithdrawExcessLamportsInstructionAccounts, in account order:

#FieldType
0source_accountPubkey
1destination_accountPubkey
2authorityPubkey
3…remainingVec<AccountMeta>

WithdrawWithheldTokensFromAccounts#

From the program's IDL:

Transfer all withheld tokens to an account. Signed by the mint's withdraw withheld tokens authority.

Discriminator 1a03 · data WithdrawWithheldTokensFromAccounts · accounts WithdrawWithheldTokensFromAccountsInstructionAccounts.

Known issue: the discriminator is 2 bytes but WithdrawWithheldTokensFromAccounts::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
num_token_accountsu8Number of token accounts harvested.

Required accounts: 3; extras go to remaining.

Fields of WithdrawWithheldTokensFromAccountsInstructionAccounts, in account order:

#FieldType
0mintPubkey
1fee_receiverPubkey
2withdraw_withheld_authorityPubkey
3…remainingVec<AccountMeta>

WithdrawWithheldTokensFromAccountsForConfidentialTransferFee#

From the program's IDL:

Transfer all withheld tokens to an account. Signed by the mint's withdraw withheld tokens authority. This instruction is susceptible to front-running.
Use HarvestWithheldTokensToMint and WithdrawWithheldTokensFromMint as alternative. Must be accompanied by the VerifyWithdrawWithheldTokens instruction.

Discriminator 2502 · data WithdrawWithheldTokensFromAccountsForConfidentialTransferFee · accounts WithdrawWithheldTokensFromAccountsForConfidentialTransferFeeInstructionAccounts.

Known issue: the discriminator is 2 bytes but WithdrawWithheldTokensFromAccountsForConfidentialTransferFee::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
num_token_accountsu8Number of token accounts harvested
proof_instruction_offseti8Proof instruction offset
new_decryptable_available_balanceDecryptableBalanceThe new decryptable balance in the destination token account

Required accounts: 5; extras go to remaining.

Fields of WithdrawWithheldTokensFromAccountsForConfidentialTransferFeeInstructionAccounts, in account order:

#FieldType
0mintPubkey
1destinationPubkey
2instructions_sysvar_or_context_statePubkey
3recordOption<Pubkey>
4authorityPubkey
5…remainingVec<AccountMeta>

WithdrawWithheldTokensFromMint#

From the program's IDL:

Transfer all withheld tokens in the mint to an account. Signed by the mint's withdraw withheld tokens authority.

Discriminator 1a02 · data WithdrawWithheldTokensFromMint · accounts WithdrawWithheldTokensFromMintInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of WithdrawWithheldTokensFromMintInstructionAccounts, in account order:

#FieldType
0mintPubkey
1fee_receiverPubkey
2withdraw_withheld_authorityPubkey
3…remainingVec<AccountMeta>

WithdrawWithheldTokensFromMintForConfidentialTransferFee#

From the program's IDL:

Transfer all withheld confidential tokens in the mint to an account.
Signed by the mint's withdraw withheld tokens authority.
The withheld confidential tokens are aggregated directly into the destination available balance. Must be accompanied by the
VerifyCiphertextCiphertextEquality instruction of the zk_elgamal_proof program in the same transaction or the address of a context state account for the proof must be provided.

Discriminator 2501 · data WithdrawWithheldTokensFromMintForConfidentialTransferFee · accounts WithdrawWithheldTokensFromMintForConfidentialTransferFeeInstructionAccounts.

Known issue: the discriminator is 2 bytes but WithdrawWithheldTokensFromMintForConfidentialTransferFee::decode reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input.raw_instruction.data[2..] instead.

FieldTypeDescription
proof_instruction_offseti8Proof instruction offset
new_decryptable_available_balanceDecryptableBalanceThe new decryptable balance in the destination token account

Required accounts: 5; extras go to remaining.

Fields of WithdrawWithheldTokensFromMintForConfidentialTransferFeeInstructionAccounts, in account order:

#FieldType
0mintPubkey
1destinationPubkey
2instructions_sysvar_or_context_statePubkey
3recordOption<Pubkey>
4authorityPubkey
5…remainingVec<AccountMeta>

Accounts#

Variants of Token2022Account. Each wraps a boxed struct from carbon_token_2022_decoder::accounts::<module>. decode_account only considers accounts owned by PROGRAM_ID and returns the first variant that matches.

Mint#

Unpacked with spl_token_2022::extension::StateWithExtensions::<spl_token_2022::state::Mint>::unpack · accounts::mint::Mint.

FieldTypeDescription
mint_authorityOption<Pubkey>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.
supplyu64Total supply of tokens.
decimalsu8Number of base 10 digits to the right of the decimal place.
is_initializedboolIs true if this structure has been initialized.
freeze_authorityOption<Pubkey>Optional authority to freeze token accounts.
extensionsOption<Vec<Extension>>The extensions activated on the mint account.

Multisig#

Unpacked with spl_token_2022::state::Multisig::unpack_unchecked · accounts::multisig::Multisig.

FieldTypeDescription
mu8Number of signers required.
nu8Number of valid signers.
is_initializedboolIs true if this structure has been initialized.
signers[Pubkey; 11]Signer public keys.

Token#

Unpacked with spl_token_2022::extension::StateWithExtensions::<spl_token_2022::state::Account>::unpack · accounts::token::Token.

FieldTypeDescription
mintPubkeyThe mint associated with this account.
ownerPubkeyThe owner of this account.
amountu64The amount of tokens this account holds.
delegateOption<Pubkey>If delegate is Some then delegated_amount represents the amount authorized by the delegate.
stateAccountStateThe account's state.
is_nativeOption<u64>If is_native.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.
delegated_amountu64The amount delegated.
close_authorityOption<Pubkey>Optional authority to close the account.
extensionsOption<Vec<Extension>>The extensions activated on the token account.

Types#

Types used by the instructions, accounts and events above, exported from carbon_token_2022_decoder::types.

AccountState#

Enum types::AccountState.

Variant
Uninitialized
Initialized
Frozen

AuthorityType#

Enum types::AuthorityType.

Variant
MintTokens
FreezeAccount
AccountOwner
CloseAccount
TransferFeeConfig
WithheldWithdraw
CloseMint
InterestRate
PermanentDelegate
ConfidentialTransferMint
TransferHookProgramId
ConfidentialTransferFeeConfig
MetadataPointer
GroupPointer
GroupMemberPointer
ScaledUiAmount
Pause
PermissionedBurn

DecryptableBalance#

From the program's IDL:

Authenticated encryption containing an account balance.

Tuple struct types::DecryptableBalance ([u8; 36]).

EncryptedBalance#

From the program's IDL:

ElGamal ciphertext containing an account balance.

Tuple struct types::EncryptedBalance ([u8; 64]).

Extension#

Enum types::Extension.

VariantFields
Uninitialized
TransferFeeConfigtransfer_fee_config_authority: Option<Pubkey>, withdraw_withheld_authority: Option<Pubkey>, withheld_amount: u64, older_transfer_fee: TransferFee, newer_transfer_fee: TransferFee
TransferFeeAmountwithheld_amount: u64
MintCloseAuthorityclose_authority: Option<Pubkey>
ConfidentialTransferMintauthority: Option<Pubkey>, auto_approve_new_accounts: bool, auditor_elgamal_pubkey: Option<Pubkey>
ConfidentialTransferAccountapproved: bool, elgamal_pubkey: Pubkey, pending_balance_low: EncryptedBalance, pending_balance_high: EncryptedBalance, available_balance: EncryptedBalance, decryptable_available_balance: DecryptableBalance, allow_confidential_credits: bool, allow_non_confidential_credits: bool, pending_balance_credit_counter: u64, maximum_pending_balance_credit_counter: u64, expected_pending_balance_credit_counter: u64, actual_pending_balance_credit_counter: u64
DefaultAccountStatestate: AccountState
ImmutableOwner
MemoTransferrequire_incoming_transfer_memos: bool
NonTransferable
InterestBearingConfigrate_authority: Option<Pubkey>, initialization_timestamp: u64, pre_update_average_rate: i16, last_update_timestamp: u64, current_rate: i16
CpiGuardlock_cpi: bool
PermanentDelegatedelegate: Option<Pubkey>
NonTransferableAccount
TransferHookauthority: Option<Pubkey>, program_id: Option<Pubkey>
TransferHookAccounttransferring: bool
ConfidentialTransferFeeauthority: Option<Pubkey>, elgamal_pubkey: Pubkey, harvest_to_mint_enabled: bool, withheld_amount: EncryptedBalance
ConfidentialTransferFeeAmountwithheld_amount: EncryptedBalance
MetadataPointerauthority: Option<Pubkey>, metadata_address: Option<Pubkey>
TokenMetadataupdate_authority: Option<Pubkey>, mint: Pubkey, name: String, symbol: String, uri: String, additional_metadata: HashMap<String, String>
GroupPointerauthority: Option<Pubkey>, group_address: Option<Pubkey>
TokenGroupupdate_authority: Option<Pubkey>, mint: Pubkey, size: u64, max_size: u64
GroupMemberPointerauthority: Option<Pubkey>, member_address: Option<Pubkey>
TokenGroupMembermint: Pubkey, group: Pubkey, member_number: u64
ConfidentialMintBurn
ScaledUiAmountConfigauthority: Option<Pubkey>, multiplier: f64, new_multiplier_effective_timestamp: u64, new_multiplier: f64
PausableConfigauthority: Option<Pubkey>, paused: bool
PausableAccount
PermissionedBurnauthority: Option<Pubkey>

TransferFeeConfig fields:

FieldTypeDescription
transfer_fee_config_authorityOption<Pubkey>Optional authority to set the fee.
withdraw_withheld_authorityOption<Pubkey>Withdraw from mint instructions must be signed by this key.
withheld_amountu64Withheld transfer fee tokens that have been moved to the mint for withdrawal.
older_transfer_feeTransferFeeOlder transfer fee, used if the current epoch < newerTransferFee.epoch.
newer_transfer_feeTransferFeeNewer transfer fee, used if the current epoch >= newerTransferFee.epoch.

TransferFeeAmount fields:

FieldTypeDescription
withheld_amountu64Withheld transfer fee tokens that can be claimed by the fee authority.

ConfidentialTransferMint fields:

FieldTypeDescription
authorityOption<Pubkey>Authority to modify the ConfidentialTransferMint configuration and to approve new accounts (if auto_approve_new_accounts is true). The legacy Token Multisig account is not supported as the authority.
auto_approve_new_accountsboolIndicate if newly configured accounts must be approved by the authority before they may be used by the user. * If true, no approval is required and new accounts may be used immediately. * If false, the authority must approve newly configured accounts (see ConfidentialTransferInstruction::ConfigureAccount).
auditor_elgamal_pubkeyOption<Pubkey>Authority to decode any transfer amount in a confidential transfer.

ConfidentialTransferAccount fields:

FieldTypeDescription
approvedbooltrue if this account has been approved for use. All confidential transfer operations for the account will fail until approval is granted.
elgamal_pubkeyPubkeyThe public key associated with ElGamal encryption.
pending_balance_lowEncryptedBalanceThe low 16 bits of the pending balance (encrypted by elgamal_pubkey).
pending_balance_highEncryptedBalanceThe high 32 bits of the pending balance (encrypted by elgamal_pubkey).
available_balanceEncryptedBalanceThe available balance (encrypted by encrypiton_pubkey).
decryptable_available_balanceDecryptableBalanceThe decryptable available balance.
allow_confidential_creditsboolIf false, the extended account rejects any incoming confidential transfers.
allow_non_confidential_creditsboolIf false, the base account rejects any incoming transfers.
pending_balance_credit_counteru64The total number of Deposit and Transfer instructions that have credited pending_balance.
maximum_pending_balance_credit_counteru64The maximum number of Deposit and Transfer instructions that can credit pending_balance before the ApplyPendingBalance instruction is executed.
expected_pending_balance_credit_counteru64The expected_pending_balance_credit_counter value that was included in the last ApplyPendingBalance instruction.
actual_pending_balance_credit_counteru64The actual pending_balance_credit_counter when the last ApplyPendingBalance instruction was executed.

MemoTransfer fields:

FieldTypeDescription
require_incoming_transfer_memosboolRequire transfers into this account to be accompanied by a memo.

CpiGuard fields:

FieldTypeDescription
lock_cpiboolLock certain token operations from taking place within CPI for this account.

TransferHook fields:

FieldTypeDescription
authorityOption<Pubkey>The transfer hook update authority.
program_idOption<Pubkey>The transfer hook program account.

TransferHookAccount fields:

FieldTypeDescription
transferringboolWhether or not this account is currently transferring tokens True during the transfer hook cpi, otherwise false.

ConfidentialTransferFee fields:

FieldTypeDescription
authorityOption<Pubkey>Optional authority to set the withdraw withheld authority ElGamal key.
elgamal_pubkeyPubkeyWithheld fees from accounts must be encrypted with this ElGamal key. Note that whoever holds the ElGamal private key for this ElGamal public key has the ability to decode any withheld fee amount that are associated with accounts. When combined with the fee parameters, the withheld fee amounts can reveal information about transfer amounts.
harvest_to_mint_enabledboolIf false, the harvest of withheld tokens to mint is rejected.
withheld_amountEncryptedBalanceWithheld confidential transfer fee tokens that have been moved to the mint for withdrawal.

ConfidentialTransferFeeAmount fields:

FieldTypeDescription
withheld_amountEncryptedBalanceAmount withheld during confidential transfers, to be harvest to the mint.

MetadataPointer fields:

FieldTypeDescription
authorityOption<Pubkey>Optional authority that can set the metadata address.
metadata_addressOption<Pubkey>Optional Account Address that holds the metadata.

TokenMetadata fields:

FieldTypeDescription
update_authorityOption<Pubkey>The authority that can sign to update the metadata.
mintPubkeyThe associated mint, used to counter spoofing to be sure that metadata belongs to a particular mint.
nameStringThe longer name of the token.
symbolStringThe shortened symbol for the token.
uriStringThe URI pointing to richer metadata.
additional_metadataHashMap<String, String>Any additional metadata about the token as key-value pairs.

GroupPointer fields:

FieldTypeDescription
authorityOption<Pubkey>Optional authority that can set the group address.
group_addressOption<Pubkey>Optional account address that holds the group.

TokenGroup fields:

FieldTypeDescription
update_authorityOption<Pubkey>The authority that can sign to update the group.
mintPubkeyThe associated mint, used to counter spoofing to be sure that group belongs to a particular mint.
sizeu64The current number of group members.
max_sizeu64The maximum number of group members.

GroupMemberPointer fields:

FieldTypeDescription
authorityOption<Pubkey>Optional authority that can set the member address.
member_addressOption<Pubkey>Optional account address that holds the member.

TokenGroupMember fields:

FieldTypeDescription
mintPubkeyThe associated mint, used to counter spoofing to be sure that member belongs to a particular mint.
groupPubkeyThe pubkey of the TokenGroup.
member_numberu64The member number.

PermissionedBurn fields:

FieldTypeDescription
authorityOption<Pubkey>Authority that is required for burning

ExtensionType#

From the program's IDL:

Extensions that can be applied to mints or accounts. Mint extensions must only be applied to mint accounts, and account extensions must only be applied to token holding accounts.

Enum types::ExtensionType.

Variant
Uninitialized
TransferFeeConfig
TransferFeeAmount
MintCloseAuthority
ConfidentialTransferMint
ConfidentialTransferAccount
DefaultAccountState
ImmutableOwner
MemoTransfer
NonTransferable
InterestBearingConfig
CpiGuard
PermanentDelegate
NonTransferableAccount
TransferHook
TransferHookAccount
ConfidentialTransferFee
ConfidentialTransferFeeAmount
ScaledUiAmountConfig
PausableConfig
PausableAccount
MetadataPointer
TokenMetadata
GroupPointer
TokenGroup
GroupMemberPointer
TokenGroupMember

TokenMetadataField#

From the program's IDL:

Fields in the metadata account, used for updating.

Enum types::TokenMetadataField.

VariantFields
Name
Symbol
Uri
KeyString

TransferFee#

Struct types::TransferFee.

FieldTypeDescription
epochu64First epoch where the transfer fee takes effect.
maximum_feeu64Maximum fee assessed on transfers, expressed as an amount of tokens.
transfer_fee_basis_pointsu16Amount of transfer collected as fees, expressed as basis points of the transfer amount, ie. increments of 0.01%.

Generated from the crate’s source at Carbon v2.0.0, so it always matches the published code. Spotted a problem? Report it; edits to this page itself are overwritten on the next release.

Your endpoints

Code samples use these instead of the placeholders, so you can copy and run them as they are. They’re stored only in this browser and never sent anywhere.