Skip to content

Commit

Permalink
🩹Fix strictRecivePaths in SDEX quote
Browse files Browse the repository at this point in the history
  • Loading branch information
MattPoblete committed Jul 31, 2024
1 parent 473ac7b commit c67c0c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helpers/horizon/getHorizonPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export function getHorizonBestPath(
if (!args.amount || !args.assetFrom || !args.assetTo || !serverHorizon) return;
if (payload.tradeType === TradeType.EXACT_INPUT) {
try {
const send = serverHorizon?.strictSendPaths(args.assetFrom, args.amount, [args.assetTo])
const send = serverHorizon.strictSendPaths(args.assetFrom, args.amount, [args.assetTo])
.call().then((res) => res.records);
return send?.then((res) => {
const maxObj = res.reduce((maxObj, obj) => {
Expand All @@ -228,7 +228,7 @@ export function getHorizonBestPath(
}
} else if (payload.tradeType === TradeType.EXACT_OUTPUT) {
try {
const receive = serverHorizon?.strictReceivePaths([args.assetFrom!], args.assetTo!, args?.amount!)
const receive = serverHorizon.strictReceivePaths([args.assetTo], args.assetFrom, args.amount)
.call().then((res) => res.records);
return receive?.then((res) => {
const minObj = res.reduce((minObj, obj) => {
Expand Down

0 comments on commit c67c0c0

Please sign in to comment.