ostium_rust_sdk/lib.rs
1//! # Ostium Rust SDK
2//!
3//! A modern Rust SDK for interacting with the Ostium trading platform on Arbitrum.
4//!
5//! ## Features
6//!
7//! - Type-safe contract interactions using Alloy
8//! - Async/await support with Tokio
9//! - GraphQL API client for market data
10//! - Comprehensive error handling
11//! - Support for both mainnet and testnet environments
12//!
13//! ## Quick Start
14//!
15//! ```rust,no_run
16//! use ostium_rust_sdk::{OstiumClient, Network};
17//!
18//! #[tokio::main]
19//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
20//! // Create a new client connected to testnet
21//! let client = OstiumClient::new(Network::Testnet).await?;
22//!
23//! // Get available trading pairs
24//! let pairs = client.get_pairs().await?;
25//! println!("Available pairs: {:?}", pairs);
26//!
27//! Ok(())
28//! }
29//! ```
30
31#![warn(missing_docs)]
32#![deny(unsafe_code)]
33
34// Test comment to demonstrate pre-commit hooks
35
36/// Client module containing the main SDK client
37pub mod client;
38
39/// Network configuration module
40pub mod config;
41
42/// Error types and handling
43pub mod error;
44
45/// Common types used throughout the SDK
46pub mod types;
47
48/// Smart contract interfaces and implementations
49pub mod contracts;
50
51/// ABI definitions for smart contracts
52pub mod abi;
53
54/// Retry module
55pub mod retry;
56
57/// Rate limiting module
58pub mod rate_limit;
59
60// Re-export main types for convenient access
61pub use client::{
62 AccountApi, AdvancedOrderApi, MarketDataApi, OstiumClient, OstiumClientBuilder, TradingApi,
63 UnsignedTransactionApi,
64};
65pub use config::{Network, NetworkConfig, NetworkConfigBuilder};
66pub use error::{OstiumError, Result};
67pub use retry::{CircuitBreaker, CircuitState, RetryConfig, RetryExecutor};
68pub use types::*;
69
70// Re-export commonly used external types
71pub use alloy_primitives::{Address, U256};
72pub use rust_decimal::Decimal;
73
74// Re-export contract interfaces
75pub use contracts::*;