ledger

[Source]

Retrieve information about the public ledger.

Request Format

An example of the request format:

curl --location 'https://xrp.nownodes.io' \
--header 'Content-Type: application/json' \
--header 'api-key: API_KEY' \
--data '{
    "method": "ledger",
    "params": [
        {
            "ledger_index": "validated",
            "transactions": false,
            "expand": false,
            "owner_funds": false
        }
    ]
}'

The request can contain the following parameters:

The ledger field is deprecated and may be removed without further notice. The full, accounts, and type fields (admin-only) are also deprecated; the Clio server does not implement these parameters.

Response Format

An example of a successful response:

{
    "result": {
        "ledger": {
            "account_hash": "640DA6DF331970751A31D8827DF58EB88C6D5CF8BF46821E6C8278408D852B84",
            "close_flags": 0,
            "close_time": 768688511,
            "close_time_human": "2024-May-10 20:35:11.000000000 UTC",
            "close_time_iso": "2024-05-10T20:35:11Z",
            "close_time_resolution": 10,
            "closed": true,
            "ledger_hash": "5CD77FE6E88EE2014A49D870FC239C16F13197E61ECFAFDA8BE5F8422CD24243",
            "ledger_index": "87899579",
            "parent_close_time": 768688510,
            "parent_hash": "BD4B8571A8A33EE9A818D1520B8720F1F0F56B204AE76999ACDC777A91A99E91",
            "total_coins": "99987599078872179",
            "transaction_hash": "8DE8E7ADEE11C448B73328630315313777BA2F323706F181D089BD3EE3B27F6E"
        },
        "ledger_hash": "5CD77FE6E88EE2014A49D870FC239C16F13197E61ECFAFDA8BE5F8422CD24243",
        "ledger_index": 87899579,
        "status": "success",
        "validated": true
    }
}

The response follows the [standard format][], with a successful result containing information about the ledger, including the following fields:

The ledger.accountState field (omitted unless requested with "full": true or "accounts": true) is deprecated.

The following deprecated fields have been removed: accepted, hash (use ledger_hash instead), seqNum (use ledger_index instead), totalCoins (use total_coins instead).

Updated in: rippled 1.12.0

Each member of the queue_data array represents one transaction in the queue. Some fields of this object may be omitted because they have not yet been calculated. The fields of this object are as follows:

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:

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 the ledger_hash or ledger_index does not exist, or it does exist but the server does not have it.

  • noPermission - If you specified full or accounts as true, but are not connected to the server as an admin (usually, admin requires connecting on localhost).

Last updated