Skip to main content

voteSubscribe RPC Method

Loading...

Updated on
Apr 14, 2026

voteSubscribe RPC Method

The Solana Kit example uses createSolanaRpcSubscriptions_UNSTABLE because the Kit API for vote subscriptions is currently experimental and the implementation may change. The voteSubscribe method itself is fully supported by the Quicknode WebSocket API.

Parameters

This method does not accept any parameters

Returns

result
integer
Loading...
voteNotification
object
Loading...
votePubkey
string
Loading...
slots
array
Loading...
hash
string
Loading...
timestamp
integer|null
Loading...
signature
string
Loading...
Request
1
import { createSolanaRpcSubscriptions_UNSTABLE } from '@solana/kit';
2
3
const rpcSubscriptions = createSolanaRpcSubscriptions_UNSTABLE('');
4
5
async function main() {
6
const abortController = new AbortController();
7
8
const votesNotification = await rpcSubscriptions
9
.voteNotifications()
10
.subscribe({ abortSignal: abortController.signal });
11
12
try {
13
for await (const notification of votesNotification) {
14
console.log('hash:', notification.hash);
15
console.log('votePubkey:', notification.votePubkey);
16
console.log('slots:', notification.slots);
17
}
18
} catch (e) {
19
console.error(e);
20
} finally {
21
abortController.abort();
22
console.log('Unsubscribed from vote notifications');
23
}
24
}
25
26
main();
27
1
import { createSolanaRpcSubscriptions_UNSTABLE } from '@solana/kit';
2
3
const rpcSubscriptions = createSolanaRpcSubscriptions_UNSTABLE('');
4
5
async function main() {
6
const abortController = new AbortController();
7
8
const votesNotification = await rpcSubscriptions
9
.voteNotifications()
10
.subscribe({ abortSignal: abortController.signal });
11
12
try {
13
for await (const notification of votesNotification) {
14
console.log('hash:', notification.hash);
15
console.log('votePubkey:', notification.votePubkey);
16
console.log('slots:', notification.slots);
17
}
18
} catch (e) {
19
console.error(e);
20
} finally {
21
abortController.abort();
22
console.log('Unsubscribed from vote notifications');
23
}
24
}
25
26
main();
27
Response
1
{
2
"jsonrpc": "2.0",
3
"result": 0,
4
"id": 1
5
}
1
{
2
"jsonrpc": "2.0",
3
"result": 0,
4
"id": 1
5
}
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free