unsubscribe - XRPL

Example code for the unsubscribe JSON RPC method. Complete guide to using unsubscribe JSON-RPC in the GetBlock Web3 documentation.

This method tells the server to stop sending messages for a particular subscription.

Parameters

Parameter
Type
Required
Description

streams

array

No

Streams to unsubscribe

accounts

array

No

Accounts to stop watching

accounts_proposed

array

No

Proposed tx accounts

books

array

No

Order books to stop watching

Request Example

cURL
curl --location --request POST 'https://xrp.getblock.io/mainnet/' \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "unsubscribe",
    "params": [{
        "streams": ["ledger"]
    }],
    "id": "getblock.io"
}'

Response Example

Response Parameters

Parameter
Type
Description

status

string

Unsubscribe status

Use Cases

  • Stop receiving updates

  • Clean up connections

  • Resource management

Error Handling

Error Code
Description

invalidParams

Invalid parameters

SDK Integration

Last updated

Was this helpful?