875428575@qq.com 2 éve
szülő
commit
17d2086de6
1 módosított fájl, 37 hozzáadás és 0 törlés
  1. 37 0
      exchanges/src/gate_swap_rest.rs

+ 37 - 0
exchanges/src/gate_swap_rest.rs

@@ -253,6 +253,43 @@ impl GateSwapRest {
         ).await;
         data
     }
+    //弃用
+    pub async fn swap_bazaar_order(&self, text: String, origin_side: String, settle: String, contract: String, size: i64) -> ResponseData {
+        let mut reduce_only = false;
+        let mut param = serde_json::json!({
+            "text":text,
+            "contract":contract,
+            "price":"0",
+            "size":size,
+        });
+
+        let req = match origin_side.as_str() {
+            "kd" => {
+                reduce_only = false;
+                true
+            }
+            "pd" => {
+                reduce_only = true;
+                true
+            }
+            "kk" => {
+                reduce_only = false;
+                true
+            }
+            "pk" => {
+                reduce_only = true;
+                true
+            }
+            _ => { false } // 处理未知请求类型
+        };
+        if req {
+            param.as_object_mut().unwrap().insert("reduce_only".to_string(), serde_json::json!(reduce_only));
+        }
+
+        let data = self.swap_order(settle, param).await;
+        data
+    }
+
     //批量取消状态为 open 的订单
     pub async fn cancel_orders(&self, settle: String, contract: String) -> ResponseData {
         let params = serde_json::json!({