ledger
POST
Returns the ledger header information.Depending on the request options, it can also return the list of transactions in the ledger and the queue data.
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.
transactionsboolean
Whether to also return the transaction data in the ledger.expandboolean
Whether to return transactions and account state as full JSON.When false, only the identifiers are returned.owner_fundsboolean
Whether to include the owner_funds field in OfferCreate transaction metadata.binaryboolean
Whether to return transactions as hex strings.queueboolean
Whether to also return the queued transactions.It can be used only when ledger_index is set to current.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 queued transactions. Returned when
queue is set to true in the request.accountstring
The address of the account that submitted the transaction.txobject
The transaction data.retries_remaininginteger
The number of retries remaining.preflight_resultstring
The result code from preliminary validation.last_resultstring
The result code from the previous attempt.auth_changeboolean
Whether the transaction changes the account's signing authority.feestring
The transaction cost, in drops.fee_levelstring
The transaction cost expressed in fee levels.max_spend_dropsstring
The maximum amount this transaction could spend, in drops.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","params": [{"ledger_hash": "17ACB57A0F73B5160713E81FE72B2AC9F6064541004E272BD09F257D57C30C02","transactions": false,"expand": false,"owner_funds": false,"binary": false,"queue": false}]}'