account_lines - XRPL

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

This method returns information about an account's trust lines, which track balances of issued currencies.

Parameters

Parameter
Type
Required
Description

account

string

Yes

Account address

peer

string

No

Filter by counterparty

ledger_hash

string

No

Ledger hash

ledger_index

string/number

No

Ledger index or shortcut

limit

number

No

Maximum results

marker

object

No

Pagination marker

Request Examples

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": "account_lines",
    "params": [{
        "account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH"
    }],
    "id": "getblock.io"
}'

Response Example

Response Parameters

Parameter
Type
Description

account

string

Counterparty address

balance

string

Current balance

currency

string

Currency code

limit

string

Trust limit

ledger_current_index

integer

Current ledger index

Use Cases

  • View token balances

  • Check trust line settings

  • Monitor issued currencies

Error Handling

Error Code
Description

actNotFound

Account not found

invalidParams

Invalid parameters

SDK Integration

Last updated

Was this helpful?