diff --git a/packages/universal-swap/package.json b/packages/universal-swap/package.json index 6f0052cb..3b8bf475 100644 --- a/packages/universal-swap/package.json +++ b/packages/universal-swap/package.json @@ -1,6 +1,6 @@ { "name": "@oraichain/oraidex-universal-swap", - "version": "1.0.55", + "version": "1.0.56", "main": "build/index.js", "files": [ "build/" diff --git a/packages/universal-swap/src/helper.ts b/packages/universal-swap/src/helper.ts index 2bb46aa6..90a5fe1a 100644 --- a/packages/universal-swap/src/helper.ts +++ b/packages/universal-swap/src/helper.ts @@ -403,7 +403,7 @@ export const simulateSwap = async (query: { offerAmount: finalAmount, operations }); - return { amount: data.amount.substring(0, data.amount.length - 1) }; + return data; } catch (error) { throw new Error(`Error when trying to simulate swap using router v2: ${JSON.stringify(error)}`); } diff --git a/packages/universal-swap/tests/index.spec.ts b/packages/universal-swap/tests/index.spec.ts index c156892a..8bb97b59 100644 --- a/packages/universal-swap/tests/index.spec.ts +++ b/packages/universal-swap/tests/index.spec.ts @@ -946,7 +946,7 @@ describe("test universal swap handler functions", () => { it.each<[CoinGeckoId, CoinGeckoId, string, string]>([ ["oraichain-token", "oraichain-token", "1000000", "1000000"], - ["tron", "airight", "1000000", "100000"] + ["tron", "airight", "100000", "100000"] ])( "test simulateSwap-given-fromid-%s-toid-%s-input-amount-%d-returns-%d", async (fromCoingeckoId, toCoingeckoId, amount, expectedSimulateData) => {