Subscribe
Introduction
//Spot Demo
{
"id": 1545910660739, //The id should be an unique value
"type": "subscribe",
"topic": "/market/ticker:BTC-USDT,ETH-USDT", //Topic needs to be subscribed. Some topics support to divisional subscribe the informations of multiple trading pairs through ",".
"privateChannel": false, //Adopted the private channel or not. Set as false by default.
"response": true //Whether the server needs to return the receipt information of this subscription or not. Set as false by default.
}
//Future Demo
{
"id": 1545910660739, //The id should be an unique value
"type": "subscribe",
"topic": "/market/ticker:XBTUSDM", //Subscribed topic. Some topics support to divisional subscribe the informations of multiple trading pairs through ",".
"privateChannel": false, //Adopted the private channel or not. Set as false by default.
"response": true //Whether the server needs to return the receipt information of this subscription or not. Set as false by default.
}
To subscribe channel messages from a certain server, the client side should send subscription message to the server.
If the subscription succeeds, the system will send ack messages to you, when the response is set as true.
{
"id": "1545910660739",
"type": "ack"
}
While there are topic messages generated, the system will send the corresponding messages to the client side. For details about the message format, please check the definitions of topics.