Struct crypto_rest_client::MexcSwapRestClient
source · pub struct MexcSwapRestClient { /* private fields */ }
Expand description
MEXC Swap market.
- REST API doc: https://mxcdevelop.github.io/APIDoc/
- Trading at: https://contract.mexc.com/exchange
Implementations§
source§impl MexcSwapRestClient
impl MexcSwapRestClient
pub fn new(api_key: Option<String>, api_secret: Option<String>) -> Self
sourcepub fn fetch_trades(symbol: &str) -> Result<String, Error>
pub fn fetch_trades(symbol: &str) -> Result<String, Error>
Get most recent trades.
For example: https://contract.mexc.com/api/v1/contract/deals/BTC_USDT
sourcepub fn fetch_l2_snapshot(symbol: &str) -> Result<String, Error>
pub fn fetch_l2_snapshot(symbol: &str) -> Result<String, Error>
Get the latest Level2 snapshot of orderbook.
Top 2000 bids and asks will be returned.
For example: https://contract.mexc.com/api/v1/contract/depth/BTC_USDT?limit=2000
Rate limit: 20 times /2 seconds