|
|
@@ -325,7 +325,7 @@ impl Platform for BitgetSpot {
|
|
|
avg_price: Decimal::ZERO,
|
|
|
status: "NEW".to_string(),
|
|
|
order_type: "".to_string(),
|
|
|
- trace_stack: TraceStack::default().on_special("324 bitget_spot".to_string()),
|
|
|
+ trace_stack: TraceStack::default().on_special("328 bitget_spot".to_string()),
|
|
|
};
|
|
|
Ok(result)
|
|
|
} else {
|
|
|
@@ -377,7 +377,7 @@ impl Platform for BitgetSpot {
|
|
|
avg_price: Decimal::ZERO,
|
|
|
status: "NEW".to_string(),
|
|
|
order_type: "".to_string(),
|
|
|
- trace_stack: TraceStack::default().on_special("376 bitget_spot".to_string()),
|
|
|
+ trace_stack: TraceStack::default().on_special("380 bitget_spot".to_string()),
|
|
|
};
|
|
|
Ok(result)
|
|
|
} else {
|
|
|
@@ -400,7 +400,7 @@ impl Platform for BitgetSpot {
|
|
|
avg_price: Decimal::ZERO,
|
|
|
status: "REMOVE".to_string(),
|
|
|
order_type: "".to_string(),
|
|
|
- trace_stack: TraceStack::default().on_special("399 bitget_spot".to_string()),
|
|
|
+ trace_stack: TraceStack::default().on_special("403 bitget_spot".to_string()),
|
|
|
};
|
|
|
Ok(result)
|
|
|
} else {
|
|
|
@@ -416,24 +416,23 @@ impl Platform for BitgetSpot {
|
|
|
let orders_res_data_str = &orders_res_data.data;
|
|
|
let orders_res_data_json: Vec<serde_json::Value> = serde_json::from_str(orders_res_data_str).unwrap();
|
|
|
for order in orders_res_data_json {
|
|
|
- let cancel_symbol = order["symbol"].as_str().unwrap().to_uppercase();
|
|
|
- let cancel_res_data = self.request.spot_cancel_symbol_orders(cancel_symbol).await;
|
|
|
+ let order_id = order["orderId"].as_str().unwrap().to_string();
|
|
|
+ let cancel_res_data = self.request.spot_cancel_order(symbol_format.clone(), order_id, "".to_string()).await;
|
|
|
+ println!("{:?}", cancel_res_data);
|
|
|
if cancel_res_data.code == "200" {
|
|
|
let cancel_res_data_str = &cancel_res_data.data;
|
|
|
- let cancel_res_data_json: Vec<serde_json::Value> = serde_json::from_str(cancel_res_data_str).unwrap();
|
|
|
- for cancel in cancel_res_data_json {
|
|
|
- result.push(Order {
|
|
|
- id: cancel["orderId"].as_str().unwrap().to_string(),
|
|
|
- custom_id: cancel["clientOid"].as_str().unwrap().to_string(),
|
|
|
- price: Decimal::ZERO,
|
|
|
- amount: Decimal::ZERO,
|
|
|
- deal_amount: Decimal::ZERO,
|
|
|
- avg_price: Decimal::ZERO,
|
|
|
- status: "REMOVE".to_string(),
|
|
|
- order_type: "".to_string(),
|
|
|
- trace_stack: TraceStack::default().on_special("430 bitget_spot".to_string()),
|
|
|
- });
|
|
|
- };
|
|
|
+ let cancel_res_data_json: serde_json::Value = serde_json::from_str(cancel_res_data_str).unwrap();
|
|
|
+ result.push(Order {
|
|
|
+ id: cancel_res_data_json["orderId"].as_str().unwrap().to_string(),
|
|
|
+ custom_id: cancel_res_data_json["clientOid"].as_str().unwrap().to_string(),
|
|
|
+ price: Decimal::ZERO,
|
|
|
+ amount: Decimal::ZERO,
|
|
|
+ deal_amount: Decimal::ZERO,
|
|
|
+ avg_price: Decimal::ZERO,
|
|
|
+ status: "REMOVE".to_string(),
|
|
|
+ order_type: "".to_string(),
|
|
|
+ trace_stack: TraceStack::default().on_special("434 bitget_spot".to_string()),
|
|
|
+ });
|
|
|
} else {
|
|
|
return Err(Error::new(ErrorKind::Other, cancel_res_data.to_string()));
|
|
|
}
|