1use gateio_rs::{api::spot, http::Credentials, ureq::GateHttpClient};
2use serde_json::Value;
3
4fn main() -> Result<(), Box<gateio_rs::ureq::Error>> {
5 dotenv::dotenv().ok();
6
7 let api_key = std::env::var("GATE_API_KEY").expect("GATE_API_KEY not set");
8 let api_secret = std::env::var("GATE_API_SECRET").expect("GATE_API_SECRET not set");
9 let credentials = Credentials::new(api_key, api_secret);
10
11 let client = GateHttpClient::default().credentials(credentials.clone());
12
13 let req = spot::get_order("123456789", "BTC_USDT").account("spot");
15
16 let resp = client.send(req)?;
17 let body = resp.into_body_str()?;
18 let resp_obj: Value = serde_json::from_str(&body).unwrap();
19 println!("{:?}", resp_obj);
20
21 Ok(())
22}