命令请求格式

示例:

{
  "action":"<command>",
  "args":["arg1", "arg2", "arg3"]
 }

命令返回格式

示例:

{
  "action":"<command>",
  "success":true,         // 成功-true, 失败-false
  "group":"<group>",
  "request":{
      // 原始请求
  },
  "error":""  // 失败时有这个字段返回具体错误原因
}

支持命令列表

subscribe: 订阅

unsubscribe: 取消订阅

添加订阅

如:客户端订阅EOS/ETH,USDT/BTC现货对的ticker的命令

示例:

 {
   "action":"subscribe",
   "args":["Ticker:EOS/ETH", "Ticker:USDT/BTC"]
 }

取消订阅

客户单取消这两个现货对的订阅

示例:

 {
    "action":"unsubscribe",
    "args":["Ticker:EOS/ETH", "Ticker:USDT/BTC"]
 }

数据推送格式:

示例:


{
  "group": "Trade:BTC/USDT",
  "data": [
    {
      "trade_id": 2555642420,
      "stock_code": "BTC/USDT",
      "sell_order_id": 2555642419,
      "buy_order_id": 2555618051,
      "sell_account_id": 2085545501,
      "buy_account_id": 2555507972,
      "deal_price": "9270.7",
      "deal_vol": "0.1",
      "fluctuation": "0",
      "sell_fee": "0.005",
      "buy_fee": "0.01",
      "sell_fee_coin_code": "BTC",
      "buy_fee_coin_code": "BTC",
      "created_at": "2019-11-01T06:29:25.069604272Z",
      "way": 2,
      "type": 0
    }
  ]
}

results matching ""

    No results matching ""