From 2ba05cd2a0dcc844686ac3645904307f493aaf18 Mon Sep 17 00:00:00 2001 From: trung2891 Date: Sat, 4 May 2024 10:22:56 +0700 Subject: [PATCH 1/2] chore: return-swap-ops-in-handle-simulate-swap --- packages/universal-swap/src/helper.ts | 5 ++++- packages/universal-swap/src/types.ts | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/universal-swap/src/helper.ts b/packages/universal-swap/src/helper.ts index c45e2fcb..ff0dc33a 100644 --- a/packages/universal-swap/src/helper.ts +++ b/packages/universal-swap/src/helper.ts @@ -656,6 +656,7 @@ export class UniversalSwapHelper { ); let amount; let routes = []; + let routeSwapOps; if (query.useSmartRoute) { const { returnAmount, routesSwap }: SmartRouterResponse = await UniversalSwapHelper.simulateSwapUsingSmartRoute({ fromInfo, @@ -664,6 +665,7 @@ export class UniversalSwapHelper { }); routes = routesSwap; amount = returnAmount; + routeSwapOps = routeSwapOps; } else { amount = ( await UniversalSwapHelper.simulateSwap({ @@ -677,7 +679,8 @@ export class UniversalSwapHelper { return { amount, displayAmount: toDisplay(amount, getTokenOnOraichain(toInfo.coinGeckoId)?.decimals), - routes + routes, + routeSwapOps }; }; diff --git a/packages/universal-swap/src/types.ts b/packages/universal-swap/src/types.ts index 18a1f37c..d0e10d11 100644 --- a/packages/universal-swap/src/types.ts +++ b/packages/universal-swap/src/types.ts @@ -17,6 +17,7 @@ export interface SimulateResponse { amount: Uint128; displayAmount: number; routes?: SmartRouteSwapAPIOperations[]; + routeSwapOps?: SmartRouteSwapOperations; } export interface SwapData { From 4bd0d4fd8d99cfd7a8c497617109217cba290f68 Mon Sep 17 00:00:00 2001 From: trung2891 Date: Sat, 4 May 2024 10:35:39 +0700 Subject: [PATCH 2/2] universal swap v1.0.76 --- packages/universal-swap/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/universal-swap/package.json b/packages/universal-swap/package.json index f9338443..8a40d127 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.75", + "version": "1.0.76", "main": "build/index.js", "files": [ "build/"