The logsUnsubscribe
method in Solana allows a client to unsubscribe from a specific logs subscription. This method can be used to cancel an existing subscription to log updates.
See also logsSubscribe | Solana.
Get your own Solana node endpoint today
Start for free and get your app to production levels immediately. No credit card required.
You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
integer
- The ID of the subscription that you want to cancel.
Response
boolean
- A boolean value indicating if the subscription was removed successfully.true
if removed successfully,false
if not.
logsUnsubscribe
code examples
logsUnsubscribe
code examplesNote that subscriptions require a WebSocket connection. You can use a WebSocket client library for your programming language of choice to interact with Solana's WebSocket API.
$ 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":"logsUnsubscribe","params":[0]}