ledger_entry - XRPL

Example code for the ledger_entry JSON RPC method. Complete guide to using ledger_entry JSON-RPC in the GetBlock Web3 documentation.

This method returns a single ledger entry from the XRP Ledger in its raw format.

Parameters

Parameter
Type
Required
Description

index

string

No

Object ID

account_root

string

No

Account address

directory

object

No

Directory specification

offer

object

No

Offer specification

ripple_state

object

No

Trust line specification

check

string

No

Check ID

escrow

object

No

Escrow specification

payment_channel

string

No

Channel ID

deposit_preauth

object

No

Preauth specification

ticket

object

No

Ticket specification

ledger_hash

string

No

Ledger hash

ledger_index

string/number

No

Ledger index

Request Examples

curl
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_entry",
    "params": [{
        "account_root": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
        "ledger_index": "validated"
    }],
    "id": "getblock.io"
}'

Response Example

Response Parameters

Parameter
Type
Description

index

string

Object identifier

node

object

Entry data

ledger_index

integer

Ledger index

Use Cases

  • Get specific entry

  • Check account state

  • Verify offers/escrows

Error Handling

Error Code
Description

entryNotFound

Entry not found

invalidParams

Invalid parameters

SDK Integration

Last updated

Was this helpful?