TriportRPC

voteUnsubscribe

Last updated:

voteUnsubscribe stops a vote stream opened with voteSubscribe on the same WebSocket connection. Send the integer subscription id from the subscribe ack; the server replies result: true and stops delivering voteNotification frames for that id. The connection and any other subscriptions it carries continue as before.

A vote stream cannot be narrowed server-side — it is always the full firehose of every validator's votes — so the only volume control you have is when you subscribe and when you unsubscribe. That makes this method part of normal operation rather than an edge case. Typical patterns: a validator health monitor subscribes, confirms its own votePubkey is appearing at the expected cadence, and unsubscribes until the next probe interval, rather than digesting mainnet's full vote traffic around the clock; a stake-weight tracker samples a few minutes of votes per hour to estimate participation; a research capture ends its collection window; or an optimistic-confirmation estimator shuts down outside trading hours. In each case, dropping the subscription frees substantial bandwidth and parsing load for whatever else shares the socket.

The lifecycle contract is the same as every Pub/Sub family. Subscription ids are meaningful only on the session that issued them: after a reconnect the server has already dropped the stream, so unsubscribing a remembered id fails with -32602 (invalid subscription id) — as does unsubscribing the same id twice. Given the stream's rate, a tail of buffered vote frames will often arrive after your unsubscribe request; drop frames whose params.subscription you no longer recognise. Nothing is replayed if you later resubscribe — votes observed while detached are simply not seen, so re-baseline validator state from getVoteAccounts when you reattach. Closing the socket outright releases all subscriptions at once and needs no per-id cleanup.

Parameters

This method takes no parameters.

Returns

voteUnsubscribe return value
FieldType
resultobject

Examples

curl https://triport.io/sol \
  -X POST -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <api-key>' \
  -d '{"id":1,"method":"voteUnsubscribe","params":[],"jsonrpc":"2.0"}'
const res = await fetch("https://triport.io/sol", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
  body: JSON.stringify({
  "id": 1,
  "method": "voteUnsubscribe",
  "params": [],
  "jsonrpc": "2.0"
}),
});
const data = await res.json();
import requests
resp = requests.post(
    "https://triport.io/sol",
    headers={"Authorization": "Bearer <api-key>"},
    json={"id":1,"method":"voteUnsubscribe","params":[],"jsonrpc":"2.0"},
)
print(resp.json())

Usage

  1. Transport: WebSocket.
  2. Networks: mainnet, devnet, testnet.
  3. Credit cost: 1 per call.

FAQ

What does voteUnsubscribe do?
Cancels an active voteSubscribe stream, identified by the subscription id returned in the subscribe ack.
How many credits does voteUnsubscribe cost?
voteUnsubscribe costs 1 credit(s) per call on Triport by default.
Is voteUnsubscribe available over WebSocket?
Yes, voteUnsubscribe supports WebSocket.