eth_ unsubscribeWebSocket
Cancels an active WebSocket subscription by its ID (create one with eth_subscribe first).
Chain
EthereumTransport WSTry-it ws docsHow to use
- Open a WebSocket to the chain WS endpoint with your key in the path.
- Copy the wscat example below into your terminal.
- Requires a persistent WebSocket — not a one-shot HTTP POST.
Parameters
JSON-RPC positional arguments — order matches the array sent in params. Index badges below match array positions.
subscriptionIdDATArequiredActual subscription ID returned on this same WebSocket connection. Replace the sample ID with the value returned by eth_subscribe; do not open a new connection to cancel the old subscription.
params array (shape)
eth_unsubscribe · paramsjson
1[2 "$SUB_ID"3]
Response fields
The result row describes the complete result; other rows describe its object fields or array elements. Indented rows describe nested members. For subscriptions,params.* rows describe later notifications rather than the initial reply.
| Field | Type | Description |
|---|---|---|
result | BOOLEAN | true if an active subscription was cancelled; false if the ID was not found on this connection. |