ripple_path_find - XRPL

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

This method is a simplified version of path_find that searches for a path one time and returns results immediately.

Parameters

Parameter
Type
Required
Description

source_account

string

Yes

Sending account

destination_account

string

Yes

Receiving account

destination_amount

object

Yes

Amount to receive

send_max

object

No

Maximum to send

source_currencies

array

No

Currencies to use

ledger_hash

string

No

Ledger hash

ledger_index

string/number

No

Ledger index

Request Example

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": "ripple_path_find",
    "params": [{
        "source_account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
        "destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
        "destination_amount": {
            "currency": "USD",
            "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
            "value": "100"
        }
    }],
    "id": "getblock.io"
}'

Response Example

Returns

Field
Type
Description

alternatives

array

Payment paths found

destination_account

string

Destination

destination_currencies

array

Available currencies

Use Cases

  • One-time path queries

  • Payment validation

  • Quote generation

SDK Integration

xrpl.js

Last updated

Was this helpful?