Skip to main content

jiminy_solana/
lib.rs

1#![no_std]
2//! # jiminy-solana
3//!
4//! Token readers, CPI guards, Ed25519, Merkle proofs, Pyth oracles,
5//! authority rotation, and the rest of the Solana platform helpers that
6//! depend on SPL Token / Token-2022.
7//!
8//! This is where you go once your program starts touching tokens. Everything
9//! reads fields directly from account data -- zero deserialization, zero
10//! allocation. Token-2022 extensions are screened with a single function
11//! call so you don't get rugged by a permanent delegate you forgot to check.
12//!
13//! ```rust,ignore
14//! use jiminy_solana::prelude::*;
15//! ```
16//!
17//! # Modules
18//!
19//! | Module | |
20//! |---|---|
21//! | [`token`] | SPL Token account readers, mint readers, Token-2022 extension screening |
22//! | [`cpi`] | Safe CPI wrappers, reentrancy guards, return data readers |
23//! | [`crypto`] | Ed25519 precompile verification, Merkle proof verification |
24//! | [`authority`] | Two-step authority rotation (propose + accept) |
25//! | [`balance`] | Pre/post CPI balance delta guards |
26//! | [`compute`] | Compute budget guards |
27//! | [`compose`] | Transaction composition guards (flash-loan detection) |
28//! | [`introspect`] | Raw transaction introspection |
29//! | [`oracle`] | Pyth V2 price feed readers |
30//! | [`twap`] | TWAP accumulators |
31//! | [`upgrade`] | Program upgrade authority verification *(feature: `programs`)* |
32//!
33//! Depends on [`jiminy_core`] for validation, math, and account IO.
34
35// ── Domain modules ───────────────────────────────────────────────────────────
36
37pub mod token;
38pub mod cpi;
39pub mod crypto;
40
41pub mod authority;
42pub mod balance;
43pub mod compute;
44pub mod compose;
45pub mod introspect;
46pub mod oracle;
47pub mod prelude;
48pub mod twap;
49
50#[cfg(feature = "programs")]
51pub mod upgrade;
52
53// ── Re-exports ───────────────────────────────────────────────────────────────
54
55pub use jiminy_core;
56pub use pinocchio;
57pub use pinocchio_system;
58pub use pinocchio_token;
59pub use pinocchio::{error::ProgramError, AccountView, Address, ProgramResult};