crypto_rest_client/exchanges/dydx/
dydx_swap.rs1use super::super::utils::http_get;
2use crate::error::Result;
3use std::collections::BTreeMap;
4
5const BASE_URL: &str = "https://api.dydx.exchange";
6
7pub struct DydxSwapRestClient {
14 _api_key: Option<String>,
15 _api_secret: Option<String>,
16}
17
18impl DydxSwapRestClient {
19 pub fn new(api_key: Option<String>, api_secret: Option<String>) -> Self {
20 DydxSwapRestClient { _api_key: api_key, _api_secret: api_secret }
21 }
22
23 pub fn fetch_l2_snapshot(symbol: &str) -> Result<String> {
29 gen_api!(format!("/v3/orderbook/{symbol}"))
30 }
31
32 pub fn fetch_open_interest() -> Result<String> {
36 gen_api!("/v3/markets")
37 }
38}