指令格式
请求格式
{"op":"<operation>", "args":["<topic1>","<topic2>"]}
名词说明
- operation: 请求动作, 取值:
订阅=
subscribe
取消订阅=unsubscribe
登录=login
- args: 请求参数,取值: 频道数组或者登录需要的参数
topic: 频道主题,由
<channel>:<filter>
组成channel 是以 business/name组成
filter 是可筛选数据,具体参考每个频道说明
示例:spot/ticker:BTC_USDT, 表示BTC/USDT 现货交易对ticker数据
errorCode: 当发送订阅或者登陆事件产生错误时,会返回用户提示的错误码
- errorMessage: 当发送订阅或者登陆事件产生错误时,会返回用户提示的错误信息
成功响应格式
返回不包含error_code字段则表示成功
当 op=login 时:
{"event":"<operation>"}
当 op=unsubscribe 时:
{"event":"<operation>","topic":"<topic>"}
当 op=subscribe 时:
{"table":"<topic1>","data":"[{"<value1>","<value2>"}]"}
{"table":"<topic2>","data":"[{"<value1>","<value2>"}]"}
失败响应格式
返回包含error_code字段则表示失败,失败原因,请参考:WebSocket 错误码
{"event":"<operation>","errorMessage":"<error_message>","errorCode":"<error_code>"}