use super::super::utils::http_get;
use crate::error::Result;
use std::collections::BTreeMap;
const BASE_URL: &str = "https://api.hbdm.com";
pub struct HuobiFutureRestClient {
_api_key: Option<String>,
_api_secret: Option<String>,
}
impl_contract!(HuobiFutureRestClient);
impl HuobiFutureRestClient {
pub fn fetch_l2_snapshot(symbol: &str) -> Result<String> {
gen_api!(format!("/market/depth?symbol={symbol}&type=step0"))
}
pub fn fetch_open_interest(symbol: Option<&str>) -> Result<String> {
if let Some(symbol) = symbol {
gen_api!(format!("/api/v1/contract_open_interest?contract_code={symbol}"))
} else {
gen_api!("/api/v1/contract_open_interest")
}
}
}