xorca/lib.rs
1//! # xORCA Rust Client
2//!
3//! A Rust client library for interacting with the xORCA staking program on Solana.
4//!
5//! ## Features
6//!
7//! - **Type-safe interactions** with the xORCA staking program
8//! - **WASM support** for use in web applications
9//! - **Auto-generated code** from the program IDL using Codama
10//! - **PDA utilities** for Program Derived Address derivation
11//! - **Math utilities** with WASM compilation support
12//! - **Serialization support** with optional serde integration
13//!
14//! ## Quick Start
15//!
16//! ```rust
17//! use xorca::*;
18//!
19//! // Get the program ID
20//! let program_id = XORCA_STAKING_PROGRAM_ID;
21//!
22//! // Derive state address PDA
23//! let (state_address, _bump) = find_state_address().unwrap();
24//! ```
25//!
26//! ## Features
27//!
28//! The crate supports several optional features:
29//!
30//! - `serde` - Enable serde serialization/deserialization
31//! - `fetch` - Enable Solana client integration for fetching account data
32//! - `floats` - Enable floating-point math operations (default)
33//! - `wasm` - Enable WASM compilation for web use
34//!
35//! ## License
36//!
37//! This project is licensed under a custom license. See [LICENSE](../LICENSE) for details.
38
39#![allow(unexpected_cfgs)]
40
41#[allow(clippy::all, unused_imports)]
42mod generated;
43#[cfg(feature = "wasm")]
44mod math;
45pub mod pda;
46
47pub use generated::accounts::*;
48pub use generated::errors::*;
49pub use generated::instructions::*;
50pub use generated::programs::XORCA_STAKING_PROGRAM_ID as ID;
51pub use generated::programs::*;
52#[cfg(feature = "fetch")]
53pub use generated::shared::*;
54pub use generated::types::*;
55
56#[cfg(feature = "fetch")]
57pub(crate) use generated::*;
58
59pub use pda::*;
60
61#[cfg(feature = "wasm")]
62pub use math::*;