getFirstAvailableBlock
POST
https://api.triport.ioReturns 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.getFirstAvailableBlockonly 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.
——optionalThis method takes no parameters.
Response
Response fields
| Field | Type | Description |
|---|---|---|
result | integer | Slot number of the lowest confirmed block still retained in the ledger. |
Errors
| Code | Meaning | When it happens |
|---|---|---|
-32003 | Rate limit exceeded | More 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. |
-32601 | Method not recognised | The method name was misspelled or is not in the Solana catalog. |
-32602 | Invalid params | A 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. minimumLedgerSlotvs. this method:minimumLedgerSlotmay report a lower slot because it counts unconfirmed ledger data. PrefergetFirstAvailableBlockwhenever 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.iofor testing.