bitbank_api/private/
fetch_orders.rs

1use super::*;
2
3#[serde_as]
4#[derive(TypedBuilder, Serialize, Debug)]
5pub struct Params {
6    #[serde_as(as = "DisplayFromStr")]
7    pair: Pair,
8    order_ids: Vec<u64>,
9}
10
11#[derive(Deserialize)]
12struct Response {
13    orders: Vec<OrderInfo>,
14}
15
16pub async fn get(cred: Credential, params: Params) -> anyhow::Result<Vec<OrderInfo>> {
17    let json = serde_json::to_string(&params)?;
18    let resp: Response = ApiExec { cred }
19        .post("/v1/user/spot/orders_info", json)
20        .await?;
21    Ok(resp.orders)
22}