TriportRPC

getLedgerEntries

Stellar / https://triport.io/rpc/stellar

Minimum tier: Free

Stellar method guide

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

getLedgerEntries parameters
NameTypeRequiredDescription
keysarrayYesArray containing the keys of the ledger entries you wish to retrieve. (an array of serialized base64 strings)
xdrFormatstringNoLets 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

getLedgerEntries return value
FieldType
getLedgerEntriesResultobject

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

  1. Transport: HTTP (JSON-RPC).
  2. Chain: Stellar.
  3. Clusters: mainnet.
  4. 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.