polyio/api/
ticker_types.rs1use std::collections::BTreeMap;
5
6use serde::Deserialize;
7
8use crate::api::response::Response;
9use crate::Str;
10
11
12#[derive(Clone, Debug, Deserialize, PartialEq)]
17pub struct TickerTypes {
18 #[serde(rename = "types")]
20 pub types: BTreeMap<String, String>,
21 #[serde(rename = "indexTypes")]
23 pub index_types: BTreeMap<String, String>,
24}
25
26Endpoint! {
27 pub Get(()),
30 Ok => Response<TickerTypes>, [
31 OK,
33 ],
34 Err => GetError, []
35
36 fn path(_input: &Self::Input) -> Str {
37 "/v2/reference/types".into()
38 }
39}
40
41
42#[cfg(not(target_arch = "wasm32"))]
43#[cfg(test)]
44mod tests {
45 use super::*;
46
47 use test_log::test;
48
49 use crate::Client;
50
51 #[test(tokio::test)]
52 async fn request_ticker_types() {
53 let client = Client::from_env().unwrap();
54 let types = client.issue::<Get>(()).await.unwrap();
55
56 println!("{:?}", types);
57 }
58}