Skip to main content

gateio_rs/api/spot/
get_batch_user_fee.rs

1use crate::http::{Credentials, Method, request::Request};
2
3/// Request for retrieving trading fees for multiple currency pairs
4pub struct GetBatchUserFee {
5    /// Comma-separated list of currency pairs to get fees for
6    pub currency_pairs: String,
7    /// API credentials for authentication
8    pub credentials: Option<Credentials>,
9}
10
11impl GetBatchUserFee {
12    /// Creates a new GetBatchUserFee request with currency pairs
13    pub fn new(currency_pairs: &str) -> Self {
14        Self {
15            currency_pairs: currency_pairs.to_owned(),
16            credentials: None,
17        }
18    }
19
20    /// Sets the API credentials for authentication
21    pub fn credentials(mut self, creds: Credentials) -> Self {
22        self.credentials = Some(creds);
23        self
24    }
25}
26
27impl From<GetBatchUserFee> for Request {
28    fn from(request: GetBatchUserFee) -> Request {
29        let params = vec![("currency_pairs".to_owned(), request.currency_pairs)];
30
31        Request {
32            method: Method::Get,
33            path: "/api/v4/spot/batch_fee".into(),
34            params,
35            payload: "".to_string(),
36            x_gate_exp_time: None,
37            credentials: request.credentials,
38            sign: true,
39        }
40    }
41}