Expand description
§Ostium Rust SDK
A modern Rust SDK for interacting with the Ostium trading platform on Arbitrum.
§Features
- Type-safe contract interactions using Alloy
- Async/await support with Tokio
- GraphQL API client for market data
- Comprehensive error handling
- Support for both mainnet and testnet environments
§Quick Start
use ostium_rust_sdk::{OstiumClient, Network};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a new client connected to testnet
let client = OstiumClient::new(Network::Testnet).await?;
// Get available trading pairs
let pairs = client.get_pairs().await?;
println!("Available pairs: {:?}", pairs);
Ok(())
}Re-exports§
pub use client::AccountApi;pub use client::AdvancedOrderApi;pub use client::MarketDataApi;pub use client::OstiumClient;pub use client::OstiumClientBuilder;pub use client::TradingApi;pub use client::UnsignedTransactionApi;pub use config::Network;pub use config::NetworkConfig;pub use config::NetworkConfigBuilder;pub use error::OstiumError;pub use error::Result;pub use retry::CircuitBreaker;pub use retry::CircuitState;pub use retry::RetryConfig;pub use retry::RetryExecutor;pub use types::*;pub use contracts::*;
Modules§
- abi
- ABI definitions for smart contracts
- client
- Client module containing the main SDK client Main client for interacting with the Ostium platform
- config
- Network configuration module Network configuration for the Ostium SDK
- contracts
- Smart contract interfaces and implementations Smart contract interfaces and implementations
- error
- Error types and handling Error types for the Ostium SDK
- rate_
limit - Rate limiting module Rate limiting functionality for the Ostium SDK
- retry
- Retry module
- types
- Common types used throughout the SDK Common types used throughout the Ostium SDK
Macros§
- retry_
contract - Execute an operation with contract-optimized retry settings and circuit breaker
- retry_
graphql - Execute an operation with GraphQL-optimized retry settings
- retry_
network - Convenience macros for different operation types Execute an operation with network-optimized retry settings
Structs§
- Address
- An Ethereum address, 20 bytes in length.
- Decimal
Decimalrepresents a 128 bit representation of a fixed-precision decimal number. The finite set of values of typeDecimalare of the form m / 10e, where m is an integer such that -296 < m < 296, and e is an integer between 0 and 28 inclusive.
Type Aliases§
- U256
- 256-bit unsigned integer type, consisting of 4, 64-bit limbs.