|
|
@@ -12,8 +12,8 @@ use exchanges::coinex_swap_ws::{CoinexSwapLogin, CoinexSwapSubscribeType, Coinex
|
|
|
use exchanges::response_base::ResponseData;
|
|
|
|
|
|
|
|
|
-const ACCESS_KEY: &str = "458BD3429F334456BC73A36773BD7551";
|
|
|
-const SECRET_KEY: &str = "901604EB82D196D61D1AD57CEAA785E24ED9AA2032CBEEE9";
|
|
|
+const ACCESS_KEY: &str = "";
|
|
|
+const SECRET_KEY: &str = "";
|
|
|
|
|
|
|
|
|
//ws-订阅公共频道信息
|
|
|
@@ -143,14 +143,14 @@ async fn rest_market_test() {
|
|
|
|
|
|
#[tokio::test]
|
|
|
async fn rest_market_list_test() {
|
|
|
- let symbol = "FTMUSDT".to_string();
|
|
|
- let price = Decimal::from_str("0.92").unwrap();
|
|
|
- let custom_id = "1234567890000";
|
|
|
+ let symbol = "DOGEUSDT".to_string();
|
|
|
+ let price = Decimal::from_str("0.15").unwrap();
|
|
|
+ let custom_id = "436265461";
|
|
|
let order_side;
|
|
|
let position_side;
|
|
|
- let amount = Decimal::from_str("10").unwrap();
|
|
|
+ let amount = Decimal::from_str("1769").unwrap();
|
|
|
let ct_val = Decimal::from_str("1").unwrap();
|
|
|
- let origin_side = "kd";
|
|
|
+ let origin_side = "kk";
|
|
|
let size = (amount / ct_val).floor();
|
|
|
match origin_side {
|
|
|
"kd" => {
|
|
|
@@ -163,11 +163,11 @@ async fn rest_market_list_test() {
|
|
|
}
|
|
|
"kk" => {
|
|
|
position_side = "short";
|
|
|
- order_side = "buy";
|
|
|
+ order_side = "sell";
|
|
|
}
|
|
|
"pk" => {
|
|
|
position_side = "short";
|
|
|
- order_side = "sell";
|
|
|
+ order_side = "buy";
|
|
|
}
|
|
|
_ => {
|
|
|
error!("下单参数错误");
|
|
|
@@ -183,7 +183,7 @@ async fn rest_market_list_test() {
|
|
|
#[tokio::test]
|
|
|
async fn rest_cancel_order_test() {
|
|
|
let mut ret = get_rest();
|
|
|
- let req_data = ret.cancel_order("FTMUSDT".to_string(), "", "175974369as").await;
|
|
|
+ let req_data = ret.cancel_order("DOGEUSDT".to_string(), "", "436265461").await;
|
|
|
|
|
|
println!("coinex--查询cancel_order--{} {:?}",req_data.data.is_null(), req_data);
|
|
|
}
|