eth_unsubscribe
Network: BSC · Mainnet · Chain ID 56 (0x38)
Counts as 1 request. See Request Counting.
Protocol: WebSocket (WSS) only
Description
Unsubscribe from a previously created subscription.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
subscriptionId | hex | Yes | Subscription ID |
Request
{
"jsonrpc": "2.0",
"method": "eth_unsubscribe",
"params": ["0x1"],
"id": 1
}Code Examples
const ws = new WebSocket("wss://bsc-rpc.blockreq.com/v1/rpc/public");
ws.onopen = () => {
ws.send(JSON.stringify({
"jsonrpc": "2.0",
"method": "eth_unsubscribe",
"params": [
"0x1"
],
"id": 1
}));
};
ws.onmessage = (event) => {
console.log(JSON.parse(event.data));
};