ledger_entry
The ledger_entry
method returns a single ledger entry from the XRP Ledger in its raw format. See [ledger format][] for information on the different types of entries you can retrieve.
Request Format
This method can retrieve several different types of data. You can select which type of item to retrieve by passing the appropriate parameters, comprised of the general and type-specific fields listed below, and following the standard request formatting. (For example, a WebSocket request always has the command
field and optionally an id
field, and a JSON-RPC request uses the method
and params
fields.)
General Fields
Field | Type | Description |
---|---|---|
| Boolean | (Optional) If |
The generator
and ledger
parameters are deprecated and may be removed without further notice.
In addition to the general fields above, you must specify exactly 1 of the following fields to indicate what type of entry to retrieve, along with its sub-fields as appropriate. The valid fields are:
ledger_entry
Request Format
General Fields
Get Ledger Object by ID
Get AccountRoot Object
Get AMM Object
Get Bridge Object
Get DirectoryNode Object
Get Offer Object
Get RippleState Object
Get Check Object
Get Escrow Object
Get PayChannel Object
Get DepositPreauth Object
Get Ticket Object
Get NFT Page
Response Format
Possible Errors
Caution: If you specify more than 1 of these type-specific fields in a request, the server retrieves results for only 1 of them. It is not defined which one the server chooses, so you should avoid doing this.
Get Ledger Object by ID
Retrieve any type of ledger object by its unique ID.
Field | Type | Description |
---|---|---|
| String | The ledger entry ID of a single entry to retrieve from the ledger, as a 64-character (256-bit) hexadecimal string. |
You can use this type of request to get any singleton ledger entry, if it exists in the ledger data, because its ID is always the same. For example:
Amendments
-7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4
FeeSettings
-4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A651
Recent History
LedgerHashes
-B4979A36CDC7F3D3D5C31A4EAE2AC7D7209DDA877588B9AFC66799692AB0D66B
NegativeUNL
-2E8A59AA9D3B5B186B0B9E0F62E6C02587CA74A4D778938E957B6357D364B244
Get AccountRoot Object
Retrieve an AccountRoot entry by its address. This is roughly equivalent to the [account_info method][].
Field | Type | Description |
---|---|---|
| String - [Address][] | The classic address of the AccountRoot entry to retrieve. |
Get AMM Object
(Requires the [AMM amendment][])
Retrieve an Automated Market-Maker (AMM) object from the ledger. This is similar to [amm_info method][], but the ledger_entry
version returns only the ledger entry as stored.
Field | Type | Description |
---|---|---|
| Object or String | The AMM to retrieve. If you specify a string, it must be the object ID of the AMM, as hexadecimal. If you specify an object, it must contain |
| Object | One of the two assets in this AMM's pool, as a currency object without an amount. |
| Object | The other of the two assets in this AMM's pool, as a currency object without an amount. |
Get Bridge Object
Retrieve a Bridge entry, which represents a single cross-chain bridge that connects the XRP Ledger with another blockchain.
Field | Type | Description |
---|---|---|
| String | The account that submitted the |
| Object | The Bridge to retrieve. Includes the door accounts and assets on the issuing and locking chain. |
Get DirectoryNode Object
Retrieve a DirectoryNode, which contains a list of other ledger objects. Can be provided as string (object ID of the Directory) or as an object.
Field | Type | Description |
---|---|---|
| Object or String | The DirectoryNode to retrieve. If a string, must be the object ID of the directory, as hexadecimal. If an object, requires either |
| Unsigned Integer | (Optional) If provided, jumps to a later "page" of the DirectoryNode. |
| String | (Optional) Unique index identifying the directory to retrieve, as a hex string. |
| String | (Optional) Unique address of the account associated with this directory. |
Get Offer Object
Retrieve an Offer entry, which defines an offer to exchange currency. Can be provided as string (unique index of the Offer) or as an object.
Field | Type | Description |
---|---|---|
| Object or String | If a string, interpret as ledger entry ID of the Offer to retrieve. If an object, requires the sub-fields |
| String - [Address][] | (Required if |
| Unsigned Integer | (Required if |
Get RippleState Object
Retrieve a [RippleState entry][], which tracks a (non-XRP) currency balance between two accounts.
Field | Type | Description |
---|---|---|
| Object | Object specifying the RippleState (trust line) object to retrieve. The |
| Array | (Required if |
| String | (Required if |
Get Check Object
Retrieve a Check entry, which is a potential payment that can be cashed by its recipient.
Field | Type | Description |
---|---|---|
| String | The object ID of a Check entry to retrieve. |
Get Escrow Object
Retrieve an Escrow entry, which holds XRP until a specific time or condition is met. Can be provided as string (object ID of the Escrow) or as an object.
Field | Type | Description |
---|---|---|
| Object or String | The Escrow to retrieve. If a string, must be the object ID of the Escrow, as hexadecimal. If an object, requires |
| String - [Address][] | (Required if |
| Unsigned Integer | (Required if |
Get PayChannel Object
Retrieve a PayChannel entry, which holds XRP for asynchronous payments.
Field | Type | Description |
---|---|---|
| String | The object ID of the PayChannel to retrieve. |
Get DepositPreauth Object
Retrieve a DepositPreauth entry, which tracks preauthorization for payments to accounts requiring Deposit Authorization.
Field | Type | Description |
---|---|---|
| Object or String | Specify the DepositPreauth to retrieve. If a string, must be the ledger entry ID of the DepositPreauth entry, as hexadecimal. If an object, requires |
| String - [Address][] | (Required if |
| String - [Address][] | (Required if |
Get Ticket Object
Retrieve a Ticket entry, which represents a [sequence number][] set aside for future use.
Field | Type | Description |
---|---|---|
| Object or String | The Ticket to retrieve. If a string, must be the ledger entry ID of the Ticket, as hexadecimal. If an object, the |
| String - [Address][] | (Required if |
| Number | (Required if |
Get NFT Page
Return an NFT Page in its raw ledger format.
Field | Type | Description |
---|---|---|
| String | The ledger entry ID of an NFT Page to retrieve. |
Try it! >
Response Format
The response follows the [standard format][], with a successful result containing the following fields:
Field | Type | Description |
---|---|---|
| String | The unique ID of this ledger entry. |
| Unsigned Integer | The [ledger index][] of the ledger that was used when retrieving this data. |
| Object | (Omitted if |
| String | (Omitted unless |
An example of a successful response:
Possible Errors
Any of the [universal error types][].
deprecatedFeature
- The request specified a removed field, such asgenerator
.entryNotFound
- The requested ledger entry does not exist in the ledger.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.malformedAddress
- The request improperly specified an [Address][] field.malformedCurrency
- The request improperly specified a [Currency Code][] field.malformedOwner
- The request improperly specified theescrow.owner
sub-field.malformedRequest
- The request provided an invalid combination of fields, or provided the wrong type for one or more fields.unknownOption
- The fields provided in the request did not match any of the expected request formats.
Last updated