Module prelude

Module prelude 

Source
Expand description

Prelude module for convenient imports

Re-exports§

pub use crate::binance::Binance;
pub use crate::binance::BinanceBuilder;
pub use crate::bitget::Bitget;
pub use crate::bitget::BitgetBuilder;
pub use crate::bybit::Bybit;
pub use crate::bybit::BybitBuilder;
pub use crate::hyperliquid::HyperLiquid;
pub use crate::hyperliquid::HyperLiquidBuilder;
pub use crate::okx::Okx;
pub use crate::okx::OkxBuilder;

Structs§

Amount
Amount type (zero-cost wrapper).
BackoffConfig
Exponential backoff configuration for reconnection.
BackoffStrategy
Calculates retry delay with exponential backoff and jitter.
Balance
Balance structure containing all currency balances
BalanceEntry
Balance entry for a single currency
BaseExchange
Base exchange implementation
CancellationToken
A token which can be used to signal a cancellation request to one or more tasks.
Currency
Currency structure representing a tradable asset
Decimal
Decimal represents a 128 bit representation of a fixed-precision decimal number. The finite set of values of type Decimal are of the form m / 10e, where m is an integer such that -296 < m < 296, and e is an integer between 0 and 28 inclusive.
ExchangeCapabilities
Exchange capabilities configuration
ExchangeConfig
Exchange configuration
ExchangeConfigBuilder
Builder for ExchangeConfig
ExpiryDate
Represents a futures contract expiry date in YYMMDD format
Fee
Fee information
HttpClient
HTTP client with retry and rate limiting support
HttpConfig
HTTP request configuration
LogConfig
Log configuration.
Market
Market structure representing a trading pair
MarketCache
Market data cache structure
MarketLimits
Market limits for order parameters
MarketPrecision
Market precision settings
MultiTierRateLimiter
Multi-tier rate limiter for exchanges with multiple rate limit tiers
Ohlcv
OHLCV (Open, High, Low, Close, Volume) candlestick data
Order
Order structure
OrderBook
Complete order book structure
OrderBookEntry
Order book entry (price level)
ParsedSymbol
Represents a parsed unified symbol with all components
Price
Price type (zero-cost wrapper).
RateLimiter
Rate limiter using token bucket algorithm
RateLimiterConfig
Rate limiter configuration
RetryConfig
Retry configuration.
RetryStrategy
Retry strategy.
Subscription
WebSocket subscription metadata.
SubscriptionManager
Subscription manager with capacity limits.
SymbolFormatter
Symbol formatter for converting ParsedSymbol to unified symbol strings
SymbolParser
Symbol parser for unified symbol strings
Ticker
Ticker data structure
TickerParams
Strongly typed parameters accepted by ticker endpoints.
TickerParamsBuilder
Convenience builder for TickerParams.
Trade
Trade data structure
TradingLimits
Trading limits for a market
WsClient
Async WebSocket client for exchange streaming APIs.
WsConfig
WebSocket connection configuration.
WsError
Extended WebSocket error with classification.
WsStats
WebSocket connection statistics (lock-free).
WsStatsSnapshot
Immutable snapshot of WebSocket connection statistics.

Enums§

ContractType
Contract settlement type for derivatives
CountingMode
Precision counting mode.
DefaultSubType
Contract settlement type for derivatives
DefaultType
Default market type for exchange operations
DefaultTypeError
Error type for DefaultType parsing
DigestFormat
Output encoding format for cryptographic digests.
EndpointType
Endpoint type enum for distinguishing between public and private API endpoints.
Error
The primary error type for the ccxt-rust library.
HashAlgorithm
Supported cryptographic hash algorithms.
LogFormat
Log format.
LogLevel
Log level.
MarketType
Market type enumeration
OrderSide
Order side (buy or sell)
OrderStatus
Order status
OrderType
Order type
PaddingMode
Output padding mode.
PrecisionMode
Precision mode for currency operations
RetryStrategyType
Retry strategy type.
RoundingMode
Rounding mode for precision calculations.
SymbolError
Symbol-related errors
SymbolMarketType
Market type derived from symbol structure
TakerOrMaker
Whether a trade is maker or taker
Timeframe
Timeframe enum for OHLCV data
WsConnectionState
WebSocket connection state.
WsErrorKind
WebSocket error classification.
WsEvent
WebSocket connection event types.
WsMessage
WebSocket message types for exchange communication.

Constants§

DEFAULT_MAX_SUBSCRIPTIONS
Default maximum number of subscriptions.
DEFAULT_SHUTDOWN_TIMEOUT
Default shutdown timeout in milliseconds.

Traits§

ContextExt
Extension trait for ergonomic error context attachment.
Deserialize
A data structure that can be deserialized from any data format supported by Serde.
ErrorContextDeprecated
Helper trait for adding context to errors (legacy alias for ContextExt).
Exchange
Core Exchange trait - the unified interface for all exchanges
ExchangeExt
Extension trait providing access to modular sub-traits from Exchange.
FullExchange
Combined trait for exchanges that support both REST and WebSocket
Serialize
A data structure that can be serialized into any data format supported by Serde.
WsExchange
WebSocket exchange trait for real-time data streaming

Functions§

base64_to_base64url
Converts standard Base64 to Base64 URL format.
base64url_decode
Decodes a Base64 URL-encoded string.
decimal_to_precision
Formats a decimal to a specific precision with configurable rounding and counting modes.
eddsa_sign
Generates an EdDSA signature using Ed25519.
hash
Computes a cryptographic hash (one-way, keyless).
hmac_sign
Generates an HMAC signature for a message.
init_logging
Initializes the logging system.
iso8601
Converts a timestamp in milliseconds to an ISO 8601 formatted string
jwt_sign
Generates a JWT (JSON Web Token).
microseconds
Returns the current time in microseconds since the Unix epoch
milliseconds
Returns the current time in milliseconds since the Unix epoch
number_to_string
Converts a decimal number to string, handling scientific notation.
parse_date
Parses a date string and returns the timestamp in milliseconds since Unix epoch
parse_iso8601
Parses an ISO 8601 date string and returns the timestamp in milliseconds
precision_from_string
Extracts precision (number of decimal places) from a string representation.
resolve_market_type
Resolves the effective market type for an API call
seconds
Returns the current time in seconds since the Unix epoch
try_init_logging
Attempts to initialize the logging system, ignoring duplicate initialization errors.
ymd
Alias for yyyymmdd function
ymdhms
Formats a timestamp as “yyyy-MM-dd HH:mm:ss”
yymmdd
Formats a timestamp as “yy-MM-dd”
yyyymmdd
Formats a timestamp as “yyyy-MM-dd”

Type Aliases§

ArcExchange
Type alias for an Arc-wrapped Exchange trait object
BoxedExchange
Type alias for a boxed Exchange trait object
MessageStream
WebSocket message stream type
OrderBookSide
Order book side (bids or asks)
Result
Result type alias for all CCXT operations.
Symbol
Type alias for trading symbols (e.g., “BTC/USDT”)
Timestamp
Type alias for timestamps (milliseconds since Unix epoch)

Derive Macros§

Deserialize
Serialize