Skip to main content

ledger RPC Method

Retrieves information about the public ledger

Updated on
Oct 4, 2023

ledger RPC Method

Parameters

ledger_hash
string
A 20-byte hex string for identifying the ledger version
ledger_index
string
The index of the ledger to retrieve information
transactions
boolean
A boolean flag indicating whether to include the information about transactions in the specified ledger version
expand
boolean
A boolean flag indicating whether to provide full JSON-formatted information for transaction/account information instead of only hashes
owner_funds
boolean
A boolean flag indicating whether to include owner_funds field in the metadata of OfferCreate transactions in the response
binary
boolean
If true, and transactions and expand are both also true, the response will contain transaction information in binary format represented as a hexadecimal string, instead of the default JSON format
queue
boolean
It include an array of queued transactions in the response results when the 'queued' parameter is set to true and the command is requesting the current ledger
type
string
It Filters by a ledger entry type. The valid types are: account, amendments, amm, check, deposit_preauth, directory, escrow, fee, hashes, nft_offer, offer, payment_channel, signer_list, state (trust line), and ticket. If using request accounts (state data), ignore it
diff
boolean
If true, returns all objects that were added, modified, or deleted as part of applying transactions in the specified ledger

Returns

result
object
The details of the result
ledger
object
The complete header data of this ledger with the following fields:
accepted
boolean
A boolean flag indicating whether the ledger has been accepted
account_hash
string
A hash value representing the state of all accounts in the ledger
close_flags
integer
A flags indicating the additional information about the ledger close
close_time
integer
The timestamp when the ledger was closed, represented in UNIX time format
close_time_human
string
The time this ledger was closed, in human-readable format
close_time_resolution
integer
The ledger close times are rounded to within this many seconds
closed
boolean
A boolean flag indicating whether or not this ledger has been closed
hash
string
The unique identifying hash of the entire ledger. This field is deprecated, use ledger_hash instead
ledger_hash
string
The unique identifying hash of the entire ledger
ledger_index
string
The index of the ledger
parent_close_time
integer
The time at which the previous ledger was closed
parent_hash
string
The unique identifying hash of the ledger that came immediately before this one
seqNum
string
The sequence number of the ledger
totalCoins
string
The total number of coins in the ledger. This field is deprecated, use total_coin instead
total_coins
string
The total number of coins in the ledger
transaction_hash
string
The transactions applied in this ledger version
ledger_hash
string
The unique identifying hash of the entire ledger
ledger_index
integer
The Ledger Index of this ledger
status
string
It indicates the status of the response
validated
boolean
It indicates whether the ledger has been validated
type
string
It Filters by a ledger entry type. The valid types are: account, amendments, amm, check, deposit_preauth, directory, escrow, fee, hashes, nft_offer, offer, payment_channel, signer_list, state (trust line), and ticket. If using request accounts (state data), ignore it
diff
boolean
If true, returns all objects that were added, modified, or deleted as part of applying transactions in the specified ledger
warnings
array
An array of warning objects, each containing the following fields:
id
integer
The ID of the warning
message
string
The warning message
Request
1
curl https://docs-demo.xrp-mainnet.quiknode.pro/ \
2
-X POST \
3
-H "Content-Type: application/json" \
4
--data '{
5
"method": "ledger",
6
"params": [{
7
"ledger_index": "current",
8
"transactions": false,
9
"expand": false,
10
"owner_funds": false
11
}],"id":1,"jsonrpc":"2.0"}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free