|
|
@@ -11,6 +11,7 @@ use tracing::{info, trace};
|
|
|
use crate::http_tool::RestTool;
|
|
|
use crate::response_base::ResponseData;
|
|
|
use std::string::String;
|
|
|
+use serde_json::json;
|
|
|
|
|
|
|
|
|
#[derive(Clone, Debug)]
|
|
|
@@ -37,7 +38,7 @@ impl KucoinSpotRest {
|
|
|
{
|
|
|
return KucoinSpotRest::new_lable("default-KucoinSpotRest".to_string(), is_colo, login_param);
|
|
|
}
|
|
|
- pub fn new_lable(label: String, is_colo: bool, login_param: BTreeMap<String, String>) -> KucoinSpotRest {
|
|
|
+ pub fn new_label(label: String, is_colo: bool, login_param: BTreeMap<String, String>) -> KucoinSpotRest {
|
|
|
let base_url = if is_colo {
|
|
|
"https://api.kucoin.com".to_string()
|
|
|
} else {
|
|
|
@@ -197,6 +198,17 @@ impl KucoinSpotRest {
|
|
|
data
|
|
|
}
|
|
|
|
|
|
+ //现货下单-
|
|
|
+ pub async fn spot_order(&mut self, params: serde_json::Value) -> ResponseData {
|
|
|
+ let data = self.request("POST".to_string(),
|
|
|
+ "/api/v1".to_string(),
|
|
|
+ format!("/orders"),
|
|
|
+ true,
|
|
|
+ params.to_string(),
|
|
|
+ ).await;
|
|
|
+ data
|
|
|
+ }
|
|
|
+
|
|
|
//获取合约令牌-公共
|
|
|
pub async fn get_public_token(&mut self) -> ResponseData {
|
|
|
let params = serde_json::json!({});
|