Skip to content

Latest commit

 

History

History
57 lines (45 loc) · 1.06 KB

eth_unsubscribe.md

File metadata and controls

57 lines (45 loc) · 1.06 KB
description
Subscriptions are cancelled with a regular RPC call with eth_unsubscribe as method and the subscription id as first parameter.

eth_unsubscribe

It returns a bool indicating if the subscription was cancelled successfully.

Parameters

  1. subscription id

Example

{% hint style="info" %} NOTE: eth_unsubscribe requests cannot be replicated in the composer tool {% endhint %}

Request

{% tabs %} {% tab title="Curl" %}

curl https://eth-mainnet.alchemyapi.io/v2/your-api-key \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id": 1, "method": "eth_unsubscribe", "params": ["0x9cef478923ff08bf67fde6c64013158d"]}'

{% endtab %}

{% tab title="Postman" %}

URL: https://eth-mainnet.alchemyapi.io/v2/your-api-key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_subscribe",
    "params":["0x9cef478923ff08bf67fde6c64013158d"],
    "id":1
}

{% endtab %} {% endtabs %}

Result

{
    "jsonrpc":"2.0",
    "id":1,
    "result":true
}