Skip to main content

ccxt_exchanges/binance/rest/
mod.rs

1//! Binance REST API implementation organized by market type and functionality.
2//!
3//! This module provides a modularized structure for Binance REST API operations,
4//! organized into logical sub-modules by market type and functionality:
5//!
6//! - `market_data`: Public market data operations (ticker, orderbook, trades, OHLCV)
7//! - `spot`: Spot trading operations (orders, balance)
8//! - `futures`: Perpetual futures (FAPI) operations
9//! - `delivery`: Delivery futures (DAPI) operations
10//! - `margin`: Margin trading operations
11//! - `account`: Account-related operations
12//! - `funding`: Deposit and withdrawal operations
13//!
14//! # Usage
15//!
16//! All methods are implemented directly on the `Binance` struct, so you can call them
17//! directly on any `Binance` instance:
18//!
19//! ```no_run
20//! # use ccxt_exchanges::binance::Binance;
21//! # use ccxt_core::ExchangeConfig;
22//! # async fn example() -> ccxt_core::Result<()> {
23//! let binance = Binance::new(ExchangeConfig::default())?;
24//!
25//! // Market data methods (from market_data.rs)
26//! let ticker = binance.fetch_ticker("BTC/USDT", ()).await?;
27//!
28//! // Futures methods (from futures.rs)
29//! // let position = binance.fetch_position("BTC/USDT:USDT", None).await?;
30//!
31//! // Margin methods (from margin.rs)
32//! // let loan = binance.borrow_cross_margin("USDT", 100.0).await?;
33//!
34//! // Funding methods (from funding.rs)
35//! // let address = binance.fetch_deposit_address("BTC", None).await?;
36//! # Ok(())
37//! # }
38//! ```
39
40pub mod account;
41pub mod delivery;
42pub mod funding;
43pub mod futures;
44pub mod margin;
45pub mod market_data;
46pub mod spot;
47
48// Re-export commonly used types
49pub use account::BalanceFetchParams;