Skip to main content

GetOpenOrders

Struct GetOpenOrders 

Source
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

Source

pub fn new() -> Self

Creates a new GetOpenOrders request

Source

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}
Source

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}
Source

pub fn account(self, account: &str) -> Self

Sets the account type filter

Source

pub fn credentials(self, creds: Credentials) -> Self

Sets the API credentials for authentication

Trait Implementations§

Source§

impl From<GetOpenOrders> for Request

Source§

fn from(request: GetOpenOrders) -> Request

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.