crypto_rest_client/exchanges/bitz/
bitz_spot.rs

1use super::super::utils::http_get;
2use crate::error::Result;
3use std::collections::BTreeMap;
4
5const BASE_URL: &str = "https://apiv2.bitz.com";
6
7/// The RESTful client for BitZ spot market.
8///
9/// * RESTful API doc: <https://apidocv2.bitz.plus/en/>
10/// * Trading at: <https://www.bitz.plus/exchange>
11/// * Rate Limits: <https://apidocv2.bitz.plus/en/#limit>
12///   * no more than 30 times within 1 sec
13pub struct BitzSpotRestClient {
14    _api_key: Option<String>,
15    _api_secret: Option<String>,
16}
17
18impl BitzSpotRestClient {
19    pub fn new(api_key: Option<String>, api_secret: Option<String>) -> Self {
20        BitzSpotRestClient { _api_key: api_key, _api_secret: api_secret }
21    }
22
23    /// Get the latest Level2 snapshot of orderbook.
24    ///
25    /// For example: <https://apiv2.bitz.com/V2/Market/depth?symbol=btc_usdt>,
26    pub fn fetch_l2_snapshot(symbol: &str) -> Result<String> {
27        gen_api!(format!("/V2/Market/depth?symbol={symbol}"))
28    }
29}