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.
| Crate | carbon-token-2022-decoder 2.0.0 |
| Install | cargo add carbon-token-2022-decoder@2. |
| Program ID | TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb (carbon_) |
| Category | Core & SPL |
| Decoder | carbon_ |
| Instruction enum | instructions:: |
| Account enum | accounts:: |
| Features | serde, postgres, graphql (none enabled by default) |
| API docs | docs.rs/carbon-token-2022-decoder/2.0.0 |
| Source | decoders/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:
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/fulluse {
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(())
}
}RUST_LOG=info cargo runEach 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:
cargo add carbon-rpc-program-subscribe-datasource@2.0.0 solana-client@4.2.2use {
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(())
}
}RUST_LOG=info cargo runEach 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::, where data and accounts are the types listed under the variant, exported from carbon_. 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:
- The instruction's program ID is
TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb. - The data starts with the variant's discriminator, and the rest deserializes into its data type.
- 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_ too. Accounts after the listed ones are in accounts. as AccountMetas. The decoder doesn't record whether an account signed or was writable: read that from input. and ., 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 usingsol_and deserialized withget_ return_ data String::.from_ utf8
Discriminator 17 · data AmountToUiAmount · accounts AmountToUiAmountInstructionAccounts.
| Field | Type | Description |
|---|---|---|
amount | u64 | The amount of tokens to reformat. |
Required accounts: 1; extras go to remaining.
Fields of AmountToUiAmountInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
ApplyConfidentialPendingBalance#
From the program's IDL:
Applies the pending balance to the available balance, based on the history of
Depositand/orTransferinstructions.
After submittingApplyPendingBalance, the client should compareConfidentialTransferAccount::withexpected_ pending_ balance_ credit_ counter ConfidentialTransferAccount::.actual_ applied_ pending_ balance_ instructions
If they are equal then theConfidentialTransferAccount::is consistent withdecryptable_ available_ balance ConfidentialTransferAccount::. If they differ then there is more pending balance to be applied.available_ balance
Discriminator 1b08 · data ApplyConfidentialPendingBalance · accounts ApplyConfidentialPendingBalanceInstructionAccounts.
Known issue: the discriminator is 2 bytes but ApplyConfidentialPendingBalance:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
expected_ | u64 | The expected number of pending balance credits since the last successful ApplyPendingBalance instruction |
new_ | DecryptableBalance | The new decryptable balance if the pending balance is applied successfully |
Required accounts: 2; extras go to remaining.
Fields of ApplyConfidentialPendingBalanceInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token | Pubkey |
| 1 | authority | Pubkey |
| 2… | remaining | Vec< |
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.
| Field | Type | Description |
|---|---|---|
amount | u64 | The amount of tokens the delegate is approved for. |
Required accounts: 3; extras go to remaining.
Fields of ApproveInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | source | Pubkey |
| 1 | delegate | Pubkey |
| 2 | owner | Pubkey |
| 3… | remaining | Vec< |
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.
| Field | Type | Description |
|---|---|---|
amount | u64 | The amount of tokens the delegate is approved for. |
decimals | u8 | Expected 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:
| # | Field | Type |
|---|---|---|
| 0 | source | Pubkey |
| 1 | mint | Pubkey |
| 2 | delegate | Pubkey |
| 3 | owner | Pubkey |
| 4… | remaining | Vec< |
ApproveConfidentialTransferAccount#
From the program's IDL:
Approves a token account for confidential transfers.
Approval is only required when theConfidentialTransferMint::field is set in theapprove_ new_ accounts
SPL Token mint. This instruction must be executed after the account owner configures their account for confidential transfers withConfidentialTransferInstruction::.ConfigureAccount
Discriminator 1b03 · data ApproveConfidentialTransferAccount · accounts ApproveConfidentialTransferAccountInstructionAccounts.
No data fields.
Required accounts: 3; extras go to remaining.
Fields of ApproveConfidentialTransferAccountInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token | Pubkey |
| 1 | mint | Pubkey |
| 2 | authority | Pubkey |
| 3… | remaining | Vec< |
Burn#
From the program's IDL:
Burns tokens by removing them from an account.
Burndoes not support accounts associated with the native mint, useCloseAccountinstead.
Discriminator 08 · data Burn · accounts BurnInstructionAccounts.
| Field | Type |
|---|---|
amount | u64 |
Required accounts: 3; extras go to remaining.
Fields of BurnInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | account | Pubkey |
| 1 | mint | Pubkey |
| 2 | authority | Pubkey |
| 3… | remaining | Vec< |
BurnChecked#
From the program's IDL:
Burns tokens by removing them from an account.
BurnCheckeddoes not support accounts associated with the native mint, useCloseAccountinstead. 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.
| Field | Type | Description |
|---|---|---|
amount | u64 | The amount of tokens to burn. |
decimals | u8 | Expected 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:
| # | Field | Type |
|---|---|---|
| 0 | account | Pubkey |
| 1 | mint | Pubkey |
| 2 | authority | Pubkey |
| 3… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | account | Pubkey |
| 1 | destination | Pubkey |
| 2 | owner | Pubkey |
| 3… | remaining | Vec< |
ConfidentialDeposit#
From the program's IDL:
Deposit SPL Tokens into the pending balance of a confidential token account.
The account owner can then invoke theApplyPendingBalanceinstruction 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 asNonTransferable.
Discriminator 1b05 · data ConfidentialDeposit · accounts ConfidentialDepositInstructionAccounts.
Known issue: the discriminator is 2 bytes but ConfidentialDeposit:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
amount | u64 | The amount of tokens to deposit. |
decimals | u8 | Expected 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:
| # | Field | Type |
|---|---|---|
| 0 | token | Pubkey |
| 1 | mint | Pubkey |
| 2 | authority | Pubkey |
| 3… | remaining | Vec< |
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 ofzk_program instructions:elgamal_ proof
VerifyCiphertextCommitmentEqualityVerifyBatchedGroupedCiphertext3HandlesValidityVerifyBatchedRangeProofU128These 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 asNonTransferable.
Discriminator 1b07 · data ConfidentialTransfer · accounts ConfidentialTransferInstructionAccounts.
Known issue: the discriminator is 2 bytes but ConfidentialTransfer:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
new_ | DecryptableBalance | The new source decryptable balance if the transfer succeeds. |
equality_ | i8 | Relative location of the ProofInstruction:: instruction to the Transfer instruction in the transaction. If the offset is 0, then use a context state account for the proof. |
ciphertext_ | i8 | Relative location of the ProofInstruction:: instruction to the Transfer instruction in the transaction. If the offset is 0, then use a context state account for the proof. |
range_ | i8 | Relative location of the ProofInstruction:: 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:
| # | Field | Type |
|---|---|---|
| 0 | source_ | Pubkey |
| 1 | mint | Pubkey |
| 2 | destination_ | Pubkey |
| 3 | instructions_ | Option< |
| 4 | equality_ | Option< |
| 5 | ciphertext_ | Option< |
| 6 | range_ | Option< |
| 7 | authority | Pubkey |
| 8… | remaining | Vec< |
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 ofzk_program instructions:elgamal_ proof
VerifyCiphertextCommitmentEqualityVerifyBatchedGroupedCiphertext3HandlesValidity(transfer amountciphertext)
VerifyPercentageWithFeeVerifyBatchedGroupedCiphertext2HandlesValidity(fee ciphertext)VerifyBatchedRangeProofU256These 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 theTransferapplies toTransferWithFee. Namely, the instruction fails if the associated mint is extended asNonTransferable.
Discriminator 1b0d · data ConfidentialTransferWithFee · accounts ConfidentialTransferWithFeeInstructionAccounts.
Known issue: the discriminator is 2 bytes but ConfidentialTransferWithFee:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
new_ | DecryptableBalance | The new source decryptable balance if the transfer succeeds. |
equality_ | i8 | Relative location of the ProofInstruction:: instruction to the TransferWithFee instruction in the transaction. If the offset is 0, then use a context state account for the proof. |
transfer_ | i8 | Relative location of the ProofInstruction:: instruction to the TransferWithFee instruction in the transaction. If the offset is 0, then use a context state account for the proof. |
fee_ | i8 | Relative location of the ProofInstruction:: instruction to the TransferWithFee instruction in the transaction. If the offset is 0, then use a context state account for the proof. |
fee_ | i8 | Relative location of the ProofInstruction:: instruction to the TransferWithFee instruction in the transaction. If the offset is 0, then use a context state account for the proof. |
range_ | i8 | Relative location of the ProofInstruction:: 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:
| # | Field | Type |
|---|---|---|
| 0 | source_ | Pubkey |
| 1 | mint | Pubkey |
| 2 | destination_ | Pubkey |
| 3 | instructions_ | Option< |
| 4 | equality_ | Option< |
| 5 | transfer_ | Option< |
| 6 | fee_ | Option< |
| 7 | fee_ | Option< |
| 8 | range_ | Option< |
| 9 | authority | Pubkey |
| 10… | remaining | Vec< |
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 ofzk_program instructions:elgamal_ proof
VerifyCiphertextCommitmentEqualityVerifyBatchedRangeProofU64These 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 asNonTransferable.
Discriminator 1b06 · data ConfidentialWithdraw · accounts ConfidentialWithdrawInstructionAccounts.
Known issue: the discriminator is 2 bytes but ConfidentialWithdraw:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
amount | u64 | The amount of tokens to withdraw. |
decimals | u8 | Expected number of base 10 digits to the right of the decimal place. |
new_ | DecryptableBalance | The new decryptable balance if the withdrawal succeeds. |
equality_ | i8 | Relative location of the ProofInstruction:: instruction to the Withdraw instruction in the transaction. If the offset is 0, then use a context state account for the proof. |
range_ | i8 | Relative location of the ProofInstruction:: 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:
| # | Field | Type |
|---|---|---|
| 0 | token | Pubkey |
| 1 | mint | Pubkey |
| 2 | instructions_ | Option< |
| 3 | equality_ | Option< |
| 4 | range_ | Option< |
| 5 | authority | Pubkey |
| 6… | remaining | Vec< |
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 theTokenInstruction::instruction has not yet successfully executed for the token account.InitializeAccount
Upon success, confidential and non-confidential deposits and transfers are enabled. Use theDisableConfidentialCreditsandDisableNonConfidentialCreditsinstructions to disable.
In order for this instruction to be successfully processed, it must be accompanied by theVerifyPubkeyValidityinstruction of thezk_program in the same transaction or the address of a context state account for the proof must be provided.elgamal_ proof
Discriminator 1b02 · data ConfigureConfidentialTransferAccount · accounts ConfigureConfidentialTransferAccountInstructionAccounts.
Known issue: the discriminator is 2 bytes but ConfigureConfidentialTransferAccount:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
decryptable_ | DecryptableBalance | The decryptable balance (always 0) once the configure account succeeds. |
maximum_ | u64 | The maximum number of despots and transfers that an account can receiver before the ApplyPendingBalance is executed |
proof_ | i8 | Relative location of the ProofInstruction:: 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:
| # | Field | Type |
|---|---|---|
| 0 | token | Pubkey |
| 1 | mint | Pubkey |
| 2 | instructions_ | Pubkey |
| 3 | record | Option< |
| 4 | authority | Pubkey |
| 5… | remaining | Vec< |
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_) will not be available until this instruction is successfully executed.mint:: id()
Discriminator 1f · data CreateNativeMint · accounts CreateNativeMintInstructionAccounts.
No data fields.
Required accounts: 3; extras go to remaining.
Fields of CreateNativeMintInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | payer | Pubkey |
| 1 | native_mint | Pubkey |
| 2 | system_ | Pubkey |
| 3… | remaining | Vec< |
DisableConfidentialCredits#
From the program's IDL:
Configure a confidential extension account to reject any incoming confidential transfers.
If theallow_field isnon_ confidential_ credits 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:
| # | Field | Type |
|---|---|---|
| 0 | token | Pubkey |
| 1 | authority | Pubkey |
| 2… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | token | Pubkey |
| 1 | owner | Pubkey |
| 2… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | authority | Pubkey |
| 2… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | token | Pubkey |
| 1 | owner | Pubkey |
| 2… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | token | Pubkey |
| 1 | authority | Pubkey |
| 2… | remaining | Vec< |
EmitTokenMetadata#
From the program's IDL:
Emits the token-metadata as return data
The format of the data emitted follows exactly theTokenMetadatastruct, 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 returnTokenMetadatawithout adhering to the specific byte layout of theTokenMetadatastruct in any accounts.
Discriminator faa6b4fa0d0cb846 · data EmitTokenMetadata · accounts EmitTokenMetadataInstructionAccounts.
| Field | Type | Description |
|---|---|---|
start | Option<u64> | Start of range of data to emit |
end | Option<u64> | End of range of data to emit |
Required accounts: 1; extras go to remaining.
Fields of EmitTokenMetadataInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | metadata | Pubkey |
| 1… | remaining | Vec< |
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 theConfidentialTransferInstruction::instruction. Use theApplyPendingBalance ConfidentialTransferInstruction::instruction to empty the available balance ciphertext.EmptyAccount
Note that a newly configured account is always empty, so this instruction is not required prior to account closing if no instructions beyondConfidentialTransferInstruction::have affected the token account.ConfigureAccount
In order for this instruction to be successfully processed, it must be accompanied by theVerifyZeroCiphertextinstruction of thezk_program in the same transaction or the address of a context state account for the proof must be provided.elgamal_ proof
Discriminator 1b04 · data EmptyConfidentialTransferAccount · accounts EmptyConfidentialTransferAccountInstructionAccounts.
Known issue: the discriminator is 2 bytes but EmptyConfidentialTransferAccount:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
proof_ | i8 | Relative location of the ProofInstruction:: 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:
| # | Field | Type |
|---|---|---|
| 0 | token | Pubkey |
| 1 | instructions_ | Pubkey |
| 2 | record | Option< |
| 3 | authority | Pubkey |
| 4… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | token | Pubkey |
| 1 | authority | Pubkey |
| 2… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | token | Pubkey |
| 1 | owner | Pubkey |
| 2… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | authority | Pubkey |
| 2… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | token | Pubkey |
| 1 | owner | Pubkey |
| 2… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | token | Pubkey |
| 1 | authority | Pubkey |
| 2… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | account | Pubkey |
| 1 | mint | Pubkey |
| 2 | owner | Pubkey |
| 3… | remaining | Vec< |
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 usingsol_and deserializing the return data as a little-endianget_ return_ data u64.
Discriminator 15 · data GetAccountDataSize · accounts GetAccountDataSizeInstructionAccounts.
No data fields.
Required accounts: 1; extras go to remaining.
Fields of GetAccountDataSizeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
HarvestWithheldTokensToMint#
From the program's IDL:
Permissionless instruction to transfer all withheld tokens to the mint.
Succeeds for frozen accounts.
Accounts provided should include theTransferFeeAmountextension.
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:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
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 theTransferFeeAmountandConfidentialTransferAccountextension. 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:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
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.
TheInitializeAccountinstruction requires no signers and MUST be included within the same Transaction as the system program'sCreateAccountinstruction 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:
| # | Field | Type |
|---|---|---|
| 0 | account | Pubkey |
| 1 | mint | Pubkey |
| 2 | owner | Pubkey |
| 3 | rent | Pubkey |
| 4… | remaining | Vec< |
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
AccountInfootherwise.
Discriminator 10 · data InitializeAccount2 · accounts InitializeAccount2InstructionAccounts.
| Field | Type | Description |
|---|---|---|
owner | Pubkey | The new account's owner/multisignature. |
Required accounts: 3; extras go to remaining.
Fields of InitializeAccount2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | account | Pubkey |
| 1 | mint | Pubkey |
| 2 | rent | Pubkey |
| 3… | remaining | Vec< |
InitializeAccount3#
From the program's IDL:
Like InitializeAccount2, but does not require the Rent sysvar to be provided.
Discriminator 12 · data InitializeAccount3 · accounts InitializeAccount3InstructionAccounts.
| Field | Type | Description |
|---|---|---|
owner | Pubkey | The new account's owner/multisignature. |
Required accounts: 2; extras go to remaining.
Fields of InitializeAccount3InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | account | Pubkey |
| 1 | mint | Pubkey |
| 2… | remaining | Vec< |
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:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
authority | Option< | Optional authority to set the withdraw withheld authority ElGamal key |
withdraw_ | Option< | Withheld fees from accounts must be encrypted with this ElGamal key |
Required accounts: 1; extras go to remaining.
Fields of InitializeConfidentialTransferFeeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
InitializeConfidentialTransferMint#
From the program's IDL:
Initializes confidential transfers for a mint.
TheConfidentialTransferInstruction::instruction requires no signers and MUST be included within the same Transaction asInitializeMint TokenInstruction::. Otherwise another party can initialize the configuration.InitializeMint
The instruction fails if theTokenInstruction::instruction has already executed for the mint.InitializeMint
Discriminator 1b00 · data InitializeConfidentialTransferMint · accounts InitializeConfidentialTransferMintInstructionAccounts.
Known issue: the discriminator is 2 bytes but InitializeConfidentialTransferMint:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
authority | Option< | Authority to modify the ConfidentialTransferMint configuration and to approve new accounts. |
auto_ | bool | Determines if newly configured accounts must be approved by the authority before they may be used by the user. |
auditor_ | Option< | New authority to decode any transfer amount in a confidential transfer. |
Required accounts: 1; extras go to remaining.
Fields of InitializeConfidentialTransferMintInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
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 beforeInitializeMint.
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:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
state | AccountState | The state each new token account should start with. |
Required accounts: 1; extras go to remaining.
Fields of InitializeDefaultAccountStateInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
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 beforeInitializeMint.
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:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
authority | Option< | The public key for the account that can update the group member address. |
member_ | Option< | The account address that holds the member. |
Required accounts: 1; extras go to remaining.
Fields of InitializeGroupMemberPointerInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
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 beforeInitializeMint.
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:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
authority | Option< | The public key for the account that can update the group address. |
group_ | Option< | The account address that holds the group. |
Required accounts: 1; extras go to remaining.
Fields of InitializeGroupPointerInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
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 beforeInitializeAccount.
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:
| # | Field | Type |
|---|---|---|
| 0 | account | Pubkey |
| 1… | remaining | Vec< |
InitializeInterestBearingMint#
From the program's IDL:
Initialize a new mint with the
InterestBearingextension.
Fails if the mint has already been initialized, so must be called beforeInitializeMint.
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:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
rate_ | Option< | The public key for the account that can update the rate |
rate | i16 | The initial interest rate |
Required accounts: 1; extras go to remaining.
Fields of InitializeInterestBearingMintInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
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 beforeInitializeMint.
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:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
authority | Option< | The public key for the account that can update the metadata address. |
metadata_ | Option< | The account address that holds the metadata. |
Required accounts: 1; extras go to remaining.
Fields of InitializeMetadataPointerInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
InitializeMint#
From the program's IDL:
Initializes a new mint and optionally deposits all the newly minted tokens in an account.
TheInitializeMintinstruction requires no signers and MUST be included within the same Transaction as the system program'sCreateAccountinstruction that creates the account being initialized.
Otherwise another party can acquire ownership of the uninitialized account.
Discriminator 00 · data InitializeMint · accounts InitializeMintInstructionAccounts.
| Field | Type | Description |
|---|---|---|
decimals | u8 | Number of decimals in token account amounts. |
mint_ | Pubkey | Minting authority. |
freeze_ | Option< | Optional authority that can freeze token accounts. |
Required accounts: 2; extras go to remaining.
Fields of InitializeMintInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | rent | Pubkey |
| 2… | remaining | Vec< |
InitializeMint2#
From the program's IDL:
Like [
InitializeMint], but does not require the Rent sysvar to be provided.
Discriminator 14 · data InitializeMint2 · accounts InitializeMint2InstructionAccounts.
| Field | Type | Description |
|---|---|---|
decimals | u8 | Number of base 10 digits to the right of the decimal place. |
mint_ | Pubkey | The authority/multisignature to mint tokens. |
freeze_ | Option< | The optional freeze authority/multisignature of the mint. |
Required accounts: 1; extras go to remaining.
Fields of InitializeMint2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
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 beforeInitializeMint. 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.
| Field | Type | Description |
|---|---|---|
close_ | Option< | Authority that must sign the CloseAccount instruction on a mint. |
Required accounts: 1; extras go to remaining.
Fields of InitializeMintCloseAuthorityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
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.
TheInitializeMultisiginstruction requires no signers and MUST be included within the same Transaction as the system program'sCreateAccountinstruction that creates the account being initialized.
Otherwise another party can acquire ownership of the uninitialized account.
Discriminator 02 · data InitializeMultisig · accounts InitializeMultisigInstructionAccounts.
| Field | Type | Description |
|---|---|---|
m | u8 | The number of signers (M) required to validate this multisignature account. |
Required accounts: 2; extras go to remaining.
Fields of InitializeMultisigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | multisig | Pubkey |
| 1 | rent | Pubkey |
| 2… | remaining | Vec< |
InitializeMultisig2#
From the program's IDL:
Like InitializeMultisig, but does not require the Rent sysvar to be provided.
Discriminator 13 · data InitializeMultisig2 · accounts InitializeMultisig2InstructionAccounts.
| Field | Type | Description |
|---|---|---|
m | u8 | The number of signers (M) required to validate this multisignature account. |
Required accounts: 1; extras go to remaining.
Fields of InitializeMultisig2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | multisig | Pubkey |
| 1… | remaining | Vec< |
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 beforeInitializeMint.
Discriminator 20 · data InitializeNonTransferableMint · accounts InitializeNonTransferableMintInstructionAccounts.
No data fields.
Required accounts: 1; extras go to remaining.
Fields of InitializeNonTransferableMintInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
InitializePausableConfig#
From the program's IDL:
Initialize a new mint with the
Pausableextension.
Fails if the mint has already been initialized, so must be called beforeInitializeMint.
Discriminator 2c00 · data InitializePausableConfig · accounts InitializePausableConfigInstructionAccounts.
Known issue: the discriminator is 2 bytes but InitializePausableConfig:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
authority | Option< | The authority that can pause and resume the mint. |
Required accounts: 1; extras go to remaining.
Fields of InitializePausableConfigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
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 beforeInitializeMint. 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.
| Field | Type | Description |
|---|---|---|
delegate | Pubkey | Authority that may sign for Transfers and Burns on any account |
Required accounts: 1; extras go to remaining.
Fields of InitializePermanentDelegateInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
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 beforeInitializeMint.
Discriminator 2e00 · data InitializePermissionedBurn · accounts InitializePermissionedBurnInstructionAccounts.
Known issue: the discriminator is 2 bytes but InitializePermissionedBurn:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
authority | Pubkey | The public key for the account that is required for token burning. |
Required accounts: 1; extras go to remaining.
Fields of InitializePermissionedBurnInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
InitializeScaledUiAmountMint#
From the program's IDL:
Initialize a new mint with the
ScaledUiAmountextension.
Fails if the mint has already been initialized, so must be called beforeInitializeMint. 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:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
authority | Option< | The authority that can update the multiplier |
multiplier | f64 | The initial multiplier for the scaled UI extension |
Required accounts: 1; extras go to remaining.
Fields of InitializeScaledUiAmountMintInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
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.
| Field | Type | Description |
|---|---|---|
update_ | Option< | Update authority for the group |
max_size | u64 | The maximum number of group members |
Required accounts: 3; extras go to remaining.
Fields of InitializeTokenGroupInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | group | Pubkey |
| 1 | mint | Pubkey |
| 2 | mint_ | Pubkey |
| 3… | remaining | Vec< |
InitializeTokenGroupMember#
From the program's IDL:
Initialize a new
Memberof aGroup
Assumes theGrouphas 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:
| # | Field | Type |
|---|---|---|
| 0 | member | Pubkey |
| 1 | member_mint | Pubkey |
| 2 | member_ | Pubkey |
| 3 | group | Pubkey |
| 4 | group_ | Pubkey |
| 5… | remaining | Vec< |
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.
| Field | Type | Description |
|---|---|---|
name | String | Longer name of the token. |
symbol | String | Shortened symbol of the token. |
uri | String | URI pointing to more metadata (image, video, etc.). |
Required accounts: 4; extras go to remaining.
Fields of InitializeTokenMetadataInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | metadata | Pubkey |
| 1 | update_ | Pubkey |
| 2 | mint | Pubkey |
| 3 | mint_ | Pubkey |
| 4… | remaining | Vec< |
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 beforeInitializeMint. 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:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
transfer_ | Option< | Pubkey that may update the fees. |
withdraw_ | Option< | Withdraw instructions must be signed by this key. |
transfer_ | u16 | Amount of transfer collected as fees, expressed as basis points of the transfer amount. |
maximum_fee | u64 | Maximum fee assessed on transfers. |
Required accounts: 1; extras go to remaining.
Fields of InitializeTransferFeeConfigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
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 beforeInitializeMint. 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:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
authority | Option< | The public key for the account that can update the program id |
program_id | Option< | The program id that performs logic during transfers |
Required accounts: 1; extras go to remaining.
Fields of InitializeTransferHookInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
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.
| Field | Type | Description |
|---|---|---|
amount | u64 | The amount of new tokens to mint. |
Required accounts: 3; extras go to remaining.
Fields of MintToInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | token | Pubkey |
| 2 | mint_ | Pubkey |
| 3… | remaining | Vec< |
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.
| Field | Type | Description |
|---|---|---|
amount | u64 | The amount of new tokens to mint. |
decimals | u8 | Expected 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:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | token | Pubkey |
| 2 | mint_ | Pubkey |
| 3… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | authority | Pubkey |
| 2… | remaining | Vec< |
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:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
amount | u64 | The amount of tokens to burn. |
Required accounts: 4; extras go to remaining.
Fields of PermissionedBurnInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | account | Pubkey |
| 1 | mint | Pubkey |
| 2 | permissioned_ | Pubkey |
| 3 | authority | Pubkey |
| 4… | remaining | Vec< |
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:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
amount | u64 | The amount of tokens to burn. |
decimals | u8 | Expected 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:
| # | Field | Type |
|---|---|---|
| 0 | account | Pubkey |
| 1 | mint | Pubkey |
| 2 | permissioned_ | Pubkey |
| 3 | authority | Pubkey |
| 4… | remaining | Vec< |
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.
| Field | Type | Description |
|---|---|---|
new_ | Vec< | New extension types to include in the reallocated account. |
Required accounts: 4; extras go to remaining.
Fields of ReallocateInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token | Pubkey |
| 1 | payer | Pubkey |
| 2 | system_ | Pubkey |
| 3 | owner | Pubkey |
| 4… | remaining | Vec< |
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.
| Field | Type | Description |
|---|---|---|
idempotent | bool | If the idempotent flag is set to true, then the instruction will not error if the key does not exist |
key | String | Key to remove in the additional metadata portion. |
Required accounts: 2; extras go to remaining.
Fields of RemoveTokenMetadataKeyInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | metadata | Pubkey |
| 1 | update_ | Pubkey |
| 2… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | authority | Pubkey |
| 2… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | source | Pubkey |
| 1 | owner | Pubkey |
| 2… | remaining | Vec< |
SetAuthority#
From the program's IDL:
Sets a new authority of a mint or account.
Discriminator 06 · data SetAuthority · accounts SetAuthorityInstructionAccounts.
| Field | Type | Description |
|---|---|---|
authority_ | AuthorityType | The type of authority to update. |
new_ | Option< | The new authority |
Required accounts: 2; extras go to remaining.
Fields of SetAuthorityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owned | Pubkey |
| 1 | owner | Pubkey |
| 2… | remaining | Vec< |
SetTransferFee#
From the program's IDL:
Set transfer fee. Only supported for mints that include the
TransferFeeConfigextension.
Discriminator 1a05 · data SetTransferFee · accounts SetTransferFeeInstructionAccounts.
Known issue: the discriminator is 2 bytes but SetTransferFee:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
transfer_ | u16 | Amount of transfer collected as fees, expressed as basis points of the transfer amount. |
maximum_fee | u64 | Maximum fee assessed on transfers. |
Required accounts: 2; extras go to remaining.
Fields of SetTransferFeeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | transfer_ | Pubkey |
| 2… | remaining | Vec< |
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 usessystem_to move lamports to a wrapped token account, and needs to have its tokeninstruction:: transfer amountfield updated.
Discriminator 11 · data SyncNative · accounts SyncNativeInstructionAccounts.
No data fields.
Required accounts: 1; extras go to remaining.
Fields of SyncNativeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | account | Pubkey |
| 1… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | account | Pubkey |
| 1 | mint | Pubkey |
| 2 | owner | Pubkey |
| 3… | remaining | Vec< |
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.
| Field | Type | Description |
|---|---|---|
amount | u64 | The amount of tokens to transfer. |
Required accounts: 3; extras go to remaining.
Fields of TransferInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | source | Pubkey |
| 1 | destination | Pubkey |
| 2 | authority | Pubkey |
| 3… | remaining | Vec< |
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.
| Field | Type | Description |
|---|---|---|
amount | u64 | The amount of tokens to transfer. |
decimals | u8 | Expected 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:
| # | Field | Type |
|---|---|---|
| 0 | source | Pubkey |
| 1 | mint | Pubkey |
| 2 | destination | Pubkey |
| 3 | authority | Pubkey |
| 4… | remaining | Vec< |
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 useTransferCheckedWithFeewith any mint.
Discriminator 1a01 · data TransferCheckedWithFee · accounts TransferCheckedWithFeeInstructionAccounts.
Known issue: the discriminator is 2 bytes but TransferCheckedWithFee:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
amount | u64 | The amount of tokens to transfer. |
decimals | u8 | Expected number of base 10 digits to the right of the decimal place. |
fee | u64 | Expected 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:
| # | Field | Type |
|---|---|---|
| 0 | source | Pubkey |
| 1 | mint | Pubkey |
| 2 | destination | Pubkey |
| 3 | authority | Pubkey |
| 4… | remaining | Vec< |
UiAmountToAmount#
From the program's IDL:
Convert a UiAmount of tokens to a little-endian
u64raw 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 usingsol_and deserializing the return data as a little-endianget_ return_ data u64.
Discriminator 18 · data UiAmountToAmount · accounts UiAmountToAmountInstructionAccounts.
| Field | Type | Description |
|---|---|---|
ui_amount | String | The ui_amount of tokens to reformat. |
Required accounts: 1; extras go to remaining.
Fields of UiAmountToAmountInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1… | remaining | Vec< |
UnwrapLamports#
From the program's IDL:
Transfer lamports from a native SOL account to a destination account.
Discriminator 2d · data UnwrapLamports · accounts UnwrapLamportsInstructionAccounts.
| Field | Type | Description |
|---|---|---|
amount | Option<u64> | The amount of lamports to transfer. |
Required accounts: 3; extras go to remaining.
Fields of UnwrapLamportsInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | source | Pubkey |
| 1 | destination | Pubkey |
| 2 | authority | Pubkey |
| 3… | remaining | Vec< |
UpdateConfidentialTransferMint#
From the program's IDL:
Updates the confidential transfer mint configuration for a mint.
UseTokenInstruction::to update the confidential transfer mint authority.SetAuthority
Discriminator 1b01 · data UpdateConfidentialTransferMint · accounts UpdateConfidentialTransferMintInstructionAccounts.
Known issue: the discriminator is 2 bytes but UpdateConfidentialTransferMint:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
auto_ | bool | Determines if newly configured accounts must be approved by the authority before they may be used by the user. |
auditor_ | Option< | New authority to decode any transfer amount in a confidential transfer. |
Required accounts: 2; extras go to remaining.
Fields of UpdateConfidentialTransferMintInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | authority | Pubkey |
| 2… | remaining | Vec< |
UpdateDefaultAccountState#
From the program's IDL:
Update the default state for new Accounts. Only supported for mints that include the
DefaultAccountStateextension.
Discriminator 1c01 · data UpdateDefaultAccountState · accounts UpdateDefaultAccountStateInstructionAccounts.
Known issue: the discriminator is 2 bytes but UpdateDefaultAccountState:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
state | AccountState | The state each new token account should start with. |
Required accounts: 2; extras go to remaining.
Fields of UpdateDefaultAccountStateInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | freeze_ | Pubkey |
| 2… | remaining | Vec< |
UpdateGroupMemberPointer#
From the program's IDL:
Update the group member pointer address. Only supported for mints that include the
GroupMemberPointerextension.
Discriminator 2901 · data UpdateGroupMemberPointer · accounts UpdateGroupMemberPointerInstructionAccounts.
Known issue: the discriminator is 2 bytes but UpdateGroupMemberPointer:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
member_ | Option< | The new account address that holds the member. |
Required accounts: 2; extras go to remaining.
Fields of UpdateGroupMemberPointerInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | group_ | Pubkey |
| 2… | remaining | Vec< |
UpdateGroupPointer#
From the program's IDL:
Update the group pointer address. Only supported for mints that include the
GroupPointerextension.
Discriminator 2801 · data UpdateGroupPointer · accounts UpdateGroupPointerInstructionAccounts.
Known issue: the discriminator is 2 bytes but UpdateGroupPointer:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
group_ | Option< | The new account address that holds the group configurations. |
Required accounts: 2; extras go to remaining.
Fields of UpdateGroupPointerInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | group_ | Pubkey |
| 2… | remaining | Vec< |
UpdateMetadataPointer#
From the program's IDL:
Update the metadata pointer address. Only supported for mints that include the
MetadataPointerextension.
Discriminator 2701 · data UpdateMetadataPointer · accounts UpdateMetadataPointerInstructionAccounts.
Known issue: the discriminator is 2 bytes but UpdateMetadataPointer:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
metadata_ | Option< | The new account address that holds the metadata. |
Required accounts: 2; extras go to remaining.
Fields of UpdateMetadataPointerInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | metadata_ | Pubkey |
| 2… | remaining | Vec< |
UpdateMultiplierScaledUiMint#
From the program's IDL:
Update the multiplier. Only supported for mints that include the
ScaledUiAmountConfigextension.
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:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
multiplier | f64 | The new multiplier for the scaled UI extension |
effective_ | i64 | The timestamp at which the new multiplier will take effect |
Required accounts: 2; extras go to remaining.
Fields of UpdateMultiplierScaledUiMintInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | authority | Pubkey |
| 2… | remaining | Vec< |
UpdateRateInterestBearingMint#
From the program's IDL:
Update the interest rate. Only supported for mints that include the
InterestBearingConfigextension.
Discriminator 2101 · data UpdateRateInterestBearingMint · accounts UpdateRateInterestBearingMintInstructionAccounts.
Known issue: the discriminator is 2 bytes but UpdateRateInterestBearingMint:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
rate | i16 | The interest rate to update. |
Required accounts: 2; extras go to remaining.
Fields of UpdateRateInterestBearingMintInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | rate_ | Pubkey |
| 2… | remaining | Vec< |
UpdateTokenGroupMaxSize#
From the program's IDL:
Update the max size of a
Group.
Discriminator 6c25ab8ff81e126e · data UpdateTokenGroupMaxSize · accounts UpdateTokenGroupMaxSizeInstructionAccounts.
| Field | Type | Description |
|---|---|---|
max_size | u64 | New max size for the group |
Required accounts: 2; extras go to remaining.
Fields of UpdateTokenGroupMaxSizeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | group | Pubkey |
| 1 | update_ | Pubkey |
| 2… | remaining | Vec< |
UpdateTokenGroupUpdateAuthority#
From the program's IDL:
Update the authority of a
Group.
Discriminator a1695801edddd8cb · data UpdateTokenGroupUpdateAuthority · accounts UpdateTokenGroupUpdateAuthorityInstructionAccounts.
| Field | Type | Description |
|---|---|---|
new_ | Option< | New authority for the group, or unset if None |
Required accounts: 2; extras go to remaining.
Fields of UpdateTokenGroupUpdateAuthorityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | group | Pubkey |
| 1 | update_ | Pubkey |
| 2… | remaining | Vec< |
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.
| Field | Type | Description |
|---|---|---|
field | TokenMetadataField | Field to update in the metadata. |
value | String | Value to write for the field. |
Required accounts: 2; extras go to remaining.
Fields of UpdateTokenMetadataFieldInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | metadata | Pubkey |
| 1 | update_ | Pubkey |
| 2… | remaining | Vec< |
UpdateTokenMetadataUpdateAuthority#
From the program's IDL:
Updates the token-metadata authority.
Discriminator d7e4a6e45464567b · data UpdateTokenMetadataUpdateAuthority · accounts UpdateTokenMetadataUpdateAuthorityInstructionAccounts.
| Field | Type | Description |
|---|---|---|
new_ | Option< | New authority for the token metadata, or unset if None |
Required accounts: 2; extras go to remaining.
Fields of UpdateTokenMetadataUpdateAuthorityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | metadata | Pubkey |
| 1 | update_ | Pubkey |
| 2… | remaining | Vec< |
UpdateTransferHook#
From the program's IDL:
Update the transfer hook program id. Only supported for mints that include the
TransferHookextension.
Accounts expected by this instruction: 0.[writable]The mint.
[signer]The transfer hook authority.
Discriminator 2401 · data UpdateTransferHook · accounts UpdateTransferHookInstructionAccounts.
Known issue: the discriminator is 2 bytes but UpdateTransferHook:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
program_id | Option< | The program id that performs logic during transfers |
Required accounts: 2; extras go to remaining.
Fields of UpdateTransferHookInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | authority | Pubkey |
| 2… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | source_ | Pubkey |
| 1 | destination_ | Pubkey |
| 2 | authority | Pubkey |
| 3… | remaining | Vec< |
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:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
num_ | u8 | Number of token accounts harvested. |
Required accounts: 3; extras go to remaining.
Fields of WithdrawWithheldTokensFromAccountsInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | fee_ | Pubkey |
| 2 | withdraw_ | Pubkey |
| 3… | remaining | Vec< |
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.
UseHarvestWithheldTokensToMintandWithdrawWithheldTokensFromMintas alternative. Must be accompanied by the VerifyWithdrawWithheldTokens instruction.
Discriminator 2502 · data WithdrawWithheldTokensFromAccountsForConfidentialTransferFee · accounts WithdrawWithheldTokensFromAccountsForConfidentialTransferFeeInstructionAccounts.
Known issue: the discriminator is 2 bytes but WithdrawWithheldTokensFromAccountsForConfidentialTransferFee:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
num_ | u8 | Number of token accounts harvested |
proof_ | i8 | Proof instruction offset |
new_ | DecryptableBalance | The new decryptable balance in the destination token account |
Required accounts: 5; extras go to remaining.
Fields of WithdrawWithheldTokensFromAccountsForConfidentialTransferFeeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | destination | Pubkey |
| 2 | instructions_ | Pubkey |
| 3 | record | Option< |
| 4 | authority | Pubkey |
| 5… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | fee_ | Pubkey |
| 2 | withdraw_ | Pubkey |
| 3… | remaining | Vec< |
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:: reads the fields from byte 1, so the decoded field values are wrong in 2.0.0. Read them from input. instead.
| Field | Type | Description |
|---|---|---|
proof_ | i8 | Proof instruction offset |
new_ | DecryptableBalance | The new decryptable balance in the destination token account |
Required accounts: 5; extras go to remaining.
Fields of WithdrawWithheldTokensFromMintForConfidentialTransferFeeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | mint | Pubkey |
| 1 | destination | Pubkey |
| 2 | instructions_ | Pubkey |
| 3 | record | Option< |
| 4 | authority | Pubkey |
| 5… | remaining | Vec< |
Accounts#
Variants of Token2022Account. Each wraps a boxed struct from carbon_. decode_ only considers accounts owned by PROGRAM_ID and returns the first variant that matches.
Mint#
Unpacked with spl_ · accounts::.
| Field | Type | Description |
|---|---|---|
mint_ | Option< | 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. |
supply | u64 | Total supply of tokens. |
decimals | u8 | Number of base 10 digits to the right of the decimal place. |
is_ | bool | Is true if this structure has been initialized. |
freeze_ | Option< | Optional authority to freeze token accounts. |
extensions | Option< | The extensions activated on the mint account. |
Multisig#
Unpacked with spl_ · accounts::.
| Field | Type | Description |
|---|---|---|
m | u8 | Number of signers required. |
n | u8 | Number of valid signers. |
is_ | bool | Is true if this structure has been initialized. |
signers | [Pubkey; 11] | Signer public keys. |
Token#
Unpacked with spl_ · accounts::.
| Field | Type | Description |
|---|---|---|
mint | Pubkey | The mint associated with this account. |
owner | Pubkey | The owner of this account. |
amount | u64 | The amount of tokens this account holds. |
delegate | Option< | If delegate is Some then delegated_ represents the amount authorized by the delegate. |
state | AccountState | The account's state. |
is_native | Option<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_ | u64 | The amount delegated. |
close_ | Option< | Optional authority to close the account. |
extensions | Option< | The extensions activated on the token account. |
Types#
Types used by the instructions, accounts and events above, exported from carbon_.
AccountState#
Enum types::.
| Variant |
|---|
Uninitialized |
Initialized |
Frozen |
AuthorityType#
Enum types::.
| 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:: ([u8; 36]).
EncryptedBalance#
From the program's IDL:
ElGamal ciphertext containing an account balance.
Tuple struct types:: ([u8; 64]).
Extension#
Enum types::.
| Variant | Fields |
|---|---|
Uninitialized | |
TransferFeeConfig | transfer_: Option<, withdraw_: Option<, withheld_: u64, older_: TransferFee, newer_: TransferFee |
TransferFeeAmount | withheld_: u64 |
MintCloseAuthority | close_: Option< |
ConfidentialTransferMint | authority: Option<, auto_: bool, auditor_: Option< |
ConfidentialTransferAccount | approved: bool, elgamal_: Pubkey, pending_: EncryptedBalance, pending_: EncryptedBalance, available_: EncryptedBalance, decryptable_: DecryptableBalance, allow_: bool, allow_: bool, pending_: u64, maximum_: u64, expected_: u64, actual_: u64 |
DefaultAccountState | state: AccountState |
ImmutableOwner | |
MemoTransfer | require_: bool |
NonTransferable | |
InterestBearingConfig | rate_: Option<, initialization_: u64, pre_: i16, last_: u64, current_: i16 |
CpiGuard | lock_cpi: bool |
PermanentDelegate | delegate: Option< |
NonTransferableAccount | |
TransferHook | authority: Option<, program_id: Option< |
TransferHookAccount | transferring: bool |
ConfidentialTransferFee | authority: Option<, elgamal_: Pubkey, harvest_: bool, withheld_: EncryptedBalance |
ConfidentialTransferFeeAmount | withheld_: EncryptedBalance |
MetadataPointer | authority: Option<, metadata_: Option< |
TokenMetadata | update_: Option<, mint: Pubkey, name: String, symbol: String, uri: String, additional_: HashMap< |
GroupPointer | authority: Option<, group_: Option< |
TokenGroup | update_: Option<, mint: Pubkey, size: u64, max_size: u64 |
GroupMemberPointer | authority: Option<, member_: Option< |
TokenGroupMember | mint: Pubkey, group: Pubkey, member_: u64 |
ConfidentialMintBurn | |
ScaledUiAmountConfig | authority: Option<, multiplier: f64, new_: u64, new_: f64 |
PausableConfig | authority: Option<, paused: bool |
PausableAccount | |
PermissionedBurn | authority: Option< |
TransferFeeConfig fields:
| Field | Type | Description |
|---|---|---|
transfer_ | Option< | Optional authority to set the fee. |
withdraw_ | Option< | Withdraw from mint instructions must be signed by this key. |
withheld_ | u64 | Withheld transfer fee tokens that have been moved to the mint for withdrawal. |
older_ | TransferFee | Older transfer fee, used if the current epoch < newerTransferFee.epoch. |
newer_ | TransferFee | Newer transfer fee, used if the current epoch >= newerTransferFee.epoch. |
TransferFeeAmount fields:
| Field | Type | Description |
|---|---|---|
withheld_ | u64 | Withheld transfer fee tokens that can be claimed by the fee authority. |
ConfidentialTransferMint fields:
| Field | Type | Description |
|---|---|---|
authority | Option< | Authority to modify the ConfidentialTransferMint configuration and to approve new accounts (if auto_ is true). The legacy Token Multisig account is not supported as the authority. |
auto_ | bool | Indicate 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::). |
auditor_ | Option< | Authority to decode any transfer amount in a confidential transfer. |
ConfidentialTransferAccount fields:
| Field | Type | Description |
|---|---|---|
approved | bool | true if this account has been approved for use. All confidential transfer operations for the account will fail until approval is granted. |
elgamal_ | Pubkey | The public key associated with ElGamal encryption. |
pending_ | EncryptedBalance | The low 16 bits of the pending balance (encrypted by elgamal_). |
pending_ | EncryptedBalance | The high 32 bits of the pending balance (encrypted by elgamal_). |
available_ | EncryptedBalance | The available balance (encrypted by encrypiton_). |
decryptable_ | DecryptableBalance | The decryptable available balance. |
allow_ | bool | If false, the extended account rejects any incoming confidential transfers. |
allow_ | bool | If false, the base account rejects any incoming transfers. |
pending_ | u64 | The total number of Deposit and Transfer instructions that have credited pending_. |
maximum_ | u64 | The maximum number of Deposit and Transfer instructions that can credit pending_ before the ApplyPendingBalance instruction is executed. |
expected_ | u64 | The expected_ value that was included in the last ApplyPendingBalance instruction. |
actual_ | u64 | The actual pending_ when the last ApplyPendingBalance instruction was executed. |
MemoTransfer fields:
| Field | Type | Description |
|---|---|---|
require_ | bool | Require transfers into this account to be accompanied by a memo. |
CpiGuard fields:
| Field | Type | Description |
|---|---|---|
lock_cpi | bool | Lock certain token operations from taking place within CPI for this account. |
TransferHook fields:
| Field | Type | Description |
|---|---|---|
authority | Option< | The transfer hook update authority. |
program_id | Option< | The transfer hook program account. |
TransferHookAccount fields:
| Field | Type | Description |
|---|---|---|
transferring | bool | Whether or not this account is currently transferring tokens True during the transfer hook cpi, otherwise false. |
ConfidentialTransferFee fields:
| Field | Type | Description |
|---|---|---|
authority | Option< | Optional authority to set the withdraw withheld authority ElGamal key. |
elgamal_ | Pubkey | Withheld 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_ | bool | If false, the harvest of withheld tokens to mint is rejected. |
withheld_ | EncryptedBalance | Withheld confidential transfer fee tokens that have been moved to the mint for withdrawal. |
ConfidentialTransferFeeAmount fields:
| Field | Type | Description |
|---|---|---|
withheld_ | EncryptedBalance | Amount withheld during confidential transfers, to be harvest to the mint. |
MetadataPointer fields:
| Field | Type | Description |
|---|---|---|
authority | Option< | Optional authority that can set the metadata address. |
metadata_ | Option< | Optional Account Address that holds the metadata. |
TokenMetadata fields:
| Field | Type | Description |
|---|---|---|
update_ | Option< | The authority that can sign to update the metadata. |
mint | Pubkey | The associated mint, used to counter spoofing to be sure that metadata belongs to a particular mint. |
name | String | The longer name of the token. |
symbol | String | The shortened symbol for the token. |
uri | String | The URI pointing to richer metadata. |
additional_ | HashMap< | Any additional metadata about the token as key-value pairs. |
GroupPointer fields:
| Field | Type | Description |
|---|---|---|
authority | Option< | Optional authority that can set the group address. |
group_ | Option< | Optional account address that holds the group. |
TokenGroup fields:
| Field | Type | Description |
|---|---|---|
update_ | Option< | The authority that can sign to update the group. |
mint | Pubkey | The associated mint, used to counter spoofing to be sure that group belongs to a particular mint. |
size | u64 | The current number of group members. |
max_size | u64 | The maximum number of group members. |
GroupMemberPointer fields:
| Field | Type | Description |
|---|---|---|
authority | Option< | Optional authority that can set the member address. |
member_ | Option< | Optional account address that holds the member. |
TokenGroupMember fields:
| Field | Type | Description |
|---|---|---|
mint | Pubkey | The associated mint, used to counter spoofing to be sure that member belongs to a particular mint. |
group | Pubkey | The pubkey of the TokenGroup. |
member_ | u64 | The member number. |
PermissionedBurn fields:
| Field | Type | Description |
|---|---|---|
authority | Option< | 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::.
| 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::.
| Variant | Fields |
|---|---|
Name | |
Symbol | |
Uri | |
Key | String |
TransferFee#
Struct types::.
| Field | Type | Description |
|---|---|---|
epoch | u64 | First epoch where the transfer fee takes effect. |
maximum_fee | u64 | Maximum fee assessed on transfers, expressed as an amount of tokens. |
transfer_ | u16 | Amount of transfer collected as fees, expressed as basis points of the transfer amount, ie. increments of 0.01%. |