use super::super::utils::http_get;
use crate::error::Result;
use std::collections::BTreeMap;
const BASE_URL: &str = "https://fapi.zb.com";
pub struct ZbSwapRestClient {
_api_key: Option<String>,
_api_secret: Option<String>,
}
impl ZbSwapRestClient {
pub fn new(api_key: Option<String>, api_secret: Option<String>) -> Self {
ZbSwapRestClient { _api_key: api_key, _api_secret: api_secret }
}
pub fn fetch_l2_snapshot(symbol: &str) -> Result<String> {
if symbol.ends_with("_QC") {
gen_api!(format!("/qc/api/public/v1/depth?symbol={symbol}&size=200"))
} else {
gen_api!(format!("/api/public/v1/depth?symbol={symbol}&size=200"))
}
}
}