Strict Send

The strict send payment path endpoint lists the paths a payment can take based on the amount of an asset you want to send. The source asset amount stays constant, and the type and amount of an asset received varies based on offers in the order books.

For this search, Horizon loads a list of assets that the recipient can recieve (based on destination_account or destination_assets) and displays the possible paths from the different source assets to the destination asset. Only paths that satisfy the source_amount are returned.

- ARGUMENT -

  • source_asset_type required

    The type for the source asset. Either native, credit_alphanum4, or credit_alphanum12.

  • source_asset_issuer optional

    The Stellar address of the issuer of the source asset. Required if the source_asset_type is not native.

  • source_asset_code optional

    The code for the source asset. Required if the source_asset_type is not native.

  • source_amount required

    The amount of the source asset that should be sent.

  • destination_account optional

    The Stellar address of the reciever. Any returned path must end with an asset that the recipient can receive. Using either source_account or source_assets as an argument is required for strict send path payments.

  • destination_assets optional

    A comma-separated list of assets that the recipient can receive. Any returned path must end 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 send path payments.

var StellarSdk = require("stellar-sdk");
var server = new StellarSdk.Server("https://expansion-testnet.bantu.network");

server
  .strictSendPaths(
    new StellarSdk.Asset(
      "BRL",
      "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
    ),
    "400",
    "GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA",
  )
  .call()
  .then(function (resp) {
    console.log(resp);
  })
  .catch(function (err) {
    console.error(err);
  });
Example Response
{
  "_embedded": {
    "records": [
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "BB1",
        "destination_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "destination_amount": "87.6373649",
        "path": [
          {
            "asset_type": "native"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "BB1",
        "destination_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "destination_amount": "36.0841597",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "EURT",
            "asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "BB1",
        "destination_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "destination_amount": "16.2264000",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "BTC",
            "asset_issuer": "GBVOL67TMUQBGL4TZYNMY3ZQ5WGQYFPFD5VJRWXR72VA33VFNL225PL5"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "BB1",
        "destination_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN",
        "destination_amount": "13.9424750",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "USD",
            "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "CNY",
        "destination_asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX",
        "destination_amount": "499.8384123",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "ULT",
            "asset_issuer": "GC76RMFNNXBFDSJRBXCABWLHXDK4ITVQSMI56DC2ZJVC3YOLLPCKKULT"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "CNY",
        "destination_asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX",
        "destination_amount": "498.1069097",
        "path": [
          {
            "asset_type": "native"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "CNY",
        "destination_asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX",
        "destination_amount": "494.5886542",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "XCN",
            "asset_issuer": "GCNY5OXYSY4FKHOPT2SPOQZAOEIGXB5LBYW3HVU3OWSTQITS65M5RCNY"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "CNY",
        "destination_asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX",
        "destination_amount": "490.0780598",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "USD",
            "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "CNY",
        "destination_asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX",
        "destination_amount": "280.2909824",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "USD",
            "asset_issuer": "GBUYUAI75XXWDZEKLY66CFYKQPET5JR4EENXZBUZ3YXZ7DS56Z4OKOFU"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "EURT",
        "destination_asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S",
        "destination_amount": "63.1883029",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "USD",
            "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "EURT",
        "destination_asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S",
        "destination_amount": "63.1472796",
        "path": [
          {
            "asset_type": "native"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "EURT",
        "destination_asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S",
        "destination_amount": "62.9386895",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "NGNT",
            "asset_issuer": "GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "EURT",
        "destination_asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S",
        "destination_amount": "6.7649849",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "WSD",
            "asset_issuer": "GDSVWEA7XV6M5XNLODVTPCGMAJTNBLZBXOFNQD3BNPNYALEYBNT6CE2V"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "EURT",
        "destination_asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S",
        "destination_amount": "0.0498106",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "CNY",
            "asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "NGNT",
        "destination_asset_issuer": "GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD",
        "destination_amount": "25155.3452034",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "USD",
            "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "NGNT",
        "destination_asset_issuer": "GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD",
        "destination_amount": "25146.7108397",
        "path": [
          {
            "asset_type": "native"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "NGNT",
        "destination_asset_issuer": "GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD",
        "destination_amount": "24986.8616583",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "BTC",
            "asset_issuer": "GAUTUYY2THLF7SGITDFMXJVYH3LHDSMGEAKSBU267M2K7A3W543CKUEF"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "NGNT",
        "destination_asset_issuer": "GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD",
        "destination_amount": "24948.9784843",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "XCN",
            "asset_issuer": "GCNY5OXYSY4FKHOPT2SPOQZAOEIGXB5LBYW3HVU3OWSTQITS65M5RCNY"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "NGNT",
        "destination_asset_issuer": "GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD",
        "destination_amount": "24930.7854717",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "EURT",
            "asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "USD",
        "destination_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "destination_amount": "69.7123752",
        "path": [
          {
            "asset_type": "native"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "USD",
        "destination_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "destination_amount": "68.9785993",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "EURT",
            "asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "USD",
        "destination_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "destination_amount": "68.6731854",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "NGNT",
            "asset_issuer": "GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "USD",
        "destination_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "destination_amount": "63.5394120",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "USD",
            "asset_issuer": "GBUYUAI75XXWDZEKLY66CFYKQPET5JR4EENXZBUZ3YXZ7DS56Z4OKOFU"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "USD",
        "destination_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
        "destination_amount": "39.6691360",
        "path": [
          {
            "asset_type": "native"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "HEX",
            "asset_issuer": "GCGBSZ3DSSH6PRHCOD4JXFNNZXCTKBDFRT4JR2HIAC6FQZU4YK7GPHEX"
          }
        ]
      },
      {
        "source_asset_type": "credit_alphanum4",
        "source_asset_code": "BRL",
        "source_asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
        "source_amount": "400.0000000",
        "destination_asset_type": "native",
        "destination_amount": "1226.9231099",
        "path": []
      }
    ]
  }
}
var StellarSdk = require("stellar-sdk");
var server = new StellarSdk.Server("https://expansion-testnet.bantu.network");

var callback = function (resp) {
  console.log(resp);
};

var es = server
  .strictSendPaths(
    new StellarSdk.Asset(
      "BRL",
      "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
    ),
    "400",
    "GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA",
  )
  .cursor("now")
  .stream({ onmessage: callback });

Last updated