Skip to content
Alchemy Logo

getLedgerEntries

POST
/{apiKey}

For reading the current value of ledger entries directly.

This method enables querying live ledger state: accounts, trustlines, offers, data, claimable balances, and liquidity pools. It also provides direct access to inspect a contract's current state, its code, or any other ledger entry. This serves as a primary method to access your contract data which may not be available via events or simulateTransaction.

To fetch contract wasm byte-code, use the ContractCode ledger entry key.

Path Parameters

stringrequireddefaults to docs-demo

For higher throughput, create your own API key

Request

string[]required

Array containing the keys of the ledger entries you wish to retrieve. (an array of serialized base64 strings)

stringoptional

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.

Responses

200

Was this page helpful?