eth_unsubscribe
Cancels an existing subscription so that no further events are sent.
This method will use 10
Compute Units.
Parameters
subscription name
- string, same as previously returned from an eth_subscribe call
params: [
"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675",
]
Returns
true
if a subscription was successfully cancelled, or false
if no subscription existed with the given ID.
// Result
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
wscat -c wss:///mainnet.avalanche.validationcloud.io/v1/<YOUR_API_KEY_HERE>/ext/bc/C/ws
{"jsonrpc": "2.0", "id": 1, "method":"eth_subscribe","params":["newHeads"]}
{"jsonrpc":"2.0","result":"0x56134e7262fbb1419088ba7326557c25","id":1}
## subscription data
{"id": 1, "jsonrpc": "2.0", "method": "eth_unsubscribe", "params": ["0x56134e7262fbb1419088ba7326557c25"]}
{"jsonrpc":"2.0","result":true,"id":1}
wscat -c wss:///mainnet.avalanche.validationcloud.io/v1/<YOUR_API_KEY_HERE>/ext/bc/C/ws
{"jsonrpc": "2.0", "id": 1, "method":"eth_subscribe","params":["newHeads"]}
{"jsonrpc":"2.0","result":"0x56134e7262fbb1419088ba7326557c25","id":1}
## subscription data
{"id": 1, "jsonrpc": "2.0", "method": "eth_unsubscribe", "params": ["0x56134e7262fbb1419088ba7326557c25"]}
{"jsonrpc":"2.0","result":true,"id":1}