TriportRPC

getFirstAvailableBlock

POSThttps://api.triport.io

Returns the slot of the lowest confirmed block that has not been purged from the ledger.

Solanasol_read_rpcfree+ — free 20 / basic 60 / pro 200 / business 600 RPS

getFirstAvailableBlock returns the slot of the oldest confirmed block that is still retained in the ledger — i.e. the lower bound of the history you can currently query. Older blocks have been purged and can no longer be fetched with methods such as getBlock or getBlockTime.

Use it to discover the earliest slot you may pass to range or per-block queries before paginating forward with getBlocks. Treating any slot below this value as available will result in "block not available" errors.

Gotchas

  • Contrast with minimumLedgerSlot, which reports the lowest slot for which the node has any ledger data — that value may include slots that were never confirmed. getFirstAvailableBlock only counts confirmed blocks, so it is the correct floor for block-fetching requests.
  • The returned slot advances over time as the ledger is trimmed. Do not cache it as a permanent value; re-query before long-running backfills.

Parameters

None. The params array is empty.

optional
This method takes no parameters.

Response

Response fields

FieldTypeDescription
resultintegerSlot number of the lowest confirmed block still retained in the ledger.

Errors

CodeMeaningWhen it happens
-32003Rate limit exceededMore than your tier's RPS for sol_read_rpc (free 20 / basic 60 / pro 200 / business 600); a burst up to 2× is allowed before throttling.
-32601Method not recognisedThe method name was misspelled or is not in the Solana catalog.
-32602Invalid paramsA non-empty params array was sent — this method accepts no parameters.

See the shared errors reference for the full error envelope and the error.data fields.

Examples

JavaScript (fetch)

const res = await fetch("https://api.triport.io", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "getFirstAvailableBlock",
    params: [],
  }),
});


const { result } = await res.json();
console.log(`Oldest retained slot: ${result}`);

TypeScript SDK (@triport/sdk)

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


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


const firstSlot: number = await client.solana.getFirstAvailableBlock();
console.log(`Oldest retained slot: ${firstSlot}`);

Python (triport-sdk)

import os
from triport import TriportClient


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


first_slot = client.solana.get_first_available_block()
print(f"Oldest retained slot: {first_slot}")

Notes

  • History floor: use this value as the lower bound when enumerating slots with getBlocks; requesting a block below it will fail.
  • minimumLedgerSlot vs. this method: minimumLedgerSlot may report a lower slot because it counts unconfirmed ledger data. Prefer getFirstAvailableBlock whenever you intend to fetch full blocks.
  • Moving target: the floor rises as the ledger is pruned — re-query it rather than caching it across a long backfill.
  • Staging: the same request works against https://staging.api.triport.io for testing.