ccxt_exchanges/
lib.rs

1//! CCXT Exchange Implementations
2//!
3//! This library contains concrete implementations of cryptocurrency exchanges
4//! built on top of ccxt-core.
5//!
6//! # Supported Exchanges
7//!
8//! - Binance ✅
9//! - Coinbase (planned)
10//! - Kraken (planned)
11//! - ... and more
12//!
13//! # Example
14//!
15//! ```rust,no_run
16//! // use ccxt_exchanges::binance::Binance;
17//!
18//! # async fn example() -> Result<(), ccxt_core::Error> {
19//! // let exchange = Binance::new(
20//! //     Some("your_api_key".to_string()),
21//! //     Some("your_secret".to_string())
22//! // );
23//! //
24//! // let markets = exchange.fetch_markets().await?;
25//! // println!("Found {} markets", markets.len());
26//! # Ok(())
27//! # }
28//! ```
29
30#![warn(missing_docs)]
31#![warn(clippy::all)]
32#![warn(clippy::pedantic)]
33// =============================================================================
34// Global Clippy Lint Suppressions
35// =============================================================================
36// These lints are suppressed globally because they apply broadly across the
37// codebase and would require excessive local annotations.
38//
39// Justified Global Suppressions (per Requirement 3.4):
40// - module_name_repetitions: Common pattern in Rust libraries (e.g., BinanceError in binance module)
41// - missing_errors_doc: Too verbose to document every Result-returning function
42// - missing_panics_doc: Too verbose to document every potential panic
43// - must_use_candidate: Not all return values need #[must_use]
44//
45// Practical Global Suppressions:
46// - doc_markdown: Technical terms in docs don't need backticks (e.g., OHLCV, HMAC, WebSocket)
47// - similar_names: Trading terminology requires similar names (bid/ask, buy/sell, base/quote)
48// - uninlined_format_args: Style preference, many existing format! calls use explicit args
49// - cast_*: Common in timestamp and numeric operations throughout exchange implementations
50// - struct_excessive_bools: Config structs legitimately have many boolean flags
51// - too_many_lines: Some complex parsing/validation functions are unavoidable
52// - return_self_not_must_use: Builder pattern methods return Self without must_use
53// - unreadable_literal: Timestamps are more readable without separators (1704110400000)
54// - needless_pass_by_value: API design choice for consistency across exchange implementations
55// - redundant_closure: Closures used for consistency in map chains and API handlers
56// - collapsible_if: Separate if statements improve readability in parsing/API logic
57// =============================================================================
58#![allow(clippy::module_name_repetitions)]
59#![allow(clippy::missing_errors_doc)]
60#![allow(clippy::missing_panics_doc)]
61#![allow(clippy::must_use_candidate)]
62#![allow(clippy::doc_markdown)]
63#![allow(clippy::similar_names)]
64#![allow(clippy::uninlined_format_args)]
65#![allow(clippy::cast_possible_truncation)]
66#![allow(clippy::cast_sign_loss)]
67#![allow(clippy::cast_possible_wrap)]
68#![allow(clippy::cast_lossless)]
69#![allow(clippy::cast_precision_loss)]
70#![allow(clippy::struct_excessive_bools)]
71#![allow(clippy::too_many_lines)]
72#![allow(clippy::return_self_not_must_use)]
73#![allow(clippy::unreadable_literal)]
74#![allow(clippy::needless_pass_by_value)]
75#![allow(clippy::redundant_closure)]
76#![allow(clippy::collapsible_if)]
77
78// Re-export ccxt-core
79pub use ccxt_core;
80
81/// Exchange trait module (DEPRECATED)
82///
83/// This module is deprecated. Use `ccxt_core::Exchange` and
84/// `ccxt_core::ExchangeCapabilities` directly instead.
85#[deprecated(
86    since = "0.2.0",
87    note = "Use `ccxt_core::Exchange` and `ccxt_core::ExchangeCapabilities` directly instead."
88)]
89pub mod exchange;
90
91/// Binance exchange implementation
92pub mod binance;
93
94/// Bitget exchange implementation
95pub mod bitget;
96
97/// Bybit exchange implementation
98pub mod bybit;
99
100/// HyperLiquid exchange implementation
101pub mod hyperliquid;
102
103/// OKX exchange implementation
104pub mod okx;
105
106/// Prelude module for convenient imports
107pub mod prelude {
108    pub use crate::binance::{Binance, BinanceBuilder};
109    pub use crate::bitget::{Bitget, BitgetBuilder};
110    pub use crate::bybit::{Bybit, BybitBuilder};
111    pub use crate::hyperliquid::{HyperLiquid, HyperLiquidBuilder};
112    pub use crate::okx::{Okx, OkxBuilder};
113    // Re-export unified Exchange trait from ccxt-core (not the deprecated local module)
114    pub use ccxt_core::{ArcExchange, BoxedExchange, Exchange, ExchangeCapabilities};
115    // Re-export WsExchange, FullExchange, and MessageStream from ccxt-core
116    pub use ccxt_core::prelude::*;
117    pub use ccxt_core::{FullExchange, MessageStream, WsExchange};
118}
119
120/// Library version
121pub const VERSION: &str = env!("CARGO_PKG_VERSION");