ccxt_rust/
lib.rs

1//! # CCXT Rust
2//!
3//! CCXT Rust is a professional-grade trading toolkit that brings the CCXT
4//! unified exchange interface to native Rust projects. It wraps REST and
5//! WebSocket APIs for major cryptocurrency exchanges under a single, strongly
6//! typed abstraction.
7//!
8//! ## Features
9//!
10//! - **Async first**: Powered by `tokio` with ergonomic async/await APIs for every call
11//! - **Unified types**: Shared `Exchange` trait and strongly typed market/order models
12//! - **Performance oriented**: Zero-cost abstractions with `rust_decimal` for precise math
13//! - **Live data**: WebSocket clients with automatic reconnection and streamed order books
14//! - **Extensible**: Builder patterns and configuration hooks for custom environments
15//!
16//! ## Installation
17//!
18//! ```toml
19//! [dependencies]
20//! ccxt-rust = { version = "0.1", features = ["full"] }
21//! ```
22//!
23//! Alternatively depend on the workspace members directly when developing inside the repo.
24//!
25//! ## Quick Start
26//!
27//! ```rust,no_run
28//! use ccxt_exchanges::binance::Binance;
29//! use ccxt_rust::prelude::*;
30//!
31//! #[tokio::main]
32//! async fn main() -> Result<()> {
33//!     // Prefer testnet when experimenting to avoid hitting live balances.
34//!     let exchange = Binance::builder()
35//!         .sandbox(true)
36//!         .build()?;
37//!
38//!     if exchange.capabilities().fetch_ticker() {
39//!         let ticker = exchange.fetch_ticker("BTC/USDT", ()).await?;
40//!         println!("Last price: {:?}", ticker.last);
41//!     }
42//!
43//!     Ok(())
44//! }
45//! ```
46//!
47//! ## Further Reading
48//!
49//! See the repository README and the `examples/` folder for advanced scenarios
50//! covering authenticated calls, streaming data, and multi-exchange orchestration.
51
52#![warn(missing_docs)]
53#![warn(clippy::all)]
54#![warn(clippy::pedantic)]
55#![allow(clippy::module_name_repetitions)]
56#![allow(clippy::missing_errors_doc)]
57
58// Re-export core types and traits
59pub use ccxt_core::{
60    error::{Error, Result},
61    types::*,
62};
63
64// Re-export exchange implementations
65pub use ccxt_core::Exchange;
66pub use ccxt_exchanges::prelude::*;
67
68// Test configuration module (only available in test builds)
69#[cfg(test)]
70pub mod test_config;
71
72/// Library version
73pub const VERSION: &str = env!("CARGO_PKG_VERSION");
74
75/// Prelude module for convenient imports
76pub mod prelude {
77    pub use ccxt_core::{
78        error::{Error, Result},
79        types::*,
80    };
81    pub use ccxt_exchanges::{exchange::Exchange, prelude::*};
82}