getLedgerEntries
Stellar / https://triport.io/rpc/stellar
Minimum tier: Free
Last updated:
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
| Name | Type | Required | Description |
|---|---|---|---|
| keys | array | Yes | Array containing the keys of the ledger entries you wish to retrieve. (an array of serialized base64 strings) |
| xdrFormat | string | No | Lets the user choose the format in which the response should be returned - either as unpacked JSON or as base64-encoded XDR strings. Note that you should not rely on any schema for the JSON, as it will change when the underlying XDR changes. |
Returns
| Field | Type |
|---|---|
| getLedgerEntriesResult | object |
Examples
curl https://triport.io/rpc/stellar \
-X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{"jsonrpc":"2.0","id":1,"method":"getLedgerEntries","params":["<keys>","<xdrFormat>"]}'const res = await fetch("https://triport.io/rpc/stellar", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 1,
"method": "getLedgerEntries",
"params": [
"<keys>",
"<xdrFormat>"
]
}),
});
const data = await res.json();import requests
resp = requests.post(
"https://triport.io/rpc/stellar",
headers={"Authorization": "Bearer <api-key>"},
json={"jsonrpc":"2.0","id":1,"method":"getLedgerEntries","params":["<keys>","<xdrFormat>"]},
)
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Chain: Stellar.
- Clusters: mainnet.
- Credit cost: 1 per call.
FAQ
- What does getLedgerEntries do?
- Returns ledger entries through Stellar Soroban JSON-RPC.
- How many credits does getLedgerEntries cost?
- getLedgerEntries costs 1 credit(s) per call on Triport by default.
- Is getLedgerEntries available over WebSocket?
- getLedgerEntries is an HTTP JSON-RPC method.