gateio_rs/api/spot/
get_fee.rs1use crate::http::{Credentials, Method, request::Request};
2
3pub struct GetFee {
5 pub currency_pair: Option<String>,
7 pub credentials: Option<Credentials>,
9}
10
11impl GetFee {
12 pub fn new() -> Self {
14 Self {
15 currency_pair: None,
16 credentials: None,
17 }
18 }
19
20 pub fn currency_pair(mut self, currency_pair: &str) -> Self {
22 self.currency_pair = Some(currency_pair.into());
23 self
24 }
25
26 pub fn credentials(mut self, creds: Credentials) -> Self {
28 self.credentials = Some(creds);
29 self
30 }
31}
32
33impl From<GetFee> for Request {
34 fn from(request: GetFee) -> Request {
35 let mut params = Vec::new();
36 if let Some(currency_pair) = request.currency_pair {
37 params.push(("currency_pair".into(), currency_pair));
38 }
39
40 Request {
41 method: Method::Get,
42 path: "/api/v4/spot/fee".into(),
43 params,
44 payload: "".to_string(),
45 x_gate_exp_time: None,
46 credentials: request.credentials,
47 sign: true,
48 }
49 }
50}