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::{
13    ApproveChecked, BurnChecked, CheckedMintDecimals, CheckedTokenAuthority, CheckedTokenMint,
14    CloseAccount, FreezeAccount, InitializeAccount, InitializeAccount2, InitializeAccount3,
15    MintToChecked, Revoke, SetAuthority, SplMint, SplMintView, SplTokenAccount,
16    SplTokenAccountView, SyncNative, ThawAccount, TokenAmountSnapshot, TokenAuthorityType,
17    TransferChecked, TOKEN_PROGRAM_ID,
18};
19
20#[cfg(feature = "legacy-token-instructions")]
21#[allow(deprecated)]
22pub use hopper_runtime::token::{Approve, Burn, MintTo, Transfer};
23
24/// SPL Token instruction builders exported by Hopper.
25///
26/// Safety-by-default exports include checked variants plus operations whose
27/// SPL semantics do not need a mint-decimals guard. Enable the explicit
28/// `legacy-token-instructions` feature to expose the deprecated plain
29/// `Transfer`, `MintTo`, `Burn`, and `Approve` builders for migration tests.
30pub mod instructions {
31    pub use hopper_runtime::token::{
32        ApproveChecked, BurnChecked, CloseAccount, FreezeAccount, InitializeAccount,
33        InitializeAccount2, InitializeAccount3, MintToChecked, Revoke, SetAuthority, SyncNative,
34        ThawAccount, TokenAuthorityType, TransferChecked,
35    };
36
37    #[cfg(feature = "legacy-token-instructions")]
38    #[allow(deprecated)]
39    pub use hopper_runtime::token::{Approve, Burn, MintTo, Transfer};
40}