|
|
@@ -7,7 +7,7 @@ use crate::http_tool::RestTool;
|
|
|
use crate::response_base::ResponseData;
|
|
|
use sha2::Sha512;
|
|
|
|
|
|
-pub struct GateUsdtSwapRest {
|
|
|
+pub struct GateSwapRest {
|
|
|
/*******参数*/
|
|
|
//是否需要登陆
|
|
|
is_login: bool,
|
|
|
@@ -16,11 +16,11 @@ pub struct GateUsdtSwapRest {
|
|
|
rest: RestTool,
|
|
|
}
|
|
|
|
|
|
-impl GateUsdtSwapRest {
|
|
|
+impl GateSwapRest {
|
|
|
/*******************************************************************************************************/
|
|
|
/*****************************************获取一个对象****************************************************/
|
|
|
/*******************************************************************************************************/
|
|
|
- pub fn new(is_colo: bool, is_login: bool, login_param: BTreeMap<String, String>) -> GateUsdtSwapRest
|
|
|
+ pub fn new(is_colo: bool, is_login: bool, login_param: BTreeMap<String, String>) -> GateSwapRest
|
|
|
{
|
|
|
let mut base_url = String::from("");
|
|
|
if is_colo {
|
|
|
@@ -31,7 +31,7 @@ impl GateUsdtSwapRest {
|
|
|
}
|
|
|
|
|
|
/*****返回结构体*******/
|
|
|
- GateUsdtSwapRest {
|
|
|
+ GateSwapRest {
|
|
|
is_login,
|
|
|
login_param,
|
|
|
rest: RestTool::new(base_url.to_string()),
|
|
|
@@ -71,6 +71,16 @@ impl GateUsdtSwapRest {
|
|
|
).await;
|
|
|
data
|
|
|
}
|
|
|
+ pub async fn get_market_details(&self, settle: String) -> ResponseData {
|
|
|
+ let mut btree_map: BTreeMap<String, String> = BTreeMap::new();
|
|
|
+ let data = self.request("GET".to_string(),
|
|
|
+ "/api/v4".to_string(),
|
|
|
+ format!("/futures/{}/contracts", settle),
|
|
|
+ true,
|
|
|
+ btree_map,
|
|
|
+ ).await;
|
|
|
+ data
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/*******************************************************************************************************/
|