Unsubscribe#
Unsubscribe from one or more channels.
Request Parameters#
Parameter | Type | Required | Description |
---|---|---|---|
op | String | Yes | Operation, unsubscribe |
args | Array | Yes | List of subscribed channels |
> channel | String | Yes | Channel name |
> chainIndex | String | Yes | Unique identifier for the chain. (e.g., 1 for Ethereum. See ChainIndex) |
> timestamp | String | Yes | Unix Epoch time, the unit is seconds |
> tokenContractAddress | String | Yes | Token contract address (e.g., 0x382bb369d343125bfb2117af9c149795c6c65c50) |
Response Parameters#
Parameter | Type | Description |
---|---|---|
event | String | Operation.unsubscribe or error |
arg | String | Subscribed channel |
> channel | String | Channel name |
> chainIndex | String | Unique identifier for the chain. (e.g., 1 for Ethereum. See ChainIndex) |
> tokenContractAddress | String | Token contract address (e.g., 0x382bb369d343125bfb2117af9c149795c6c65c50) |
code | String | Error code |
msg | String | Error message |
connId | String | WebSocket connection ID |
Request format description
{
"op": "unsubscribe",
"args": ["SubscriptionTopic"]
}
Request Example#
shell
{
"op": "unsubscribe",
"args": [{
"channel": "price",
"chainIndex": "1",
"tokenContractAddress": "0x382bb369d343125bfb2117af9c149795c6c65c50"
}]
}
Response Example#
200
{
"event": "unsubscribe",
"arg": {
"channel": "price",
"chainIndex": "1",
"tokenContractAddress":"0x382bb369d343125bfb2117af9c149795c6c65c50"
},
"connId": "d0b44253"
}