The strict receive payment path endpoint lists the paths a payment can take based on the amount of an asset you want the recipient to receive. The destination asset amount stays constant, and the type and amount of an asset sent vary based on offers in the order books.
For this search, Horizon loads a list of assets available to the sender (based on source_account or source_assets) and displays the possible paths from the different source assets to the destination asset. Only paths that satisfy the destination_amount are returned.
- ARGUMENT -
source_account optional
The Stellar address of the sender. Any returned path must start with an asset that the sender holds. Using either source_account or source_assets as an argument is required for strict receive path payments.
source_assets optional
A comma-separated list of assets available to the sender. Any returned path must start with an asset in this list. Each asset is formatted as CODE:ISSUER_ACCOUNT. For example: USD:GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX. Using either source_account or source_assets as an argument is required for strict receive path payments.
destination_asset_type required
The type for the destination asset. Either native, credit_alphanum4, or credit_alphanum12.
destination_asset_issuer optional
The Stellar address of the issuer of the destination asset. Required if the destination_asset_type is not native.
destination_asset_code optional
The code for the destination asset. Required if the destination_asset_type is not native.
destination_amount required
The amount of the destination asset that should be received.
var StellarSdk =require("stellar-sdk");var server =newStellarSdk.Server("https://expansion-testnet.bantu.network");server.strictReceivePaths( [newStellarSdk.Asset("CNY","GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX", ), ],newStellarSdk.Asset("BB1","GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN", ),"5", ).call().then(function (resp) {console.log(resp); }).catch(function (err) {console.error(err); });