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

unsubscribe

Tells the server to stop sending push messages for a particular subscription or set of subscriptions opened with subscribe on the same WebSocket connection. Available over WebSocket only.

This method will use 20 Compute Units.


Reference: Here

Parameters

  • streams (array, optional) Names of streams to unsubscribe from, such as ledger, transactions, transactions_proposed, validations, manifests or book_changes.

  • accounts (array, optional) Account addresses to stop receiving updates for. This only stops messages if you previously subscribed to those accounts specifically; you cannot use it to filter accounts out of a stream.

  • accounts_proposed (array, optional) Like accounts, but for accounts_proposed subscriptions that included not-yet-validated transactions.

  • books (array, optional) Order books to unsubscribe from. Each member is an object with taker_gets and taker_pays (currency objects, omit issuer for XRP) and optionally both (remove the subscription for both sides of the book) and domain (permissioned DEX). A book subscribed with a domain is a different subscription from the open-DEX book, so send the same domain to remove it.

Returns

  • result (object) Empty on success. Push messages for the removed subscriptions stop after this response.

// Result
// Documented response shape (xrpl.org)
{"id":2,"result":{},"status":"success","type":"response"}
wscat -c wss://mainnet.xrpl.validationcloud.io/v1/<YOUR_API_KEY_HERE>

{"id":1,"command":"subscribe","streams":["ledger"]}
{"id":1,"result":{},"status":"success","type":"response"}
{"id":2,"command":"unsubscribe","streams":["ledger"]}
{"id":2,"result":{},"status":"success","type":"response"}

The JSON-RPC shaped request {"jsonrpc":"2.0","id":2,"method":"unsubscribe","params":[{"streams":["ledger"]}]} is also accepted on the same WebSocket connection. Closing the WebSocket connection removes all of its subscriptions without needing an explicit unsubscribe.

Last updated

Was this helpful?