ccxt_exchanges/binance/
constants.rs1use std::collections::HashMap;
7
8pub mod endpoints {
10 pub const PUBLIC: &str = "https://api.binance.com/api/v3";
12 pub const SAPI: &str = "https://api.binance.com/sapi/v1";
14 pub const FAPI: &str = "https://fapi.binance.com/fapi/v1";
16 pub const DAPI: &str = "https://dapi.binance.com/dapi/v1";
18
19 pub const EXCHANGE_INFO: &str = "/exchangeInfo";
21 pub const TICKER_24HR: &str = "/ticker/24hr";
23 pub const TICKER_PRICE: &str = "/ticker/price";
25 pub const DEPTH: &str = "/depth";
27 pub const TRADES: &str = "/trades";
29 pub const AGG_TRADES: &str = "/aggTrades";
31 pub const KLINES: &str = "/klines";
33 pub const TICKER_ROLLING: &str = "/ticker";
35 pub const HISTORICAL_TRADES: &str = "/historicalTrades";
37 pub const SYSTEM_STATUS: &str = "/system/status";
39 pub const TIME: &str = "/time";
41
42 pub const ORDER: &str = "/order";
44 pub const OPEN_ORDERS: &str = "/openOrders";
46 pub const ALL_ORDERS: &str = "/allOrders";
48}
49
50pub mod status {
52 pub const NEW: &str = "NEW";
54 pub const PARTIALLY_FILLED: &str = "PARTIALLY_FILLED";
56 pub const FILLED: &str = "FILLED";
58 pub const CANCELED: &str = "CANCELED";
60 pub const PENDING_CANCEL: &str = "PENDING_CANCEL";
62 pub const REJECTED: &str = "REJECTED";
64 pub const EXPIRED: &str = "EXPIRED";
66}
67
68pub fn timeframes() -> HashMap<String, String> {
70 let mut timeframes = HashMap::new();
71 timeframes.insert("1s".to_string(), "1s".to_string());
72 timeframes.insert("1m".to_string(), "1m".to_string());
73 timeframes.insert("3m".to_string(), "3m".to_string());
74 timeframes.insert("5m".to_string(), "5m".to_string());
75 timeframes.insert("15m".to_string(), "15m".to_string());
76 timeframes.insert("30m".to_string(), "30m".to_string());
77 timeframes.insert("1h".to_string(), "1h".to_string());
78 timeframes.insert("2h".to_string(), "2h".to_string());
79 timeframes.insert("4h".to_string(), "4h".to_string());
80 timeframes.insert("6h".to_string(), "6h".to_string());
81 timeframes.insert("8h".to_string(), "8h".to_string());
82 timeframes.insert("12h".to_string(), "12h".to_string());
83 timeframes.insert("1d".to_string(), "1d".to_string());
84 timeframes.insert("3d".to_string(), "3d".to_string());
85 timeframes.insert("1w".to_string(), "1w".to_string());
86 timeframes.insert("1M".to_string(), "1M".to_string());
87 timeframes
88}