Skip to main content

ledger_data RPC Method

Retrieves contents of the specified ledger

Updated on
Oct 4, 2023

ledger_data RPC Method

Parameters

ledger_hash
string
The unique identifying hash of the entire ledger
ledger_index
integer
The ledger index of this ledger
binary
boolean
If true, it returns ledger entries as hexadecimal strings instead of JSON
limit
integer
It limit the number of ledger entries to retrieve
marker
string
A server-defined value indicating the response is paginated
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

Returns

result
object
A result object which contains the following fields:
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
marker
string
A server-defined value indicating the response is paginated
state
array
An array of JSON objects containing data from the ledger's state tree, each containing the following fields:
Account
string
The account associated with the ledger state
Balance
string
The balance of the account
Flags
integer
The flags associated with the account
LedgerEntryType
string
It indicate what type of ledger object this object represents (Only included if binary is false)
OwnerCount
integer
The number of owners associated with the account
PreviousTxnID
string
The ID of the previous transaction
PreviousTxnLgrSeq
integer
The sequence number of the previous transaction ledger
Sequence
integer
The sequence number of the account
index
string
The index of the ledger state
validated
boolean
It indicates whether the ledger is validated
status
string
The status of the request
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_data",
6
"params": [{}],"id":1,"jsonrpc":"2.0"}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free