Market API

Unsubscribe#

Unsubscribe from one or more channels.

Request Parameters#

ParameterTypeRequiredDescription
opStringYesOperation, unsubscribe
argsArrayYesList of subscribed channels
> channelStringYesChannel name
> chainIndexStringYesUnique identifier for the chain. (e.g., 1 for Ethereum. See ChainIndex)
> timestampStringYesUnix Epoch time, the unit is seconds
> tokenContractAddressStringYesToken contract address (e.g., 0x382bb369d343125bfb2117af9c149795c6c65c50)

Response Parameters#

ParameterTypeDescription
eventStringOperation.unsubscribe or error
argStringSubscribed channel
> channelStringChannel name
> chainIndexStringUnique identifier for the chain. (e.g., 1 for Ethereum. See ChainIndex)
> tokenContractAddressStringToken contract address (e.g., 0x382bb369d343125bfb2117af9c149795c6c65c50)
codeStringError code
msgStringError message
connIdStringWebSocket 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"
}