The blockUnsubscribe
method in Solana allows a client to unsubscribe from a specific block subscription. This method can be used to cancel an existing subscription to block updates.
integer
- The ID of the subscription that you want to cancel.boolean
- A boolean value indicating if the subscription was removed successfully. true
if removed successfully, false
if not.blockUnsubscribe
code examples$ wscat -c YOUR_CHAINSTACK_WEBSOCKET_ENDPOINT
# Wait for the connection to be established
Connected (press CTRL+C to quit)
> {"jsonrpc":"2.0","id":1,"method":"blockUnsubscribe","params":[0]}
blockUnsubscribe
method to remove a subscription matching the ID passed as a parameter. Replace 'YOUR_SOLANA_WEBSOCKET_ENDPOINT'
with your actual Solana WebSocket endpoint URL, and use the correct subscription ID in the params
array.Was this page helpful?