ccxt_exchanges/binance/
constants.rs

1//! Binance API constants.
2//!
3//! This module contains constants for API endpoints, order statuses, and other
4//! fixed strings used throughout the Binance implementation.
5
6/// API Endpoints
7pub mod endpoints {
8    /// Public API base URL
9    pub const PUBLIC: &str = "https://api.binance.com/api/v3";
10    /// SAPI (System API) base URL
11    pub const SAPI: &str = "https://api.binance.com/sapi/v1";
12    /// FAPI (Futures API) base URL
13    pub const FAPI: &str = "https://fapi.binance.com/fapi/v1";
14    /// DAPI (Delivery API) base URL
15    pub const DAPI: &str = "https://dapi.binance.com/dapi/v1";
16
17    /// Exchange Info endpoint
18    pub const EXCHANGE_INFO: &str = "/exchangeInfo";
19    /// 24hr Ticker endpoint
20    pub const TICKER_24HR: &str = "/ticker/24hr";
21    /// Price Ticker endpoint
22    pub const TICKER_PRICE: &str = "/ticker/price";
23    /// Order Book (Depth) endpoint
24    pub const DEPTH: &str = "/depth";
25    /// Recent Trades endpoint
26    pub const TRADES: &str = "/trades";
27    /// Aggregated Trades endpoint
28    pub const AGG_TRADES: &str = "/aggTrades";
29    /// Kline/Candlestick endpoint
30    pub const KLINES: &str = "/klines";
31    /// Rolling window ticker endpoint
32    pub const TICKER_ROLLING: &str = "/ticker";
33    /// Historical Trades endpoint
34    pub const HISTORICAL_TRADES: &str = "/historicalTrades";
35    /// System Status endpoint
36    pub const SYSTEM_STATUS: &str = "/system/status";
37    /// Server Time endpoint
38    pub const TIME: &str = "/time";
39
40    /// Order endpoint (create, cancel, fetch)
41    pub const ORDER: &str = "/order";
42    /// Open Orders endpoint
43    pub const OPEN_ORDERS: &str = "/openOrders";
44    /// All Orders endpoint
45    pub const ALL_ORDERS: &str = "/allOrders";
46}
47
48/// Order Statuses
49pub mod status {
50    /// The order has been accepted by the engine.
51    pub const NEW: &str = "NEW";
52    /// A part of the order has been filled.
53    pub const PARTIALLY_FILLED: &str = "PARTIALLY_FILLED";
54    /// The order has been completed.
55    pub const FILLED: &str = "FILLED";
56    /// The order has been canceled by the user.
57    pub const CANCELED: &str = "CANCELED";
58    /// The order is currently pending cancelation.
59    pub const PENDING_CANCEL: &str = "PENDING_CANCEL";
60    /// The order was not accepted by the engine and not processed.
61    pub const REJECTED: &str = "REJECTED";
62    /// The order was canceled according to the order type's rules.
63    pub const EXPIRED: &str = "EXPIRED";
64}