|
|
@@ -179,28 +179,28 @@ impl KucoinSwapWs {
|
|
|
//订阅枚举解析
|
|
|
pub fn enum_to_string(symbol: String, subscribe_type: KucoinSubscribeType) -> serde_json::Value {
|
|
|
match subscribe_type {
|
|
|
- KucoinSubscribeType::PuContractMarketLevel2Depth50 => {
|
|
|
+ KucoinSubscribeType::PuContractMarketLevel2Depth50 => {//level2
|
|
|
serde_json::json!({
|
|
|
"topic": format!("/contractMarket/level2Depth50:{}", symbol),
|
|
|
"type": "subscribe",
|
|
|
"response": true
|
|
|
})
|
|
|
}
|
|
|
- KucoinSubscribeType::PuContractMarketExecution => {
|
|
|
+ KucoinSubscribeType::PuContractMarketExecution => {//match
|
|
|
serde_json::json!({
|
|
|
"topic": format!("/contractMarket/execution:{}", symbol),
|
|
|
"type": "subscribe",
|
|
|
"response": true
|
|
|
})
|
|
|
}
|
|
|
- KucoinSubscribeType::PuContractMarkettickerV2 => {
|
|
|
+ KucoinSubscribeType::PuContractMarkettickerV2 => {//tickerV2
|
|
|
serde_json::json!({
|
|
|
"topic": format!("/contractMarket/tickerV2:{}", symbol),
|
|
|
"type": "subscribe",
|
|
|
"response": true
|
|
|
})
|
|
|
}
|
|
|
- KucoinSubscribeType::PrContractAccountWallet => {
|
|
|
+ KucoinSubscribeType::PrContractAccountWallet => {//orderMargin.change
|
|
|
serde_json::json!({
|
|
|
"type": "subscribe",
|
|
|
"topic": "/contractAccount/wallet",
|
|
|
@@ -208,7 +208,7 @@ impl KucoinSwapWs {
|
|
|
"response":true,
|
|
|
})
|
|
|
}
|
|
|
- KucoinSubscribeType::PrContractPosition => {
|
|
|
+ KucoinSubscribeType::PrContractPosition => {//position.change
|
|
|
serde_json::json!({
|
|
|
"type": "subscribe",
|
|
|
"topic": format!("/contract/position:{}", symbol),
|
|
|
@@ -216,7 +216,7 @@ impl KucoinSwapWs {
|
|
|
"response":true,
|
|
|
})
|
|
|
}
|
|
|
- KucoinSubscribeType::PrContractMarketTradeOrdersSys => {
|
|
|
+ KucoinSubscribeType::PrContractMarketTradeOrdersSys => {//orderChange
|
|
|
serde_json::json!({
|
|
|
"type": "subscribe",
|
|
|
"topic": format!("/contractMarket/tradeOrders"),
|
|
|
@@ -224,7 +224,7 @@ impl KucoinSwapWs {
|
|
|
"response":true,
|
|
|
})
|
|
|
}
|
|
|
- KucoinSubscribeType::PrContractMarketTradeOrders => {
|
|
|
+ KucoinSubscribeType::PrContractMarketTradeOrders => {//symbolOrderChange
|
|
|
serde_json::json!({
|
|
|
"type": "subscribe",
|
|
|
"topic": format!("/contractMarket/tradeOrders:{}", symbol),
|
|
|
@@ -493,7 +493,7 @@ impl KucoinSwapWs {
|
|
|
res_data.code = format!("{}", json_value["code"]);
|
|
|
res_data.message = format!("{}", json_value["data"].as_str().unwrap());
|
|
|
} else if json_value.get("topic").is_some() {
|
|
|
- res_data.channel = format!("{}", json_value["topic"].as_str().unwrap());
|
|
|
+ res_data.channel = format!("{}", json_value["subject"].as_str().unwrap());
|
|
|
|
|
|
if json_value["topic"].as_str() == Option::from("/contractAccount/wallet") {
|
|
|
res_data.code = "-202".to_string();
|