getFirstAvailableBlock
Last updated:
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
This method takes no parameters.
Returns
| Field | Type |
|---|---|
| result | object |
Examples
curl https://triport.io/sol \
-X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{"id":1,"method":"getFirstAvailableBlock","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": "getFirstAvailableBlock",
"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":"getFirstAvailableBlock","params":[],"jsonrpc":"2.0"},
)
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Networks: mainnet, devnet, testnet.
- Credit cost: 1 per call.
FAQ
- What does getFirstAvailableBlock do?
- Returns the slot of the lowest confirmed block that has not been purged from the ledger.
- How many credits does getFirstAvailableBlock cost?
- getFirstAvailableBlock costs 1 credit(s) per call on Triport by default.
- Is getFirstAvailableBlock available over WebSocket?
- getFirstAvailableBlock is an HTTP JSON-RPC method.