getLedgerEntries — Stellar JSON-RPC
Returns ledger entries through Stellar Soroban JSON-RPC.
https://triport.io/rpc/stellar- Network
- Stellar mainnet
- Scope
- stellar:rpc
- Auth
- x-token: $TRIPORT_API_KEY
- Rate limit
- stellar_read_rpc — 15 / 20 / 100 / 250 RPS sustained · short burst 30 / 40 / 200 / 500 (free / basic / pro / business) (plan policy); Burst capacity
Endpoint and plans: Stellar RPC endpoint.
Terms on this page: JSON-RPC.
Reads current ledger state for base64-encoded XDR ledger keys, including accounts, trustlines, offers, data, claimable balances, liquidity pools, and contract entries.
Use it for the current value of a known key. Use getEvents for retained activity or simulateTransaction for a prospective invocation.
At most 200 keys are accepted. Missing keys are not fabricated in entries; correlate results by key.
Parameters
JSON-RPC params is a by-name object. Only the fields below are defined by the OpenRPC catalog.
keysarray of stringrequiredxdrFormatstringoptionalResponse
The response is copied unchanged from the accepted fixture.
resultobjectresult.entriesarray of objectresult.entries[].keystringresult.entries[].lastModifiedLedgerSeqnumberresult.entries[].liveUntilLedgerSeqnumberresult.entries[].xdrstringresult.latestLedgernumberErrors
Errors use the standard JSON-RPC envelope. See Stellar errors and the shared error reference.
| Code | Meaning | When it happens |
|---|---|---|
-32602 | Invalid params | the by-name object or a field has the wrong type; positional-array style params are rejected. |
-32601 | Method not found | The method is absent from the published Stellar OpenRPC catalog. |
401 | Unauthorized | The API key is missing or invalid. |
429 | Rate limited | The stellar_read_rpc RPS budget is exceeded. |
Examples
JavaScript (fetch)
const request = {
"jsonrpc": "2.0",
"id": 1,
"method": "getLedgerEntries",
"params": {
"keys": [
"AAAAAAAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQ=="
]
}
};
const response = await fetch("https://triport.io/rpc/stellar", {
method: "POST",
headers: {
"x-token": process.env.TRIPORT_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify(request),
});
const payload = await response.json();
if (!response.ok || payload.error) throw new Error(JSON.stringify(payload.error));
console.log(payload.result);Notes
- At most 200 ledger keys are accepted.
- JSON XDR representation can change when underlying XDR changes.
- Related:
getEventsandsimulateTransaction. - This is a read-only surface. No write or transaction-submission method is published.