account_currencies - XRPL

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

This method retrieves a list of currencies that an account can send or receive, based on its trust lines.

Parameters

Parameter
Type
Required
Description

account

string

Yes

Account address

ledger_hash

string

No

Ledger hash

ledger_index

string/number

No

Ledger index or shortcut

Request Example

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_currencies",
    "params": [{
        "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
        "ledger_index": "validated"
    }],
    "id": "getblock.io"
}'

Response Example

Response Parameters

Parameter
Type
Description

receive_currencies

array

Receivable currencies

send_currencies

array

Sendable currencies

ledger_index

integer

Ledger index used

Use Cases

  • Check supported currencies

  • Build currency selection UIs

  • Validate payment paths

Error Handling

Error Code
Description

actNotFound

Account not found

invalidParams

Invalid parameters

SDK Integration

Last updated

Was this helpful?