For the complete documentation index, see llms.txt. This page is also available as Markdown.

unsubscribe_all - Cosmos

Example code for the unsubscribe_all JSON-RPC method. Complete guide on how to use unsubscribe_all JSON-RPC in GetBlock Web3 documentation.

Cancels all active subscriptions on the current WebSocket connection. Useful when resetting the subscription state or before cleanly disconnecting.

WebSocket-only method. This method is only available over the WebSocket transport at wss://go.getblock.io/<ACCESS-TOKEN>/websocket. It will not work via HTTP POST. Use a WebSocket client such as wscat, the @cosmjs/tendermint-rpc WebSocketClient, or Python's websockets library.

Parameters

  • None

Request Example

# WebSocket-only method. Use wscat (or similar) to connect first:
wscat -c 'wss://go.getblock.io/<ACCESS-TOKEN>/websocket'

# Then send:
{"jsonrpc": "2.0", "method": "unsubscribe_all", "params": [], "id": "getblock.io"}

Response Example

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {}
}

Response Parameters

Field
Type
Description

result

object

Empty object on success

Use Cases

  • Bulk-clearing subscriptions before disconnecting

  • Resetting state in long-lived WebSocket clients

Error Handling

Status Code
Error Message
Cause

404

Not Found

Missing or invalid <ACCESS-TOKEN>

-32603

Internal error

Server-side error while processing the request

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Last updated

Was this helpful?