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// Allow common patterns that are acceptable in this codebase
34#![allow(clippy::module_name_repetitions)]
35#![allow(clippy::missing_errors_doc)]
36#![allow(clippy::missing_panics_doc)]
37#![allow(clippy::must_use_candidate)]
38#![allow(clippy::doc_markdown)]
39#![allow(clippy::similar_names)]
40#![allow(clippy::uninlined_format_args)]
41#![allow(clippy::should_implement_trait)]
42#![allow(clippy::match_same_arms)]
43#![allow(clippy::redundant_closure_for_method_calls)]
44#![allow(clippy::cast_possible_truncation)]
45#![allow(clippy::cast_sign_loss)]
46#![allow(clippy::cast_possible_wrap)]
47#![allow(clippy::cast_lossless)]
48#![allow(clippy::cast_precision_loss)]
49#![allow(clippy::struct_excessive_bools)]
50#![allow(clippy::too_many_arguments)]
51#![allow(clippy::too_many_lines)]
52#![allow(clippy::wildcard_imports)]
53#![allow(clippy::needless_pass_by_value)]
54#![allow(clippy::unnecessary_wraps)]
55#![allow(clippy::items_after_statements)]
56#![allow(clippy::collapsible_if)]
57#![allow(clippy::if_not_else)]
58#![allow(clippy::if_same_then_else)]
59#![allow(clippy::derivable_impls)]
60#![allow(clippy::from_over_into)]
61#![allow(clippy::map_unwrap_or)]
62#![allow(clippy::unnecessary_map_or)]
63#![allow(clippy::clone_on_copy)]
64#![allow(clippy::explicit_iter_loop)]
65#![allow(clippy::ref_option)]
66#![allow(clippy::ignored_unit_patterns)]
67#![allow(clippy::manual_midpoint)]
68#![allow(clippy::manual_pattern_char_comparison)]
69#![allow(clippy::return_self_not_must_use)]
70#![allow(clippy::format_push_string)]
71#![allow(clippy::redundant_closure)]
72#![allow(clippy::unused_self)]
73#![allow(clippy::match_wildcard_for_single_variants)]
74#![allow(clippy::unnested_or_patterns)]
75#![allow(clippy::redundant_field_names)]
76#![allow(clippy::unreadable_literal)]
77#![allow(clippy::empty_line_after_doc_comments)]
78#![allow(clippy::needless_continue)]
79#![allow(clippy::redundant_else)]
80#![allow(clippy::unnecessary_literal_bound)]
81#![allow(clippy::let_and_return)]
82#![allow(clippy::implicit_hasher)]
83#![allow(clippy::get_first)]
84#![allow(clippy::unnecessary_literal_unwrap)]
85#![allow(clippy::map_flatten)]
86#![allow(clippy::manual_map)]
87#![allow(clippy::unnecessary_cast)]
88#![allow(clippy::manual_strip)]
89#![allow(clippy::unnecessary_lazy_evaluations)]
90#![allow(clippy::manual_range_contains)]
91#![allow(clippy::collapsible_else_if)]
92#![allow(clippy::implicit_clone)]
93#![allow(clippy::semicolon_if_nothing_returned)]
94#![allow(clippy::single_match_else)]
95#![allow(clippy::assigning_clones)]
96#![allow(clippy::collapsible_match)]
97#![allow(clippy::option_as_ref_deref)]
98#![allow(clippy::field_reassign_with_default)]
99#![allow(clippy::unused_async)]
100
101// Re-export ccxt-core
102pub use ccxt_core;
103
104/// Exchange trait module (DEPRECATED)
105///
106/// This module is deprecated. Use `ccxt_core::Exchange` and
107/// `ccxt_core::ExchangeCapabilities` directly instead.
108#[deprecated(
109    since = "0.2.0",
110    note = "Use `ccxt_core::Exchange` and `ccxt_core::ExchangeCapabilities` directly instead."
111)]
112pub mod exchange;
113
114/// Binance exchange implementation
115pub mod binance;
116
117/// Bitget exchange implementation
118pub mod bitget;
119
120/// Bybit exchange implementation
121pub mod bybit;
122
123/// HyperLiquid exchange implementation
124pub mod hyperliquid;
125
126/// OKX exchange implementation
127pub mod okx;
128
129/// Prelude module for convenient imports
130pub mod prelude {
131    pub use crate::binance::{Binance, BinanceBuilder};
132    pub use crate::bitget::{Bitget, BitgetBuilder};
133    pub use crate::bybit::{Bybit, BybitBuilder};
134    pub use crate::hyperliquid::{HyperLiquid, HyperLiquidBuilder};
135    pub use crate::okx::{Okx, OkxBuilder};
136    // Re-export unified Exchange trait from ccxt-core (not the deprecated local module)
137    pub use ccxt_core::{ArcExchange, BoxedExchange, Exchange, ExchangeCapabilities};
138    // Re-export WsExchange, FullExchange, and MessageStream from ccxt-core
139    pub use ccxt_core::prelude::*;
140    pub use ccxt_core::{FullExchange, MessageStream, WsExchange};
141}
142
143/// Library version
144pub const VERSION: &str = env!("CARGO_PKG_VERSION");