소스 검색

新增 coinsph 交易所

hl 1 년 전
부모
커밋
5907d91317
2개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 2
      exchanges/src/coinsph_swap_rest.rs
  2. 4 1
      exchanges/tests/coinsph_swap_test.rs

+ 1 - 2
exchanges/src/coinsph_swap_rest.rs

@@ -74,8 +74,7 @@ impl CoinsphSwapRest {
         data
         data
     }
     }
     //获取合约信息
     //获取合约信息
-    pub async fn get_market(&mut self) -> ResponseData {
-        let params = json!({});
+    pub async fn get_market(&mut self,params:Value) -> ResponseData {
         let data = self.request("GET".to_string(),
         let data = self.request("GET".to_string(),
                                 "/openapi/v1".to_string(),
                                 "/openapi/v1".to_string(),
                                 "/exchangeInfo".to_string(),
                                 "/exchangeInfo".to_string(),

+ 4 - 1
exchanges/tests/coinsph_swap_test.rs

@@ -1,6 +1,7 @@
 use std::collections::BTreeMap;
 use std::collections::BTreeMap;
 use std::sync::Arc;
 use std::sync::Arc;
 use std::sync::atomic::AtomicBool;
 use std::sync::atomic::AtomicBool;
+use serde_json::json;
 
 
 use tokio::sync::Mutex;
 use tokio::sync::Mutex;
 use tracing::trace;
 use tracing::trace;
@@ -120,7 +121,9 @@ async fn rest_get_market_test() {
     global::log_utils::init_log_with_trace();
     global::log_utils::init_log_with_trace();
 
 
     let mut ret = get_rest();
     let mut ret = get_rest();
-    let req_data = ret.get_market().await;
+    let req_data = ret.get_market(json!({
+            "symbol":"ETHBTC"
+    })).await;
     println!("Coinsph--获取合约信息--{:?}", req_data);
     println!("Coinsph--获取合约信息--{:?}", req_data);
 }
 }