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