pub struct GetOpenOrders {
pub page: Option<i32>,
pub limit: Option<i32>,
pub account: Option<String>,
pub credentials: Option<Credentials>,
}Expand description
Request for retrieving all open orders
Fields§
§page: Option<i32>Page number for pagination
limit: Option<i32>Maximum number of orders to return per page
account: Option<String>Optional account type filter
credentials: Option<Credentials>API credentials for authentication
Implementations§
Source§impl GetOpenOrders
impl GetOpenOrders
Sourcepub fn page(self, page: i32) -> Self
pub fn page(self, page: i32) -> Self
Sets the page number for pagination
Examples found in repository?
examples/sync/get_open_orders.rs (line 13)
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_open_orders().page(1).limit(100);
14
15 let resp = client.send(req)?;
16 let body = resp.into_body_str()?;
17 let resp_obj: Value = serde_json::from_str(&body).unwrap();
18 println!("{:?}", resp_obj);
19
20 Ok(())
21}Sourcepub fn limit(self, limit: i32) -> Self
pub fn limit(self, limit: i32) -> Self
Sets the maximum number of orders per page
Examples found in repository?
examples/sync/get_open_orders.rs (line 13)
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_open_orders().page(1).limit(100);
14
15 let resp = client.send(req)?;
16 let body = resp.into_body_str()?;
17 let resp_obj: Value = serde_json::from_str(&body).unwrap();
18 println!("{:?}", resp_obj);
19
20 Ok(())
21}Sourcepub fn credentials(self, creds: Credentials) -> Self
pub fn credentials(self, creds: Credentials) -> Self
Sets the API credentials for authentication
Trait Implementations§
Source§impl From<GetOpenOrders> for Request
impl From<GetOpenOrders> for Request
Source§fn from(request: GetOpenOrders) -> Request
fn from(request: GetOpenOrders) -> Request
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for GetOpenOrders
impl RefUnwindSafe for GetOpenOrders
impl Send for GetOpenOrders
impl Sync for GetOpenOrders
impl Unpin for GetOpenOrders
impl UnsafeUnpin for GetOpenOrders
impl UnwindSafe for GetOpenOrders
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more