eth_unsubscribe
Polygon API - 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 cancel

Parameters

  1. 1.
    subscription id

Example

NOTE: eth_unsubscribe requests cannot be replicated in the composer tool

Request

Curl
Postman
1
curl https://polygon-mainnet.g.alchemyapi.io/v2/your-api-key \
2
-X POST \
3
-H "Content-Type: application/json" \
4
-d '{"jsonrpc":"2.0","id": 1, "method": "eth_unsubscribe", "params": ["0x9cef478923ff08bf67fde6c64013158d"]}'
Copied!
1
URL: https://polygon-mainnet.g.alchemyapi.io/v2/your-api-key
2
RequestType: POST
3
Body:
4
{
5
"jsonrpc":"2.0",
6
"method":"eth_subscribe",
7
"params":["0x9cef478923ff08bf67fde6c64013158d"],
8
"id":1
9
}
Copied!

Result

1
{
2
"jsonrpc":"2.0",
3
"id":1,
4
"result":true
5
}
Copied!
​
Last modified 18d ago