eth_unsubscribe
Subscriptions are cancelled with a regular RPC call with eth_unsubscribe as method and the subscription id as first parameter. It returns a bool indicating if the subscription was cancelled successful.

REQUEST PARAMS

  • SUBSCRIPTION ID [required]

EXAMPLE

1
>wscat -c wss://mainnet.infura.io/ws/v3/YOUR-PROJECT-ID
2
3
>{"jsonrpc":"2.0", "id": 1, "method": "eth_unsubscribe", "params": ["0x9cef478923ff08bf67fde6c64013158d"]}
Copied!

RESPONSE

RESULT FIELDS

  • UNSUBSCRIBED FLAG - true if the subscription was cancelled successful.

BODY

1
{
2
"id": 1,
3
"jsonrpc": "2.0",
4
"result": true
5
}
Copied!
Copy link