TriportRPC

getSlotLeaders

POSThttps://api.triport.io/sol

Returns the ordered list of slot leaders (validator identity pubkeys) for a contiguous range of slots.

Solanasol_read_rpcfree+ — free 20 rps · basic 60 rps · pro 200 rps · business 600 rps (with 2× burst)

getSlotLeaders returns the validator that is scheduled to produce each slot over a window of the leader schedule. Given a startSlot and a limit, it returns an ordered array of base-58 validator identity public keys: element 0 is the leader of startSlot, element 1 of startSlot + 1, and so on.

Use it to predict which validator will produce upcoming slots — for example to route a transaction toward the next leader's TPU, to attribute confirmed slots to a validator, or to render an upcoming leader schedule. Because Solana assigns leaders in fixed-size groups of consecutive slots, you will typically see the same pubkey repeated for several entries in a row.

The window must fall within the leader schedule the cluster currently knows about (the current and next epoch). Requesting a startSlot too far in the future, or a limit outside the 1–5000 range, returns an invalid-params error rather than a partial list.

Parameters

Positional params array: [startSlot, limit]. Both are required.

startSlotinteger (u64 slot number)required
First slot of the range. Element 0 of the result is this slot's leader.
limitintegerrequired
Number of consecutive slots to return leaders for. Must be between 1 and 5000 inclusive.

Response

Response fields

FieldTypeDescription
resultarray of stringOrdered list of base-58 validator identity pubkeys. Length equals limit. result[i] is the leader of slot startSlot + i.

Errors

CodeMeaningWhen it happens
-32602Invalid paramslimit is outside 1–5000, startSlot is negative, or a param is missing/wrong type.
-32003Rate limit exceededYou exceeded your tier's sol_read_rpc RPS (e.g. 20 rps sustained on free). Retry after Retry-After.
-32601Method not foundThe method name was misspelled or sent to the wrong chain path.

Example rate-limit envelope (HTTP 429):

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32003,
    "message": "Rate limit exceeded: 20 RPS sustained on sol_read_rpc (free tier)",
    "data": {
      "current_tier": "free",
      "category": "sol_read_rpc",
      "limit_rps": 20,
      "burst_capacity": 40,
      "retry_after_sec": 1
    }
  }
}

See errors.md for the full error envelope and the complete code list.

Examples

JavaScript (fetch)

const res = await fetch("https://api.triport.io/sol", {
  method: "POST",
  headers: {
    "x-token": process.env.TRIPORT_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "getSlotLeaders",
    params: [348392041, 10],
  }),
});


const { result } = await res.json();
console.log(result); // ["DWvDTSh3...", "DWvDTSh3...", ...]

TypeScript SDK (@triport/sdk)

import { TriportClient } from "@triport/sdk";


const client = new TriportClient({ apiKey: process.env.TRIPORT_API_KEY! });


const leaders: string[] = await client.solana.getSlotLeaders({
  startSlot: 348392041,
  limit: 10,
});


console.log(leaders[0]); // leader of slot 348392041

Python (triport-sdk)

import os
from triport import TriportClient


client = TriportClient(api_key=os.environ["TRIPORT_API_KEY"])


leaders = client.solana.get_slot_leaders(start_slot=348392041, limit=10)


print(leaders[0])  # leader of slot 348392041

Notes

  • Range cap: limit is hard-capped at 5000. To cover a wider window, page forward by advancing startSlot by the previous limit.
  • Repeated entries are expected: leaders are assigned in groups of consecutive slots, so the same pubkey commonly appears multiple times in a row.
  • Schedule horizon: queries outside the currently-known leader schedule (roughly the current and next epoch) fail with -32602 rather than returning a truncated list.
  • Related methods: getSlot for the current slot, getBlockProduction for which leaders actually produced blocks. See getting-started.md for auth and chain-path basics and rate-limits-and-tiers.md for per-tier RPS.