Skip to main content

Module token

Module token 

Source
Expand description

Hopper-native SPL Token CPI builders.

The API is Hopper-owned (builder pattern over AccountView / Signer) and execution flows through Hopper’s checked native CPI semantics.

Provides checked-by-default TransferChecked, MintToChecked, BurnChecked, ApproveChecked, CloseAccount, Revoke, SetAuthority, FreezeAccount, ThawAccount, SyncNative, and InitializeAccount builders. Multisig owner flows are first-class via bounded signer-account slices. Deprecated plain Transfer/MintTo/Burn/Approve builders are compiled only when legacy-token-instructions is explicitly enabled.

Re-exports§

pub use crate::token_mint::InitializeMint2;
pub use crate::token_mint::MintConfig;
pub use crate::token_mint::MintPlan;
pub use crate::token_mint::MintProgram;

Modules§

instructions
Legacy module-path re-exports.

Structs§

ApproveChecked
Builder for SPL Token ApproveChecked (instruction index 13).
BurnChecked
Builder for SPL Token BurnChecked (instruction index 15).
CheckedMintDecimals
Proof token that an SPL Mint matched expected decimals.
CheckedTokenAuthority
Proof token that an SPL TokenAccount matched an expected token authority.
CheckedTokenMint
Proof token that an SPL TokenAccount matched an expected mint.
CloseAccount
Builder for SPL Token CloseAccount (instruction index 9).
FreezeAccount
Builder for SPL Token FreezeAccount (instruction index 10).
InitializeAccount
Builder for SPL Token InitializeAccount (instruction index 1).
InitializeAccount2
Builder for SPL Token InitializeAccount2 (instruction index 16).
InitializeAccount3
Builder for SPL Token InitializeAccount3 (instruction index 18).
MintToChecked
Builder for SPL Token MintToChecked (instruction index 14).
Revoke
Builder for SPL Token Revoke (instruction index 5).
SetAuthority
Builder for SPL Token SetAuthority (instruction index 6).
SplMint
Known external SPL Mint adapter.
SplMintView
Guard-owned zero-copy SPL Mint view.
SplTokenAccount
Known external SPL TokenAccount adapter.
SplTokenAccountView
Guard-owned zero-copy SPL TokenAccount view.
SyncNative
Builder for SPL Token SyncNative (instruction index 17).
ThawAccount
Builder for SPL Token ThawAccount (instruction index 11).
TokenAmountSnapshot
Snapshot of a token account amount before CPI.
TransferChecked
Builder for classic SPL Token TransferChecked (instruction index 12).

Enums§

TokenAuthorityType
Authority classes accepted by SPL Token’s SetAuthority instruction.

Constants§

MAX_TOKEN_MULTISIG_SIGNERS
SPL Token multisig accounts support at most 11 signer accounts.
SPL_MINT_LEN
SPL_TOKEN_ACCOUNT_LEN
TOKEN_PROGRAM_ID
SPL Token program address.

Functions§

require_mint_authority
Verify an SPL Mint account’s mint_authority COption field matches expected_authority.
require_mint_decimals
Verify an SPL Mint account’s decimals byte matches expected.
require_mint_freeze_authority
Verify an SPL Mint account’s freeze_authority COption field matches expected_freeze.
require_token_authority
Verify an SPL Token account’s owner field matches authority.key().
require_token_mint
Verify an SPL Token account’s mint field matches expected_mint.
require_token_owner_eq
Verify an SPL Token account’s owner field matches a pubkey supplied directly (i.e. not wrapped in an AccountView).