use super::super::utils::http_get;
use crate::error::Result;
use std::collections::BTreeMap;
const BASE_URL: &str = "https://futures.kraken.com/derivatives/api/v3";
pub struct KrakenFuturesRestClient {
_api_key: Option<String>,
_api_secret: Option<String>,
}
impl KrakenFuturesRestClient {
pub fn new(api_key: Option<String>, api_secret: Option<String>) -> Self {
KrakenFuturesRestClient { _api_key: api_key, _api_secret: api_secret }
}
#[allow(non_snake_case)]
pub fn fetch_trades(symbol: &str, lastTime: Option<String>) -> Result<String> {
gen_api!(format!("/history?symbol={symbol}"), lastTime)
}
pub fn fetch_l2_snapshot(symbol: &str) -> Result<String> {
gen_api!(format!("/orderbook?symbol={symbol}"))
}
}