For the complete documentation index, see llms.txt. This page is also available as Markdown.

path_find - XRPL

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

This method searches for a path along which a payment can be made, and periodically sends updates when the path changes.

Parameters

Parameter
Type
Required
Description

subcommand

string

Yes

"create", "close", or "status"

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

Request Example

curl --location --request POST 'https://go.getblock.io/<ACCESS_TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "path_find",
    "params": [{
        "subcommand": "create",
        "source_account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
        "destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
        "destination_amount": {
            "currency": "USD",
            "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
            "value": "100"
        }
    }],
    "id": "getblock.io"
}'
const axios = require('axios');

const url = 'https://go.getblock.io/<ACCESS_TOKEN>/';
const headers = {
    'Content-Type': 'application/json'
};

const payload = {
    jsonrpc: '2.0',
    method: 'path_find',
    params: [{
        subcommand: 'create',
        source_account: 'rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH',
        destination_account: 'ra5nK24KXen9AHvsdFTKHSANinZseWnPcX',
        destination_amount: {
            currency: 'USD',
            issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B',
            value: '100'
        }
    }],
    id: 'getblock.io'
};

axios.post(url, payload, { headers })
    .then(response => console.log(response.data))
    .catch(error => console.error(error));

Response Example

Returns

Field
Type
Description

alternatives

array

Payment paths found

destination_account

string

Destination

destination_amount

object

Amount

Use Cases

  • Cross-currency payments

  • Find best exchange rates

  • Payment routing

SDK Integration

Last updated

Was this helpful?