1#![warn(missing_docs)]
42#![warn(clippy::all)]
43#![warn(clippy::pedantic)]
44#![allow(clippy::module_name_repetitions)]
67#![allow(clippy::missing_errors_doc)]
68#![allow(clippy::missing_panics_doc)]
69#![allow(clippy::must_use_candidate)]
70#![allow(clippy::doc_markdown)]
71#![allow(clippy::similar_names)]
72#![allow(clippy::cast_sign_loss)]
73#![allow(clippy::cast_possible_wrap)]
74#![allow(clippy::struct_excessive_bools)]
75#![allow(clippy::too_many_lines)]
76#![allow(clippy::return_self_not_must_use)]
77#![allow(clippy::unreadable_literal)]
78
79pub use rust_decimal;
81pub use serde;
82pub use serde_json;
83
84pub mod auth;
86pub mod base_exchange;
87pub mod capability;
88pub mod config;
89pub mod credentials;
90pub mod error;
91pub mod exchange;
92pub mod http_client;
93pub mod logging;
94pub mod precision;
95pub mod rate_limiter;
96pub mod retry_strategy;
97pub mod symbol;
98pub mod time;
99pub mod traits;
101pub mod types;
102pub mod ws_client;
103pub mod ws_exchange;
104
105#[cfg(any(test, feature = "test-utils", debug_assertions))]
107pub mod test_config;
108
109pub use base_exchange::{BaseExchange, ExchangeConfig, ExchangeConfigBuilder, MarketCache};
114pub use credentials::{SecretBytes, SecretString};
115pub use exchange::{ArcExchange, BoxedExchange, Exchange, ExchangeExt};
117pub use capability::{
119 Capabilities, Capability, ExchangeCapabilities, ExchangeCapabilitiesBuilder, TraitCategory,
120};
121pub use error::{
123 ContextExt, Error, ExchangeErrorDetails, NetworkError, OrderError, ParseError, Result,
124};
125pub use ws_exchange::{FullExchange, MessageStream, WsExchange};
126#[allow(deprecated)]
128pub use error::ErrorContext;
129pub use types::{
130 Amount, Balance, BalanceEntry, Cost, Currency, CurrencyNetwork, DefaultSubType, DefaultType,
131 DefaultTypeError, EndpointType, Fee, Market, MarketLimits, MarketPrecision, MarketType, MinMax,
132 Ohlcv, Order, OrderBook, OrderBookEntry, OrderBookSide, OrderSide, OrderStatus, OrderType,
133 PrecisionMode, Price, TakerOrMaker, Ticker, TickerParams, TickerParamsBuilder, Timeframe,
134 Trade, TradingLimits, resolve_market_type,
135};
136pub use symbol::{SymbolError, SymbolFormatter, SymbolParser};
138pub use types::symbol::{ContractType, ExpiryDate, ParsedSymbol, SymbolMarketType};
139pub use ws_client::{
140 BackoffConfig, BackoffStrategy, DEFAULT_MAX_SUBSCRIPTIONS, DEFAULT_SHUTDOWN_TIMEOUT,
141 Subscription, SubscriptionManager, WsClient, WsConfig, WsConnectionState, WsError, WsErrorKind,
142 WsEvent, WsMessage, WsStats, WsStatsSnapshot,
143};
144pub use tokio_util::sync::CancellationToken;
146
147pub mod prelude {
154 pub use crate::auth::{
155 DigestFormat, HashAlgorithm, base64_to_base64url, base64url_decode, eddsa_sign, hash,
156 hmac_sign, jwt_sign,
157 };
158 pub use crate::base_exchange::{
159 BaseExchange, ExchangeConfig, ExchangeConfigBuilder, MarketCache,
160 };
161 pub use crate::error::{ContextExt, Error, Result};
162 pub use crate::exchange::{
164 ArcExchange, BoxedExchange, Exchange, ExchangeCapabilities, ExchangeExt,
165 };
166 pub use crate::ws_exchange::{FullExchange, MessageStream, WsExchange};
168 #[allow(deprecated)]
170 pub use crate::error::ErrorContext;
171 pub use crate::http_client::{HttpClient, HttpConfig};
172 pub use crate::logging::{LogConfig, LogFormat, LogLevel, init_logging, try_init_logging};
173 pub use crate::precision::{
174 CountingMode, PaddingMode, RoundingMode, decimal_to_precision, number_to_string,
175 precision_from_string,
176 };
177 pub use crate::rate_limiter::{MultiTierRateLimiter, RateLimiter, RateLimiterConfig};
178 pub use crate::retry_strategy::{RetryConfig, RetryStrategy, RetryStrategyType};
179 pub use crate::time::{
180 iso8601, microseconds, milliseconds, parse_date, parse_iso8601, seconds, ymd, ymdhms,
181 yymmdd, yyyymmdd,
182 };
183 pub use crate::types::{
184 Amount, Balance, BalanceEntry, Currency, DefaultSubType, DefaultType, DefaultTypeError,
185 EndpointType, Fee, Market, MarketLimits, MarketPrecision, MarketType, Ohlcv, Order,
186 OrderBook, OrderBookEntry, OrderBookSide, OrderSide, OrderStatus, OrderType, PrecisionMode,
187 Price, Symbol, TakerOrMaker, Ticker, TickerParams, TickerParamsBuilder, Timeframe,
188 Timestamp, Trade, TradingLimits, resolve_market_type,
189 };
190 pub use crate::symbol::{SymbolError, SymbolFormatter, SymbolParser};
192 pub use crate::types::symbol::{ContractType, ExpiryDate, ParsedSymbol, SymbolMarketType};
193 pub use crate::ws_client::{
194 BackoffConfig, BackoffStrategy, DEFAULT_MAX_SUBSCRIPTIONS, DEFAULT_SHUTDOWN_TIMEOUT,
195 Subscription, SubscriptionManager, WsClient, WsConfig, WsConnectionState, WsError,
196 WsErrorKind, WsEvent, WsMessage, WsStats, WsStatsSnapshot,
197 };
198 pub use rust_decimal::Decimal;
200 pub use serde::{Deserialize, Serialize};
201 pub use tokio_util::sync::CancellationToken;
202}
203
204pub const VERSION: &str = env!("CARGO_PKG_VERSION");
206
207pub const NAME: &str = env!("CARGO_PKG_NAME");
209
210#[cfg(test)]
211mod tests {
212 use super::*;
213
214 #[test]
215 fn test_version() {
216 assert!(!VERSION.is_empty());
217 assert_eq!(NAME, "ccxt-core");
218 }
219}