diff --git a/packages/swap/src/providers/rango/index.ts b/packages/swap/src/providers/rango/index.ts index da35ddadb..71774e3e7 100644 --- a/packages/swap/src/providers/rango/index.ts +++ b/packages/swap/src/providers/rango/index.ts @@ -317,8 +317,9 @@ class Rango extends ProviderClass { !f.token.address && f.expenseType === "FROM_SOURCE_WALLET" && f.name !== "Network Fee" - ) + ) { additionalNativeFees = additionalNativeFees.add(toBN(f.amount)); + } }); return { transactions, diff --git a/packages/swap/tests/changelly.test.ts b/packages/swap/tests/changelly.test.ts index 387ce6401..9c14aa46a 100644 --- a/packages/swap/tests/changelly.test.ts +++ b/packages/swap/tests/changelly.test.ts @@ -39,7 +39,7 @@ describe("Changelly Provider", () => { expect(quote?.quote.meta.walletIdentifier).to.be.eq( WalletIdentifier.enkrypt ); - expect(quote?.fromTokenAmount.toString()).to.be.eq(amount.toString()); + expect(quote?.fromTokenAmount.gte(amount)).to.be.eq(true); expect(quote?.toTokenAmount.gtn(0)).to.be.eq(true); const swap = await changelly.getSwap(quote!.quote); diff --git a/packages/swap/tests/rango.test.ts b/packages/swap/tests/rango.test.ts index c6e5a770a..016de5436 100644 --- a/packages/swap/tests/rango.test.ts +++ b/packages/swap/tests/rango.test.ts @@ -71,7 +71,7 @@ describe("Rango Provider", () => { ); expect(quote?.fromTokenAmount.toString()).to.be.eq(amount.toString()); expect(quote?.toTokenAmount.gtn(0)).to.be.eq(true); - expect(quote?.additionalNativeFees.gtn(0)).to.be.eq(true); + expect(quote?.additionalNativeFees.eqn(0)).to.be.eq(true); const swap = await rango.getSwap(quote!.quote); expect(swap?.transactions.length).to.be.eq(1); }).timeout(25000);