crypto_rest_client/exchanges/mexc/
mexc_swap.rs1use super::super::utils::http_get;
2use crate::error::Result;
3use std::collections::BTreeMap;
4
5const BASE_URL: &str = "https://contract.mexc.com";
6
7pub struct MexcSwapRestClient {
12 _api_key: Option<String>,
13 _api_secret: Option<String>,
14}
15
16impl MexcSwapRestClient {
17 pub fn new(api_key: Option<String>, api_secret: Option<String>) -> Self {
18 MexcSwapRestClient { _api_key: api_key, _api_secret: api_secret }
19 }
20
21 pub fn fetch_trades(symbol: &str) -> Result<String> {
25 gen_api!(format!("/api/v1/contract/deals/{symbol}"))
26 }
27
28 pub fn fetch_l2_snapshot(symbol: &str) -> Result<String> {
36 gen_api!(format!("/api/v1/contract/depth/{symbol}?limit=2000"))
37 }
38}