# Token-2022 decoder (Carbon 2.0)

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

`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](https://carbon.sevenlabs.org/concepts/decoders.md) for how decoders plug into a pipeline.

|                  |                                                                                                               |
| ---------------- | ------------------------------------------------------------------------------------------------------------- |
| Crate            | [`carbon-token-2022-decoder`](https://crates.io/crates/carbon-token-2022-decoder/2.0.0) 2.0.0                 |
| Install          | `cargo add carbon-token-2022-decoder@2.0.0`                                                                   |
| Program ID       | `TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb` (`carbon_token_2022_decoder::PROGRAM_ID`)                       |
| Category         | [Core & SPL](https://carbon.sevenlabs.org/decoders/core-and-spl.md)                                           |
| Decoder          | `carbon_token_2022_decoder::Token2022Decoder`                                                                 |
| Instruction enum | `instructions::Token2022Instruction`                                                                          |
| Account enum     | `accounts::Token2022Account`                                                                                  |
| Features         | `serde`, `postgres`, `graphql` (none enabled by default)                                                      |
| API docs         | [docs.rs/carbon-token-2022-decoder/2.0.0](https://docs.rs/carbon-token-2022-decoder/2.0.0)                    |
| Source           | [decoders/token-2022-decoder](https://github.com/sevenlabs-hq/carbon/tree/v2.0.0/decoders/token-2022-decoder) |

Other core and SPL decoders: [Address Lookup Table](https://carbon.sevenlabs.org/decoders/address-lookup-table.md), [Associated Token Account](https://carbon.sevenlabs.org/decoders/associated-token-account.md), [SPL Memo](https://carbon.sevenlabs.org/decoders/memo-program.md), [SPL Name Service](https://carbon.sevenlabs.org/decoders/name-service.md), [SPL Token](https://carbon.sevenlabs.org/decoders/token-program.md), [Stake Program](https://carbon.sevenlabs.org/decoders/stake-program.md), [System Program](https://carbon.sevenlabs.org/decoders/system-program.md). To decode several in one pipeline, see [core and SPL program decoders](https://carbon.sevenlabs.org/decoders/core-and-spl.md).

Guide: [Index token transfers](https://carbon.sevenlabs.org/guides/index-token-transfers.md).

> **Warning: Known issue in 2.0.0.** 34 extension instructions with a two-byte discriminator decode their data fields one byte too early (`decode` skips 1 byte instead of 2), so the field values are wrong: [`ApplyConfidentialPendingBalance`](#applyconfidentialpendingbalance), [`ConfidentialDeposit`](#confidentialdeposit), [`ConfidentialTransfer`](#confidentialtransfer), [`ConfidentialTransferWithFee`](#confidentialtransferwithfee), [`ConfidentialWithdraw`](#confidentialwithdraw), [`ConfigureConfidentialTransferAccount`](#configureconfidentialtransferaccount), [`EmptyConfidentialTransferAccount`](#emptyconfidentialtransferaccount), [`InitializeConfidentialTransferFee`](#initializeconfidentialtransferfee), [`InitializeConfidentialTransferMint`](#initializeconfidentialtransfermint), [`InitializeDefaultAccountState`](#initializedefaultaccountstate), [`InitializeGroupMemberPointer`](#initializegroupmemberpointer), [`InitializeGroupPointer`](#initializegrouppointer), [`InitializeInterestBearingMint`](#initializeinterestbearingmint), [`InitializeMetadataPointer`](#initializemetadatapointer), [`InitializePausableConfig`](#initializepausableconfig), [`InitializePermissionedBurn`](#initializepermissionedburn), [`InitializeScaledUiAmountMint`](#initializescaleduiamountmint), [`InitializeTransferFeeConfig`](#initializetransferfeeconfig), [`InitializeTransferHook`](#initializetransferhook), [`PermissionedBurn`](#permissionedburn), [`PermissionedBurnChecked`](#permissionedburnchecked), [`SetTransferFee`](#settransferfee), [`TransferCheckedWithFee`](#transfercheckedwithfee), [`UpdateConfidentialTransferMint`](#updateconfidentialtransfermint), [`UpdateDefaultAccountState`](#updatedefaultaccountstate), [`UpdateGroupMemberPointer`](#updategroupmemberpointer), [`UpdateGroupPointer`](#updategrouppointer), [`UpdateMetadataPointer`](#updatemetadatapointer), [`UpdateMultiplierScaledUiMint`](#updatemultiplierscaleduimint), [`UpdateRateInterestBearingMint`](#updaterateinterestbearingmint), [`UpdateTransferHook`](#updatetransferhook), [`WithdrawWithheldTokensFromAccounts`](#withdrawwithheldtokensfromaccounts), [`WithdrawWithheldTokensFromAccountsForConfidentialTransferFee`](#withdrawwithheldtokensfromaccountsforconfidentialtransferfee), [`WithdrawWithheldTokensFromMintForConfidentialTransferFee`](#withdrawwithheldtokensfrommintforconfidentialtransferfee). The variant (which instruction it is) and its accounts are correct; read the fields from `input.raw_instruction.data[2..]` instead.

The `serde` feature derives `Serialize`/`Deserialize` on every type, `postgres` adds tables and processors for [Postgres](https://carbon.sevenlabs.org/guides/postgres.md), and `graphql` adds a schema for the [GraphQL server](https://carbon.sevenlabs.org/guides/graphql.md).

## Usage

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

```sh
cargo add carbon-core@2.0.0 carbon-token-2022-decoder@2.0.0 carbon-rpc-transaction-crawler-datasource@2.0.0 carbon-log-metrics@2.0.0 env_logger tokio --features tokio/full
```

`src/main.rs`:

```rust
use {
    carbon_core::{
        error::CarbonResult, instruction::InstructionProcessorInputType, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_token_2022_decoder::{instructions::Token2022Instruction, Token2022Decoder, PROGRAM_ID},
    carbon_rpc_transaction_crawler_datasource::{ConnectionConfig, Filters, RpcTransactionCrawler},
    std::sync::Arc,
};

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

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

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

struct InstructionLogger;

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

```sh
RUST_LOG=info cargo run
```

Each `TransferChecked` instruction prints one line with the transaction signature and the decoded `TransferChecked` data. The public endpoint rate-limits requests, so the first lines can take a while; use your own RPC URL for anything beyond a test. See [stream with RPC](https://carbon.sevenlabs.org/guides/stream-with-rpc.md) 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:

```sh
cargo add carbon-rpc-program-subscribe-datasource@2.0.0 solana-client@4.2.2
```

`src/main.rs`:

```rust
use {
    carbon_core::{
        account::AccountProcessorInputType, error::CarbonResult, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_token_2022_decoder::{accounts::Token2022Account, Token2022Decoder, PROGRAM_ID},
    carbon_rpc_program_subscribe_datasource::{Filters, RpcProgramSubscribe},
    solana_client::{
        rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig, UiAccountEncoding},
        rpc_filter::{Memcmp, RpcFilterType},
    },
    std::sync::Arc,
};

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

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

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

struct AccountLogger;

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

```sh
RUST_LOG=info cargo run
```

Each update to a `Mint` account prints its address and decoded fields; the program runs until you stop it. Cargo resolves `solana-client` to 4.2.2, the exact version the datasource pins, so both use the same `RpcProgramAccountsConfig` type. To load every existing account once instead of streaming changes, see [load account state](https://carbon.sevenlabs.org/guides/load-account-state.md).

## Instructions

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

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

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

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

### `AmountToUiAmount`

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

Discriminator `17` · data `AmountToUiAmount` · accounts `AmountToUiAmountInstructionAccounts`.

| 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<AccountMeta>` |

### `ApplyConfidentialPendingBalance`

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

Discriminator `1b08` · data `ApplyConfidentialPendingBalance` · accounts `ApplyConfidentialPendingBalanceInstructionAccounts`.

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

| Field                                     | Type                                        | Description                                                                                                |
| ----------------------------------------- | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `expected_pending_balance_credit_counter` | `u64`                                       | The expected number of pending balance credits since the last successful `ApplyPendingBalance` instruction |
| `new_decryptable_available_balance`       | [`DecryptableBalance`](#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<AccountMeta>` |

### `Approve`

> _From the program's IDL:_
>
> Approves a delegate. A delegate is given the authority over tokens on behalf of the source account's owner.

Discriminator `04` · data `Approve` · accounts `ApproveInstructionAccounts`.

| 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<AccountMeta>` |

### `ApproveChecked`

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

Discriminator `0d` · data `ApproveChecked` · accounts `ApproveCheckedInstructionAccounts`.

| 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<AccountMeta>` |

### `ApproveConfidentialTransferAccount`

> _From the program's IDL:_
>
> Approves a token account for confidential transfers.\
> Approval is only required when the `ConfidentialTransferMint::approve_new_accounts` field is set in the\
> SPL Token mint.  This instruction must be executed after the account owner configures their account for confidential transfers with `ConfidentialTransferInstruction::ConfigureAccount`.

Discriminator `1b03` · data `ApproveConfidentialTransferAccount` · accounts `ApproveConfidentialTransferAccountInstructionAccounts`.

No data fields.

Required accounts: 3; extras go to `remaining`.

Fields of `ApproveConfidentialTransferAccountInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `token`     | `Pubkey`           |
| 1  | `mint`      | `Pubkey`           |
| 2  | `authority` | `Pubkey`           |
| 3… | `remaining` | `Vec<AccountMeta>` |

### `Burn`

> _From the program's IDL:_
>
> Burns tokens by removing them from an account. `Burn` does not support accounts associated with the native mint, use `CloseAccount` instead.

Discriminator `08` · data `Burn` · accounts `BurnInstructionAccounts`.

| 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<AccountMeta>` |

### `BurnChecked`

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

Discriminator `0f` · data `BurnChecked` · accounts `BurnCheckedInstructionAccounts`.

| 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<AccountMeta>` |

### `CloseAccount`

> _From the program's IDL:_
>
> Close an account by transferring all its SOL to the destination account.\
> Non-native accounts may only be closed if its token amount is zero.

Discriminator `09` · data `CloseAccount` · accounts `CloseAccountInstructionAccounts`.

No data fields.

Required accounts: 3; extras go to `remaining`.

Fields of `CloseAccountInstructionAccounts`, in account order:

| #  | Field         | Type               |
| -- | ------------- | ------------------ |
| 0  | `account`     | `Pubkey`           |
| 1  | `destination` | `Pubkey`           |
| 2  | `owner`       | `Pubkey`           |
| 3… | `remaining`   | `Vec<AccountMeta>` |

### `ConfidentialDeposit`

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

Discriminator `1b05` · data `ConfidentialDeposit` · accounts `ConfidentialDepositInstructionAccounts`.

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

| 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<AccountMeta>` |

### `ConfidentialTransfer`

> _From the program's IDL:_
>
> Transfer tokens confidentially.\
> In order for this instruction to be successfully processed, it must be accompanied by the following list of `zk_elgamal_proof` program instructions:
>
> - `VerifyCiphertextCommitmentEquality`
> - `VerifyBatchedGroupedCiphertext3HandlesValidity`
> - `VerifyBatchedRangeProofU128`
>
> These instructions can be accompanied in the same transaction or can be pre-verified into a context state account, in which case, only their context state account addresses need to be provided.\
> Fails if the associated mint is extended as `NonTransferable`.

Discriminator `1b07` · data `ConfidentialTransfer` · accounts `ConfidentialTransferInstructionAccounts`.

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

| Field                                          | Type                                        | Description                                                                                                                                                                                                                     |
| ---------------------------------------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `new_source_decryptable_available_balance`     | [`DecryptableBalance`](#decryptablebalance) | The new source decryptable balance if the transfer succeeds.                                                                                                                                                                    |
| `equality_proof_instruction_offset`            | `i8`                                        | Relative location of the `ProofInstruction::VerifyCiphertextCommitmentEquality` instruction to the `Transfer` instruction in the transaction. If the offset is `0`, then use a context state account for the proof.             |
| `ciphertext_validity_proof_instruction_offset` | `i8`                                        | Relative location of the `ProofInstruction::VerifyBatchedGroupedCiphertext3HandlesValidity` instruction to the `Transfer` instruction in the transaction. If the offset is `0`, then use a context state account for the proof. |
| `range_proof_instruction_offset`               | `i8`                                        | Relative location of the `ProofInstruction::BatchedRangeProofU128Data` instruction to the `Transfer` instruction in the transaction. If the offset is `0`, then use a context state account for the proof.                      |

Required accounts: 8; extras go to `remaining`.

Fields of `ConfidentialTransferInstructionAccounts`, in account order:

| #  | Field                        | Type               |
| -- | ---------------------------- | ------------------ |
| 0  | `source_token`               | `Pubkey`           |
| 1  | `mint`                       | `Pubkey`           |
| 2  | `destination_token`          | `Pubkey`           |
| 3  | `instructions_sysvar`        | `Option<Pubkey>`   |
| 4  | `equality_record`            | `Option<Pubkey>`   |
| 5  | `ciphertext_validity_record` | `Option<Pubkey>`   |
| 6  | `range_record`               | `Option<Pubkey>`   |
| 7  | `authority`                  | `Pubkey`           |
| 8… | `remaining`                  | `Vec<AccountMeta>` |

### `ConfidentialTransferWithFee`

> _From the program's IDL:_
>
> Transfer tokens confidentially with fee.\
> In order for this instruction to be successfully processed, it must be accompanied by the following list of `zk_elgamal_proof` program instructions:
>
> - `VerifyCiphertextCommitmentEquality`
> - `VerifyBatchedGroupedCiphertext3HandlesValidity` (transfer amount
>
> ciphertext)
>
> - `VerifyPercentageWithFee`
> - `VerifyBatchedGroupedCiphertext2HandlesValidity` (fee ciphertext)
> - `VerifyBatchedRangeProofU256`
>
> These instructions can be accompanied in the same transaction or can be pre-verified into a context state account, in which case, only their context state account addresses need to be provided.\
> The same restrictions for the `Transfer` applies to `TransferWithFee`. Namely, the instruction fails if the associated mint is extended as `NonTransferable`.

Discriminator `1b0d` · data `ConfidentialTransferWithFee` · accounts `ConfidentialTransferWithFeeInstructionAccounts`.

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

| Field                                                          | Type                                        | Description                                                                                                                                                                                                                            |
| -------------------------------------------------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `new_source_decryptable_available_balance`                     | [`DecryptableBalance`](#decryptablebalance) | The new source decryptable balance if the transfer succeeds.                                                                                                                                                                           |
| `equality_proof_instruction_offset`                            | `i8`                                        | Relative location of the `ProofInstruction::VerifyCiphertextCommitmentEquality` instruction to the `TransferWithFee` instruction in the transaction. If the offset is `0`, then use a context state account for the proof.             |
| `transfer_amount_ciphertext_validity_proof_instruction_offset` | `i8`                                        | Relative location of the `ProofInstruction::VerifyBatchedGroupedCiphertext3HandlesValidity` instruction to the `TransferWithFee` instruction in the transaction. If the offset is `0`, then use a context state account for the proof. |
| `fee_sigma_proof_instruction_offset`                           | `i8`                                        | Relative location of the `ProofInstruction::VerifyPercentageWithFee` instruction to the `TransferWithFee` instruction in the transaction. If the offset is `0`, then use a context state account for the proof.                        |
| `fee_ciphertext_validity_proof_instruction_offset`             | `i8`                                        | Relative location of the `ProofInstruction::VerifyBatchedGroupedCiphertext2HandlesValidity` instruction to the `TransferWithFee` instruction in the transaction. If the offset is `0`, then use a context state account for the proof. |
| `range_proof_instruction_offset`                               | `i8`                                        | Relative location of the `ProofInstruction::BatchedRangeProofU256Data` instruction to the `TransferWithFee` instruction in the transaction. If the offset is `0`, then use a context state account for the proof.                      |

Required accounts: 10; extras go to `remaining`.

Fields of `ConfidentialTransferWithFeeInstructionAccounts`, in account order:

| #   | Field                                        | Type               |
| --- | -------------------------------------------- | ------------------ |
| 0   | `source_token`                               | `Pubkey`           |
| 1   | `mint`                                       | `Pubkey`           |
| 2   | `destination_token`                          | `Pubkey`           |
| 3   | `instructions_sysvar`                        | `Option<Pubkey>`   |
| 4   | `equality_record`                            | `Option<Pubkey>`   |
| 5   | `transfer_amount_ciphertext_validity_record` | `Option<Pubkey>`   |
| 6   | `fee_sigma_record`                           | `Option<Pubkey>`   |
| 7   | `fee_ciphertext_validity_record`             | `Option<Pubkey>`   |
| 8   | `range_record`                               | `Option<Pubkey>`   |
| 9   | `authority`                                  | `Pubkey`           |
| 10… | `remaining`                                  | `Vec<AccountMeta>` |

### `ConfidentialWithdraw`

> _From the program's IDL:_
>
> Withdraw SPL Tokens from the available balance of a confidential token account.\
> In order for this instruction to be successfully processed, it must be accompanied by the following list of `zk_elgamal_proof` program instructions:
>
> - `VerifyCiphertextCommitmentEquality`
> - `VerifyBatchedRangeProofU64`
>
> These instructions can be accompanied in the same transaction or can be pre-verified into a context state account, in which case, only their context state account address need to be provided.\
> Fails if the source or destination accounts are frozen.\
> Fails if the associated mint is extended as `NonTransferable`.

Discriminator `1b06` · data `ConfidentialWithdraw` · accounts `ConfidentialWithdrawInstructionAccounts`.

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

| 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_decryptable_available_balance` | [`DecryptableBalance`](#decryptablebalance) | The new decryptable balance if the withdrawal succeeds.                                                                                                                                                             |
| `equality_proof_instruction_offset` | `i8`                                        | Relative location of the `ProofInstruction::VerifyCiphertextCommitmentEquality` instruction to the `Withdraw` instruction in the transaction. If the offset is `0`, then use a context state account for the proof. |
| `range_proof_instruction_offset`    | `i8`                                        | Relative location of the `ProofInstruction::BatchedRangeProofU64` instruction to the `Withdraw` instruction in the transaction. If the offset is `0`, then use a context state account for the proof.               |

Required accounts: 6; extras go to `remaining`.

Fields of `ConfidentialWithdrawInstructionAccounts`, in account order:

| #  | Field                 | Type               |
| -- | --------------------- | ------------------ |
| 0  | `token`               | `Pubkey`           |
| 1  | `mint`                | `Pubkey`           |
| 2  | `instructions_sysvar` | `Option<Pubkey>`   |
| 3  | `equality_record`     | `Option<Pubkey>`   |
| 4  | `range_record`        | `Option<Pubkey>`   |
| 5  | `authority`           | `Pubkey`           |
| 6… | `remaining`           | `Vec<AccountMeta>` |

### `ConfigureConfidentialTransferAccount`

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

Discriminator `1b02` · data `ConfigureConfidentialTransferAccount` · accounts `ConfigureConfidentialTransferAccountInstructionAccounts`.

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

| Field                                    | Type                                        | Description                                                                                                                                                                                                  |
| ---------------------------------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `decryptable_zero_balance`               | [`DecryptableBalance`](#decryptablebalance) | The decryptable balance (always 0) once the configure account succeeds.                                                                                                                                      |
| `maximum_pending_balance_credit_counter` | `u64`                                       | The maximum number of despots and transfers that an account can receiver before the `ApplyPendingBalance` is executed                                                                                        |
| `proof_instruction_offset`               | `i8`                                        | Relative location of the `ProofInstruction::ZeroCiphertextProof` instruction to the `ConfigureAccount` instruction in the transaction. If the offset is `0`, then use a context state account for the proof. |

Required accounts: 5; extras go to `remaining`.

Fields of `ConfigureConfidentialTransferAccountInstructionAccounts`, in account order:

| #  | Field                                  | Type               |
| -- | -------------------------------------- | ------------------ |
| 0  | `token`                                | `Pubkey`           |
| 1  | `mint`                                 | `Pubkey`           |
| 2  | `instructions_sysvar_or_context_state` | `Pubkey`           |
| 3  | `record`                               | `Option<Pubkey>`   |
| 4  | `authority`                            | `Pubkey`           |
| 5… | `remaining`                            | `Vec<AccountMeta>` |

### `CreateNativeMint`

> _From the program's IDL:_
>
> Creates the native mint.\
> This instruction only needs to be invoked once after deployment and is permissionless. Wrapped SOL (`native_mint::id()`) will not be available until this instruction is successfully executed.

Discriminator `1f` · data `CreateNativeMint` · accounts `CreateNativeMintInstructionAccounts`.

No data fields.

Required accounts: 3; extras go to `remaining`.

Fields of `CreateNativeMintInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `payer`          | `Pubkey`           |
| 1  | `native_mint`    | `Pubkey`           |
| 2  | `system_program` | `Pubkey`           |
| 3… | `remaining`      | `Vec<AccountMeta>` |

### `DisableConfidentialCredits`

> _From the program's IDL:_
>
> Configure a confidential extension account to reject any incoming confidential transfers.\
> If the `allow_non_confidential_credits` field is `true`, then the base account can still receive non-confidential transfers.\
> This instruction can be used to disable confidential payments after a token account has already been extended for confidential transfers.

Discriminator `1b0a` · data `DisableConfidentialCredits` · accounts `DisableConfidentialCreditsInstructionAccounts`.

No data fields.

Required accounts: 2; extras go to `remaining`.

Fields of `DisableConfidentialCreditsInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `token`     | `Pubkey`           |
| 1  | `authority` | `Pubkey`           |
| 2… | `remaining` | `Vec<AccountMeta>` |

### `DisableCpiGuard`

> _From the program's IDL:_
>
> Allow all token operations to happen via CPI as normal.\
> Implicitly initializes the extension in the case where it is not present.

Discriminator `2201` · data `DisableCpiGuard` · accounts `DisableCpiGuardInstructionAccounts`.

No data fields.

Required accounts: 2; extras go to `remaining`.

Fields of `DisableCpiGuardInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `token`     | `Pubkey`           |
| 1  | `owner`     | `Pubkey`           |
| 2… | `remaining` | `Vec<AccountMeta>` |

### `DisableHarvestToMint`

> _From the program's IDL:_
>
> Configure a confidential transfer fee mint to reject any harvested confidential fees.

Discriminator `2505` · data `DisableHarvestToMint` · accounts `DisableHarvestToMintInstructionAccounts`.

No data fields.

Required accounts: 2; extras go to `remaining`.

Fields of `DisableHarvestToMintInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `mint`      | `Pubkey`           |
| 1  | `authority` | `Pubkey`           |
| 2… | `remaining` | `Vec<AccountMeta>` |

### `DisableMemoTransfers`

> _From the program's IDL:_
>
> Stop requiring memos for transfers into this Account.\
> Implicitly initializes the extension in the case where it is not present.

Discriminator `1e01` · data `DisableMemoTransfers` · accounts `DisableMemoTransfersInstructionAccounts`.

No data fields.

Required accounts: 2; extras go to `remaining`.

Fields of `DisableMemoTransfersInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `token`     | `Pubkey`           |
| 1  | `owner`     | `Pubkey`           |
| 2… | `remaining` | `Vec<AccountMeta>` |

### `DisableNonConfidentialCredits`

> _From the program's IDL:_
>
> Configure an account with the confidential extension to reject any incoming non-confidential transfers.\
> This instruction can be used to configure a confidential extension account to exclusively receive confidential payments.

Discriminator `1b0c` · data `DisableNonConfidentialCredits` · accounts `DisableNonConfidentialCreditsInstructionAccounts`.

No data fields.

Required accounts: 2; extras go to `remaining`.

Fields of `DisableNonConfidentialCreditsInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `token`     | `Pubkey`           |
| 1  | `authority` | `Pubkey`           |
| 2… | `remaining` | `Vec<AccountMeta>` |

### `EmitTokenMetadata`

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

Discriminator `faa6b4fa0d0cb846` · data `EmitTokenMetadata` · accounts `EmitTokenMetadataInstructionAccounts`.

| 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<AccountMeta>` |

### `EmptyConfidentialTransferAccount`

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

Discriminator `1b04` · data `EmptyConfidentialTransferAccount` · accounts `EmptyConfidentialTransferAccountInstructionAccounts`.

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

| Field                      | Type | Description                                                                                                                                                                                             |
| -------------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `proof_instruction_offset` | `i8` | Relative location of the `ProofInstruction::VerifyCloseAccount` instruction to the `EmptyAccount` instruction in the transaction. If the offset is `0`, then use a context state account for the proof. |

Required accounts: 4; extras go to `remaining`.

Fields of `EmptyConfidentialTransferAccountInstructionAccounts`, in account order:

| #  | Field                                  | Type               |
| -- | -------------------------------------- | ------------------ |
| 0  | `token`                                | `Pubkey`           |
| 1  | `instructions_sysvar_or_context_state` | `Pubkey`           |
| 2  | `record`                               | `Option<Pubkey>`   |
| 3  | `authority`                            | `Pubkey`           |
| 4… | `remaining`                            | `Vec<AccountMeta>` |

### `EnableConfidentialCredits`

> _From the program's IDL:_
>
> Configure a confidential extension account to accept incoming confidential transfers.

Discriminator `1b09` · data `EnableConfidentialCredits` · accounts `EnableConfidentialCreditsInstructionAccounts`.

No data fields.

Required accounts: 2; extras go to `remaining`.

Fields of `EnableConfidentialCreditsInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `token`     | `Pubkey`           |
| 1  | `authority` | `Pubkey`           |
| 2… | `remaining` | `Vec<AccountMeta>` |

### `EnableCpiGuard`

> _From the program's IDL:_
>
> Lock certain token operations from taking place within CPI for this Account, namely:
>
> - Transfer and Burn must go through a delegate.
> - CloseAccount can only return lamports to owner.
> - SetAuthority can only be used to remove an existing close authority.
> - Approve is disallowed entirely.
>
> In addition, CPI Guard cannot be enabled or disabled via CPI.

Discriminator `2200` · data `EnableCpiGuard` · accounts `EnableCpiGuardInstructionAccounts`.

No data fields.

Required accounts: 2; extras go to `remaining`.

Fields of `EnableCpiGuardInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `token`     | `Pubkey`           |
| 1  | `owner`     | `Pubkey`           |
| 2… | `remaining` | `Vec<AccountMeta>` |

### `EnableHarvestToMint`

> _From the program's IDL:_
>
> Configure a confidential transfer fee mint to accept harvested confidential fees.

Discriminator `2504` · data `EnableHarvestToMint` · accounts `EnableHarvestToMintInstructionAccounts`.

No data fields.

Required accounts: 2; extras go to `remaining`.

Fields of `EnableHarvestToMintInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `mint`      | `Pubkey`           |
| 1  | `authority` | `Pubkey`           |
| 2… | `remaining` | `Vec<AccountMeta>` |

### `EnableMemoTransfers`

> _From the program's IDL:_
>
> Require memos for transfers into this Account. Adds the MemoTransfer extension to the Account, if it doesn't already exist.

Discriminator `1e00` · data `EnableMemoTransfers` · accounts `EnableMemoTransfersInstructionAccounts`.

No data fields.

Required accounts: 2; extras go to `remaining`.

Fields of `EnableMemoTransfersInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `token`     | `Pubkey`           |
| 1  | `owner`     | `Pubkey`           |
| 2… | `remaining` | `Vec<AccountMeta>` |

### `EnableNonConfidentialCredits`

> _From the program's IDL:_
>
> Configure an account with the confidential extension to accept incoming non-confidential transfers.

Discriminator `1b0b` · data `EnableNonConfidentialCredits` · accounts `EnableNonConfidentialCreditsInstructionAccounts`.

No data fields.

Required accounts: 2; extras go to `remaining`.

Fields of `EnableNonConfidentialCreditsInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `token`     | `Pubkey`           |
| 1  | `authority` | `Pubkey`           |
| 2… | `remaining` | `Vec<AccountMeta>` |

### `FreezeAccount`

> _From the program's IDL:_
>
> Freeze an Initialized account using the Mint's freeze_authority (if set).

Discriminator `0a` · data `FreezeAccount` · accounts `FreezeAccountInstructionAccounts`.

No data fields.

Required accounts: 3; extras go to `remaining`.

Fields of `FreezeAccountInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `account`   | `Pubkey`           |
| 1  | `mint`      | `Pubkey`           |
| 2  | `owner`     | `Pubkey`           |
| 3… | `remaining` | `Vec<AccountMeta>` |

### `GetAccountDataSize`

> _From the program's IDL:_
>
> Gets the required size of an account for the given mint as a little-endian `u64`.\
> Return data can be fetched using `sol_get_return_data` and deserializing the return data as a little-endian `u64`.

Discriminator `15` · data `GetAccountDataSize` · accounts `GetAccountDataSizeInstructionAccounts`.

No data fields.

Required accounts: 1; extras go to `remaining`.

Fields of `GetAccountDataSizeInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `mint`      | `Pubkey`           |
| 1… | `remaining` | `Vec<AccountMeta>` |

### `HarvestWithheldTokensToMint`

> _From the program's IDL:_
>
> Permissionless instruction to transfer all withheld tokens to the mint.\
> Succeeds for frozen accounts.\
> Accounts provided should include the `TransferFeeAmount` extension.\
> If not, the account is skipped.

Discriminator `1a04` · data `HarvestWithheldTokensToMint` · accounts `HarvestWithheldTokensToMintInstructionAccounts`.

No data fields.

Required accounts: 1; extras go to `remaining`.

Fields of `HarvestWithheldTokensToMintInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `mint`      | `Pubkey`           |
| 1… | `remaining` | `Vec<AccountMeta>` |

### `HarvestWithheldTokensToMintForConfidentialTransferFee`

> _From the program's IDL:_
>
> Permissionless instruction to transfer all withheld confidential tokens to the mint. Succeeds for frozen accounts.\
> Accounts provided should include both the `TransferFeeAmount` and `ConfidentialTransferAccount` extension. If not, the account is skipped.

Discriminator `2503` · data `HarvestWithheldTokensToMintForConfidentialTransferFee` · accounts `HarvestWithheldTokensToMintForConfidentialTransferFeeInstructionAccounts`.

No data fields.

Required accounts: 1; extras go to `remaining`.

Fields of `HarvestWithheldTokensToMintForConfidentialTransferFeeInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `mint`      | `Pubkey`           |
| 1… | `remaining` | `Vec<AccountMeta>` |

### `InitializeAccount`

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

Discriminator `01` · data `InitializeAccount` · accounts `InitializeAccountInstructionAccounts`.

No data fields.

Required accounts: 4; extras go to `remaining`.

Fields of `InitializeAccountInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `account`   | `Pubkey`           |
| 1  | `mint`      | `Pubkey`           |
| 2  | `owner`     | `Pubkey`           |
| 3  | `rent`      | `Pubkey`           |
| 4… | `remaining` | `Vec<AccountMeta>` |

### `InitializeAccount2`

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

Discriminator `10` · data `InitializeAccount2` · accounts `InitializeAccount2InstructionAccounts`.

| 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<AccountMeta>` |

### `InitializeAccount3`

> _From the program's IDL:_
>
> Like InitializeAccount2, but does not require the Rent sysvar to be provided.

Discriminator `12` · data `InitializeAccount3` · accounts `InitializeAccount3InstructionAccounts`.

| 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<AccountMeta>` |

### `InitializeConfidentialTransferFee`

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

Discriminator `2500` · data `InitializeConfidentialTransferFee` · accounts `InitializeConfidentialTransferFeeInstructionAccounts`.

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

| Field                                         | Type             | Description                                                           |
| --------------------------------------------- | ---------------- | --------------------------------------------------------------------- |
| `authority`                                   | `Option<Pubkey>` | Optional authority to set the withdraw withheld authority ElGamal key |
| `withdraw_withheld_authority_el_gamal_pubkey` | `Option<Pubkey>` | Withheld fees from accounts must be encrypted with this ElGamal key   |

Required accounts: 1; extras go to `remaining`.

Fields of `InitializeConfidentialTransferFeeInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `mint`      | `Pubkey`           |
| 1… | `remaining` | `Vec<AccountMeta>` |

### `InitializeConfidentialTransferMint`

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

Discriminator `1b00` · data `InitializeConfidentialTransferMint` · accounts `InitializeConfidentialTransferMintInstructionAccounts`.

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

| Field                       | Type             | Description                                                                                                      |
| --------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------- |
| `authority`                 | `Option<Pubkey>` | Authority to modify the `ConfidentialTransferMint` configuration and to approve new accounts.                    |
| `auto_approve_new_accounts` | `bool`           | Determines if newly configured accounts must be approved by the `authority` before they may be used by the user. |
| `auditor_elgamal_pubkey`    | `Option<Pubkey>` | New authority to decode any transfer amount in a confidential transfer.                                          |

Required accounts: 1; extras go to `remaining`.

Fields of `InitializeConfidentialTransferMintInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `mint`      | `Pubkey`           |
| 1… | `remaining` | `Vec<AccountMeta>` |

### `InitializeDefaultAccountState`

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

Discriminator `1c00` · data `InitializeDefaultAccountState` · accounts `InitializeDefaultAccountStateInstructionAccounts`.

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

| Field   | Type                            | Description                                         |
| ------- | ------------------------------- | --------------------------------------------------- |
| `state` | [`AccountState`](#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<AccountMeta>` |

### `InitializeGroupMemberPointer`

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

Discriminator `2900` · data `InitializeGroupMemberPointer` · accounts `InitializeGroupMemberPointerInstructionAccounts`.

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

| Field            | Type             | Description                                                              |
| ---------------- | ---------------- | ------------------------------------------------------------------------ |
| `authority`      | `Option<Pubkey>` | The public key for the account that can update the group member address. |
| `member_address` | `Option<Pubkey>` | 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<AccountMeta>` |

### `InitializeGroupPointer`

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

Discriminator `2800` · data `InitializeGroupPointer` · accounts `InitializeGroupPointerInstructionAccounts`.

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

| Field           | Type             | Description                                                       |
| --------------- | ---------------- | ----------------------------------------------------------------- |
| `authority`     | `Option<Pubkey>` | The public key for the account that can update the group address. |
| `group_address` | `Option<Pubkey>` | 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<AccountMeta>` |

### `InitializeImmutableOwner`

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

Discriminator `16` · data `InitializeImmutableOwner` · accounts `InitializeImmutableOwnerInstructionAccounts`.

No data fields.

Required accounts: 1; extras go to `remaining`.

Fields of `InitializeImmutableOwnerInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `account`   | `Pubkey`           |
| 1… | `remaining` | `Vec<AccountMeta>` |

### `InitializeInterestBearingMint`

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

Discriminator `2100` · data `InitializeInterestBearingMint` · accounts `InitializeInterestBearingMintInstructionAccounts`.

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

| Field            | Type             | Description                                             |
| ---------------- | ---------------- | ------------------------------------------------------- |
| `rate_authority` | `Option<Pubkey>` | 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<AccountMeta>` |

### `InitializeMetadataPointer`

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

Discriminator `2700` · data `InitializeMetadataPointer` · accounts `InitializeMetadataPointerInstructionAccounts`.

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

| Field              | Type             | Description                                                          |
| ------------------ | ---------------- | -------------------------------------------------------------------- |
| `authority`        | `Option<Pubkey>` | The public key for the account that can update the metadata address. |
| `metadata_address` | `Option<Pubkey>` | 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<AccountMeta>` |

### `InitializeMint`

> _From the program's IDL:_
>
> Initializes a new mint and optionally deposits all the newly minted tokens in an account.\
> The `InitializeMint` instruction requires no signers and MUST be included within the same Transaction as the system program's `CreateAccount` instruction that creates the account being initialized.\
> Otherwise another party can acquire ownership of the uninitialized account.

Discriminator `00` · data `InitializeMint` · accounts `InitializeMintInstructionAccounts`.

| Field              | Type             | Description                                        |
| ------------------ | ---------------- | -------------------------------------------------- |
| `decimals`         | `u8`             | Number of decimals in token account amounts.       |
| `mint_authority`   | `Pubkey`         | Minting authority.                                 |
| `freeze_authority` | `Option<Pubkey>` | 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<AccountMeta>` |

### `InitializeMint2`

> _From the program's IDL:_
>
> Like \[`InitializeMint`], but does not require the Rent sysvar to be provided.

Discriminator `14` · data `InitializeMint2` · accounts `InitializeMint2InstructionAccounts`.

| Field              | Type             | Description                                                 |
| ------------------ | ---------------- | ----------------------------------------------------------- |
| `decimals`         | `u8`             | Number of base 10 digits to the right of the decimal place. |
| `mint_authority`   | `Pubkey`         | The authority/multisignature to mint tokens.                |
| `freeze_authority` | `Option<Pubkey>` | 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<AccountMeta>` |

### `InitializeMintCloseAuthority`

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

Discriminator `19` · data `InitializeMintCloseAuthority` · accounts `InitializeMintCloseAuthorityInstructionAccounts`.

| Field             | Type             | Description                                                        |
| ----------------- | ---------------- | ------------------------------------------------------------------ |
| `close_authority` | `Option<Pubkey>` | 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<AccountMeta>` |

### `InitializeMultisig`

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

Discriminator `02` · data `InitializeMultisig` · accounts `InitializeMultisigInstructionAccounts`.

| 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<AccountMeta>` |

### `InitializeMultisig2`

> _From the program's IDL:_
>
> Like InitializeMultisig, but does not require the Rent sysvar to be provided.

Discriminator `13` · data `InitializeMultisig2` · accounts `InitializeMultisig2InstructionAccounts`.

| 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<AccountMeta>` |

### `InitializeNonTransferableMint`

> _From the program's IDL:_
>
> Initialize the non transferable extension for the given mint account\
> Fails if the account has already been initialized, so must be called before `InitializeMint`.

Discriminator `20` · data `InitializeNonTransferableMint` · accounts `InitializeNonTransferableMintInstructionAccounts`.

No data fields.

Required accounts: 1; extras go to `remaining`.

Fields of `InitializeNonTransferableMintInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `mint`      | `Pubkey`           |
| 1… | `remaining` | `Vec<AccountMeta>` |

### `InitializePausableConfig`

> _From the program's IDL:_
>
> Initialize a new mint with the `Pausable` extension.\
> Fails if the mint has already been initialized, so must be called before `InitializeMint`.

Discriminator `2c00` · data `InitializePausableConfig` · accounts `InitializePausableConfigInstructionAccounts`.

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

| Field       | Type             | Description                                       |
| ----------- | ---------------- | ------------------------------------------------- |
| `authority` | `Option<Pubkey>` | 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<AccountMeta>` |

### `InitializePermanentDelegate`

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

Discriminator `23` · data `InitializePermanentDelegate` · accounts `InitializePermanentDelegateInstructionAccounts`.

| Field      | Type     | Description                                                        |
| ---------- | -------- | ------------------------------------------------------------------ |
| `delegate` | `Pubkey` | Authority that may sign for `Transfer`s and `Burn`s on any account |

Required accounts: 1; extras go to `remaining`.

Fields of `InitializePermanentDelegateInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `mint`      | `Pubkey`           |
| 1… | `remaining` | `Vec<AccountMeta>` |

### `InitializePermissionedBurn`

> _From the program's IDL:_
>
> Require permissioned burn for the given mint account.\
> Fails if the mint has already been initialized, so must be called before `InitializeMint`.

Discriminator `2e00` · data `InitializePermissionedBurn` · accounts `InitializePermissionedBurnInstructionAccounts`.

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

| 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<AccountMeta>` |

### `InitializeScaledUiAmountMint`

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

Discriminator `2b00` · data `InitializeScaledUiAmountMint` · accounts `InitializeScaledUiAmountMintInstructionAccounts`.

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

| Field        | Type             | Description                                        |
| ------------ | ---------------- | -------------------------------------------------- |
| `authority`  | `Option<Pubkey>` | 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<AccountMeta>` |

### `InitializeTokenGroup`

> _From the program's IDL:_
>
> Initialize a new `Group`\
> Assumes one has already initialized a mint for the group.

Discriminator `79716c2736330004` · data `InitializeTokenGroup` · accounts `InitializeTokenGroupInstructionAccounts`.

| Field              | Type             | Description                         |
| ------------------ | ---------------- | ----------------------------------- |
| `update_authority` | `Option<Pubkey>` | 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_authority` | `Pubkey`           |
| 3… | `remaining`      | `Vec<AccountMeta>` |

### `InitializeTokenGroupMember`

> _From the program's IDL:_
>
> Initialize a new `Member` of a `Group`\
> Assumes the `Group` has already been initialized, as well as the mint for the member.

Discriminator `9820deb0dfed7486` · data `InitializeTokenGroupMember` · accounts `InitializeTokenGroupMemberInstructionAccounts`.

No data fields.

Required accounts: 5; extras go to `remaining`.

Fields of `InitializeTokenGroupMemberInstructionAccounts`, in account order:

| #  | Field                    | Type               |
| -- | ------------------------ | ------------------ |
| 0  | `member`                 | `Pubkey`           |
| 1  | `member_mint`            | `Pubkey`           |
| 2  | `member_mint_authority`  | `Pubkey`           |
| 3  | `group`                  | `Pubkey`           |
| 4  | `group_update_authority` | `Pubkey`           |
| 5… | `remaining`              | `Vec<AccountMeta>` |

### `InitializeTokenMetadata`

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

Discriminator `d2e11ea258b84d8d` · data `InitializeTokenMetadata` · accounts `InitializeTokenMetadataInstructionAccounts`.

| 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_authority` | `Pubkey`           |
| 2  | `mint`             | `Pubkey`           |
| 3  | `mint_authority`   | `Pubkey`           |
| 4… | `remaining`        | `Vec<AccountMeta>` |

### `InitializeTransferFeeConfig`

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

Discriminator `1a00` · data `InitializeTransferFeeConfig` · accounts `InitializeTransferFeeConfigInstructionAccounts`.

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

| Field                           | Type             | Description                                                                             |
| ------------------------------- | ---------------- | --------------------------------------------------------------------------------------- |
| `transfer_fee_config_authority` | `Option<Pubkey>` | Pubkey that may update the fees.                                                        |
| `withdraw_withheld_authority`   | `Option<Pubkey>` | Withdraw instructions must be signed by this key.                                       |
| `transfer_fee_basis_points`     | `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<AccountMeta>` |

### `InitializeTransferHook`

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

Discriminator `2400` · data `InitializeTransferHook` · accounts `InitializeTransferHookInstructionAccounts`.

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

| Field        | Type             | Description                                                   |
| ------------ | ---------------- | ------------------------------------------------------------- |
| `authority`  | `Option<Pubkey>` | The public key for the account that can update the program id |
| `program_id` | `Option<Pubkey>` | 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<AccountMeta>` |

### `MintTo`

> _From the program's IDL:_
>
> Mints new tokens to an account. The native mint does not support minting.

Discriminator `07` · data `MintTo` · accounts `MintToInstructionAccounts`.

| 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_authority` | `Pubkey`           |
| 3… | `remaining`      | `Vec<AccountMeta>` |

### `MintToChecked`

> _From the program's IDL:_
>
> Mints new tokens to an account. The native mint does not support minting.\
> This instruction differs from MintTo in that the decimals value is checked by the caller. This may be useful when creating transactions offline or within a hardware wallet.

Discriminator `0e` · data `MintToChecked` · accounts `MintToCheckedInstructionAccounts`.

| 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_authority` | `Pubkey`           |
| 3… | `remaining`      | `Vec<AccountMeta>` |

### `Pause`

> _From the program's IDL:_
>
> Pause the mint.\
> Fails if the mint is not pausable.

Discriminator `2c01` · data `Pause` · accounts `PauseInstructionAccounts`.

No data fields.

Required accounts: 2; extras go to `remaining`.

Fields of `PauseInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `mint`      | `Pubkey`           |
| 1  | `authority` | `Pubkey`           |
| 2… | `remaining` | `Vec<AccountMeta>` |

### `PermissionedBurn`

> _From the program's IDL:_
>
> Burn tokens when the mint has the permissioned burn extension enabled.

Discriminator `2e01` · data `PermissionedBurn` · accounts `PermissionedBurnInstructionAccounts`.

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

| 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_burn_authority` | `Pubkey`           |
| 3  | `authority`                   | `Pubkey`           |
| 4… | `remaining`                   | `Vec<AccountMeta>` |

### `PermissionedBurnChecked`

> _From the program's IDL:_
>
> Burn tokens with expected decimals when the mint has the permissioned burn extension enabled.

Discriminator `2e02` · data `PermissionedBurnChecked` · accounts `PermissionedBurnCheckedInstructionAccounts`.

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

| 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_burn_authority` | `Pubkey`           |
| 3  | `authority`                   | `Pubkey`           |
| 4… | `remaining`                   | `Vec<AccountMeta>` |

### `Reallocate`

> _From the program's IDL:_
>
> Check to see if a token account is large enough for a list of\
> ExtensionTypes, and if not, use reallocation to increase the data size.

Discriminator `1d` · data `Reallocate` · accounts `ReallocateInstructionAccounts`.

| Field                 | Type                                   | Description                                                |
| --------------------- | -------------------------------------- | ---------------------------------------------------------- |
| `new_extension_types` | [`Vec<ExtensionType>`](#extensiontype) | 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_program` | `Pubkey`           |
| 3  | `owner`          | `Pubkey`           |
| 4… | `remaining`      | `Vec<AccountMeta>` |

### `RemoveTokenMetadataKey`

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

Discriminator `ea122038598d25b5` · data `RemoveTokenMetadataKey` · accounts `RemoveTokenMetadataKeyInstructionAccounts`.

| 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_authority` | `Pubkey`           |
| 2… | `remaining`        | `Vec<AccountMeta>` |

### `Resume`

> _From the program's IDL:_
>
> Resume the mint.\
> Fails if the mint is not pausable.

Discriminator `2c02` · data `Resume` · accounts `ResumeInstructionAccounts`.

No data fields.

Required accounts: 2; extras go to `remaining`.

Fields of `ResumeInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `mint`      | `Pubkey`           |
| 1  | `authority` | `Pubkey`           |
| 2… | `remaining` | `Vec<AccountMeta>` |

### `Revoke`

> _From the program's IDL:_
>
> Revokes the delegate's authority.

Discriminator `05` · data `Revoke` · accounts `RevokeInstructionAccounts`.

No data fields.

Required accounts: 2; extras go to `remaining`.

Fields of `RevokeInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `source`    | `Pubkey`           |
| 1  | `owner`     | `Pubkey`           |
| 2… | `remaining` | `Vec<AccountMeta>` |

### `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_type` | [`AuthorityType`](#authoritytype) | The type of authority to update. |
| `new_authority`  | `Option<Pubkey>`                  | 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<AccountMeta>` |

### `SetTransferFee`

> _From the program's IDL:_
>
> Set transfer fee. Only supported for mints that include the `TransferFeeConfig` extension.

Discriminator `1a05` · data `SetTransferFee` · accounts `SetTransferFeeInstructionAccounts`.

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

| Field                       | Type  | Description                                                                             |
| --------------------------- | ----- | --------------------------------------------------------------------------------------- |
| `transfer_fee_basis_points` | `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_fee_config_authority` | `Pubkey`           |
| 2… | `remaining`                     | `Vec<AccountMeta>` |

### `SyncNative`

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

Discriminator `11` · data `SyncNative` · accounts `SyncNativeInstructionAccounts`.

No data fields.

Required accounts: 1; extras go to `remaining`.

Fields of `SyncNativeInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `account`   | `Pubkey`           |
| 1… | `remaining` | `Vec<AccountMeta>` |

### `ThawAccount`

> _From the program's IDL:_
>
> Thaw a Frozen account using the Mint's freeze_authority (if set).

Discriminator `0b` · data `ThawAccount` · accounts `ThawAccountInstructionAccounts`.

No data fields.

Required accounts: 3; extras go to `remaining`.

Fields of `ThawAccountInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `account`   | `Pubkey`           |
| 1  | `mint`      | `Pubkey`           |
| 2  | `owner`     | `Pubkey`           |
| 3… | `remaining` | `Vec<AccountMeta>` |

### `Transfer`

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

Discriminator `03` · data `Transfer` · accounts `TransferInstructionAccounts`.

| 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<AccountMeta>` |

### `TransferChecked`

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

Discriminator `0c` · data `TransferChecked` · accounts `TransferCheckedInstructionAccounts`.

| 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<AccountMeta>` |

### `TransferCheckedWithFee`

> _From the program's IDL:_
>
> Transfer, providing expected mint information and fees.\
> This instruction succeeds if the mint has no configured transfer fee and the provided fee is 0. This allows applications to use `TransferCheckedWithFee` with any mint.

Discriminator `1a01` · data `TransferCheckedWithFee` · accounts `TransferCheckedWithFeeInstructionAccounts`.

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

| 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<AccountMeta>` |

### `UiAmountToAmount`

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

Discriminator `18` · data `UiAmountToAmount` · accounts `UiAmountToAmountInstructionAccounts`.

| 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<AccountMeta>` |

### `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<AccountMeta>` |

### `UpdateConfidentialTransferMint`

> _From the program's IDL:_
>
> Updates the confidential transfer mint configuration for a mint.\
> Use `TokenInstruction::SetAuthority` to update the confidential transfer mint authority.

Discriminator `1b01` · data `UpdateConfidentialTransferMint` · accounts `UpdateConfidentialTransferMintInstructionAccounts`.

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

| Field                       | Type             | Description                                                                                                      |
| --------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------- |
| `auto_approve_new_accounts` | `bool`           | Determines if newly configured accounts must be approved by the `authority` before they may be used by the user. |
| `auditor_elgamal_pubkey`    | `Option<Pubkey>` | New authority to decode any transfer amount in a confidential transfer.                                          |

Required accounts: 2; extras go to `remaining`.

Fields of `UpdateConfidentialTransferMintInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `mint`      | `Pubkey`           |
| 1  | `authority` | `Pubkey`           |
| 2… | `remaining` | `Vec<AccountMeta>` |

### `UpdateDefaultAccountState`

> _From the program's IDL:_
>
> Update the default state for new Accounts. Only supported for mints that include the `DefaultAccountState` extension.

Discriminator `1c01` · data `UpdateDefaultAccountState` · accounts `UpdateDefaultAccountStateInstructionAccounts`.

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

| Field   | Type                            | Description                                         |
| ------- | ------------------------------- | --------------------------------------------------- |
| `state` | [`AccountState`](#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_authority` | `Pubkey`           |
| 2… | `remaining`        | `Vec<AccountMeta>` |

### `UpdateGroupMemberPointer`

> _From the program's IDL:_
>
> Update the group member pointer address. Only supported for mints that include the `GroupMemberPointer` extension.

Discriminator `2901` · data `UpdateGroupMemberPointer` · accounts `UpdateGroupMemberPointerInstructionAccounts`.

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

| Field            | Type             | Description                                    |
| ---------------- | ---------------- | ---------------------------------------------- |
| `member_address` | `Option<Pubkey>` | 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_member_pointer_authority` | `Pubkey`           |
| 2… | `remaining`                      | `Vec<AccountMeta>` |

### `UpdateGroupPointer`

> _From the program's IDL:_
>
> Update the group pointer address. Only supported for mints that include the `GroupPointer` extension.

Discriminator `2801` · data `UpdateGroupPointer` · accounts `UpdateGroupPointerInstructionAccounts`.

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

| Field           | Type             | Description                                                  |
| --------------- | ---------------- | ------------------------------------------------------------ |
| `group_address` | `Option<Pubkey>` | 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_pointer_authority` | `Pubkey`           |
| 2… | `remaining`               | `Vec<AccountMeta>` |

### `UpdateMetadataPointer`

> _From the program's IDL:_
>
> Update the metadata pointer address. Only supported for mints that include the `MetadataPointer` extension.

Discriminator `2701` · data `UpdateMetadataPointer` · accounts `UpdateMetadataPointerInstructionAccounts`.

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

| Field              | Type             | Description                                      |
| ------------------ | ---------------- | ------------------------------------------------ |
| `metadata_address` | `Option<Pubkey>` | 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_pointer_authority` | `Pubkey`           |
| 2… | `remaining`                  | `Vec<AccountMeta>` |

### `UpdateMultiplierScaledUiMint`

> _From the program's IDL:_
>
> Update the multiplier. Only supported for mints that include the `ScaledUiAmountConfig` extension.\
> You can set a specific timestamp for the multiplier to take effect.

Discriminator `2b01` · data `UpdateMultiplierScaledUiMint` · accounts `UpdateMultiplierScaledUiMintInstructionAccounts`.

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

| Field                 | Type  | Description                                                |
| --------------------- | ----- | ---------------------------------------------------------- |
| `multiplier`          | `f64` | The new multiplier for the scaled UI extension             |
| `effective_timestamp` | `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<AccountMeta>` |

### `UpdateRateInterestBearingMint`

> _From the program's IDL:_
>
> Update the interest rate. Only supported for mints that include the `InterestBearingConfig` extension.

Discriminator `2101` · data `UpdateRateInterestBearingMint` · accounts `UpdateRateInterestBearingMintInstructionAccounts`.

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

| 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_authority` | `Pubkey`           |
| 2… | `remaining`      | `Vec<AccountMeta>` |

### `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_authority` | `Pubkey`           |
| 2… | `remaining`        | `Vec<AccountMeta>` |

### `UpdateTokenGroupUpdateAuthority`

> _From the program's IDL:_
>
> Update the authority of a `Group`.

Discriminator `a1695801edddd8cb` · data `UpdateTokenGroupUpdateAuthority` · accounts `UpdateTokenGroupUpdateAuthorityInstructionAccounts`.

| Field                  | Type             | Description                                     |
| ---------------------- | ---------------- | ----------------------------------------------- |
| `new_update_authority` | `Option<Pubkey>` | 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_authority` | `Pubkey`           |
| 2… | `remaining`        | `Vec<AccountMeta>` |

### `UpdateTokenMetadataField`

> _From the program's IDL:_
>
> Updates a field in a token-metadata account.\
> The field can be one of the required fields (name, symbol, URI), or a totally new field denoted by a "key" string.\
> By the end of the instruction, the metadata account must be properly resized based on the new size of the TLV entry.
>
> - If the new size is larger, the program must first reallocate to
>
> avoid overwriting other TLV entries.
>
> - If the new size is smaller, the program must reallocate at the end
>
> so that it's possible to iterate over TLV entries

Discriminator `dde9312db5cadcc8` · data `UpdateTokenMetadataField` · accounts `UpdateTokenMetadataFieldInstructionAccounts`.

| Field   | Type                                        | Description                      |
| ------- | ------------------------------------------- | -------------------------------- |
| `field` | [`TokenMetadataField`](#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_authority` | `Pubkey`           |
| 2… | `remaining`        | `Vec<AccountMeta>` |

### `UpdateTokenMetadataUpdateAuthority`

> _From the program's IDL:_
>
> Updates the token-metadata authority.

Discriminator `d7e4a6e45464567b` · data `UpdateTokenMetadataUpdateAuthority` · accounts `UpdateTokenMetadataUpdateAuthorityInstructionAccounts`.

| Field                  | Type             | Description                                              |
| ---------------------- | ---------------- | -------------------------------------------------------- |
| `new_update_authority` | `Option<Pubkey>` | 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_authority` | `Pubkey`           |
| 2… | `remaining`        | `Vec<AccountMeta>` |

### `UpdateTransferHook`

> _From the program's IDL:_
>
> Update the transfer hook program id. Only supported for mints that include the `TransferHook` extension.\
> Accounts expected by this instruction:
> 0\. `[writable]` The mint.
>
> 1. `[signer]` The transfer hook authority.

Discriminator `2401` · data `UpdateTransferHook` · accounts `UpdateTransferHookInstructionAccounts`.

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

| Field        | Type             | Description                                         |
| ------------ | ---------------- | --------------------------------------------------- |
| `program_id` | `Option<Pubkey>` | 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<AccountMeta>` |

### `WithdrawExcessLamports`

> _From the program's IDL:_
>
> This instruction is to be used to rescue SOLs sent to any TokenProgram owned account by sending them to any other account, leaving behind only lamports for rent exemption.

Discriminator `26` · data `WithdrawExcessLamports` · accounts `WithdrawExcessLamportsInstructionAccounts`.

No data fields.

Required accounts: 3; extras go to `remaining`.

Fields of `WithdrawExcessLamportsInstructionAccounts`, in account order:

| #  | Field                 | Type               |
| -- | --------------------- | ------------------ |
| 0  | `source_account`      | `Pubkey`           |
| 1  | `destination_account` | `Pubkey`           |
| 2  | `authority`           | `Pubkey`           |
| 3… | `remaining`           | `Vec<AccountMeta>` |

### `WithdrawWithheldTokensFromAccounts`

> _From the program's IDL:_
>
> Transfer all withheld tokens to an account. Signed by the mint's withdraw withheld tokens authority.

Discriminator `1a03` · data `WithdrawWithheldTokensFromAccounts` · accounts `WithdrawWithheldTokensFromAccountsInstructionAccounts`.

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

| Field                | Type | Description                         |
| -------------------- | ---- | ----------------------------------- |
| `num_token_accounts` | `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_receiver`                | `Pubkey`           |
| 2  | `withdraw_withheld_authority` | `Pubkey`           |
| 3… | `remaining`                   | `Vec<AccountMeta>` |

### `WithdrawWithheldTokensFromAccountsForConfidentialTransferFee`

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

Discriminator `2502` · data `WithdrawWithheldTokensFromAccountsForConfidentialTransferFee` · accounts `WithdrawWithheldTokensFromAccountsForConfidentialTransferFeeInstructionAccounts`.

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

| Field                               | Type                                        | Description                                                  |
| ----------------------------------- | ------------------------------------------- | ------------------------------------------------------------ |
| `num_token_accounts`                | `u8`                                        | Number of token accounts harvested                           |
| `proof_instruction_offset`          | `i8`                                        | Proof instruction offset                                     |
| `new_decryptable_available_balance` | [`DecryptableBalance`](#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_sysvar_or_context_state` | `Pubkey`           |
| 3  | `record`                               | `Option<Pubkey>`   |
| 4  | `authority`                            | `Pubkey`           |
| 5… | `remaining`                            | `Vec<AccountMeta>` |

### `WithdrawWithheldTokensFromMint`

> _From the program's IDL:_
>
> Transfer all withheld tokens in the mint to an account. Signed by the mint's withdraw withheld tokens authority.

Discriminator `1a02` · data `WithdrawWithheldTokensFromMint` · accounts `WithdrawWithheldTokensFromMintInstructionAccounts`.

No data fields.

Required accounts: 3; extras go to `remaining`.

Fields of `WithdrawWithheldTokensFromMintInstructionAccounts`, in account order:

| #  | Field                         | Type               |
| -- | ----------------------------- | ------------------ |
| 0  | `mint`                        | `Pubkey`           |
| 1  | `fee_receiver`                | `Pubkey`           |
| 2  | `withdraw_withheld_authority` | `Pubkey`           |
| 3… | `remaining`                   | `Vec<AccountMeta>` |

### `WithdrawWithheldTokensFromMintForConfidentialTransferFee`

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

Discriminator `2501` · data `WithdrawWithheldTokensFromMintForConfidentialTransferFee` · accounts `WithdrawWithheldTokensFromMintForConfidentialTransferFeeInstructionAccounts`.

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

| Field                               | Type                                        | Description                                                  |
| ----------------------------------- | ------------------------------------------- | ------------------------------------------------------------ |
| `proof_instruction_offset`          | `i8`                                        | Proof instruction offset                                     |
| `new_decryptable_available_balance` | [`DecryptableBalance`](#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_sysvar_or_context_state` | `Pubkey`           |
| 3  | `record`                               | `Option<Pubkey>`   |
| 4  | `authority`                            | `Pubkey`           |
| 5… | `remaining`                            | `Vec<AccountMeta>` |

## Accounts

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

### `Mint`

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

| Field              | Type                                   | Description                                                                                                                                                                                                     |
| ------------------ | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mint_authority`   | `Option<Pubkey>`                       | Optional authority used to mint new tokens. The mint authority may only be provided during mint creation. If no mint authority is present then the mint has a fixed supply and no further tokens may be minted. |
| `supply`           | `u64`                                  | Total supply of tokens.                                                                                                                                                                                         |
| `decimals`         | `u8`                                   | Number of base 10 digits to the right of the decimal place.                                                                                                                                                     |
| `is_initialized`   | `bool`                                 | Is `true` if this structure has been initialized.                                                                                                                                                               |
| `freeze_authority` | `Option<Pubkey>`                       | Optional authority to freeze token accounts.                                                                                                                                                                    |
| `extensions`       | [`Option<Vec<Extension>>`](#extension) | The extensions activated on the mint account.                                                                                                                                                                   |

### `Multisig`

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

| Field            | Type           | Description                                       |
| ---------------- | -------------- | ------------------------------------------------- |
| `m`              | `u8`           | Number of signers required.                       |
| `n`              | `u8`           | Number of valid signers.                          |
| `is_initialized` | `bool`         | Is `true` if this structure has been initialized. |
| `signers`        | `[Pubkey; 11]` | Signer public keys.                               |

### `Token`

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

| 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<Pubkey>`                       | If `delegate` is `Some` then `delegated_amount` represents the amount authorized by the delegate.                                                                                                                                               |
| `state`            | [`AccountState`](#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_amount` | `u64`                                  | The amount delegated.                                                                                                                                                                                                                           |
| `close_authority`  | `Option<Pubkey>`                       | Optional authority to close the account.                                                                                                                                                                                                        |
| `extensions`       | [`Option<Vec<Extension>>`](#extension) | The extensions activated on the token account.                                                                                                                                                                                                  |

## Types

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

### `AccountState`

Enum `types::AccountState`.

| Variant         |
| --------------- |
| `Uninitialized` |
| `Initialized`   |
| `Frozen`        |

### `AuthorityType`

Enum `types::AuthorityType`.

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

### `DecryptableBalance`

> _From the program's IDL:_
>
> Authenticated encryption containing an account balance.

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

### `EncryptedBalance`

> _From the program's IDL:_
>
> ElGamal ciphertext containing an account balance.

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

### `Extension`

Enum `types::Extension`.

| Variant                         | Fields                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Uninitialized`                 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `TransferFeeConfig`             | `transfer_fee_config_authority`: `Option<Pubkey>`, `withdraw_withheld_authority`: `Option<Pubkey>`, `withheld_amount`: `u64`, `older_transfer_fee`: [`TransferFee`](#transferfee), `newer_transfer_fee`: [`TransferFee`](#transferfee)                                                                                                                                                                                                                                                                                                                                                                  |
| `TransferFeeAmount`             | `withheld_amount`: `u64`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `MintCloseAuthority`            | `close_authority`: `Option<Pubkey>`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `ConfidentialTransferMint`      | `authority`: `Option<Pubkey>`, `auto_approve_new_accounts`: `bool`, `auditor_elgamal_pubkey`: `Option<Pubkey>`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `ConfidentialTransferAccount`   | `approved`: `bool`, `elgamal_pubkey`: `Pubkey`, `pending_balance_low`: [`EncryptedBalance`](#encryptedbalance), `pending_balance_high`: [`EncryptedBalance`](#encryptedbalance), `available_balance`: [`EncryptedBalance`](#encryptedbalance), `decryptable_available_balance`: [`DecryptableBalance`](#decryptablebalance), `allow_confidential_credits`: `bool`, `allow_non_confidential_credits`: `bool`, `pending_balance_credit_counter`: `u64`, `maximum_pending_balance_credit_counter`: `u64`, `expected_pending_balance_credit_counter`: `u64`, `actual_pending_balance_credit_counter`: `u64` |
| `DefaultAccountState`           | `state`: [`AccountState`](#accountstate)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `ImmutableOwner`                |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `MemoTransfer`                  | `require_incoming_transfer_memos`: `bool`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `NonTransferable`               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `InterestBearingConfig`         | `rate_authority`: `Option<Pubkey>`, `initialization_timestamp`: `u64`, `pre_update_average_rate`: `i16`, `last_update_timestamp`: `u64`, `current_rate`: `i16`                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `CpiGuard`                      | `lock_cpi`: `bool`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `PermanentDelegate`             | `delegate`: `Option<Pubkey>`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `NonTransferableAccount`        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `TransferHook`                  | `authority`: `Option<Pubkey>`, `program_id`: `Option<Pubkey>`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `TransferHookAccount`           | `transferring`: `bool`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `ConfidentialTransferFee`       | `authority`: `Option<Pubkey>`, `elgamal_pubkey`: `Pubkey`, `harvest_to_mint_enabled`: `bool`, `withheld_amount`: [`EncryptedBalance`](#encryptedbalance)                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `ConfidentialTransferFeeAmount` | `withheld_amount`: [`EncryptedBalance`](#encryptedbalance)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `MetadataPointer`               | `authority`: `Option<Pubkey>`, `metadata_address`: `Option<Pubkey>`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `TokenMetadata`                 | `update_authority`: `Option<Pubkey>`, `mint`: `Pubkey`, `name`: `String`, `symbol`: `String`, `uri`: `String`, `additional_metadata`: `HashMap<String, String>`                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `GroupPointer`                  | `authority`: `Option<Pubkey>`, `group_address`: `Option<Pubkey>`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `TokenGroup`                    | `update_authority`: `Option<Pubkey>`, `mint`: `Pubkey`, `size`: `u64`, `max_size`: `u64`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `GroupMemberPointer`            | `authority`: `Option<Pubkey>`, `member_address`: `Option<Pubkey>`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `TokenGroupMember`              | `mint`: `Pubkey`, `group`: `Pubkey`, `member_number`: `u64`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `ConfidentialMintBurn`          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `ScaledUiAmountConfig`          | `authority`: `Option<Pubkey>`, `multiplier`: `f64`, `new_multiplier_effective_timestamp`: `u64`, `new_multiplier`: `f64`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `PausableConfig`                | `authority`: `Option<Pubkey>`, `paused`: `bool`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `PausableAccount`               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `PermissionedBurn`              | `authority`: `Option<Pubkey>`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

`TransferFeeConfig` fields:

| Field                           | Type                          | Description                                                                   |
| ------------------------------- | ----------------------------- | ----------------------------------------------------------------------------- |
| `transfer_fee_config_authority` | `Option<Pubkey>`              | Optional authority to set the fee.                                            |
| `withdraw_withheld_authority`   | `Option<Pubkey>`              | Withdraw from mint instructions must be signed by this key.                   |
| `withheld_amount`               | `u64`                         | Withheld transfer fee tokens that have been moved to the mint for withdrawal. |
| `older_transfer_fee`            | [`TransferFee`](#transferfee) | Older transfer fee, used if the current epoch < newerTransferFee.epoch.       |
| `newer_transfer_fee`            | [`TransferFee`](#transferfee) | Newer transfer fee, used if the current epoch >= newerTransferFee.epoch.      |

`TransferFeeAmount` fields:

| Field             | Type  | Description                                                            |
| ----------------- | ----- | ---------------------------------------------------------------------- |
| `withheld_amount` | `u64` | Withheld transfer fee tokens that can be claimed by the fee authority. |

`ConfidentialTransferMint` fields:

| Field                       | Type             | Description                                                                                                                                                                                                                                                                                                                   |
| --------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `authority`                 | `Option<Pubkey>` | Authority to modify the `ConfidentialTransferMint` configuration and to approve new accounts (if `auto_approve_new_accounts` is true). The legacy Token Multisig account is not supported as the authority.                                                                                                                   |
| `auto_approve_new_accounts` | `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::ConfigureAccount`). |
| `auditor_elgamal_pubkey`    | `Option<Pubkey>` | 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`                          | `Pubkey`                                    | The public key associated with ElGamal encryption.                                                                                                      |
| `pending_balance_low`                     | [`EncryptedBalance`](#encryptedbalance)     | The low 16 bits of the pending balance (encrypted by `elgamal_pubkey`).                                                                                 |
| `pending_balance_high`                    | [`EncryptedBalance`](#encryptedbalance)     | The high 32 bits of the pending balance (encrypted by `elgamal_pubkey`).                                                                                |
| `available_balance`                       | [`EncryptedBalance`](#encryptedbalance)     | The available balance (encrypted by `encrypiton_pubkey`).                                                                                               |
| `decryptable_available_balance`           | [`DecryptableBalance`](#decryptablebalance) | The decryptable available balance.                                                                                                                      |
| `allow_confidential_credits`              | `bool`                                      | If `false`, the extended account rejects any incoming confidential transfers.                                                                           |
| `allow_non_confidential_credits`          | `bool`                                      | If `false`, the base account rejects any incoming transfers.                                                                                            |
| `pending_balance_credit_counter`          | `u64`                                       | The total number of `Deposit` and `Transfer` instructions that have credited `pending_balance`.                                                         |
| `maximum_pending_balance_credit_counter`  | `u64`                                       | The maximum number of `Deposit` and `Transfer` instructions that can credit `pending_balance` before the `ApplyPendingBalance` instruction is executed. |
| `expected_pending_balance_credit_counter` | `u64`                                       | The `expected_pending_balance_credit_counter` value that was included in the last `ApplyPendingBalance` instruction.                                    |
| `actual_pending_balance_credit_counter`   | `u64`                                       | The actual `pending_balance_credit_counter` when the last `ApplyPendingBalance` instruction was executed.                                               |

`MemoTransfer` fields:

| Field                             | Type   | Description                                                      |
| --------------------------------- | ------ | ---------------------------------------------------------------- |
| `require_incoming_transfer_memos` | `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<Pubkey>` | The transfer hook update authority. |
| `program_id` | `Option<Pubkey>` | 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<Pubkey>`                        | Optional authority to set the withdraw withheld authority ElGamal key.                                                                                                                                                                                                                                                                               |
| `elgamal_pubkey`          | `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_to_mint_enabled` | `bool`                                  | If `false`, the harvest of withheld tokens to mint is rejected.                                                                                                                                                                                                                                                                                      |
| `withheld_amount`         | [`EncryptedBalance`](#encryptedbalance) | Withheld confidential transfer fee tokens that have been moved to the mint for withdrawal.                                                                                                                                                                                                                                                           |

`ConfidentialTransferFeeAmount` fields:

| Field             | Type                                    | Description                                                               |
| ----------------- | --------------------------------------- | ------------------------------------------------------------------------- |
| `withheld_amount` | [`EncryptedBalance`](#encryptedbalance) | Amount withheld during confidential transfers, to be harvest to the mint. |

`MetadataPointer` fields:

| Field              | Type             | Description                                           |
| ------------------ | ---------------- | ----------------------------------------------------- |
| `authority`        | `Option<Pubkey>` | Optional authority that can set the metadata address. |
| `metadata_address` | `Option<Pubkey>` | Optional Account Address that holds the metadata.     |

`TokenMetadata` fields:

| Field                 | Type                      | Description                                                                                          |
| --------------------- | ------------------------- | ---------------------------------------------------------------------------------------------------- |
| `update_authority`    | `Option<Pubkey>`          | 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_metadata` | `HashMap<String, String>` | Any additional metadata about the token as key-value pairs.                                          |

`GroupPointer` fields:

| Field           | Type             | Description                                        |
| --------------- | ---------------- | -------------------------------------------------- |
| `authority`     | `Option<Pubkey>` | Optional authority that can set the group address. |
| `group_address` | `Option<Pubkey>` | Optional account address that holds the group.     |

`TokenGroup` fields:

| Field              | Type             | Description                                                                                       |
| ------------------ | ---------------- | ------------------------------------------------------------------------------------------------- |
| `update_authority` | `Option<Pubkey>` | 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<Pubkey>` | Optional authority that can set the member address. |
| `member_address` | `Option<Pubkey>` | 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_number` | `u64`    | The member number.                                                                                 |

`PermissionedBurn` fields:

| Field       | Type             | Description                            |
| ----------- | ---------------- | -------------------------------------- |
| `authority` | `Option<Pubkey>` | Authority that is required for burning |

### `ExtensionType`

> _From the program's IDL:_
>
> Extensions that can be applied to mints or accounts.  Mint extensions must only be applied to mint accounts, and account extensions must only be applied to token holding accounts.

Enum `types::ExtensionType`.

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

### `TokenMetadataField`

> _From the program's IDL:_
>
> Fields in the metadata account, used for updating.

Enum `types::TokenMetadataField`.

| Variant  | Fields   |
| -------- | -------- |
| `Name`   |          |
| `Symbol` |          |
| `Uri`    |          |
| `Key`    | `String` |

### `TransferFee`

Struct `types::TransferFee`.

| 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_fee_basis_points` | `u16` | Amount of transfer collected as fees, expressed as basis points of the transfer amount, ie. increments of 0.01%. |

---

Carbon 2.0.0 documentation · Web: https://carbon.sevenlabs.org/decoders/token-2022 · Last updated 2026-11-09 · Index of all pages: https://carbon.sevenlabs.org/llms.txt
