1631 lines
80 KiB
Rust
1631 lines
80 KiB
Rust
// file: kb-lib/src/executor/spl/token_2022/intent.rs
|
|
// version: 26
|
|
|
|
//! Typed Token-2022 execution intents.
|
|
|
|
use ts_rs::TS; // rust-rules: derive-import
|
|
|
|
/// Stable operation code for mint initialization through `InitializeMint2`.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_MINT_OPERATION: &str = "spl.token_2022.initialize_mint";
|
|
/// Stable operation code for token-account initialization through `InitializeAccount3`.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_ACCOUNT_OPERATION: &str =
|
|
"spl.token_2022.initialize_account";
|
|
/// Stable operation code for multisig initialization through `InitializeMultisig2`.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_MULTISIG_OPERATION: &str =
|
|
"spl.token_2022.initialize_multisig";
|
|
/// Stable operation code for an unchecked token transfer.
|
|
pub const EX_SPL_TOKEN_2022_TRANSFER_OPERATION: &str = "spl.token_2022.transfer";
|
|
/// Stable operation code for an approval.
|
|
pub const EX_SPL_TOKEN_2022_APPROVE_OPERATION: &str = "spl.token_2022.approve";
|
|
/// Stable operation code for a delegate revocation.
|
|
pub const EX_SPL_TOKEN_2022_REVOKE_OPERATION: &str = "spl.token_2022.revoke";
|
|
/// Stable operation code for an authority change.
|
|
pub const EX_SPL_TOKEN_2022_SET_AUTHORITY_OPERATION: &str = "spl.token_2022.set_authority";
|
|
/// Stable operation code for minting tokens.
|
|
pub const EX_SPL_TOKEN_2022_MINT_TO_OPERATION: &str = "spl.token_2022.mint_to";
|
|
/// Stable operation code for burning tokens.
|
|
pub const EX_SPL_TOKEN_2022_BURN_OPERATION: &str = "spl.token_2022.burn";
|
|
/// Stable operation code for closing a token account.
|
|
pub const EX_SPL_TOKEN_2022_CLOSE_ACCOUNT_OPERATION: &str = "spl.token_2022.close_account";
|
|
/// Stable operation code for freezing a token account.
|
|
pub const EX_SPL_TOKEN_2022_FREEZE_ACCOUNT_OPERATION: &str = "spl.token_2022.freeze_account";
|
|
/// Stable operation code for thawing a token account.
|
|
pub const EX_SPL_TOKEN_2022_THAW_ACCOUNT_OPERATION: &str = "spl.token_2022.thaw_account";
|
|
/// Stable operation code for a checked token transfer.
|
|
pub const EX_SPL_TOKEN_2022_TRANSFER_CHECKED_OPERATION: &str = "spl.token_2022.transfer_checked";
|
|
/// Stable operation code for a checked approval.
|
|
pub const EX_SPL_TOKEN_2022_APPROVE_CHECKED_OPERATION: &str = "spl.token_2022.approve_checked";
|
|
/// Stable operation code for checked minting.
|
|
pub const EX_SPL_TOKEN_2022_MINT_TO_CHECKED_OPERATION: &str = "spl.token_2022.mint_to_checked";
|
|
/// Stable operation code for checked burning.
|
|
pub const EX_SPL_TOKEN_2022_BURN_CHECKED_OPERATION: &str = "spl.token_2022.burn_checked";
|
|
/// Stable operation code for synchronizing wrapped SOL.
|
|
pub const EX_SPL_TOKEN_2022_SYNC_NATIVE_OPERATION: &str = "spl.token_2022.sync_native";
|
|
/// Stable operation code for querying account data size.
|
|
pub const EX_SPL_TOKEN_2022_GET_ACCOUNT_DATA_SIZE_OPERATION: &str =
|
|
"spl.token_2022.get_account_data_size";
|
|
/// Stable operation code for the classic compatibility no-op.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_IMMUTABLE_OWNER_OPERATION: &str =
|
|
"spl.token_2022.initialize_immutable_owner";
|
|
/// Stable operation code for raw-to-UI amount conversion.
|
|
pub const EX_SPL_TOKEN_2022_AMOUNT_TO_UI_AMOUNT_OPERATION: &str =
|
|
"spl.token_2022.amount_to_ui_amount";
|
|
/// Stable operation code for UI-to-raw amount conversion.
|
|
pub const EX_SPL_TOKEN_2022_UI_AMOUNT_TO_AMOUNT_OPERATION: &str =
|
|
"spl.token_2022.ui_amount_to_amount";
|
|
/// Stable operation code for rescuing excess lamports.
|
|
pub const EX_SPL_TOKEN_2022_WITHDRAW_EXCESS_LAMPORTS_OPERATION: &str =
|
|
"spl.token_2022.withdraw_excess_lamports";
|
|
/// Stable operation code for the recent wrapped-SOL partial unwrap.
|
|
pub const EX_SPL_TOKEN_2022_UNWRAP_LAMPORTS_OPERATION: &str = "spl.token_2022.unwrap_lamports";
|
|
/// Stable operation code for Token-2022 account reallocation.
|
|
pub const EX_SPL_TOKEN_2022_REALLOCATE_OPERATION: &str = "spl.token_2022.reallocate";
|
|
/// Stable operation code for initializing a non-transferable mint.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_NON_TRANSFERABLE_MINT_OPERATION: &str =
|
|
"spl.token_2022.initialize_non_transferable_mint";
|
|
/// Stable operation code for initializing a permanent delegate.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_PERMANENT_DELEGATE_OPERATION: &str =
|
|
"spl.token_2022.initialize_permanent_delegate";
|
|
/// Stable operation code for initializing an interest-bearing mint.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_INTEREST_BEARING_MINT_OPERATION: &str =
|
|
"spl.token_2022.initialize_interest_bearing_mint";
|
|
/// Stable operation code for updating an interest-bearing mint rate.
|
|
pub const EX_SPL_TOKEN_2022_UPDATE_INTEREST_BEARING_RATE_OPERATION: &str =
|
|
"spl.token_2022.update_interest_bearing_rate";
|
|
/// Stable operation code for transfer-fee configuration initialization.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_TRANSFER_FEE_CONFIG_OPERATION: &str =
|
|
"spl.token_2022.initialize_transfer_fee_config";
|
|
/// Stable operation code for updating transfer-fee parameters.
|
|
pub const EX_SPL_TOKEN_2022_SET_TRANSFER_FEE_OPERATION: &str = "spl.token_2022.set_transfer_fee";
|
|
/// Stable operation code for a checked transfer with an expected fee.
|
|
pub const EX_SPL_TOKEN_2022_TRANSFER_CHECKED_WITH_FEE_OPERATION: &str =
|
|
"spl.token_2022.transfer_checked_with_fee";
|
|
/// Stable operation code for withdrawing withheld fees from a mint.
|
|
pub const EX_SPL_TOKEN_2022_WITHDRAW_WITHHELD_TOKENS_FROM_MINT_OPERATION: &str =
|
|
"spl.token_2022.withdraw_withheld_tokens_from_mint";
|
|
/// Stable operation code for withdrawing withheld fees from token accounts.
|
|
pub const EX_SPL_TOKEN_2022_WITHDRAW_WITHHELD_TOKENS_FROM_ACCOUNTS_OPERATION: &str =
|
|
"spl.token_2022.withdraw_withheld_tokens_from_accounts";
|
|
/// Stable operation code for harvesting withheld fees into a mint.
|
|
pub const EX_SPL_TOKEN_2022_HARVEST_WITHHELD_TOKENS_TO_MINT_OPERATION: &str =
|
|
"spl.token_2022.harvest_withheld_tokens_to_mint";
|
|
/// Stable operation code for initializing a default account state.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_DEFAULT_ACCOUNT_STATE_OPERATION: &str =
|
|
"spl.token_2022.initialize_default_account_state";
|
|
/// Stable operation code for updating a default account state.
|
|
pub const EX_SPL_TOKEN_2022_UPDATE_DEFAULT_ACCOUNT_STATE_OPERATION: &str =
|
|
"spl.token_2022.update_default_account_state";
|
|
/// Stable operation code for requiring memos on incoming transfers.
|
|
pub const EX_SPL_TOKEN_2022_ENABLE_REQUIRED_TRANSFER_MEMOS_OPERATION: &str =
|
|
"spl.token_2022.enable_required_transfer_memos";
|
|
/// Stable operation code for disabling required incoming-transfer memos.
|
|
pub const EX_SPL_TOKEN_2022_DISABLE_REQUIRED_TRANSFER_MEMOS_OPERATION: &str =
|
|
"spl.token_2022.disable_required_transfer_memos";
|
|
/// Stable operation code for enabling CPI Guard on a token account.
|
|
pub const EX_SPL_TOKEN_2022_ENABLE_CPI_GUARD_OPERATION: &str = "spl.token_2022.enable_cpi_guard";
|
|
/// Stable operation code for disabling CPI Guard on a token account.
|
|
pub const EX_SPL_TOKEN_2022_DISABLE_CPI_GUARD_OPERATION: &str = "spl.token_2022.disable_cpi_guard";
|
|
/// Stable operation code for initializing a transfer-hook pointer.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_TRANSFER_HOOK_OPERATION: &str =
|
|
"spl.token_2022.initialize_transfer_hook";
|
|
/// Stable operation code for updating or clearing a transfer-hook program id.
|
|
pub const EX_SPL_TOKEN_2022_UPDATE_TRANSFER_HOOK_OPERATION: &str =
|
|
"spl.token_2022.update_transfer_hook";
|
|
/// Stable operation code for initializing a metadata pointer.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_METADATA_POINTER_OPERATION: &str =
|
|
"spl.token_2022.initialize_metadata_pointer";
|
|
/// Stable operation code for updating or clearing a metadata pointer.
|
|
pub const EX_SPL_TOKEN_2022_UPDATE_METADATA_POINTER_OPERATION: &str =
|
|
"spl.token_2022.update_metadata_pointer";
|
|
/// Stable operation code for initializing a group pointer.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_GROUP_POINTER_OPERATION: &str =
|
|
"spl.token_2022.initialize_group_pointer";
|
|
/// Stable operation code for updating or clearing a group pointer.
|
|
pub const EX_SPL_TOKEN_2022_UPDATE_GROUP_POINTER_OPERATION: &str =
|
|
"spl.token_2022.update_group_pointer";
|
|
/// Stable operation code for initializing a group-member pointer.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_GROUP_MEMBER_POINTER_OPERATION: &str =
|
|
"spl.token_2022.initialize_group_member_pointer";
|
|
/// Stable operation code for updating or clearing a group-member pointer.
|
|
pub const EX_SPL_TOKEN_2022_UPDATE_GROUP_MEMBER_POINTER_OPERATION: &str =
|
|
"spl.token_2022.update_group_member_pointer";
|
|
/// Stable operation code for initializing Token-2022 embedded metadata.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_TOKEN_METADATA_OPERATION: &str =
|
|
"spl.token_2022.initialize_token_metadata";
|
|
/// Stable operation code for updating an embedded metadata field.
|
|
pub const EX_SPL_TOKEN_2022_UPDATE_TOKEN_METADATA_FIELD_OPERATION: &str =
|
|
"spl.token_2022.update_token_metadata_field";
|
|
/// Stable operation code for removing an embedded metadata key.
|
|
pub const EX_SPL_TOKEN_2022_REMOVE_TOKEN_METADATA_KEY_OPERATION: &str =
|
|
"spl.token_2022.remove_token_metadata_key";
|
|
/// Stable operation code for initializing an embedded token group.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_TOKEN_GROUP_OPERATION: &str =
|
|
"spl.token_2022.initialize_token_group";
|
|
/// Stable operation code for updating an embedded token-group maximum size.
|
|
pub const EX_SPL_TOKEN_2022_UPDATE_TOKEN_GROUP_MAX_SIZE_OPERATION: &str =
|
|
"spl.token_2022.update_token_group_max_size";
|
|
/// Stable operation code for initializing an embedded token-group member.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_TOKEN_GROUP_MEMBER_OPERATION: &str =
|
|
"spl.token_2022.initialize_token_group_member";
|
|
/// Stable operation code for initializing scaled UI amounts.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_SCALED_UI_AMOUNT_OPERATION: &str =
|
|
"spl.token_2022.initialize_scaled_ui_amount";
|
|
/// Stable operation code for scheduling a scaled UI multiplier update.
|
|
pub const EX_SPL_TOKEN_2022_UPDATE_SCALED_UI_AMOUNT_MULTIPLIER_OPERATION: &str =
|
|
"spl.token_2022.update_scaled_ui_amount_multiplier";
|
|
/// Stable operation code for initializing pausable mint state.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_PAUSABLE_CONFIG_OPERATION: &str =
|
|
"spl.token_2022.initialize_pausable_config";
|
|
/// Stable operation code for pausing mint activity.
|
|
pub const EX_SPL_TOKEN_2022_PAUSE_OPERATION: &str = "spl.token_2022.pause";
|
|
/// Stable operation code for resuming mint activity.
|
|
pub const EX_SPL_TOKEN_2022_RESUME_OPERATION: &str = "spl.token_2022.resume";
|
|
/// Stable operation code for initializing permissioned burn.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_PERMISSIONED_BURN_OPERATION: &str =
|
|
"spl.token_2022.initialize_permissioned_burn";
|
|
/// Stable operation code for a permissioned burn.
|
|
pub const EX_SPL_TOKEN_2022_PERMISSIONED_BURN_OPERATION: &str = "spl.token_2022.permissioned_burn";
|
|
/// Stable operation code for a checked permissioned burn.
|
|
pub const EX_SPL_TOKEN_2022_PERMISSIONED_BURN_CHECKED_OPERATION: &str =
|
|
"spl.token_2022.permissioned_burn_checked";
|
|
/// Stable operation code for initializing Confidential Transfer mint configuration.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_CONFIDENTIAL_TRANSFER_MINT_OPERATION: &str =
|
|
"spl.token_2022.initialize_confidential_transfer_mint";
|
|
/// Stable operation code for updating Confidential Transfer mint configuration.
|
|
pub const EX_SPL_TOKEN_2022_UPDATE_CONFIDENTIAL_TRANSFER_MINT_OPERATION: &str =
|
|
"spl.token_2022.update_confidential_transfer_mint";
|
|
/// Stable operation code for applying pending confidential balance credits.
|
|
pub const EX_SPL_TOKEN_2022_APPLY_PENDING_CONFIDENTIAL_BALANCE_OPERATION: &str =
|
|
"spl.token_2022.apply_pending_confidential_balance";
|
|
/// Stable operation code for approving a configured confidential account.
|
|
pub const EX_SPL_TOKEN_2022_APPROVE_CONFIDENTIAL_TRANSFER_ACCOUNT_OPERATION: &str =
|
|
"spl.token_2022.approve_confidential_transfer_account";
|
|
/// Stable operation code for depositing public tokens into a confidential pending balance.
|
|
pub const EX_SPL_TOKEN_2022_DEPOSIT_CONFIDENTIAL_TOKENS_OPERATION: &str =
|
|
"spl.token_2022.deposit_confidential_tokens";
|
|
/// Stable operation code for enabling incoming confidential credits.
|
|
pub const EX_SPL_TOKEN_2022_ENABLE_CONFIDENTIAL_CREDITS_OPERATION: &str =
|
|
"spl.token_2022.enable_confidential_credits";
|
|
/// Stable operation code for disabling incoming confidential credits.
|
|
pub const EX_SPL_TOKEN_2022_DISABLE_CONFIDENTIAL_CREDITS_OPERATION: &str =
|
|
"spl.token_2022.disable_confidential_credits";
|
|
/// Stable operation code for enabling incoming non-confidential credits.
|
|
pub const EX_SPL_TOKEN_2022_ENABLE_NON_CONFIDENTIAL_CREDITS_OPERATION: &str =
|
|
"spl.token_2022.enable_non_confidential_credits";
|
|
/// Stable operation code for disabling incoming non-confidential credits.
|
|
pub const EX_SPL_TOKEN_2022_DISABLE_NON_CONFIDENTIAL_CREDITS_OPERATION: &str =
|
|
"spl.token_2022.disable_non_confidential_credits";
|
|
/// Stable operation code for configuring one confidential token account.
|
|
pub const EX_SPL_TOKEN_2022_CONFIGURE_CONFIDENTIAL_TRANSFER_ACCOUNT_OPERATION: &str =
|
|
"spl.token_2022.configure_confidential_transfer_account";
|
|
/// Stable operation code for configuring one confidential token account through the registry.
|
|
pub const EX_SPL_TOKEN_2022_CONFIGURE_CONFIDENTIAL_TRANSFER_ACCOUNT_WITH_REGISTRY_OPERATION: &str =
|
|
"spl.token_2022.configure_confidential_transfer_account_with_registry";
|
|
/// Stable operation code for emptying a confidential available balance before close.
|
|
pub const EX_SPL_TOKEN_2022_EMPTY_CONFIDENTIAL_TRANSFER_ACCOUNT_OPERATION: &str =
|
|
"spl.token_2022.empty_confidential_transfer_account";
|
|
/// Stable operation code for withdrawing confidential balance into public balance.
|
|
pub const EX_SPL_TOKEN_2022_WITHDRAW_CONFIDENTIAL_TOKENS_OPERATION: &str =
|
|
"spl.token_2022.withdraw_confidential_tokens";
|
|
/// Stable operation code for transferring confidential tokens.
|
|
pub const EX_SPL_TOKEN_2022_TRANSFER_CONFIDENTIAL_TOKENS_OPERATION: &str =
|
|
"spl.token_2022.transfer_confidential_tokens";
|
|
/// Stable operation code for confidential transfer with fee.
|
|
pub const EX_SPL_TOKEN_2022_TRANSFER_CONFIDENTIAL_TOKENS_WITH_FEE_OPERATION: &str =
|
|
"spl.token_2022.transfer_confidential_tokens_with_fee";
|
|
/// Stable operation code for initializing confidential transfer fee configuration.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_CONFIDENTIAL_TRANSFER_FEE_CONFIG_OPERATION: &str =
|
|
"spl.token_2022.initialize_confidential_transfer_fee_config";
|
|
/// Stable operation code for enabling confidential fee harvest to the mint.
|
|
pub const EX_SPL_TOKEN_2022_ENABLE_CONFIDENTIAL_TRANSFER_FEE_HARVEST_OPERATION: &str =
|
|
"spl.token_2022.enable_confidential_transfer_fee_harvest";
|
|
/// Stable operation code for disabling confidential fee harvest to the mint.
|
|
pub const EX_SPL_TOKEN_2022_DISABLE_CONFIDENTIAL_TRANSFER_FEE_HARVEST_OPERATION: &str =
|
|
"spl.token_2022.disable_confidential_transfer_fee_harvest";
|
|
/// Stable operation code for harvesting confidential withheld fees to the mint.
|
|
pub const EX_SPL_TOKEN_2022_HARVEST_CONFIDENTIAL_WITHHELD_TOKENS_TO_MINT_OPERATION: &str =
|
|
"spl.token_2022.harvest_confidential_withheld_tokens_to_mint";
|
|
/// Stable operation code for withdrawing confidential withheld fees from the mint.
|
|
pub const EX_SPL_TOKEN_2022_WITHDRAW_CONFIDENTIAL_WITHHELD_TOKENS_FROM_MINT_OPERATION: &str =
|
|
"spl.token_2022.withdraw_confidential_withheld_tokens_from_mint";
|
|
/// Stable operation code for withdrawing confidential withheld fees from token accounts.
|
|
pub const EX_SPL_TOKEN_2022_WITHDRAW_CONFIDENTIAL_WITHHELD_TOKENS_FROM_ACCOUNTS_OPERATION: &str =
|
|
"spl.token_2022.withdraw_confidential_withheld_tokens_from_accounts";
|
|
/// Stable operation code for initializing confidential mint and burn.
|
|
pub const EX_SPL_TOKEN_2022_INITIALIZE_CONFIDENTIAL_MINT_BURN_MINT_OPERATION: &str =
|
|
"spl.token_2022.initialize_confidential_mint_burn_mint";
|
|
/// Stable operation code for rotating the confidential supply ElGamal public key.
|
|
pub const EX_SPL_TOKEN_2022_ROTATE_CONFIDENTIAL_SUPPLY_ELGAMAL_PUBKEY_OPERATION: &str =
|
|
"spl.token_2022.rotate_confidential_supply_elgamal_pubkey";
|
|
/// Stable operation code for updating the decryptable confidential supply.
|
|
pub const EX_SPL_TOKEN_2022_UPDATE_CONFIDENTIAL_DECRYPTABLE_SUPPLY_OPERATION: &str =
|
|
"spl.token_2022.update_confidential_decryptable_supply";
|
|
/// Stable operation code for applying pending confidential burns.
|
|
pub const EX_SPL_TOKEN_2022_APPLY_PENDING_CONFIDENTIAL_BURN_OPERATION: &str =
|
|
"spl.token_2022.apply_pending_confidential_burn";
|
|
/// Stable operation code for confidential minting.
|
|
pub const EX_SPL_TOKEN_2022_CONFIDENTIAL_MINT_OPERATION: &str = "spl.token_2022.confidential_mint";
|
|
/// Stable operation code for confidential burning.
|
|
pub const EX_SPL_TOKEN_2022_CONFIDENTIAL_BURN_OPERATION: &str = "spl.token_2022.confidential_burn";
|
|
/// Stable operation code for permissioned confidential burning.
|
|
pub const EX_SPL_TOKEN_2022_PERMISSIONED_CONFIDENTIAL_BURN_OPERATION: &str =
|
|
"spl.token_2022.permissioned_confidential_burn";
|
|
|
|
/// Stable operation code for a recent bounded batch.
|
|
pub const EX_SPL_TOKEN_2022_BATCH_OPERATION: &str = "spl.token_2022.batch";
|
|
|
|
/// Operation codes constructible by this executor.
|
|
pub const EX_SPL_TOKEN_2022_SUPPORTED_OPERATION_CODES: &[&str] = &[
|
|
EX_SPL_TOKEN_2022_INITIALIZE_MINT_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_ACCOUNT_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_MULTISIG_OPERATION,
|
|
EX_SPL_TOKEN_2022_TRANSFER_OPERATION,
|
|
EX_SPL_TOKEN_2022_APPROVE_OPERATION,
|
|
EX_SPL_TOKEN_2022_REVOKE_OPERATION,
|
|
EX_SPL_TOKEN_2022_SET_AUTHORITY_OPERATION,
|
|
EX_SPL_TOKEN_2022_MINT_TO_OPERATION,
|
|
EX_SPL_TOKEN_2022_BURN_OPERATION,
|
|
EX_SPL_TOKEN_2022_CLOSE_ACCOUNT_OPERATION,
|
|
EX_SPL_TOKEN_2022_FREEZE_ACCOUNT_OPERATION,
|
|
EX_SPL_TOKEN_2022_THAW_ACCOUNT_OPERATION,
|
|
EX_SPL_TOKEN_2022_TRANSFER_CHECKED_OPERATION,
|
|
EX_SPL_TOKEN_2022_APPROVE_CHECKED_OPERATION,
|
|
EX_SPL_TOKEN_2022_MINT_TO_CHECKED_OPERATION,
|
|
EX_SPL_TOKEN_2022_BURN_CHECKED_OPERATION,
|
|
EX_SPL_TOKEN_2022_SYNC_NATIVE_OPERATION,
|
|
EX_SPL_TOKEN_2022_GET_ACCOUNT_DATA_SIZE_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_IMMUTABLE_OWNER_OPERATION,
|
|
EX_SPL_TOKEN_2022_AMOUNT_TO_UI_AMOUNT_OPERATION,
|
|
EX_SPL_TOKEN_2022_UI_AMOUNT_TO_AMOUNT_OPERATION,
|
|
EX_SPL_TOKEN_2022_WITHDRAW_EXCESS_LAMPORTS_OPERATION,
|
|
EX_SPL_TOKEN_2022_UNWRAP_LAMPORTS_OPERATION,
|
|
EX_SPL_TOKEN_2022_REALLOCATE_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_NON_TRANSFERABLE_MINT_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_PERMANENT_DELEGATE_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_INTEREST_BEARING_MINT_OPERATION,
|
|
EX_SPL_TOKEN_2022_UPDATE_INTEREST_BEARING_RATE_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_TRANSFER_FEE_CONFIG_OPERATION,
|
|
EX_SPL_TOKEN_2022_SET_TRANSFER_FEE_OPERATION,
|
|
EX_SPL_TOKEN_2022_TRANSFER_CHECKED_WITH_FEE_OPERATION,
|
|
EX_SPL_TOKEN_2022_WITHDRAW_WITHHELD_TOKENS_FROM_MINT_OPERATION,
|
|
EX_SPL_TOKEN_2022_WITHDRAW_WITHHELD_TOKENS_FROM_ACCOUNTS_OPERATION,
|
|
EX_SPL_TOKEN_2022_HARVEST_WITHHELD_TOKENS_TO_MINT_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_DEFAULT_ACCOUNT_STATE_OPERATION,
|
|
EX_SPL_TOKEN_2022_UPDATE_DEFAULT_ACCOUNT_STATE_OPERATION,
|
|
EX_SPL_TOKEN_2022_ENABLE_REQUIRED_TRANSFER_MEMOS_OPERATION,
|
|
EX_SPL_TOKEN_2022_DISABLE_REQUIRED_TRANSFER_MEMOS_OPERATION,
|
|
EX_SPL_TOKEN_2022_ENABLE_CPI_GUARD_OPERATION,
|
|
EX_SPL_TOKEN_2022_DISABLE_CPI_GUARD_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_TRANSFER_HOOK_OPERATION,
|
|
EX_SPL_TOKEN_2022_UPDATE_TRANSFER_HOOK_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_METADATA_POINTER_OPERATION,
|
|
EX_SPL_TOKEN_2022_UPDATE_METADATA_POINTER_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_GROUP_POINTER_OPERATION,
|
|
EX_SPL_TOKEN_2022_UPDATE_GROUP_POINTER_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_GROUP_MEMBER_POINTER_OPERATION,
|
|
EX_SPL_TOKEN_2022_UPDATE_GROUP_MEMBER_POINTER_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_TOKEN_METADATA_OPERATION,
|
|
EX_SPL_TOKEN_2022_UPDATE_TOKEN_METADATA_FIELD_OPERATION,
|
|
EX_SPL_TOKEN_2022_REMOVE_TOKEN_METADATA_KEY_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_TOKEN_GROUP_OPERATION,
|
|
EX_SPL_TOKEN_2022_UPDATE_TOKEN_GROUP_MAX_SIZE_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_TOKEN_GROUP_MEMBER_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_SCALED_UI_AMOUNT_OPERATION,
|
|
EX_SPL_TOKEN_2022_UPDATE_SCALED_UI_AMOUNT_MULTIPLIER_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_PAUSABLE_CONFIG_OPERATION,
|
|
EX_SPL_TOKEN_2022_PAUSE_OPERATION,
|
|
EX_SPL_TOKEN_2022_RESUME_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_PERMISSIONED_BURN_OPERATION,
|
|
EX_SPL_TOKEN_2022_PERMISSIONED_BURN_OPERATION,
|
|
EX_SPL_TOKEN_2022_PERMISSIONED_BURN_CHECKED_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_CONFIDENTIAL_TRANSFER_MINT_OPERATION,
|
|
EX_SPL_TOKEN_2022_UPDATE_CONFIDENTIAL_TRANSFER_MINT_OPERATION,
|
|
EX_SPL_TOKEN_2022_APPLY_PENDING_CONFIDENTIAL_BALANCE_OPERATION,
|
|
EX_SPL_TOKEN_2022_APPROVE_CONFIDENTIAL_TRANSFER_ACCOUNT_OPERATION,
|
|
EX_SPL_TOKEN_2022_DEPOSIT_CONFIDENTIAL_TOKENS_OPERATION,
|
|
EX_SPL_TOKEN_2022_ENABLE_CONFIDENTIAL_CREDITS_OPERATION,
|
|
EX_SPL_TOKEN_2022_DISABLE_CONFIDENTIAL_CREDITS_OPERATION,
|
|
EX_SPL_TOKEN_2022_ENABLE_NON_CONFIDENTIAL_CREDITS_OPERATION,
|
|
EX_SPL_TOKEN_2022_DISABLE_NON_CONFIDENTIAL_CREDITS_OPERATION,
|
|
EX_SPL_TOKEN_2022_CONFIGURE_CONFIDENTIAL_TRANSFER_ACCOUNT_OPERATION,
|
|
EX_SPL_TOKEN_2022_CONFIGURE_CONFIDENTIAL_TRANSFER_ACCOUNT_WITH_REGISTRY_OPERATION,
|
|
EX_SPL_TOKEN_2022_EMPTY_CONFIDENTIAL_TRANSFER_ACCOUNT_OPERATION,
|
|
EX_SPL_TOKEN_2022_WITHDRAW_CONFIDENTIAL_TOKENS_OPERATION,
|
|
EX_SPL_TOKEN_2022_TRANSFER_CONFIDENTIAL_TOKENS_OPERATION,
|
|
EX_SPL_TOKEN_2022_TRANSFER_CONFIDENTIAL_TOKENS_WITH_FEE_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_CONFIDENTIAL_TRANSFER_FEE_CONFIG_OPERATION,
|
|
EX_SPL_TOKEN_2022_ENABLE_CONFIDENTIAL_TRANSFER_FEE_HARVEST_OPERATION,
|
|
EX_SPL_TOKEN_2022_DISABLE_CONFIDENTIAL_TRANSFER_FEE_HARVEST_OPERATION,
|
|
EX_SPL_TOKEN_2022_HARVEST_CONFIDENTIAL_WITHHELD_TOKENS_TO_MINT_OPERATION,
|
|
EX_SPL_TOKEN_2022_WITHDRAW_CONFIDENTIAL_WITHHELD_TOKENS_FROM_MINT_OPERATION,
|
|
EX_SPL_TOKEN_2022_WITHDRAW_CONFIDENTIAL_WITHHELD_TOKENS_FROM_ACCOUNTS_OPERATION,
|
|
EX_SPL_TOKEN_2022_INITIALIZE_CONFIDENTIAL_MINT_BURN_MINT_OPERATION,
|
|
EX_SPL_TOKEN_2022_ROTATE_CONFIDENTIAL_SUPPLY_ELGAMAL_PUBKEY_OPERATION,
|
|
EX_SPL_TOKEN_2022_UPDATE_CONFIDENTIAL_DECRYPTABLE_SUPPLY_OPERATION,
|
|
EX_SPL_TOKEN_2022_APPLY_PENDING_CONFIDENTIAL_BURN_OPERATION,
|
|
EX_SPL_TOKEN_2022_CONFIDENTIAL_MINT_OPERATION,
|
|
EX_SPL_TOKEN_2022_CONFIDENTIAL_BURN_OPERATION,
|
|
EX_SPL_TOKEN_2022_PERMISSIONED_CONFIDENTIAL_BURN_OPERATION,
|
|
];
|
|
|
|
/// Exact unsigned on-chain amount represented as a decimal JSON string.
|
|
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
|
|
#[ts(
|
|
export,
|
|
export_to = "../frontend/ts/bindings/kb_lib/executor/spl/token_2022/intent/ExSplTokenAmount.ts"
|
|
)]
|
|
pub struct ExSplTokenAmount(
|
|
/// Canonical unsigned decimal representation.
|
|
pub std::string::String,
|
|
);
|
|
|
|
/// Positive normal finite scaled-UI multiplier represented as a decimal JSON string.
|
|
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
|
|
#[ts(
|
|
export,
|
|
export_to = "../frontend/ts/bindings/kb_lib/executor/spl/token_2022/intent/ExSplTokenMultiplier.ts"
|
|
)]
|
|
pub struct ExSplTokenMultiplier(
|
|
/// Decimal representation parsed to the official `f64` wire contract.
|
|
pub std::string::String,
|
|
);
|
|
|
|
/// Ordered simple or multisig authority supplied to an instruction builder.
|
|
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
|
|
#[ts(
|
|
export,
|
|
export_to = "../frontend/ts/bindings/kb_lib/executor/spl/token_2022/intent/ExSplTokenAuthority.ts"
|
|
)]
|
|
pub struct ExSplTokenAuthority {
|
|
/// Authority account. It signs only when `multisig_signers` is empty.
|
|
pub authority: crate::MdPubkey,
|
|
/// Ordered multisig signer occurrences. Duplicate metas remain ordered.
|
|
pub multisig_signers: std::vec::Vec<crate::MdPubkey>,
|
|
}
|
|
|
|
/// Authority domain used by `SetAuthority`.
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
|
|
#[serde(rename_all = "snake_case")]
|
|
#[ts(
|
|
export,
|
|
export_to = "../frontend/ts/bindings/kb_lib/executor/spl/token_2022/intent/ExSplTokenAuthorityType.ts"
|
|
)]
|
|
pub enum ExSplTokenAuthorityType {
|
|
/// Mint authority.
|
|
MintTokens,
|
|
/// Freeze authority.
|
|
FreezeAccount,
|
|
/// Token-account owner.
|
|
AccountOwner,
|
|
/// Token-account close authority.
|
|
CloseAccount,
|
|
}
|
|
|
|
/// Default state assigned to newly initialized Token-2022 accounts.
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
|
|
#[serde(rename_all = "snake_case")]
|
|
#[ts(
|
|
export,
|
|
export_to = "../frontend/ts/bindings/kb_lib/executor/spl/token_2022/intent/ExSplTokenDefaultAccountState.ts"
|
|
)]
|
|
pub enum ExSplTokenDefaultAccountState {
|
|
/// Newly initialized accounts remain usable.
|
|
Initialized,
|
|
/// Newly initialized accounts start frozen.
|
|
Frozen,
|
|
}
|
|
|
|
/// Token-metadata field selected for an update.
|
|
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
|
|
#[serde(rename_all = "snake_case", tag = "kind", content = "key")]
|
|
#[ts(
|
|
export,
|
|
export_to = "../frontend/ts/bindings/kb_lib/executor/spl/token_2022/intent/ExSplTokenMetadataField.ts"
|
|
)]
|
|
pub enum ExSplTokenMetadataField {
|
|
/// Update the required name field.
|
|
Name,
|
|
/// Update the required symbol field.
|
|
Symbol,
|
|
/// Update the required URI field.
|
|
Uri,
|
|
/// Update or create an additional key.
|
|
Key(std::string::String),
|
|
}
|
|
|
|
/// One officially constructible non-batch instruction.
|
|
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
|
|
#[serde(tag = "instruction", rename_all = "snake_case")]
|
|
#[ts(
|
|
export,
|
|
export_to = "../frontend/ts/bindings/kb_lib/executor/spl/token_2022/intent/ExSplTokenSingleOperation.ts"
|
|
)]
|
|
pub enum ExSplTokenSingleOperation {
|
|
/// Initialize a mint with the current no-Rent builder.
|
|
InitializeMint {
|
|
/// Mint account already created for the classic Token program.
|
|
mint: crate::MdPubkey,
|
|
/// Mint authority.
|
|
mint_authority: crate::MdPubkey,
|
|
/// Optional freeze authority.
|
|
freeze_authority: std::option::Option<crate::MdPubkey>,
|
|
/// Mint decimals.
|
|
decimals: u8,
|
|
},
|
|
/// Initialize a token account with the current no-Rent builder.
|
|
InitializeAccount {
|
|
/// Token account already created for the classic Token program.
|
|
account: crate::MdPubkey,
|
|
/// Mint associated with the account.
|
|
mint: crate::MdPubkey,
|
|
/// Token-account owner.
|
|
owner: crate::MdPubkey,
|
|
},
|
|
/// Initialize a multisig with the current no-Rent builder.
|
|
InitializeMultisig {
|
|
/// Multisig account already created for the classic Token program.
|
|
multisig: crate::MdPubkey,
|
|
/// Ordered member accounts.
|
|
members: std::vec::Vec<crate::MdPubkey>,
|
|
/// Required member threshold.
|
|
threshold: u8,
|
|
},
|
|
/// Transfer a raw token amount without carrying the mint or decimals in the wire.
|
|
Transfer {
|
|
/// Source token account.
|
|
source: crate::MdPubkey,
|
|
/// Destination token account.
|
|
destination: crate::MdPubkey,
|
|
/// Owner, delegate or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Exact raw token amount.
|
|
amount: crate::ExSplTokenAmount,
|
|
},
|
|
/// Approve a delegate for a raw token allowance.
|
|
Approve {
|
|
/// Source token account.
|
|
source: crate::MdPubkey,
|
|
/// Delegate account.
|
|
delegate: crate::MdPubkey,
|
|
/// Owner or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Exact raw allowance.
|
|
amount: crate::ExSplTokenAmount,
|
|
},
|
|
/// Revoke the current delegate.
|
|
Revoke {
|
|
/// Source token account.
|
|
source: crate::MdPubkey,
|
|
/// Owner or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Change or revoke an authority.
|
|
SetAuthority {
|
|
/// Mint or token account whose authority changes.
|
|
owned: crate::MdPubkey,
|
|
/// Authority domain.
|
|
authority_type: crate::ExSplTokenAuthorityType,
|
|
/// New authority, or `None` to revoke it.
|
|
new_authority: std::option::Option<crate::MdPubkey>,
|
|
/// Current simple or multisig authority.
|
|
current_authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Mint a raw token amount.
|
|
MintTo {
|
|
/// Mint account.
|
|
mint: crate::MdPubkey,
|
|
/// Destination token account.
|
|
destination: crate::MdPubkey,
|
|
/// Mint authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Exact raw amount.
|
|
amount: crate::ExSplTokenAmount,
|
|
},
|
|
/// Burn a raw token amount.
|
|
Burn {
|
|
/// Source token account.
|
|
source: crate::MdPubkey,
|
|
/// Mint account.
|
|
mint: crate::MdPubkey,
|
|
/// Owner, delegate or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Exact raw amount.
|
|
amount: crate::ExSplTokenAmount,
|
|
},
|
|
/// Close a token account.
|
|
CloseAccount {
|
|
/// Token account to close.
|
|
account: crate::MdPubkey,
|
|
/// Lamport destination.
|
|
destination: crate::MdPubkey,
|
|
/// Owner or close authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Freeze a token account.
|
|
FreezeAccount {
|
|
/// Token account to freeze.
|
|
account: crate::MdPubkey,
|
|
/// Mint account.
|
|
mint: crate::MdPubkey,
|
|
/// Freeze authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Thaw a token account.
|
|
ThawAccount {
|
|
/// Token account to thaw.
|
|
account: crate::MdPubkey,
|
|
/// Mint account.
|
|
mint: crate::MdPubkey,
|
|
/// Freeze authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Transfer while checking an explicit mint and decimals value.
|
|
TransferChecked {
|
|
/// Source token account.
|
|
source: crate::MdPubkey,
|
|
/// Mint account.
|
|
mint: crate::MdPubkey,
|
|
/// Destination token account.
|
|
destination: crate::MdPubkey,
|
|
/// Owner, delegate or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Exact raw amount.
|
|
amount: crate::ExSplTokenAmount,
|
|
/// Expected mint decimals.
|
|
decimals: u8,
|
|
},
|
|
/// Approve a delegate while checking an explicit mint and decimals value.
|
|
ApproveChecked {
|
|
/// Source token account.
|
|
source: crate::MdPubkey,
|
|
/// Mint account.
|
|
mint: crate::MdPubkey,
|
|
/// Delegate account.
|
|
delegate: crate::MdPubkey,
|
|
/// Owner or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Exact raw allowance.
|
|
amount: crate::ExSplTokenAmount,
|
|
/// Expected mint decimals.
|
|
decimals: u8,
|
|
},
|
|
/// Mint while checking explicit decimals.
|
|
MintToChecked {
|
|
/// Mint account.
|
|
mint: crate::MdPubkey,
|
|
/// Destination token account.
|
|
destination: crate::MdPubkey,
|
|
/// Mint authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Exact raw amount.
|
|
amount: crate::ExSplTokenAmount,
|
|
/// Expected mint decimals.
|
|
decimals: u8,
|
|
},
|
|
/// Burn while checking explicit decimals.
|
|
BurnChecked {
|
|
/// Source token account.
|
|
source: crate::MdPubkey,
|
|
/// Mint account.
|
|
mint: crate::MdPubkey,
|
|
/// Owner, delegate or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Exact raw amount.
|
|
amount: crate::ExSplTokenAmount,
|
|
/// Expected mint decimals.
|
|
decimals: u8,
|
|
},
|
|
/// Synchronize a wrapped-SOL account.
|
|
SyncNative {
|
|
/// Wrapped-SOL token account.
|
|
account: crate::MdPubkey,
|
|
/// Include the optional Rent sysvar account published by interface 3.0.0.
|
|
include_rent_sysvar: bool,
|
|
},
|
|
/// Query the token-account size for a mint.
|
|
GetAccountDataSize {
|
|
/// Mint account.
|
|
mint: crate::MdPubkey,
|
|
},
|
|
/// Build the classic-program immutable-owner compatibility no-op.
|
|
InitializeImmutableOwner {
|
|
/// Token account being prepared.
|
|
account: crate::MdPubkey,
|
|
},
|
|
/// Convert a raw amount using mint decimals through return data.
|
|
AmountToUiAmount {
|
|
/// Mint account.
|
|
mint: crate::MdPubkey,
|
|
/// Exact raw amount.
|
|
amount: crate::ExSplTokenAmount,
|
|
},
|
|
/// Convert a UI amount using mint decimals through return data.
|
|
UiAmountToAmount {
|
|
/// Mint account.
|
|
mint: crate::MdPubkey,
|
|
/// Exact UTF-8 UI amount.
|
|
ui_amount: std::string::String,
|
|
},
|
|
/// Withdraw lamports above rent exemption.
|
|
WithdrawExcessLamports {
|
|
/// Program-owned source account.
|
|
account: crate::MdPubkey,
|
|
/// Lamport destination.
|
|
destination: crate::MdPubkey,
|
|
/// Owner or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Reallocate a token account to add extension storage.
|
|
Reallocate {
|
|
/// Token account to grow.
|
|
account: crate::MdPubkey,
|
|
/// Payer funding rent growth.
|
|
payer: crate::MdPubkey,
|
|
/// Owner or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Ordered published extension type codes.
|
|
extension_types: std::vec::Vec<u16>,
|
|
},
|
|
/// Initialize the non-transferable mint extension before mint initialization.
|
|
InitializeNonTransferableMint {
|
|
/// Mint receiving the non-transferable extension.
|
|
mint: crate::MdPubkey,
|
|
},
|
|
/// Initialize a permanent delegate before mint initialization.
|
|
InitializePermanentDelegate {
|
|
/// Mint receiving the permanent delegate extension.
|
|
mint: crate::MdPubkey,
|
|
/// Permanent delegate public key.
|
|
delegate: crate::MdPubkey,
|
|
},
|
|
/// Initialize interest-bearing configuration before mint initialization.
|
|
InitializeInterestBearingMint {
|
|
/// Mint receiving the interest-bearing extension.
|
|
mint: crate::MdPubkey,
|
|
/// Optional authority allowed to update the rate.
|
|
rate_authority: std::option::Option<crate::MdPubkey>,
|
|
/// Initial signed interest rate in basis points.
|
|
rate_basis_points: i16,
|
|
},
|
|
/// Update the interest-bearing rate through a simple or multisig authority.
|
|
UpdateInterestBearingRate {
|
|
/// Interest-bearing mint to update.
|
|
mint: crate::MdPubkey,
|
|
/// Current rate authority or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// New signed interest rate in basis points.
|
|
rate_basis_points: i16,
|
|
},
|
|
/// Initialize transfer-fee configuration before mint initialization.
|
|
InitializeTransferFeeConfig {
|
|
/// Mint receiving the extension.
|
|
mint: crate::MdPubkey,
|
|
/// Optional authority allowed to update fee parameters.
|
|
transfer_fee_config_authority: std::option::Option<crate::MdPubkey>,
|
|
/// Optional authority allowed to withdraw withheld fees.
|
|
withdraw_withheld_authority: std::option::Option<crate::MdPubkey>,
|
|
/// Fee in basis points, bounded by the official interface.
|
|
transfer_fee_basis_points: u16,
|
|
/// Maximum raw fee amount.
|
|
maximum_fee: crate::ExSplTokenAmount,
|
|
},
|
|
/// Update transfer-fee parameters.
|
|
SetTransferFee {
|
|
/// Mint containing `TransferFeeConfig`.
|
|
mint: crate::MdPubkey,
|
|
/// Current transfer-fee configuration authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// New fee in basis points.
|
|
transfer_fee_basis_points: u16,
|
|
/// New maximum raw fee amount.
|
|
maximum_fee: crate::ExSplTokenAmount,
|
|
},
|
|
/// Transfer a checked amount while asserting the exact expected fee.
|
|
TransferCheckedWithFee {
|
|
/// Source token account.
|
|
source: crate::MdPubkey,
|
|
/// Mint account.
|
|
mint: crate::MdPubkey,
|
|
/// Destination token account.
|
|
destination: crate::MdPubkey,
|
|
/// Owner, delegate or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Exact raw amount.
|
|
amount: crate::ExSplTokenAmount,
|
|
/// Mint decimals asserted by the wire.
|
|
decimals: u8,
|
|
/// Exact expected raw fee.
|
|
fee: crate::ExSplTokenAmount,
|
|
},
|
|
/// Withdraw all fees withheld by a mint.
|
|
WithdrawWithheldTokensFromMint {
|
|
/// Mint containing `TransferFeeConfig`.
|
|
mint: crate::MdPubkey,
|
|
/// Destination token account.
|
|
destination: crate::MdPubkey,
|
|
/// Withdraw-withheld authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Withdraw all fees withheld by an ordered set of token accounts.
|
|
WithdrawWithheldTokensFromAccounts {
|
|
/// Mint shared by all source accounts.
|
|
mint: crate::MdPubkey,
|
|
/// Destination token account.
|
|
destination: crate::MdPubkey,
|
|
/// Withdraw-withheld authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Ordered source token accounts.
|
|
sources: std::vec::Vec<crate::MdPubkey>,
|
|
},
|
|
/// Permissionlessly harvest withheld fees from token accounts into a mint.
|
|
HarvestWithheldTokensToMint {
|
|
/// Destination mint.
|
|
mint: crate::MdPubkey,
|
|
/// Ordered source token accounts.
|
|
sources: std::vec::Vec<crate::MdPubkey>,
|
|
},
|
|
/// Initialize the default state for accounts created from a mint.
|
|
InitializeDefaultAccountState {
|
|
/// Mint receiving the extension before mint initialization.
|
|
mint: crate::MdPubkey,
|
|
/// Default state for subsequently initialized token accounts.
|
|
state: crate::ExSplTokenDefaultAccountState,
|
|
},
|
|
/// Update the default state through the mint freeze authority.
|
|
UpdateDefaultAccountState {
|
|
/// Mint containing the extension.
|
|
mint: crate::MdPubkey,
|
|
/// Current freeze authority or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// New default account state.
|
|
state: crate::ExSplTokenDefaultAccountState,
|
|
},
|
|
/// Require incoming transfers to be preceded by a memo.
|
|
EnableRequiredTransferMemos {
|
|
/// Token account to update.
|
|
account: crate::MdPubkey,
|
|
/// Token-account owner or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Stop requiring incoming-transfer memos.
|
|
DisableRequiredTransferMemos {
|
|
/// Token account to update.
|
|
account: crate::MdPubkey,
|
|
/// Token-account owner or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Enable CPI Guard for a token account.
|
|
EnableCpiGuard {
|
|
/// Token account to update.
|
|
account: crate::MdPubkey,
|
|
/// Token-account owner or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Disable CPI Guard for a token account.
|
|
DisableCpiGuard {
|
|
/// Token account to update.
|
|
account: crate::MdPubkey,
|
|
/// Token-account owner or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Initialize a transfer-hook extension before mint initialization.
|
|
InitializeTransferHook {
|
|
/// Mint receiving the extension.
|
|
mint: crate::MdPubkey,
|
|
/// Optional authority allowed to update the hook program id.
|
|
authority: std::option::Option<crate::MdPubkey>,
|
|
/// Optional program invoked during transfers.
|
|
program_id: std::option::Option<crate::MdPubkey>,
|
|
},
|
|
/// Update or clear the transfer-hook program id.
|
|
UpdateTransferHook {
|
|
/// Mint containing the extension.
|
|
mint: crate::MdPubkey,
|
|
/// Current simple or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// New hook program id, or `None` to clear it.
|
|
program_id: std::option::Option<crate::MdPubkey>,
|
|
},
|
|
/// Initialize a metadata pointer before mint initialization.
|
|
InitializeMetadataPointer {
|
|
/// Mint receiving the extension.
|
|
mint: crate::MdPubkey,
|
|
/// Optional authority allowed to update the pointer.
|
|
authority: std::option::Option<crate::MdPubkey>,
|
|
/// Optional account holding metadata.
|
|
metadata_address: std::option::Option<crate::MdPubkey>,
|
|
},
|
|
/// Update or clear a metadata pointer.
|
|
UpdateMetadataPointer {
|
|
/// Mint containing the extension.
|
|
mint: crate::MdPubkey,
|
|
/// Current simple or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// New metadata account, or `None` to clear it.
|
|
metadata_address: std::option::Option<crate::MdPubkey>,
|
|
},
|
|
/// Initialize a group pointer before mint initialization.
|
|
InitializeGroupPointer {
|
|
/// Mint receiving the extension.
|
|
mint: crate::MdPubkey,
|
|
/// Optional authority allowed to update the pointer.
|
|
authority: std::option::Option<crate::MdPubkey>,
|
|
/// Optional account holding the group.
|
|
group_address: std::option::Option<crate::MdPubkey>,
|
|
},
|
|
/// Update or clear a group pointer.
|
|
UpdateGroupPointer {
|
|
/// Mint containing the extension.
|
|
mint: crate::MdPubkey,
|
|
/// Current simple or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// New group account, or `None` to clear it.
|
|
group_address: std::option::Option<crate::MdPubkey>,
|
|
},
|
|
/// Initialize a group-member pointer before mint initialization.
|
|
InitializeGroupMemberPointer {
|
|
/// Mint receiving the extension.
|
|
mint: crate::MdPubkey,
|
|
/// Optional authority allowed to update the pointer.
|
|
authority: std::option::Option<crate::MdPubkey>,
|
|
/// Optional account holding the group member.
|
|
member_address: std::option::Option<crate::MdPubkey>,
|
|
},
|
|
/// Update or clear a group-member pointer.
|
|
UpdateGroupMemberPointer {
|
|
/// Mint containing the extension.
|
|
mint: crate::MdPubkey,
|
|
/// Current simple or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// New group-member account, or `None` to clear it.
|
|
member_address: std::option::Option<crate::MdPubkey>,
|
|
},
|
|
/// Initialize Token-2022 metadata in the mint account.
|
|
InitializeTokenMetadata {
|
|
/// Metadata account, normally the mint itself.
|
|
metadata: crate::MdPubkey,
|
|
/// Update authority stored in metadata.
|
|
update_authority: crate::MdPubkey,
|
|
/// Associated mint.
|
|
mint: crate::MdPubkey,
|
|
/// Current mint authority signer.
|
|
mint_authority: crate::MdPubkey,
|
|
/// Bounded token name.
|
|
name: std::string::String,
|
|
/// Bounded token symbol.
|
|
symbol: std::string::String,
|
|
/// Bounded metadata URI.
|
|
uri: std::string::String,
|
|
},
|
|
/// Update a required or additional metadata field.
|
|
UpdateTokenMetadataField {
|
|
/// Metadata account.
|
|
metadata: crate::MdPubkey,
|
|
/// Current update authority signer.
|
|
update_authority: crate::MdPubkey,
|
|
/// Field to update.
|
|
field: crate::ExSplTokenMetadataField,
|
|
/// New bounded value.
|
|
value: std::string::String,
|
|
},
|
|
/// Remove an additional metadata key.
|
|
RemoveTokenMetadataKey {
|
|
/// Metadata account.
|
|
metadata: crate::MdPubkey,
|
|
/// Current update authority signer.
|
|
update_authority: crate::MdPubkey,
|
|
/// Additional key to remove.
|
|
key: std::string::String,
|
|
/// Whether a missing key is accepted.
|
|
idempotent: bool,
|
|
},
|
|
/// Initialize a Token Group entry.
|
|
InitializeTokenGroup {
|
|
/// Group state account, normally the group mint.
|
|
group: crate::MdPubkey,
|
|
/// Group mint.
|
|
mint: crate::MdPubkey,
|
|
/// Current mint authority signer.
|
|
mint_authority: crate::MdPubkey,
|
|
/// Optional future group update authority.
|
|
update_authority: std::option::Option<crate::MdPubkey>,
|
|
/// Maximum number of members.
|
|
max_size: u64,
|
|
},
|
|
/// Update a Token Group maximum size.
|
|
UpdateTokenGroupMaxSize {
|
|
/// Group state account.
|
|
group: crate::MdPubkey,
|
|
/// Current group update authority signer.
|
|
update_authority: crate::MdPubkey,
|
|
/// New maximum number of members.
|
|
max_size: u64,
|
|
},
|
|
/// Initialize a Token Group Member entry.
|
|
InitializeTokenGroupMember {
|
|
/// Member state account, normally the member mint.
|
|
member: crate::MdPubkey,
|
|
/// Member mint.
|
|
member_mint: crate::MdPubkey,
|
|
/// Member mint authority signer.
|
|
member_mint_authority: crate::MdPubkey,
|
|
/// Group state account.
|
|
group: crate::MdPubkey,
|
|
/// Group update authority signer.
|
|
group_update_authority: crate::MdPubkey,
|
|
},
|
|
/// Initialize scaled UI amount configuration before mint initialization.
|
|
InitializeScaledUiAmount {
|
|
/// Mint receiving the extension.
|
|
mint: crate::MdPubkey,
|
|
/// Optional future multiplier authority.
|
|
authority: std::option::Option<crate::MdPubkey>,
|
|
/// Positive normal finite initial multiplier.
|
|
multiplier: crate::ExSplTokenMultiplier,
|
|
},
|
|
/// Schedule or immediately apply a scaled UI multiplier update.
|
|
UpdateScaledUiAmountMultiplier {
|
|
/// Mint containing the extension.
|
|
mint: crate::MdPubkey,
|
|
/// Current simple or multisig multiplier authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Positive normal finite new multiplier.
|
|
multiplier: crate::ExSplTokenMultiplier,
|
|
/// UNIX timestamp at which the multiplier becomes effective.
|
|
effective_timestamp: i64,
|
|
},
|
|
/// Initialize pausable configuration before mint initialization.
|
|
InitializePausableConfig {
|
|
/// Mint receiving the extension.
|
|
mint: crate::MdPubkey,
|
|
/// Authority permitted to pause and resume the mint.
|
|
authority: crate::MdPubkey,
|
|
},
|
|
/// Pause minting, burning and transferring.
|
|
Pause {
|
|
/// Mint containing pausable configuration.
|
|
mint: crate::MdPubkey,
|
|
/// Current simple or multisig pause authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Resume minting, burning and transferring.
|
|
Resume {
|
|
/// Mint containing pausable configuration.
|
|
mint: crate::MdPubkey,
|
|
/// Current simple or multisig pause authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Initialize permissioned burn before mint initialization.
|
|
InitializePermissionedBurn {
|
|
/// Mint receiving the extension.
|
|
mint: crate::MdPubkey,
|
|
/// Mandatory permissioned burn authority.
|
|
authority: crate::MdPubkey,
|
|
},
|
|
/// Burn using both the permissioned authority and source owner/delegate.
|
|
PermissionedBurn {
|
|
/// Source token account.
|
|
source: crate::MdPubkey,
|
|
/// Token mint.
|
|
mint: crate::MdPubkey,
|
|
/// Dedicated permissioned burn authority signer.
|
|
permissioned_burn_authority: crate::MdPubkey,
|
|
/// Source owner/delegate, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Raw amount to burn.
|
|
amount: crate::ExSplTokenAmount,
|
|
},
|
|
/// Checked permissioned burn with exact mint decimals.
|
|
PermissionedBurnChecked {
|
|
/// Source token account.
|
|
source: crate::MdPubkey,
|
|
/// Token mint.
|
|
mint: crate::MdPubkey,
|
|
/// Dedicated permissioned burn authority signer.
|
|
permissioned_burn_authority: crate::MdPubkey,
|
|
/// Source owner/delegate, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Raw amount to burn.
|
|
amount: crate::ExSplTokenAmount,
|
|
/// Expected mint decimals.
|
|
decimals: u8,
|
|
},
|
|
/// Initialize Confidential Transfer configuration before mint initialization.
|
|
InitializeConfidentialTransferMint {
|
|
/// Mint receiving the extension.
|
|
mint: crate::MdPubkey,
|
|
/// Optional authority for configuration updates and account approval.
|
|
authority: std::option::Option<crate::MdPubkey>,
|
|
/// Whether newly configured accounts are approved automatically.
|
|
auto_approve_new_accounts: bool,
|
|
/// Optional caller-generated auditor ElGamal public key.
|
|
auditor_elgamal_pubkey: std::option::Option<crate::ExSplTokenElGamalPubkey>,
|
|
},
|
|
/// Update Confidential Transfer mint configuration.
|
|
UpdateConfidentialTransferMint {
|
|
/// Mint containing the extension.
|
|
mint: crate::MdPubkey,
|
|
/// Current configuration authority, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Whether newly configured accounts are approved automatically.
|
|
auto_approve_new_accounts: bool,
|
|
/// Optional caller-generated auditor ElGamal public key.
|
|
auditor_elgamal_pubkey: std::option::Option<crate::ExSplTokenElGamalPubkey>,
|
|
},
|
|
/// Apply pending confidential credits to the available balance.
|
|
ApplyPendingConfidentialBalance {
|
|
/// Token account whose pending credits are applied.
|
|
account: crate::MdPubkey,
|
|
/// Expected pending-balance credit counter.
|
|
expected_pending_balance_credit_counter: u64,
|
|
/// Caller-generated new decryptable available balance.
|
|
new_decryptable_available_balance: crate::ExSplTokenDecryptableBalance,
|
|
/// Owner or delegate, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Approve a configured account for confidential transfers.
|
|
ApproveConfidentialTransferAccount {
|
|
/// Token account to approve.
|
|
account: crate::MdPubkey,
|
|
/// Mint containing the confidential-transfer configuration.
|
|
mint: crate::MdPubkey,
|
|
/// Confidential-transfer mint authority, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Deposit a public token amount into the account confidential pending balance.
|
|
DepositConfidentialTokens {
|
|
/// Token account receiving the confidential pending credit.
|
|
account: crate::MdPubkey,
|
|
/// Token mint.
|
|
mint: crate::MdPubkey,
|
|
/// Owner or delegate, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Exact public amount deposited.
|
|
amount: crate::ExSplTokenAmount,
|
|
/// Expected mint decimals.
|
|
decimals: u8,
|
|
},
|
|
/// Enable incoming confidential credits on a configured token account.
|
|
EnableConfidentialCredits {
|
|
/// Token account to update.
|
|
account: crate::MdPubkey,
|
|
/// Owner or delegate, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Disable incoming confidential credits on a configured token account.
|
|
DisableConfidentialCredits {
|
|
/// Token account to update.
|
|
account: crate::MdPubkey,
|
|
/// Owner or delegate, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Enable incoming non-confidential credits on a configured token account.
|
|
EnableNonConfidentialCredits {
|
|
/// Token account to update.
|
|
account: crate::MdPubkey,
|
|
/// Owner or delegate, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Disable incoming non-confidential credits on a configured token account.
|
|
DisableNonConfidentialCredits {
|
|
/// Token account to update.
|
|
account: crate::MdPubkey,
|
|
/// Owner or delegate, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Configure a confidential token account using a public-key validity proof reference.
|
|
ConfigureConfidentialTransferAccount {
|
|
/// Token account receiving the confidential extension.
|
|
account: crate::MdPubkey,
|
|
/// Corresponding Token-2022 mint.
|
|
mint: crate::MdPubkey,
|
|
/// Caller-generated decryptable zero balance.
|
|
decryptable_zero_balance: crate::ExSplTokenDecryptableBalance,
|
|
/// Maximum accepted pending-balance credit counter.
|
|
maximum_pending_balance_credit_counter: u64,
|
|
/// Owner or delegate, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Exact PubkeyValidity proof reference.
|
|
proof: crate::ExSplTokenConfidentialProofReference,
|
|
},
|
|
/// Configure a confidential token account through an ElGamal Registry account.
|
|
ConfigureConfidentialTransferAccountWithRegistry {
|
|
/// Token account receiving the confidential extension.
|
|
account: crate::MdPubkey,
|
|
/// Corresponding Token-2022 mint.
|
|
mint: crate::MdPubkey,
|
|
/// Valid ElGamal Registry PDA for the token-account owner.
|
|
registry_account: crate::MdPubkey,
|
|
/// Optional payer used only when the account must be reallocated.
|
|
payer: std::option::Option<crate::MdPubkey>,
|
|
},
|
|
/// Empty the confidential available-balance ciphertext before account close.
|
|
EmptyConfidentialTransferAccount {
|
|
/// Token account whose available confidential balance must already be zero.
|
|
account: crate::MdPubkey,
|
|
/// Owner or delegate, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Exact ZeroCiphertext proof reference.
|
|
proof: crate::ExSplTokenConfidentialProofReference,
|
|
},
|
|
/// Withdraw confidential available balance into the public token balance.
|
|
WithdrawConfidentialTokens {
|
|
/// Token account whose confidential available balance is debited.
|
|
account: crate::MdPubkey,
|
|
/// Token mint.
|
|
mint: crate::MdPubkey,
|
|
/// Exact raw amount withdrawn.
|
|
amount: crate::ExSplTokenAmount,
|
|
/// Expected mint decimals.
|
|
decimals: u8,
|
|
/// Caller-generated new decryptable available balance.
|
|
new_decryptable_available_balance: crate::ExSplTokenDecryptableBalance,
|
|
/// Owner or delegate, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Ciphertext-commitment equality proof reference.
|
|
equality_proof: crate::ExSplTokenConfidentialProofReference,
|
|
/// Batched U64 range proof reference.
|
|
range_proof: crate::ExSplTokenConfidentialProofReference,
|
|
},
|
|
/// Transfer confidential tokens between two Token-2022 accounts.
|
|
TransferConfidentialTokens {
|
|
/// Source token account whose confidential available balance is debited.
|
|
source: crate::MdPubkey,
|
|
/// Token mint.
|
|
mint: crate::MdPubkey,
|
|
/// Destination token account whose pending confidential balance is credited.
|
|
destination: crate::MdPubkey,
|
|
/// Caller-generated new source decryptable available balance.
|
|
new_source_decryptable_available_balance: crate::ExSplTokenDecryptableBalance,
|
|
/// Caller-generated lower auditor ciphertext component.
|
|
transfer_amount_auditor_ciphertext_lo: crate::ExSplTokenElGamalCiphertext,
|
|
/// Caller-generated upper auditor ciphertext component.
|
|
transfer_amount_auditor_ciphertext_hi: crate::ExSplTokenElGamalCiphertext,
|
|
/// Source owner or delegate, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Ciphertext-commitment equality proof reference.
|
|
equality_proof: crate::ExSplTokenConfidentialProofReference,
|
|
/// Batched grouped-ciphertext validity proof reference.
|
|
ciphertext_validity_proof: crate::ExSplTokenConfidentialProofReference,
|
|
/// Batched U128 range proof reference.
|
|
range_proof: crate::ExSplTokenConfidentialProofReference,
|
|
},
|
|
/// Transfer confidential tokens while applying the mint confidential transfer fee.
|
|
TransferConfidentialTokensWithFee {
|
|
/// Source token account whose confidential available balance is debited.
|
|
source: crate::MdPubkey,
|
|
/// Token mint.
|
|
mint: crate::MdPubkey,
|
|
/// Destination token account whose pending confidential balance is credited.
|
|
destination: crate::MdPubkey,
|
|
/// Caller-generated new source decryptable available balance.
|
|
new_source_decryptable_available_balance: crate::ExSplTokenDecryptableBalance,
|
|
/// Caller-generated lower auditor ciphertext component.
|
|
transfer_amount_auditor_ciphertext_lo: crate::ExSplTokenElGamalCiphertext,
|
|
/// Caller-generated upper auditor ciphertext component.
|
|
transfer_amount_auditor_ciphertext_hi: crate::ExSplTokenElGamalCiphertext,
|
|
/// Source owner or delegate, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Ciphertext-commitment equality proof reference.
|
|
equality_proof: crate::ExSplTokenConfidentialProofReference,
|
|
/// Transfer-amount grouped-ciphertext validity proof reference.
|
|
transfer_amount_ciphertext_validity_proof: crate::ExSplTokenConfidentialProofReference,
|
|
/// Percentage-with-fee proof reference.
|
|
fee_sigma_proof: crate::ExSplTokenConfidentialProofReference,
|
|
/// Fee-ciphertext grouped-validity proof reference.
|
|
fee_ciphertext_validity_proof: crate::ExSplTokenConfidentialProofReference,
|
|
/// Batched U256 range proof reference.
|
|
range_proof: crate::ExSplTokenConfidentialProofReference,
|
|
},
|
|
/// Initialize confidential transfer fee configuration before mint initialization.
|
|
InitializeConfidentialTransferFeeConfig {
|
|
/// Mint receiving the extension.
|
|
mint: crate::MdPubkey,
|
|
/// Optional authority permitted to enable or disable harvest to mint.
|
|
authority: std::option::Option<crate::MdPubkey>,
|
|
/// Caller-provided ElGamal public key used to encrypt withheld fees.
|
|
withdraw_withheld_authority_elgamal_pubkey: crate::ExSplTokenElGamalPubkey,
|
|
},
|
|
/// Enable permissionless harvest of confidential withheld fees to the mint.
|
|
EnableConfidentialTransferFeeHarvest {
|
|
/// Mint containing confidential transfer fee configuration.
|
|
mint: crate::MdPubkey,
|
|
/// Current confidential transfer fee authority, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Disable permissionless harvest of confidential withheld fees to the mint.
|
|
DisableConfidentialTransferFeeHarvest {
|
|
/// Mint containing confidential transfer fee configuration.
|
|
mint: crate::MdPubkey,
|
|
/// Current confidential transfer fee authority, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Harvest confidential withheld fees from ordered token accounts to the mint.
|
|
HarvestConfidentialWithheldTokensToMint {
|
|
/// Mint receiving aggregated confidential withheld fees.
|
|
mint: crate::MdPubkey,
|
|
/// Ordered distinct source token accounts.
|
|
sources: std::vec::Vec<crate::MdPubkey>,
|
|
},
|
|
/// Withdraw all confidential withheld fees aggregated on the mint.
|
|
WithdrawConfidentialWithheldTokensFromMint {
|
|
/// Mint containing the aggregated confidential withheld ciphertext.
|
|
mint: crate::MdPubkey,
|
|
/// Confidential-transfer account receiving the withdrawn fees.
|
|
destination: crate::MdPubkey,
|
|
/// Caller-generated new decryptable available balance for the destination.
|
|
new_decryptable_available_balance: crate::ExSplTokenDecryptableBalance,
|
|
/// Mint withdraw-withheld authority, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Ciphertext-ciphertext equality proof reference.
|
|
proof: crate::ExSplTokenConfidentialProofReference,
|
|
},
|
|
/// Withdraw confidential withheld fees directly from ordered token accounts.
|
|
WithdrawConfidentialWithheldTokensFromAccounts {
|
|
/// Mint governing the confidential transfer fee configuration.
|
|
mint: crate::MdPubkey,
|
|
/// Confidential-transfer account receiving the withdrawn fees.
|
|
destination: crate::MdPubkey,
|
|
/// Caller-generated new decryptable available balance for the destination.
|
|
new_decryptable_available_balance: crate::ExSplTokenDecryptableBalance,
|
|
/// Mint withdraw-withheld authority, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Ordered distinct source token accounts.
|
|
sources: std::vec::Vec<crate::MdPubkey>,
|
|
/// Ciphertext-ciphertext equality proof reference.
|
|
proof: crate::ExSplTokenConfidentialProofReference,
|
|
},
|
|
/// Initialize confidential mint and burn configuration before mint initialization.
|
|
InitializeConfidentialMintBurnMint {
|
|
/// Mint receiving the confidential mint-burn extension.
|
|
mint: crate::MdPubkey,
|
|
/// Caller-provided ElGamal public key used for confidential supply encryption.
|
|
supply_elgamal_pubkey: crate::ExSplTokenElGamalPubkey,
|
|
/// Caller-provided initial decryptable zero supply.
|
|
decryptable_supply: crate::ExSplTokenDecryptableBalance,
|
|
},
|
|
/// Rotate the ElGamal public key used for confidential supply encryption.
|
|
RotateConfidentialSupplyElGamalPubkey {
|
|
/// Mint containing the confidential mint-burn extension.
|
|
mint: crate::MdPubkey,
|
|
/// New caller-provided supply ElGamal public key.
|
|
new_supply_elgamal_pubkey: crate::ExSplTokenElGamalPubkey,
|
|
/// Confidential mint authority, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Ciphertext-ciphertext equality proof reference.
|
|
proof: crate::ExSplTokenConfidentialProofReference,
|
|
},
|
|
/// Update the caller-decryptable confidential supply ciphertext.
|
|
UpdateConfidentialDecryptableSupply {
|
|
/// Mint containing the confidential mint-burn extension.
|
|
mint: crate::MdPubkey,
|
|
/// New caller-provided decryptable supply.
|
|
new_decryptable_supply: crate::ExSplTokenDecryptableBalance,
|
|
/// Confidential mint authority, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Apply the pending confidential burn ciphertext to the supply.
|
|
ApplyPendingConfidentialBurn {
|
|
/// Mint containing the confidential mint-burn extension.
|
|
mint: crate::MdPubkey,
|
|
/// Confidential mint authority, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
},
|
|
/// Mint tokens directly into one confidential token account.
|
|
ConfidentialMint {
|
|
/// Confidential token account receiving the minted amount.
|
|
destination: crate::MdPubkey,
|
|
/// Mint containing the confidential mint-burn extension.
|
|
mint: crate::MdPubkey,
|
|
/// Caller-generated new decryptable confidential supply.
|
|
new_decryptable_supply: crate::ExSplTokenDecryptableBalance,
|
|
/// Mint amount ciphertext under the auditor key, low limb.
|
|
mint_amount_auditor_ciphertext_lo: crate::ExSplTokenElGamalCiphertext,
|
|
/// Mint amount ciphertext under the auditor key, high limb.
|
|
mint_amount_auditor_ciphertext_hi: crate::ExSplTokenElGamalCiphertext,
|
|
/// Confidential mint authority, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Ciphertext-commitment equality proof reference.
|
|
equality_proof: crate::ExSplTokenConfidentialProofReference,
|
|
/// Three-handle grouped-ciphertext validity proof reference.
|
|
ciphertext_validity_proof: crate::ExSplTokenConfidentialProofReference,
|
|
/// Batched U128 range proof reference.
|
|
range_proof: crate::ExSplTokenConfidentialProofReference,
|
|
},
|
|
/// Burn tokens directly from one confidential token account.
|
|
ConfidentialBurn {
|
|
/// Confidential token account supplying the burned amount.
|
|
source: crate::MdPubkey,
|
|
/// Mint containing the confidential mint-burn extension.
|
|
mint: crate::MdPubkey,
|
|
/// Caller-generated new decryptable available balance for the source.
|
|
new_decryptable_available_balance: crate::ExSplTokenDecryptableBalance,
|
|
/// Burn amount ciphertext under the auditor key, low limb.
|
|
burn_amount_auditor_ciphertext_lo: crate::ExSplTokenElGamalCiphertext,
|
|
/// Burn amount ciphertext under the auditor key, high limb.
|
|
burn_amount_auditor_ciphertext_hi: crate::ExSplTokenElGamalCiphertext,
|
|
/// Confidential account owner/delegate, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Ciphertext-commitment equality proof reference.
|
|
equality_proof: crate::ExSplTokenConfidentialProofReference,
|
|
/// Three-handle grouped-ciphertext validity proof reference.
|
|
ciphertext_validity_proof: crate::ExSplTokenConfidentialProofReference,
|
|
/// Batched U128 range proof reference.
|
|
range_proof: crate::ExSplTokenConfidentialProofReference,
|
|
},
|
|
/// Burn tokens from one confidential account with the mint permissioned-burn authority.
|
|
PermissionedConfidentialBurn {
|
|
/// Confidential token account supplying the burned amount.
|
|
source: crate::MdPubkey,
|
|
/// Mint containing Permissioned Burn and Confidential Mint/Burn extensions.
|
|
mint: crate::MdPubkey,
|
|
/// Permissioned-burn authority configured on the mint; always a direct signer.
|
|
permissioned_burn_authority: crate::MdPubkey,
|
|
/// Caller-generated new decryptable available balance for the source.
|
|
new_decryptable_available_balance: crate::ExSplTokenDecryptableBalance,
|
|
/// Burn amount ciphertext under the auditor key, low limb.
|
|
burn_amount_auditor_ciphertext_lo: crate::ExSplTokenElGamalCiphertext,
|
|
/// Burn amount ciphertext under the auditor key, high limb.
|
|
burn_amount_auditor_ciphertext_hi: crate::ExSplTokenElGamalCiphertext,
|
|
/// Confidential account owner/delegate, simple or multisig.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Ciphertext-commitment equality proof reference.
|
|
equality_proof: crate::ExSplTokenConfidentialProofReference,
|
|
/// Three-handle grouped-ciphertext validity proof reference.
|
|
ciphertext_validity_proof: crate::ExSplTokenConfidentialProofReference,
|
|
/// Batched U128 range proof reference.
|
|
range_proof: crate::ExSplTokenConfidentialProofReference,
|
|
},
|
|
/// Unwrap some or all lamports from a wrapped-SOL account.
|
|
UnwrapLamports {
|
|
/// Wrapped-SOL token account.
|
|
account: crate::MdPubkey,
|
|
/// Lamport destination.
|
|
destination: crate::MdPubkey,
|
|
/// Owner or multisig authority.
|
|
authority: crate::ExSplTokenAuthority,
|
|
/// Exact lamports to unwrap, or `None` for the complete balance.
|
|
amount_lamports: std::option::Option<crate::ExSplTokenAmount>,
|
|
},
|
|
}
|
|
|
|
impl crate::ExSplTokenSingleOperation {
|
|
/// Returns the stable operation code.
|
|
pub fn operation_code(&self) -> &'static str {
|
|
return match self {
|
|
Self::InitializeMint { .. } => crate::EX_SPL_TOKEN_2022_INITIALIZE_MINT_OPERATION,
|
|
Self::InitializeAccount { .. } => crate::EX_SPL_TOKEN_2022_INITIALIZE_ACCOUNT_OPERATION,
|
|
Self::InitializeMultisig { .. } => crate::EX_SPL_TOKEN_2022_INITIALIZE_MULTISIG_OPERATION,
|
|
Self::Transfer { .. } => crate::EX_SPL_TOKEN_2022_TRANSFER_OPERATION,
|
|
Self::Approve { .. } => crate::EX_SPL_TOKEN_2022_APPROVE_OPERATION,
|
|
Self::Revoke { .. } => crate::EX_SPL_TOKEN_2022_REVOKE_OPERATION,
|
|
Self::SetAuthority { .. } => crate::EX_SPL_TOKEN_2022_SET_AUTHORITY_OPERATION,
|
|
Self::MintTo { .. } => crate::EX_SPL_TOKEN_2022_MINT_TO_OPERATION,
|
|
Self::Burn { .. } => crate::EX_SPL_TOKEN_2022_BURN_OPERATION,
|
|
Self::CloseAccount { .. } => crate::EX_SPL_TOKEN_2022_CLOSE_ACCOUNT_OPERATION,
|
|
Self::FreezeAccount { .. } => crate::EX_SPL_TOKEN_2022_FREEZE_ACCOUNT_OPERATION,
|
|
Self::ThawAccount { .. } => crate::EX_SPL_TOKEN_2022_THAW_ACCOUNT_OPERATION,
|
|
Self::TransferChecked { .. } => crate::EX_SPL_TOKEN_2022_TRANSFER_CHECKED_OPERATION,
|
|
Self::ApproveChecked { .. } => crate::EX_SPL_TOKEN_2022_APPROVE_CHECKED_OPERATION,
|
|
Self::MintToChecked { .. } => crate::EX_SPL_TOKEN_2022_MINT_TO_CHECKED_OPERATION,
|
|
Self::BurnChecked { .. } => crate::EX_SPL_TOKEN_2022_BURN_CHECKED_OPERATION,
|
|
Self::SyncNative { .. } => crate::EX_SPL_TOKEN_2022_SYNC_NATIVE_OPERATION,
|
|
Self::GetAccountDataSize { .. } => crate::EX_SPL_TOKEN_2022_GET_ACCOUNT_DATA_SIZE_OPERATION,
|
|
Self::InitializeImmutableOwner { .. } => crate::EX_SPL_TOKEN_2022_INITIALIZE_IMMUTABLE_OWNER_OPERATION,
|
|
Self::AmountToUiAmount { .. } => crate::EX_SPL_TOKEN_2022_AMOUNT_TO_UI_AMOUNT_OPERATION,
|
|
Self::UiAmountToAmount { .. } => crate::EX_SPL_TOKEN_2022_UI_AMOUNT_TO_AMOUNT_OPERATION,
|
|
Self::WithdrawExcessLamports { .. } => crate::EX_SPL_TOKEN_2022_WITHDRAW_EXCESS_LAMPORTS_OPERATION,
|
|
Self::InitializeTransferFeeConfig { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_INITIALIZE_TRANSFER_FEE_CONFIG_OPERATION
|
|
},
|
|
Self::SetTransferFee { .. } => crate::EX_SPL_TOKEN_2022_SET_TRANSFER_FEE_OPERATION,
|
|
Self::TransferCheckedWithFee { .. } => crate::EX_SPL_TOKEN_2022_TRANSFER_CHECKED_WITH_FEE_OPERATION,
|
|
Self::WithdrawWithheldTokensFromMint { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_WITHDRAW_WITHHELD_TOKENS_FROM_MINT_OPERATION
|
|
},
|
|
Self::WithdrawWithheldTokensFromAccounts { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_WITHDRAW_WITHHELD_TOKENS_FROM_ACCOUNTS_OPERATION
|
|
},
|
|
Self::HarvestWithheldTokensToMint { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_HARVEST_WITHHELD_TOKENS_TO_MINT_OPERATION
|
|
},
|
|
Self::InitializeDefaultAccountState { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_INITIALIZE_DEFAULT_ACCOUNT_STATE_OPERATION
|
|
},
|
|
Self::UpdateDefaultAccountState { .. } => crate::EX_SPL_TOKEN_2022_UPDATE_DEFAULT_ACCOUNT_STATE_OPERATION,
|
|
Self::EnableRequiredTransferMemos { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_ENABLE_REQUIRED_TRANSFER_MEMOS_OPERATION
|
|
},
|
|
Self::DisableRequiredTransferMemos { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_DISABLE_REQUIRED_TRANSFER_MEMOS_OPERATION
|
|
},
|
|
Self::EnableCpiGuard { .. } => crate::EX_SPL_TOKEN_2022_ENABLE_CPI_GUARD_OPERATION,
|
|
Self::DisableCpiGuard { .. } => crate::EX_SPL_TOKEN_2022_DISABLE_CPI_GUARD_OPERATION,
|
|
Self::InitializeTransferHook { .. } => crate::EX_SPL_TOKEN_2022_INITIALIZE_TRANSFER_HOOK_OPERATION,
|
|
Self::UpdateTransferHook { .. } => crate::EX_SPL_TOKEN_2022_UPDATE_TRANSFER_HOOK_OPERATION,
|
|
Self::InitializeMetadataPointer { .. } => crate::EX_SPL_TOKEN_2022_INITIALIZE_METADATA_POINTER_OPERATION,
|
|
Self::UpdateMetadataPointer { .. } => crate::EX_SPL_TOKEN_2022_UPDATE_METADATA_POINTER_OPERATION,
|
|
Self::InitializeGroupPointer { .. } => crate::EX_SPL_TOKEN_2022_INITIALIZE_GROUP_POINTER_OPERATION,
|
|
Self::UpdateGroupPointer { .. } => crate::EX_SPL_TOKEN_2022_UPDATE_GROUP_POINTER_OPERATION,
|
|
Self::InitializeGroupMemberPointer { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_INITIALIZE_GROUP_MEMBER_POINTER_OPERATION
|
|
},
|
|
Self::UpdateGroupMemberPointer { .. } => crate::EX_SPL_TOKEN_2022_UPDATE_GROUP_MEMBER_POINTER_OPERATION,
|
|
Self::InitializeTokenMetadata { .. } => crate::EX_SPL_TOKEN_2022_INITIALIZE_TOKEN_METADATA_OPERATION,
|
|
Self::UpdateTokenMetadataField { .. } => crate::EX_SPL_TOKEN_2022_UPDATE_TOKEN_METADATA_FIELD_OPERATION,
|
|
Self::RemoveTokenMetadataKey { .. } => crate::EX_SPL_TOKEN_2022_REMOVE_TOKEN_METADATA_KEY_OPERATION,
|
|
Self::InitializeTokenGroup { .. } => crate::EX_SPL_TOKEN_2022_INITIALIZE_TOKEN_GROUP_OPERATION,
|
|
Self::UpdateTokenGroupMaxSize { .. } => crate::EX_SPL_TOKEN_2022_UPDATE_TOKEN_GROUP_MAX_SIZE_OPERATION,
|
|
Self::InitializeTokenGroupMember { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_INITIALIZE_TOKEN_GROUP_MEMBER_OPERATION
|
|
},
|
|
Self::InitializeScaledUiAmount { .. } => crate::EX_SPL_TOKEN_2022_INITIALIZE_SCALED_UI_AMOUNT_OPERATION,
|
|
Self::UpdateScaledUiAmountMultiplier { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_UPDATE_SCALED_UI_AMOUNT_MULTIPLIER_OPERATION
|
|
},
|
|
Self::InitializePausableConfig { .. } => crate::EX_SPL_TOKEN_2022_INITIALIZE_PAUSABLE_CONFIG_OPERATION,
|
|
Self::Pause { .. } => crate::EX_SPL_TOKEN_2022_PAUSE_OPERATION,
|
|
Self::Resume { .. } => crate::EX_SPL_TOKEN_2022_RESUME_OPERATION,
|
|
Self::InitializePermissionedBurn { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_INITIALIZE_PERMISSIONED_BURN_OPERATION
|
|
},
|
|
Self::PermissionedBurn { .. } => crate::EX_SPL_TOKEN_2022_PERMISSIONED_BURN_OPERATION,
|
|
Self::PermissionedBurnChecked { .. } => crate::EX_SPL_TOKEN_2022_PERMISSIONED_BURN_CHECKED_OPERATION,
|
|
Self::InitializeConfidentialTransferMint { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_INITIALIZE_CONFIDENTIAL_TRANSFER_MINT_OPERATION
|
|
},
|
|
Self::UpdateConfidentialTransferMint { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_UPDATE_CONFIDENTIAL_TRANSFER_MINT_OPERATION
|
|
},
|
|
Self::ApplyPendingConfidentialBalance { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_APPLY_PENDING_CONFIDENTIAL_BALANCE_OPERATION
|
|
},
|
|
Self::ApproveConfidentialTransferAccount { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_APPROVE_CONFIDENTIAL_TRANSFER_ACCOUNT_OPERATION
|
|
},
|
|
Self::DepositConfidentialTokens { .. } => crate::EX_SPL_TOKEN_2022_DEPOSIT_CONFIDENTIAL_TOKENS_OPERATION,
|
|
Self::EnableConfidentialCredits { .. } => crate::EX_SPL_TOKEN_2022_ENABLE_CONFIDENTIAL_CREDITS_OPERATION,
|
|
Self::DisableConfidentialCredits { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_DISABLE_CONFIDENTIAL_CREDITS_OPERATION
|
|
},
|
|
Self::EnableNonConfidentialCredits { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_ENABLE_NON_CONFIDENTIAL_CREDITS_OPERATION
|
|
},
|
|
Self::DisableNonConfidentialCredits { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_DISABLE_NON_CONFIDENTIAL_CREDITS_OPERATION
|
|
},
|
|
Self::ConfigureConfidentialTransferAccount { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_CONFIGURE_CONFIDENTIAL_TRANSFER_ACCOUNT_OPERATION
|
|
},
|
|
Self::ConfigureConfidentialTransferAccountWithRegistry { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_CONFIGURE_CONFIDENTIAL_TRANSFER_ACCOUNT_WITH_REGISTRY_OPERATION
|
|
},
|
|
Self::EmptyConfidentialTransferAccount { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_EMPTY_CONFIDENTIAL_TRANSFER_ACCOUNT_OPERATION
|
|
},
|
|
Self::WithdrawConfidentialTokens { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_WITHDRAW_CONFIDENTIAL_TOKENS_OPERATION
|
|
},
|
|
Self::TransferConfidentialTokens { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_TRANSFER_CONFIDENTIAL_TOKENS_OPERATION
|
|
},
|
|
Self::TransferConfidentialTokensWithFee { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_TRANSFER_CONFIDENTIAL_TOKENS_WITH_FEE_OPERATION
|
|
},
|
|
Self::InitializeConfidentialTransferFeeConfig { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_INITIALIZE_CONFIDENTIAL_TRANSFER_FEE_CONFIG_OPERATION
|
|
},
|
|
Self::EnableConfidentialTransferFeeHarvest { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_ENABLE_CONFIDENTIAL_TRANSFER_FEE_HARVEST_OPERATION
|
|
},
|
|
Self::DisableConfidentialTransferFeeHarvest { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_DISABLE_CONFIDENTIAL_TRANSFER_FEE_HARVEST_OPERATION
|
|
},
|
|
Self::HarvestConfidentialWithheldTokensToMint { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_HARVEST_CONFIDENTIAL_WITHHELD_TOKENS_TO_MINT_OPERATION
|
|
},
|
|
Self::WithdrawConfidentialWithheldTokensFromMint { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_WITHDRAW_CONFIDENTIAL_WITHHELD_TOKENS_FROM_MINT_OPERATION
|
|
},
|
|
Self::WithdrawConfidentialWithheldTokensFromAccounts { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_WITHDRAW_CONFIDENTIAL_WITHHELD_TOKENS_FROM_ACCOUNTS_OPERATION
|
|
},
|
|
Self::InitializeConfidentialMintBurnMint { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_INITIALIZE_CONFIDENTIAL_MINT_BURN_MINT_OPERATION
|
|
},
|
|
Self::RotateConfidentialSupplyElGamalPubkey { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_ROTATE_CONFIDENTIAL_SUPPLY_ELGAMAL_PUBKEY_OPERATION
|
|
},
|
|
Self::UpdateConfidentialDecryptableSupply { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_UPDATE_CONFIDENTIAL_DECRYPTABLE_SUPPLY_OPERATION
|
|
},
|
|
Self::ApplyPendingConfidentialBurn { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_APPLY_PENDING_CONFIDENTIAL_BURN_OPERATION
|
|
},
|
|
Self::ConfidentialMint { .. } => crate::EX_SPL_TOKEN_2022_CONFIDENTIAL_MINT_OPERATION,
|
|
Self::ConfidentialBurn { .. } => crate::EX_SPL_TOKEN_2022_CONFIDENTIAL_BURN_OPERATION,
|
|
Self::PermissionedConfidentialBurn { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_PERMISSIONED_CONFIDENTIAL_BURN_OPERATION
|
|
},
|
|
Self::UnwrapLamports { .. } => crate::EX_SPL_TOKEN_2022_UNWRAP_LAMPORTS_OPERATION,
|
|
Self::Reallocate { .. } => crate::EX_SPL_TOKEN_2022_REALLOCATE_OPERATION,
|
|
Self::InitializeNonTransferableMint { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_INITIALIZE_NON_TRANSFERABLE_MINT_OPERATION
|
|
},
|
|
Self::InitializePermanentDelegate { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_INITIALIZE_PERMANENT_DELEGATE_OPERATION
|
|
},
|
|
Self::InitializeInterestBearingMint { .. } => {
|
|
crate::EX_SPL_TOKEN_2022_INITIALIZE_INTEREST_BEARING_MINT_OPERATION
|
|
},
|
|
Self::UpdateInterestBearingRate { .. } => crate::EX_SPL_TOKEN_2022_UPDATE_INTEREST_BEARING_RATE_OPERATION,
|
|
};
|
|
}
|
|
|
|
pub(crate) fn requires_materialization(&self) -> bool {
|
|
return !matches!(
|
|
self,
|
|
Self::GetAccountDataSize { .. }
|
|
| Self::InitializeImmutableOwner { .. }
|
|
| Self::AmountToUiAmount { .. }
|
|
| Self::UiAmountToAmount { .. }
|
|
);
|
|
}
|
|
}
|
|
|
|
/// Top-level SPL Token operation, including the recent bounded Batch builder.
|
|
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
|
|
#[serde(tag = "operation", rename_all = "snake_case")]
|
|
#[ts(
|
|
export,
|
|
export_to = "../frontend/ts/bindings/kb_lib/executor/spl/token_2022/intent/ExSplToken2022Operation.ts"
|
|
)]
|
|
pub enum ExSplToken2022Operation {
|
|
/// Build one non-batch instruction.
|
|
Instruction {
|
|
/// Exact instruction arguments.
|
|
value: std::boxed::Box<crate::ExSplTokenSingleOperation>,
|
|
},
|
|
/// Build one Batch from ordered, non-batch child operations.
|
|
Batch {
|
|
/// Ordered child operations. Nested Batch is impossible in this contract.
|
|
instructions: std::vec::Vec<crate::ExSplTokenSingleOperation>,
|
|
},
|
|
}
|
|
|
|
impl crate::ExSplToken2022Operation {
|
|
/// Returns the stable top-level operation code.
|
|
pub fn operation_code(&self) -> &'static str {
|
|
return match self {
|
|
Self::Instruction { value } => value.operation_code(),
|
|
Self::Batch { .. } => crate::EX_SPL_TOKEN_2022_BATCH_OPERATION,
|
|
};
|
|
}
|
|
|
|
pub(crate) fn requires_materialization(&self) -> bool {
|
|
return match self {
|
|
Self::Instruction { value } => value.requires_materialization(),
|
|
Self::Batch { instructions } => {
|
|
instructions.iter().any(|value| return value.requires_materialization())
|
|
},
|
|
};
|
|
}
|
|
}
|
|
|
|
/// Complete typed intent accepted by the Token-2022 executor.
|
|
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
|
|
#[ts(
|
|
export,
|
|
export_to = "../frontend/ts/bindings/kb_lib/executor/spl/token_2022/intent/ExSplToken2022ExecutionIntent.ts"
|
|
)]
|
|
pub struct ExSplToken2022ExecutionIntent {
|
|
/// Stable caller-provided identifier used for logs and replay correlation.
|
|
pub intent_id: std::string::String,
|
|
/// Transaction fee payer.
|
|
pub fee_payer: crate::MdPubkey,
|
|
/// Conservative execution policy. Its default is simulation-only.
|
|
pub policy: crate::ExApiExecutionPolicy,
|
|
/// Typed classic Token operation.
|
|
pub operation: crate::ExSplToken2022Operation,
|
|
}
|