Skip to main content

rootUnsubscribe RPC Method

(Subscription Websocket) Unsubscribe from root notifications.

Updated on
Oct 4, 2023

rootUnsubscribe RPC Method

Parameters

number
The account id for the subscription to cancel

Returns

result
boolean
The result will be an RpcResponse JSON object with unsubscribed success message
Request
1
const web3 = require("@solana/web3.js");
2
(async () => {
3
const solanaConnection = new web3.Connection("https://docs-demo.solana-mainnet.quiknode.pro/", {
4
wsEndpoint: "",
5
});
6
solanaConnection.removeRootChangeListener(0);
7
})();
8
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free