eth_unsubscribe - Optimism
Subscriptions are canceled 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 canceled successfully

Parameters

  1. 1.
    subscription id

Example

NOTE: eth_unsubscribe requests cannot be replicated in the composer tool
Request
Curl
1
wscat -c wss://opt-mainnet.g.alchemy.com/v2/<"YOUR KEY">
2
3
{"jsonrpc":"2.0","method":"eth_subscribe","params":["0x9cef478923ff08bf67fde6c64013158d"],"id":1}
Copied!
1
{
2
"jsonrpc":"2.0",
3
"id":1,
4
"result":true
5
}
Copied!
Optimism API
Alchemy Documentation
Copy link
Contents