eth_unsubscribe
Cancels an existing subscription created with eth_subscribe.
Geth reference · All supported methods
Parameters
Parameters are positional, in the order below.
| Parameter | Type | Required | Description |
|---|---|---|---|
Subscription ID | Hexadecimal quantity | Yes | See the linked specification for field encoding. |
Return value
true if the subscription was removed; false if the subscription was not found on this connection.
Example
Send this message over the WebSocket connection for <gateway-url>/<service-url>:
json
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_unsubscribe",
"params": [
"0x9cef478923ff08bf67fde6c64013158d"
]
}Illustrative response; values depend on the selected network and request:
json
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}Direct behavior
Use the same WebSocket connection that created the subscription. Unsubscribing ends that subscription without closing other subscriptions or ordinary RPC requests on the connection. See Subscriptions.