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