|
|
@@ -1,4 +1,3 @@
|
|
|
-use std::str::FromStr;
|
|
|
use std::sync::Arc;
|
|
|
use std::sync::atomic::AtomicBool;
|
|
|
use std::time::Duration;
|
|
|
@@ -7,6 +6,7 @@ use chrono::Utc;
|
|
|
use futures_channel::mpsc::{UnboundedReceiver, UnboundedSender};
|
|
|
use hex;
|
|
|
use hmac::{Hmac, Mac, NewMac};
|
|
|
+use rust_decimal::prelude::ToPrimitive;
|
|
|
use serde_json::{json, Value};
|
|
|
use sha2::Sha512;
|
|
|
use tokio::sync::Mutex;
|
|
|
@@ -344,7 +344,7 @@ impl GateSwapWs {
|
|
|
let message = json_value["error"]["message"].as_str().unwrap().to_string();
|
|
|
let mes = message.trim_end_matches('\n');
|
|
|
|
|
|
- res_data.code = i16::from_str(json_value["error"]["code"].as_str().unwrap()).unwrap();
|
|
|
+ res_data.code = json_value["error"]["code"].as_i64().unwrap().to_i16().unwrap();
|
|
|
res_data.message = mes.to_string();
|
|
|
} else if json_value["result"]["status"].as_str() == Option::from("success") {//订阅返回
|
|
|
res_data.code = -201;
|