Skip to main content

hopper_token/
lib.rs

1//! Hopper-owned SPL Token builder surface.
2//!
3//! Thin first-class Hopper wrappers over the canonical runtime builders.
4//! This crate gives Hopper a native token CPI surface instead of forcing
5//! authored programs to depend on external helper crates.
6
7#![no_std]
8#![deny(unsafe_op_in_unsafe_fn)]
9
10pub mod layout;
11
12pub use hopper_runtime::token_mint::{InitializeMint2, MintConfig, MintPlan, MintProgram};
13
14pub use hopper_runtime::token::{
15    ApproveChecked, BurnChecked, CheckedMintDecimals, CheckedTokenAuthority, CheckedTokenMint,
16    CloseAccount, FreezeAccount, InitializeAccount, InitializeAccount2, InitializeAccount3,
17    MintToChecked, Revoke, SetAuthority, SplMint, SplMintView, SplTokenAccount,
18    SplTokenAccountView, SyncNative, ThawAccount, TokenAmountSnapshot, TokenAuthorityType,
19    TransferChecked, TOKEN_PROGRAM_ID,
20};
21
22#[cfg(feature = "legacy-token-instructions")]
23#[allow(deprecated)]
24pub use hopper_runtime::token::{Approve, Burn, MintTo, Transfer};
25
26/// SPL Token instruction builders exported by Hopper.
27///
28/// Safety-by-default exports include checked variants plus operations whose
29/// SPL semantics do not need a mint-decimals guard. Enable the explicit
30/// `legacy-token-instructions` feature to expose the deprecated plain
31/// `Transfer`, `MintTo`, `Burn`, and `Approve` builders for migration tests.
32pub mod instructions {
33    pub use hopper_runtime::token::{
34        ApproveChecked, BurnChecked, CloseAccount, FreezeAccount, InitializeAccount,
35        InitializeAccount2, InitializeAccount3, MintToChecked, Revoke, SetAuthority, SyncNative,
36        ThawAccount, TokenAuthorityType, TransferChecked,
37    };
38    pub use hopper_runtime::token_mint::InitializeMint2;
39
40    #[cfg(feature = "legacy-token-instructions")]
41    #[allow(deprecated)]
42    pub use hopper_runtime::token::{Approve, Burn, MintTo, Transfer};
43}