eth_unsubscribeWebSocket

Cancels an active WebSocket subscription by its ID (create one with eth_subscribe first).

Chain EthereumTransport WSTry-it ws docs

How to use

  1. Open a WebSocket to the chain WS endpoint with your key in the path.
  2. Copy the wscat example below into your terminal.
  3. 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.

subscriptionIdDATArequired

Actual 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.

FieldTypeDescription
resultBOOLEANtrue if an active subscription was cancelled; false if the ID was not found on this connection.