1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! # Lighter RS
//!
//! A comprehensive Rust SDK for the Lighter Protocol trading application blockchain.
//!
//! This library provides all necessary functionality for trading on Lighter, including:
//! - Cryptographic signing and key management
//! - Transaction construction and validation
//! - HTTP client for API interactions
//! - Type-safe transaction types for all supported operations
//!
//! ## Modules
//!
//! - `constants`: Core constants and limits used throughout the protocol
//! - `signer`: Cryptographic key management and signing functionality
//! - `types`: Transaction types and request builders
//! - `client`: HTTP client for API interactions
//! - `errors`: Error types and handling
//!
//! ## Example
//!
//! ```rust,no_run
//! use lighter_rs::client::TxClient;
//! use lighter_rs::types::CreateOrderTxReq;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! // Create a transaction client
//! let tx_client = TxClient::new(
//! "https://api.lighter.xyz",
//! "your_api_key_hex",
//! 12345, // account_index
//! 0, // api_key_index
//! 1, // chain_id
//! )?;
//!
//! // Create and submit an order
//! // let order = CreateOrderTxReq { ... };
//! // let result = tx_client.create_order(&order, None).await?;
//! # Ok(())
//! # }
//! ```
// Re-export commonly used types
pub use TxResponse;
pub use *;
pub use ;
pub use ;
pub use ;
/// Library version
pub const VERSION: &str = env!;