ledger
The ledger
command retrieves information about the public ledger.
New in: Clio v1.0.0
Note that the Clio server returns validated ledger data by default.
Request Format
An example of the request format:
The request can contain the following parameters:
| Type | Description |
| [Hash][] | (Optional) A 20-byte hex string for the ledger version to use. (See [Specifying Ledgers][]). |
| [Ledger Index][] | (Optional) The [ledger index][] of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers][]) |
| Boolean | (Optional) If |
| Boolean | (Optional) Provide full JSON-formatted information for transaction/account information instead of only hashes. Defaults to |
| Boolean | (Optional) If |
| Boolean | (Optional) If |
| Boolean | (Optional) If |
The ledger
field is deprecated and may be removed without further notice.
The ledger
command in Clio does not support the following fields that are supported by ledger command in rippled:
accounts
full
queue
Clio will always forward the request to rippled
when any of the above fields is set to true
.
Response Format
An example of a successful response:
The response follows the [standard format][], with a successful result containing information about the ledger, including the following fields:
| Type | Description |
| Object | The complete header data of this ledger. |
| String | Hash of all account state information in this ledger, as hex |
| Array | (Omitted unless requested) All the account-state information in this ledger. |
| Integer | A bit-map of flags relating to the closing of this ledger. |
| Integer | The time this ledger was closed, in [seconds since the Ripple Epoch][]. |
| String | The time this ledger was closed, in human-readable format. Always uses the UTC time zone. |
| Integer | Ledger close times are rounded to within this many seconds. |
| Boolean | Whether or not this ledger has been closed. |
| String | Unique identifying hash of the entire ledger. |
| String | The [Ledger Index][] of this ledger, as a quoted integer. |
| Integer | The time at which the previous ledger was closed. |
| String | Unique identifying hash of the ledger that came immediately before this one. |
| String | Total number of XRP drops in the network, as a quoted integer. (This decreases as transaction costs destroy XRP.) |
| String | Hash of the transaction information included in this ledger, as hex. |
| Array | (Omitted unless requested) Transactions applied in this ledger version. By default, members are the transactions' identifying [Hash][] strings. If the request specified |
| String | Unique identifying hash of the entire ledger. |
| Number | The [Ledger Index][] of this ledger. |
| Boolean | (May be omitted) If |
| Object | (Omitted unless requested with the |
If the request specified "owner_funds": true
and expanded transactions, the response has a field owner_funds
in the metaData
object of each [OfferCreate transaction][]. The purpose of this field is to make it easier to track the funding status of offers with each new validated ledger. This field is defined slightly differently than the version of this field in Order Book subscription streams:
| Value | Description |
| String | Numeric amount of the |
If the request specified "diff": true
, the response has an object diff
. The fields of this object are as follows:
| Value | Description |
| String | The object identifier. |
| Object or Hex String | Depending on whether the request set |
Possible Errors
Any of the [universal error types][].
invalidParams
- One or more fields are specified incorrectly, or one or more required fields are missing.lgrNotFound
- The ledger specified by theledger_hash
orledger_index
does not exist, or it does exist but the server does not have it.
Last updated