Skip to main content

ledger_data

POST

Returns the contents of the ledger state tree.Calling it repeatedly with marker lets you iterate through an entire ledger version.
param[0]
parametersobjectrequired
ledger_hashstring
The hash of the ledger version to use. Pass a 32-byte hex string.
ledger_indexoneOf
Specifies the ledger version to use. Pass a ledger index as an integer, or use one of the shortcut strings below.
  • validated: Uses the most recent ledger version validated by the network.
  • closed: Uses the most recent ledger version the server has closed. It may not be validated.
  • current: Uses the in-progress ledger version the server is currently building.
The ledger index of the version to use.
binaryboolean
Whether to return ledger entries as hex strings.
limitinteger
The number of ledger entries to return.Up to 2048 entries are returned when binary is true, and up to 256 when it is false.
markerstring
A value that marks a pagination position. Pass the marker value from a previous response to retrieve the next page.Its format depends on the server implementation, so use it verbatim without interpreting its contents.
typestring
The ledger entry type to return. (e.g.) account, state, offer
Responses
Ledger header information.
account_hashstring
The hash of the entire account state information.
close_flagsinteger
A bit-map of the flags applied when the ledger closed.
close_timeinteger
The time the ledger closed, in seconds since the Ripple Epoch.
close_time_humanstring
The time the ledger closed, as a human-readable UTC string.
close_time_isostring
The time the ledger closed, in ISO 8601 format.
close_time_resolutioninteger
The rounding interval applied to ledger close times, in seconds.
closedboolean
Whether the ledger version is closed.
ledger_hashstring
The unique hash that identifies the ledger version.
ledger_indexstring
The ledger index.
parent_close_timeinteger
The time the previous ledger closed, in seconds since the Ripple Epoch.
parent_hashstring
The hash of the previous ledger version.
total_coinsstring
The total amount of XRP in the network, in drops.
transaction_hashstring
The hash of all transactions included in this ledger version.
transactionsarray
The list of transactions included in the ledger. Returned when transactions is set to true in the request.
The list of entries in the ledger state tree.
datastring
The entry, hex-encoded. Returned when binary is true.
LedgerEntryTypestring
The type of the ledger entry. Returned when binary is false.
indexstring
The ID that identifies the ledger entry.
markerstring
A value that marks a pagination position. Pass the marker value from a previous response to retrieve the next page.Its format depends on the server implementation, so use it verbatim without interpreting its contents.
ledger_hashstring
The hash of the ledger version used. Returned when a validated ledger version was queried.
ledger_indexinteger
The ledger index of the version used. Returned when a validated ledger version was queried.
ledger_current_indexinteger
The ledger index of the in-progress ledger. Returned when the current ledger was queried.
validatedboolean
Whether the response was derived from a validated ledger version.
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "ERROR_CODE",
"message": "Unauthorized"
}
cURL
curl -X POST 'https://xrpl-mainnet.nodit.io' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"method": "ledger_data",
"params": [
{
"ledger_hash": "17ACB57A0F73B5160713E81FE72B2AC9F6064541004E272BD09F257D57C30C02",
"binary": false,
"limit": 5,
"type": "account"
}
]
}'