1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// CCXT Rust – library root
//
// Hand-written files (never overwritten by the transpiler):
// src/error.rs – ExchangeError enum + From impls
// src/value.rs – CCXT Value type (mirrors transpiler output)
// src/types.rs – Domain types: Order, Trade, Ticker, …
// src/exchange.rs – Exchange base: HTTP, crypto, string utilities
// src/precise.rs – Precise decimal arithmetic (mirrors Precise.ts)
//
// Generated files (overwritten on each transpile run):
// src/exchange_generated.rs – Exchange.ts base methods
// src/exchange_errors.rs – error constructor functions
// src/exchanges/mod.rs – pub mod declarations for REST exchanges
// src/exchanges/*.rs – individual REST exchange implementations
// src/pro/mod.rs – pub mod declarations for WS exchanges
// src/pro/*.rs – individual WebSocket exchange implementations
// Hand-written code keeps rustc's naming/dead-code allowances (the transpiled
// surface uses camelCase) and silences the noisy Clippy *style/complexity/perf*
// groups, but leaves Clippy's `correctness` and `suspicious` groups ENABLED so
// real defects in the hand-written runtime aren't masked (review #11). Generated
// files carry their own blanket `clippy::all` allow.
// The base surface (`ExchangeBase`/`ExchangeRuntime`/`PredictionBase`) uses
// native `async fn` in public traits. This is deliberate (review #1): virtual
// dispatch boxes these futures as `Pin<Box<dyn Future + 'a>>` WITHOUT a `Send`
// bound, so callers get non-`Send` futures by design — the exchange objects are
// driven on a single task, not shared across threads. `async fn` in a trait is
// exactly the right desugaring for that contract, so silence the auto-trait
// advisory lint rather than hand-rolling `-> impl Future` signatures.
// The transpiled base method surface (now the `ExchangeBase` trait, review #1)
// compiles and typechecks against the hand-written base; the per-exchange REST
// Cores are the part gated behind `transpiled-base`.
// The transpiled base `impl Exchange` methods (describe, safe_market,
// set_markets, …). The hand-written base (exchange.rs / exchange_stubs.rs)
// calls these unconditionally, so they are non-optional infrastructure — always
// compiled, independent of the per-exchange `transpiled-base` feature (which
// gates only the heavy `exchanges`/`prediction` venue modules). This keeps a
// no-default-features consumer build compiling instead of failing with missing
// base methods.
// Prediction-market tier (ts/src/base/PredictionExchange.ts + ts/src/prediction/*).
// `prediction_exchange` is the hand-written base struct; the `_generated` module
// holds its transpiled methods (now a `trait PredictionBase: ExchangeBase`). Both
// gated behind the same `transpiled-base` feature as the rest of the transpiled
// surface. The prediction tier is a second inheritance layer (Core →
// PredictionExchange → Exchange) wired with its own static ExchangeBase dispatch
// (review #1 pointer removal).
// Transpiled prediction-market venue Cores (ts/src/prediction/*.ts). Kept in
// their own module so an id that also exists as a regular exchange (hyperliquid)
// doesn't collide under `exchanges`.
// The per-exchange typed unified-method wrappers (`Binance`, `Kraken`, … with
// `fetch_ticker(..) -> Result<Ticker>`) plus the `TypedExchange` /
// `TypedExchangeExt` traits now live in the sibling `ccxt-typed` crate (import
// as `ccxt_typed::Binance`). They were split out so the base `ccxt` crate's
// single `rustc` invocation stays under the CI runner's memory ceiling.
// ── top-level re-exports ──────────────────────────────────────────────────────
pub use ExchangeError;
pub use ;
pub use ;
pub use Exchange;
/// Convenience Result alias used throughout the crate.
pub type Result<T> = Result;