bitbank_api/private/
cancel_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// pub use super::cancel_order::CanceledOrder;
12
13#[derive(Deserialize)]
14struct Response {
15    orders: Vec<OrderInfo>,
16}
17
18pub async fn post(cred: Credential, params: Params) -> anyhow::Result<Vec<OrderInfo>> {
19    let json = serde_json::to_string(&params)?;
20    let resp: Response = ApiExec { cred }
21        .post("/v1/user/spot/cancel_orders", json)
22        .await?;
23    Ok(resp.orders)
24}