1#![warn(missing_docs)]
42#![warn(clippy::all)]
43#![warn(clippy::pedantic)]
44#![allow(clippy::module_name_repetitions)]
46#![allow(clippy::missing_errors_doc)]
47#![allow(clippy::missing_panics_doc)]
48#![allow(clippy::must_use_candidate)]
49#![allow(clippy::doc_markdown)]
50#![allow(clippy::similar_names)]
51#![allow(clippy::uninlined_format_args)]
52#![allow(clippy::should_implement_trait)]
53#![allow(clippy::match_same_arms)]
54#![allow(clippy::redundant_closure_for_method_calls)]
55#![allow(clippy::cast_possible_truncation)]
56#![allow(clippy::cast_sign_loss)]
57#![allow(clippy::cast_possible_wrap)]
58#![allow(clippy::cast_lossless)]
59#![allow(clippy::cast_precision_loss)]
60#![allow(clippy::struct_excessive_bools)]
61#![allow(clippy::too_many_arguments)]
62#![allow(clippy::too_many_lines)]
63#![allow(clippy::wildcard_imports)]
64#![allow(clippy::needless_pass_by_value)]
65#![allow(clippy::unnecessary_wraps)]
66#![allow(clippy::items_after_statements)]
67#![allow(clippy::collapsible_if)]
68#![allow(clippy::if_not_else)]
69#![allow(clippy::if_same_then_else)]
70#![allow(clippy::derivable_impls)]
71#![allow(clippy::from_over_into)]
72#![allow(clippy::map_unwrap_or)]
73#![allow(clippy::unnecessary_map_or)]
74#![allow(clippy::clone_on_copy)]
75#![allow(clippy::explicit_iter_loop)]
76#![allow(clippy::ref_option)]
77#![allow(clippy::ignored_unit_patterns)]
78#![allow(clippy::manual_midpoint)]
79#![allow(clippy::manual_pattern_char_comparison)]
80#![allow(clippy::return_self_not_must_use)]
81#![allow(clippy::format_push_string)]
82#![allow(clippy::redundant_closure)]
83#![allow(clippy::unused_self)]
84#![allow(clippy::match_wildcard_for_single_variants)]
85
86pub use rust_decimal;
88pub use serde;
89pub use serde_json;
90
91pub mod auth;
93pub mod base_exchange;
94pub mod capability;
95pub mod error;
96pub mod exchange;
97pub mod http_client;
98pub mod logging;
99pub mod precision;
100pub mod rate_limiter;
101pub mod retry_strategy;
102pub mod symbol;
103pub mod time;
104pub mod traits;
106pub mod types;
107pub mod ws_client;
108pub mod ws_exchange;
109
110#[cfg(any(test, feature = "test-utils", debug_assertions))]
112pub mod test_config;
113
114pub use base_exchange::{BaseExchange, ExchangeConfig, ExchangeConfigBuilder, MarketCache};
119pub use exchange::{ArcExchange, BoxedExchange, Exchange, ExchangeExt};
121pub use capability::{
123 Capabilities, Capability, ExchangeCapabilities, ExchangeCapabilitiesBuilder, TraitCategory,
124};
125pub use error::{
127 ContextExt, Error, ExchangeErrorDetails, NetworkError, OrderError, ParseError, Result,
128};
129pub use ws_exchange::{FullExchange, MessageStream, WsExchange};
130#[allow(deprecated)]
132pub use error::ErrorContext;
133pub use types::{
134 Amount, Balance, BalanceEntry, Cost, Currency, CurrencyNetwork, DefaultSubType, DefaultType,
135 DefaultTypeError, Fee, Market, MarketLimits, MarketPrecision, MarketType, MinMax, Ohlcv, Order,
136 OrderBook, OrderBookEntry, OrderBookSide, OrderSide, OrderStatus, OrderType, PrecisionMode,
137 Price, TakerOrMaker, Ticker, TickerParams, TickerParamsBuilder, Timeframe, Trade,
138 TradingLimits, resolve_market_type,
139};
140pub use symbol::{SymbolError, SymbolFormatter, SymbolParser};
142pub use types::symbol::{ContractType, ExpiryDate, ParsedSymbol, SymbolMarketType};
143pub use ws_client::{Subscription, WsClient, WsConfig, WsConnectionState, WsMessage};
144
145pub mod prelude {
152 pub use crate::auth::{
153 DigestFormat, HashAlgorithm, base64_to_base64url, base64url_decode, eddsa_sign, hash,
154 hmac_sign, jwt_sign,
155 };
156 pub use crate::base_exchange::{
157 BaseExchange, ExchangeConfig, ExchangeConfigBuilder, MarketCache,
158 };
159 pub use crate::error::{ContextExt, Error, Result};
160 pub use crate::exchange::{
162 ArcExchange, BoxedExchange, Exchange, ExchangeCapabilities, ExchangeExt,
163 };
164 pub use crate::ws_exchange::{FullExchange, MessageStream, WsExchange};
166 #[allow(deprecated)]
168 pub use crate::error::ErrorContext;
169 pub use crate::http_client::{HttpClient, HttpConfig};
170 pub use crate::logging::{LogConfig, LogFormat, LogLevel, init_logging, try_init_logging};
171 pub use crate::precision::{
172 CountingMode, PaddingMode, RoundingMode, decimal_to_precision, number_to_string,
173 precision_from_string,
174 };
175 pub use crate::rate_limiter::{MultiTierRateLimiter, RateLimiter, RateLimiterConfig};
176 pub use crate::retry_strategy::{RetryConfig, RetryStrategy, RetryStrategyType};
177 pub use crate::time::{
178 iso8601, microseconds, milliseconds, parse_date, parse_iso8601, seconds, ymd, ymdhms,
179 yymmdd, yyyymmdd,
180 };
181 pub use crate::types::{
182 Amount, Balance, BalanceEntry, Currency, DefaultSubType, DefaultType, DefaultTypeError,
183 Fee, Market, MarketLimits, MarketPrecision, MarketType, Ohlcv, Order, OrderBook,
184 OrderBookEntry, OrderBookSide, OrderSide, OrderStatus, OrderType, PrecisionMode, Price,
185 Symbol, TakerOrMaker, Ticker, TickerParams, TickerParamsBuilder, Timeframe, Timestamp,
186 Trade, TradingLimits, resolve_market_type,
187 };
188 pub use crate::symbol::{SymbolError, SymbolFormatter, SymbolParser};
190 pub use crate::types::symbol::{ContractType, ExpiryDate, ParsedSymbol, SymbolMarketType};
191 pub use crate::ws_client::{Subscription, WsClient, WsConfig, WsConnectionState, WsMessage};
192 pub use rust_decimal::Decimal;
193 pub use serde::{Deserialize, Serialize};
194}
195
196pub const VERSION: &str = env!("CARGO_PKG_VERSION");
198
199pub const NAME: &str = env!("CARGO_PKG_NAME");
201
202#[cfg(test)]
203mod tests {
204 use super::*;
205
206 #[test]
207 fn test_version() {
208 assert!(!VERSION.is_empty());
209 assert_eq!(NAME, "ccxt-core");
210 }
211}