|
|
@@ -1,26 +1,19 @@
|
|
|
-use std::cmp::max;
|
|
|
+
|
|
|
use std::collections::BTreeMap;
|
|
|
-use std::io::{Error, ErrorKind};
|
|
|
use std::str::FromStr;
|
|
|
use std::sync::Arc;
|
|
|
use std::sync::atomic::AtomicBool;
|
|
|
-use futures_channel::mpsc::UnboundedSender;
|
|
|
-use futures_util::StreamExt;
|
|
|
use rust_decimal::Decimal;
|
|
|
use serde_json::Value;
|
|
|
use tokio::sync::Mutex;
|
|
|
-use tokio::time::Instant;
|
|
|
-use tracing::{error, info, trace};
|
|
|
-use exchanges::binance_swap_ws::BinanceSwapSubscribeType;
|
|
|
+use tracing::{error, trace};
|
|
|
use exchanges::coinex_swap_rest::CoinexSwapRest;
|
|
|
use exchanges::coinex_swap_ws::{CoinexSwapLogin, CoinexSwapSubscribeType, CoinexSwapWs};
|
|
|
-use exchanges::gate_swap_rest::GateSwapRest;
|
|
|
-use exchanges::gate_swap_ws::{GateSwapLogin, GateSwapWs, GateSwapWsType};
|
|
|
use exchanges::response_base::ResponseData;
|
|
|
-use global::trace_stack::TraceStack;
|
|
|
|
|
|
-const ACCESS_KEY: &str = "";
|
|
|
-const SECRET_KEY: &str = "";
|
|
|
+
|
|
|
+const ACCESS_KEY: &str = "458BD3429F334456BC73A36773BD7551";
|
|
|
+const SECRET_KEY: &str = "901604EB82D196D61D1AD57CEAA785E24ED9AA2032CBEEE9";
|
|
|
|
|
|
|
|
|
//ws-订阅公共频道信息
|
|
|
@@ -29,7 +22,7 @@ async fn ws_custom_subscribe() {
|
|
|
global::log_utils::init_log_with_trace();
|
|
|
|
|
|
let (write_tx, write_rx) = futures_channel::mpsc::unbounded();
|
|
|
- let (read_tx, mut read_rx) = futures_channel::mpsc::unbounded::<ResponseData>();
|
|
|
+ let (_read_tx, mut read_rx) = futures_channel::mpsc::unbounded::<ResponseData>();
|
|
|
|
|
|
// let (write_tx, write_rx) = tokio::sync::broadcast::channel::<Message>(10);
|
|
|
// let (read_tx, mut read_rx) = tokio::sync::broadcast::channel::<ResponseData>(10);
|
|
|
@@ -44,7 +37,7 @@ async fn ws_custom_subscribe() {
|
|
|
trace!("线程-数据读取-开启");
|
|
|
loop {
|
|
|
// 从通道中接收并丢弃所有的消息,直到通道为空
|
|
|
- while let Ok(Some(data)) = read_rx.try_next() {
|
|
|
+ while let Ok(Some(_data)) = read_rx.try_next() {
|
|
|
|
|
|
// 从通道中接收并丢弃所有的消息,直到通道为空
|
|
|
while let Ok(Some(_)) = read_rx.try_next() {
|
|
|
@@ -198,7 +191,7 @@ async fn rest_cancel_order_test() {
|
|
|
#[tokio::test]
|
|
|
async fn rest_cancel_all_order_test() {
|
|
|
let mut ret = get_rest();
|
|
|
- let ct_val = Decimal::ONE;
|
|
|
+ let _ct_val = Decimal::ONE;
|
|
|
let orders_res_data = ret.get_pending_orders().await;
|
|
|
let mut result = vec![];
|
|
|
if orders_res_data.code == 200 {
|
|
|
@@ -230,7 +223,7 @@ async fn rest_pending_order_list_test() {
|
|
|
#[tokio::test]
|
|
|
async fn rest_order_status_test() {
|
|
|
let mut ret = get_rest();
|
|
|
- let req_data = ret.get().await;
|
|
|
+ let req_data = ret.get_order_details("136925916412".to_string(), "DOGEUSDT".to_string()).await;
|
|
|
println!("coinex--查询pending_order--{:?}", req_data);
|
|
|
}
|
|
|
|