xrp

XRP (XRP)

Method: POST ledger

dropdown
POST

ledger

Retrieve information about the public ledger.

Parameters

ledger_hash - String

(Optional) A 20-byte hex string for the ledger version to use.

ledger_index - String or Unsigned Integer

(Optional) The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically.

account - String

The unique identifier of an account, typically the account's Address.

The request returns channels where this account is the channel's owner/source.

transactions - Boolean

(Optional) If true, include an array of suggested transactions, as JSON objects, that you can sign and submit to fix the problems. Defaults to false.

expand - Boolean

(Optional) Provide full JSON-formatted information for transaction/account information instead of only hashes.

Defaults to false. Ignored unless you request transactions, accounts, or both.

owner_funds - Boolean

(Optional) If true, include owner_funds field in the metadata of OfferCreate transactions in the response.

Defaults to false. Ignored unless transactions are included and expand is true.

binary - Boolean

(Optional) If true, and transactions and expand are both also true, return transaction information in binary format (hexadecimal string) instead of JSON format.

queue - Boolean

(Optional) If true, and the command is requesting the current ledger, includes an array of queued transactions in the results.

Request

curl --location --request POST 'https://xrp.getblock.io/mainnet/' 
--header 'x-api-key: YOUR-API-KEY' 
--header 'Content-Type: application/json' 
--data-raw '{"jsonrpc": "2.0",
"method": "ledger",
"params": [{"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH"}],
"id": "getblock.io"}'


Response

{
    "result": {
        "closed": {
            "ledger": {
                "accepted": true,
                "account_hash": "39BF0510635E17CE7A19B14813558818DF398D48930F6AE8BBDBB9143B2BFF5F",
                "close_flags": 0,
                "close_time": 674581032,
                "close_time_human": "2021-May-17 15:37:12.000000000 UTC",
                "close_time_resolution": 10,
                "closed": true,
                "hash": "3A0B41C31B13436610C5961E2C914529CAD3CCC4A7859ED6AABFCD0700847BC1",
                "ledger_hash": "3A0B41C31B13436610C5961E2C914529CAD3CCC4A7859ED6AABFCD0700847BC1",
                "ledger_index": "63632029",
                "parent_close_time": 674581031,
                "parent_hash": "ED4061A556FDBDD78AAE685C5E4C0BA02A8827E77BE9CD21142F6B4AB9D6828D",
                "seqNum": "63632029",
                "totalCoins": "99990418267097571",
                "total_coins": "99990418267097571",
                "transaction_hash": "67FD5590C4D59835BAD515633365690C28BABF91A262E53BE45DE6B0D8674558"
            }
        },
        "open": {
            "ledger": {
                "closed": false,
                "ledger_index": "63632030",
                "parent_hash": "3A0B41C31B13436610C5961E2C914529CAD3CCC4A7859ED6AABFCD0700847BC1",
                "seqNum": "63632030"
            }
        },
        "status": "success"
    }
}