eth_unsubscribe

Network: Polygon · Mainnet · Chain ID 137 (0x89)

Counts as 1 request. See Request Counting.

Protocol: WebSocket (WSS) only

Description

Unsubscribe from a previously created subscription.

Parameters

ParameterTypeRequiredDescription
subscriptionIdhexYesSubscription ID

Request

{ "jsonrpc": "2.0", "method": "eth_unsubscribe", "params": ["0x1"], "id": 1 }

Code Examples

const ws = new WebSocket("wss://polygon-bor-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)); };

Try It