get_price_order/
get_price_order.rs1use 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 order_id = "1037810722"; let req = spot::get_price_order(order_id);
18
19 let resp = client.send(req)?;
20 let body = resp.into_body_str()?;
21 let resp_obj: Value = serde_json::from_str(&body).unwrap();
22 println!("{:?}", resp_obj);
23
24 Ok(())
25}