|
|
@@ -142,7 +142,8 @@ impl GateSwapRest {
|
|
|
}
|
|
|
|
|
|
//下单:side-下单方向,pos_side-持仓方向
|
|
|
- pub async fn order(&self, settle: String,
|
|
|
+ pub async fn order(&self,
|
|
|
+ settle: String,
|
|
|
pos_side: String,
|
|
|
side: String,
|
|
|
contract: String,
|
|
|
@@ -158,9 +159,9 @@ impl GateSwapRest {
|
|
|
}
|
|
|
let mut param = serde_json::json!({
|
|
|
"contract":contract, //合约标识
|
|
|
- "size":size, //合约标识
|
|
|
+ "size":size,
|
|
|
"price":price,
|
|
|
- "text":text
|
|
|
+ "text":text,
|
|
|
});
|
|
|
if price == "0" {
|
|
|
param.as_object_mut().unwrap().insert("tif".to_string(), serde_json::json!("ioc"));
|
|
|
@@ -183,7 +184,7 @@ impl GateSwapRest {
|
|
|
}
|
|
|
_ => {} // 处理未知请求类型
|
|
|
};
|
|
|
-
|
|
|
+ println!("----param{}", param.to_string());
|
|
|
let data = self.swap_order(settle, param).await;
|
|
|
data
|
|
|
}
|