WebSocketAPI
舞动的代码 edited this page Jul 12, 2018
·
2 revisions
订阅路径:
wss://ws.coinbig.com/ws
成功建立和 WebSocket API 的连接之后,向 Server 发送如下格式的数据来订阅数据:
{
"datatype":"API_NEW",
"data":27
}
参数名 | 参数类型 | 必填 | 描述 |
---|---|---|---|
datatype | String | 是 | 订阅频道 |
data | String | 是 | 币对ID |
{
"tradeMappingId":27,
"buy":{
"orderid":447163,
"price":1,
"count":1,
"status":3
},
"sell":{
"orderid":445050,
"price":1,
"count":1,
"status":3
}
}
- 之后每当 有新的成交价时,client 会收到数据,
{
"tradeMappingId":当前交易的币对ID,
"buy":{
"orderid":订单号,
"price":成交价格,
"count":成交数量,
"time":成交时间
}
}