[go: up one dir, main page]

Crate ccxt_core

Crate ccxt_core 

Source
Expand description

CCXT Core Library

This is the core library for CCXT Rust implementation, providing fundamental data structures, error types, and traits for cryptocurrency exchange integration.

§Features

  • Type Safety: Leverages Rust’s type system for compile-time guarantees
  • Precision: Uses rust_decimal::Decimal for accurate financial calculations
  • Async/Await: Built on tokio for high-performance async operations
  • Error Handling: Comprehensive error types with thiserror

§Example

use ccxt_core::prelude::*;

// Create a market
let market = Market::new_spot(
    "btc/usdt".to_string(),
    "BTC/USDT".to_string(),
    "BTC".to_string(),
    "USDT".to_string(),
);

// Create an order
let order = Order::new(
    "12345".to_string(),
    "BTC/USDT".to_string(),
    OrderType::Limit,
    OrderSide::Buy,
    rust_decimal_macros::dec!(0.1),
    Some(rust_decimal_macros::dec!(50000.0)),
    OrderStatus::Open,
);

Re-exports§

pub use base_exchange::BaseExchange;
pub use base_exchange::ExchangeConfig;
pub use base_exchange::ExchangeConfigBuilder;
pub use base_exchange::MarketCache;
pub use exchange::ArcExchange;
pub use exchange::BoxedExchange;
pub use exchange::Exchange;
pub use exchange::ExchangeCapabilities;
pub use error::ContextExt;
pub use error::Error;
pub use error::ExchangeErrorDetails;
pub use error::NetworkError;
pub use error::OrderError;
pub use error::ParseError;
pub use error::Result;
pub use ws_exchange::FullExchange;
pub use ws_exchange::MessageStream;
pub use ws_exchange::WsExchange;
pub use error::ErrorContext;Deprecated
pub use types::Amount;
pub use types::Balance;
pub use types::BalanceEntry;
pub use types::Cost;
pub use types::Currency;
pub use types::CurrencyNetwork;
pub use types::Fee;
pub use types::Market;
pub use types::MarketLimits;
pub use types::MarketPrecision;
pub use types::MarketType;
pub use types::MinMax;
pub use types::Ohlcv;
pub use types::Order;
pub use types::OrderBook;
pub use types::OrderBookEntry;
pub use types::OrderBookSide;
pub use types::OrderSide;
pub use types::OrderStatus;
pub use types::OrderType;
pub use types::PrecisionMode;
pub use types::Price;
pub use types::TakerOrMaker;
pub use types::Ticker;
pub use types::TickerParams;
pub use types::TickerParamsBuilder;
pub use types::Timeframe;
pub use types::Trade;
pub use types::TradingLimits;
pub use symbol::SymbolError;
pub use symbol::SymbolFormatter;
pub use symbol::SymbolParser;
pub use types::symbol::ContractType;
pub use types::symbol::ExpiryDate;
pub use types::symbol::ParsedSymbol;
pub use types::symbol::SymbolMarketType;
pub use ws_client::Subscription;
pub use ws_client::WsClient;
pub use ws_client::WsConfig;
pub use ws_client::WsConnectionState;
pub use ws_client::WsMessage;
pub use rust_decimal;
pub use serde;
pub use serde_json;

Modules§

auth
API authentication and cryptographic signing utilities.
base_exchange
Base exchange implementation
error
Error Handling for CCXT Rust
exchange
Unified Exchange Trait
http_client
HTTP client abstraction layer
logging
Structured logging system.
precision
Financial-grade precision calculation utilities.
prelude
Prelude module for convenient imports
rate_limiter
Rate Limiter Module
retry_strategy
Retry strategy module.
symbol
Unified Symbol Format Module
test_config
Test configuration management utilities.
time
Time utilities for CCXT
types
Core type definitions for CCXT
ws_client
WebSocket client module.
ws_exchange
WebSocket Exchange Trait

Macros§

require_credentials
Requires exchange credentials to run a test.
skip_if
Conditionally skips a test based on a condition.

Constants§

NAME
Library name
VERSION
Library version