{
"pair": "ETH-USD",
"method": "SUBSCRIBE",
"apiKey": "?",
"signType": 2,
"signature": "?",
"event": "api_entrust",
"timestamp": 1657157345159
}
1 Get current timestamp(ms):
2 Sign the string format of the timestamp, result:
0x2c919fc2ad33889d524b61f5b5a4bc6f2b6d3f3b53505232c8f0e3e12c378dca6f35b217c8018d3da73794df3d428c1f1301c7cdb56b3c0944e0735417849f841c
3 Assembling parameters, including basic parameters for subscription and custom additional parameters for the interface.
{
"pair": "ETH-USD",
"method": "SUBSCRIBE",
"event": "api_entrust",
"apiKey": "st_fq6cvRF4fr5tnKiZfrIntRnLfrwxcXjcfr1y8FR7",
"signature": "0x2c919fc2ad33889d524b61f5b5a4bc6f2b6d3f3b53505232c8f0e3e12c378dca6f35b217c8018d3da73794df3d428c1f1301c7cdb56b3c0944e0735417849f841c",
"timestamp": 1725870671040,
"signType": "2"
}
4 Returns after a successful subscription
{
"event": "api_entrust_res",
"method": "SUBSCRIBE",
"msg": "subscribe success: api_entrust",
"pair": "ETH-USD",
"success": true
}
5 Server websocket push data.
{
"data": {
"changeType": "NEW",
"clientOrderId": "1725870680532",
"contractPairId": 1,
"currentEntrustId": 180632923,
"dealAmount": "0.00",
"dealQuantity": "0",
"direction": "LONG",
"isClose": false,
"isMarket": false,
"lever": 1,
"matchType": 1,
"price": "2000",
"quantity": "0.02",
"symbol": "ETH-USD"
},
"event": "api_entrust",
"success": true
}