Skip to main content

Module token

Module token 

Source
Expand description

TEMPORARY: backend facade for SPL Token CPI builders.

This module keeps Hopper-owned instruction semantics while execution still flows through the active backend substrate. It will be replaced by Hopper-native instruction builders once the substrate-facing builders are finalized.

Semantic CPI facades: the API is Hopper-owned (builder pattern over AccountView / Signer), while execution is delegated through Hopper’s checked CPI semantics.

Provides checked-by-default TransferChecked, MintToChecked, BurnChecked, ApproveChecked, CloseAccount, Revoke, and InitializeAccount builders. Deprecated plain Transfer/MintTo/Burn/Approve builders are compiled only when legacy-token-instructions is explicitly enabled.

Modules§

instructions
Compatibility re-exports.

Structs§

ApproveChecked
Builder for SPL Token ApproveChecked (instruction index 13).
BurnChecked
Builder for SPL Token BurnChecked (instruction index 15).
CloseAccount
Builder for SPL Token CloseAccount (instruction index 9).
InitializeAccount
Builder for SPL Token InitializeAccount (instruction index 1).
MintToChecked
Builder for SPL Token MintToChecked (instruction index 14).
Revoke
Builder for SPL Token Revoke (instruction index 5).
TransferChecked
Builder for SPL Token TransferChecked (instruction index 12).

Constants§

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).