Skip to main content

gateio_rs/api/spot/
get_currencies.rs

1use crate::http::{Credentials, Method, request::Request};
2
3/// Request for retrieving all supported spot currencies
4pub struct GetCurrencies {
5    /// API credentials for authentication (optional for public data)
6    pub credentials: Option<Credentials>,
7}
8
9impl GetCurrencies {
10    /// Creates a new GetCurrencies request
11    pub fn new() -> Self {
12        Self { credentials: None }
13    }
14
15    /// Sets the API credentials for authentication
16    pub fn credentials(mut self, creds: Credentials) -> Self {
17        self.credentials = Some(creds);
18        self
19    }
20}
21
22impl From<GetCurrencies> for Request {
23    fn from(request: GetCurrencies) -> Request {
24        let params = Vec::new();
25
26        Request {
27            method: Method::Get,
28            path: "/api/v4/spot/currencies".into(),
29            params,
30            payload: "".to_string(),
31            x_gate_exp_time: None,
32            credentials: request.credentials,
33            sign: false,
34        }
35    }
36}