From 453eb9f1eb95ac0b89ace49056f9c4a7a90f0d51 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Van Date: Thu, 12 Dec 2024 11:54:12 +0700 Subject: [PATCH] remove hardcode list pairs --- packages/oraidex-common/src/pairs.ts | 84 ---------------- packages/oraidex-common/tests/helper.spec.ts | 17 ---- packages/oraidex-common/tests/pairs.spec.ts | 27 ----- packages/universal-swap/src/helper.ts | 100 ++++++------------- packages/universal-swap/tests/helper.spec.ts | 63 ------------ packages/universal-swap/tests/index.spec.ts | 62 +++++++----- 6 files changed, 68 insertions(+), 285 deletions(-) delete mode 100644 packages/oraidex-common/tests/pairs.spec.ts diff --git a/packages/oraidex-common/src/pairs.ts b/packages/oraidex-common/src/pairs.ts index 2bc5999c..b387aa01 100644 --- a/packages/oraidex-common/src/pairs.ts +++ b/packages/oraidex-common/src/pairs.ts @@ -112,87 +112,3 @@ export const PAIRS: PairMapping[] = [ symbols: ["MAX", "ORAIX"] } ]; - -// FIXME: makes this dynamic in the future so that permissionless listing is simpler -export enum pairLpTokens { - AIRI_ORAI = "orai1hxm433hnwthrxneyjysvhny539s9kh6s2g2n8y", - ORAIX_ORAI = "orai1qmy3uuxktflvreanaqph6yua7stjn6j65rur62", - SCORAI_ORAI = "orai1ay689ltr57jt2snujarvakxrmtuq8fhuat5rnvq6rct89vjer9gqm2vde6", - ATOM_ORAI = "orai1g2prqry343kx566cp7uws9w7v78n5tejylvaz6", - USDT_ORAI = "orai1mav52eqhd07c3lwevcnqdykdzhh4733zf32jcn", - KWT_ORAI = "orai17rcfcrwltujfvx7w4l2ggyku8qrncy0hdvrzvc", - OSMO_ORAI = "orai19ltj97jmdqnz5mrd2amethetvcwsp0220kww3e", - MILKY_USDT = "orai18ywllw03hvy720l06rme0apwyyq9plk64h9ccf", - USDC_ORAI = "orai1e0x87w9ezwq2sdmvv5dq5ngzy98lt47tqfaf2m7zpkg49g5dj6fqred5d7", - TRX_ORAI = "orai1wgywgvumt5dxhm7vjpwx5es9ecrtl85qaqdspjqwx2lugy7vmw5qlwrn88", - SCATOM_ATOM = "orai1hcjne0hmdj6pjrc3xuksucr0yplsa9ny7v047c34y8k8hfflq6yqyjapnn", - INJ_ORAI = "orai1slqw6gfvs6l2jgvh5ryjayf4g77d7sgfv6fumtyzcr06a6g9gnrq6c4rgg", - USDC_ORAIX = "orai1nwpfd09mr4rf8d5c9mh43axzezkwyr7dq2lus23jsw4xw2jqkaxqxwmkd3", - ORAI_WETH = "orai1rvr9wk6mdlfysvgp72ltthqvkkd5677mp892efq86yyr9alt0tms2a6lcs", - ORAI_BTC = "orai1jd9lc2qt0ltjsatgnu38xsz8ngp89clp0dpeh8geyjj70yvkn4kqmrmh3m", - NTMPI_USDC = "orai1rmvjmwd940ztafxue7630g75px8tqma4jskjuu57fkj0eqahqfgqqwjm00", - OCH_ORAI = "orai1xs5aj90d5m8kwfp9t6ghkcpk8d7sy5jsxdsyejjdxudhhfm7wegsdg929d", - MAX_ORAIX = "orai1gswmxchtlkav289eq86z4ehaezntctdrptcww4yvpp20d93xza0qsqjxvv" -} - -// token identifier can be denom or contract addr -export const isInPairList = (tokenIdentifier: string) => { - return PAIRS.some((pair) => - pair.asset_infos.some((info) => { - if ("native_token" in info) { - return info.native_token.denom === tokenIdentifier; - } - return info.token.contract_addr === tokenIdentifier; - }) - ); -}; - -export const isFactoryV1 = (assetInfos: [AssetInfo, AssetInfo]): boolean => { - const pair = PAIRS.find( - (pair) => - pair.asset_infos.find((info) => parseAssetInfo(info) === parseAssetInfo(assetInfos[0])) && - pair.asset_infos.find((info) => parseAssetInfo(info) === parseAssetInfo(assetInfos[1])) - ); - if (!pair) { - return true; - } - return pair.factoryV1 ?? false; -}; - -export const getPoolTokens = (): TokenItemType[] => { - return uniq(flatten(PAIRS.map((pair) => pair.asset_infos)).map((info) => assetInfoMap[parseAssetInfo(info)])); -}; - -export const PAIRS_CHART = PAIRS.map((pair) => { - const assets = pair.asset_infos.map((info) => { - if ("native_token" in info) return info.native_token.denom; - return info.token.contract_addr; - }); - - return { - ...pair, - symbol: `${pair.symbols[0]}/${pair.symbols[1]}`, - info: `${assets[0]}-${assets[1]}` - }; -}); - -export enum PairAddress { - AIRI_ORAI = "orai1wkhkazf88upf2dxqedggy3ldja342rzmfs2mep", - ORAIX_ORAI = "orai1m6q5k5nr2eh8q0rdrf57wr7phk7uvlpg7mwfv5", - ATOM_ORAI = "orai1jf74ry4m0jcy9emsaudkhe7vte9l8qy8enakvs", - USDT_ORAI = "orai1c5s03c3l336dgesne7dylnmhszw8554tsyy9yt", - KWT_ORAI = "orai1ynmd2cemryhcwtjq3adhcwayrm89l2cr4tws4v", - OSMO_ORAI = "orai1d37artrk4tkhz2qyjmaulc2jzjkx7206tmpfug", - MILKY_USDT = "orai1hr2l03ep6p9lwdkuqu5253fgpzc40xcpwymjfc", - SCORAI_ORAI = "orai15aunrryk5yqsrgy0tvzpj7pupu62s0t2n09t0dscjgzaa27e44esefzgf8", - USDC_ORAI = "orai19ttg0j7w5kr83js32tmwnwxxdq9rkmw4m3d7mn2j2hkpugwwa4tszwsnkg", - TRX_ORAI = "orai103ya8qkcf3vg4nksqquy0v5pvnugjtlt0uxpfh0fkuqge2a6k4aqwurg22", - SCATOM_ATOM = "orai16ltg2c8u9styus3dgql64mpupvtclxt9xdzvz0slx3pnrycxpm3qw75c5x", - INJ_ORAI = "orai1le7w5dmd23ky8f6zgtgfnpdv269qs6ezgr839sm8kj24rwaqqnrs58wf4u", - USDC_ORAIX = "orai1n4edv5h86rawzrvhy8lmrmnnmmherxnhuwqnk3yuvt0wgclh75usyn3md6", - ORAI_WETH = "orai10jgd0l4l0p2h7ugpk2lz64wpefjxc0h7evnlxf76a3fspdplarnsl9ma4j", - ORAI_BTC = "orai1fv5kwdv4z0gvp75ht378x8cg2j7prlywa0g35qmctez9q8u4xryspn6lrd", - NTMPI_USDC = "orai1yemx80gvcw05trjehy94rl4jz5dqjf2qxhks6258uvxd5s0m7h2quavx0g", - OCH_ORAI = "orai1d3f3e3j400hxse5z8vxxnxdwmvljs7mh8xa3wp3spe8g4ngnc3cqx8scs3", - MAX_ORAIX = "orai1s3746evfgwm7dtl3x4s7fmd37c4s8t566z0xvflr4shdculkxw5qa3pusc" -} diff --git a/packages/oraidex-common/tests/helper.spec.ts b/packages/oraidex-common/tests/helper.spec.ts index 90934a03..4ae38864 100644 --- a/packages/oraidex-common/tests/helper.spec.ts +++ b/packages/oraidex-common/tests/helper.spec.ts @@ -37,7 +37,6 @@ import { parseAssetInfoFromContractAddrOrDenom } from "../src/helper"; import { CoinGeckoId, NetworkChainId } from "../src/network"; -import { isFactoryV1 } from "../src/pairs"; import { AmountDetails, TokenItemType, cosmosTokens, flattenTokens, oraichainTokens } from "../src/token"; import fs from "fs"; import path from "path"; @@ -105,22 +104,6 @@ describe("should helper functions in helper run exactly", () => { expect(parseAssetInfo(assetInfo)).toEqual(expectedResult); }); - it("test-isFactoryV1-true", () => { - const data = isFactoryV1([ - { native_token: { denom: ORAI } }, - { token: { contract_addr: "orai10ldgzued6zjp0mkqwsv2mux3ml50l97c74x8sg" } } - ]); - expect(data).toEqual(true); - }); - - it("test-isFactoryV1-false", () => { - const data = isFactoryV1([ - { native_token: { denom: ORAI } }, - { token: { contract_addr: "orai15un8msx3n5zf9ahlxmfeqd2kwa5wm0nrpxer304m9nd5q6qq0g6sku5pdd" } } - ]); - expect(data).toEqual(false); - }); - it.each([ ["1000000", "1000000", 1, 6, "990000"], ["1800000", "100000", 1, 6, "178200"], diff --git a/packages/oraidex-common/tests/pairs.spec.ts b/packages/oraidex-common/tests/pairs.spec.ts deleted file mode 100644 index a67ca2b3..00000000 --- a/packages/oraidex-common/tests/pairs.spec.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { MILKY_CONTRACT, OSMOSIS_ORAICHAIN_DENOM, USDC_CONTRACT, USDT_CONTRACT } from "../src/constant"; -import { isFactoryV1, isInPairList } from "../src/pairs"; -import { expect, afterAll, beforeAll, describe, it } from "vitest"; - -describe("test pairs functions should behave correctly", () => { - it("test-isFactoryV1", () => { - const oraiToken = { native_token: { denom: "orai" } }; - expect( - isFactoryV1([oraiToken, { token: { contract_addr: "orai10ldgzued6zjp0mkqwsv2mux3ml50l97c74x8sg" } }]) - ).toEqual(true); - - expect( - isFactoryV1([ - oraiToken, - { token: { contract_addr: "orai15un8msx3n5zf9ahlxmfeqd2kwa5wm0nrpxer304m9nd5q6qq0g6sku5pdd" } } - ]) - ).toEqual(false); - }); - - it.each<[string, boolean]>([ - [USDT_CONTRACT, true], - [OSMOSIS_ORAICHAIN_DENOM, true], - ["foobar", false] - ])("test-isInPairList", (identifier, expectedResult) => { - expect(isInPairList(identifier)).toEqual(expectedResult); - }); -}); diff --git a/packages/universal-swap/src/helper.ts b/packages/universal-swap/src/helper.ts index 9525be91..d87d46f5 100644 --- a/packages/universal-swap/src/helper.ts +++ b/packages/universal-swap/src/helper.ts @@ -32,7 +32,6 @@ import { IUniswapV2Router02__factory, cosmosTokens, StargateMsg, - isInPairList, BigDecimal, NEUTARO_INFO, USDC_INFO, @@ -735,41 +734,6 @@ export class UniversalSwapHelper { }; }; - /** - * @deprecated. Use UniversalSwapHelper.handleSimulateSwap - */ - static simulateSwap = async (query: { - fromInfo: TokenItemType; - toInfo: TokenItemType; - amount: string; - routerClient: OraiswapRouterReadOnlyInterface; - }): Promise<{ amount: Uint128 }> => { - const { amount, fromInfo, toInfo, routerClient } = query; - - // check for universal-swap 2 tokens that have same coingeckoId, should return simulate data with average ratio 1-1. - if (fromInfo.coinGeckoId === toInfo.coinGeckoId) { - return { - amount - }; - } - - // check if they have pairs. If not then we go through ORAI - const { info: offerInfo } = parseTokenInfo(fromInfo, amount); - const { info: askInfo } = parseTokenInfo(toInfo); - const operations = UniversalSwapHelper.generateSwapOperationMsgs(offerInfo, askInfo); - console.log("operations: ", operations); - try { - let finalAmount = amount; - const data = await routerClient.simulateSwapOperations({ - offerAmount: finalAmount, - operations - }); - return data; - } catch (error) { - throw new Error(`Error when trying to simulate swap using router v2: ${JSON.stringify(error)}`); - } - }; - // simulate swap functions static simulateSwapUsingSmartRoute = async (query: { fromInfo: TokenItemType; @@ -858,6 +822,23 @@ export class UniversalSwapHelper { } }; + static getRouterConfig = (options: { + path?: string; + protocols?: string[]; + dontAllowSwapAfter?: string[]; + maxSplits?: number; + ignoreFee?: boolean; + }) => { + return { + url: "https://osor.oraidex.io", + path: options?.path ?? "/smart-router/alpha-router", + protocols: options?.protocols ?? ["Oraidex", "OraidexV3"], + dontAllowSwapAfter: options?.dontAllowSwapAfter ?? ["Oraidex", "OraidexV3"], + maxSplits: options?.maxSplits ?? 1, + ignoreFee: options?.ignoreFee ?? false + }; + }; + static handleSimulateSwap = async (query: { originalFromInfo: TokenItemType; originalToInfo: TokenItemType; @@ -890,15 +871,7 @@ export class UniversalSwapHelper { return { amount, displayAmount }; } - const routerConfigDefault = { - url: query?.routerConfig?.url ?? "https://osor.oraidex.io", - path: query?.routerConfig?.path ?? "/smart-router/alpha-router", - protocols: query?.routerConfig?.protocols ?? ["Oraidex", "OraidexV3"], - dontAllowSwapAfter: query?.routerConfig?.dontAllowSwapAfter ?? ["Oraidex", "OraidexV3"], - maxSplits: query?.routerConfig?.maxSplits ?? 10, - ignoreFee: query?.routerConfig?.ignoreFee ?? false - }; - + const routerConfigDefault = UniversalSwapHelper.getRouterConfig({}); let fromInfo = getTokenOnOraichain(query.originalFromInfo.coinGeckoId); let toInfo = getTokenOnOraichain(query.originalToInfo.coinGeckoId); @@ -970,19 +943,16 @@ export class UniversalSwapHelper { "From token on Oraichain is not on Oraichain. The developers have made a mistake. Please notify them!" ); // estimate exchange token when From Token not orai. Only need to swap & check if it is swappable with ORAI. Otherwise, we ignore the fees - if (isInPairList(fromTokenInOrai.denom) || isInPairList(fromTokenInOrai.contractAddress)) { - const oraiToken = getTokenOnOraichain("oraichain-token"); - const { amount } = await UniversalSwapHelper.simulateSwap({ - fromInfo: fromTokenInOrai, - toInfo: oraiToken, - amount: toAmount(fromAmount, fromTokenInOrai.decimals).toString(), - routerClient: routerClient - }); - const amountDisplay = toDisplay(amount, fromTokenInOrai.decimals); - const relayerAmountDisplay = toDisplay(relayerAmount); - if (relayerAmountDisplay > amountDisplay) return false; - return true; - } + const oraiToken = getTokenOnOraichain("oraichain-token"); + const { amount } = await UniversalSwapHelper.handleSimulateSwap({ + originalFromInfo: fromTokenInOrai, + originalToInfo: oraiToken, + originalAmount: fromAmount, + routerClient: routerClient + }); + const amountDisplay = toDisplay(amount, fromTokenInOrai.decimals); + const relayerAmountDisplay = toDisplay(relayerAmount); + if (relayerAmountDisplay > amountDisplay) return false; return true; }; @@ -1032,10 +1002,10 @@ export class UniversalSwapHelper { throw generateError( `Error in checking balance channel ibc: cannot simulate from: ${fromToken.coinGeckoId} to: ${toToken.coinGeckoId}` ); - const { amount } = await UniversalSwapHelper.simulateSwap({ - fromInfo: fromTokenInfo, - toInfo: toTokenInfo, - amount: toAmount(_toAmount, fromTokenInfo.decimals).toString(), + const { amount } = await UniversalSwapHelper.handleSimulateSwap({ + originalFromInfo: fromTokenInfo, + originalToInfo: toTokenInfo, + originalAmount: _toAmount, routerClient }); _toAmount = toDisplay(amount, fromTokenInfo.decimals); @@ -1542,12 +1512,6 @@ export const generateSwapRoute = UniversalSwapHelper.generateSwapRoute; */ export const generateSwapOperationMsgs = UniversalSwapHelper.generateSwapOperationMsgs; -// simulate swap functions -/** - * @deprecated - */ -export const simulateSwap = UniversalSwapHelper.simulateSwap; - /** * @deprecated */ diff --git a/packages/universal-swap/tests/helper.spec.ts b/packages/universal-swap/tests/helper.spec.ts index 3882aa01..8ce1d040 100644 --- a/packages/universal-swap/tests/helper.spec.ts +++ b/packages/universal-swap/tests/helper.spec.ts @@ -59,7 +59,6 @@ import { isEvmSwappable, isSupportedNoPoolSwapEvm, generateSwapRoute, - generateSwapOperationMsgs, UniversalSwapHelper } from "../src/helper"; import { SwapRoute, UniversalSwapType } from "../src/types"; @@ -806,68 +805,6 @@ describe("test helper functions", () => { }); }); - it.each<[AssetInfo, AssetInfo, SwapOperation[]]>([ - [ - ORAIX_INFO, - NEUTARO_INFO, - [ - { - orai_swap: { - offer_asset_info: ORAIX_INFO, - ask_asset_info: ORAI_INFO - } - }, - { - orai_swap: { - offer_asset_info: ORAI_INFO, - ask_asset_info: USDC_INFO - } - }, - { - orai_swap: { - offer_asset_info: USDC_INFO, - ask_asset_info: NEUTARO_INFO - } - } - ] - ], - [ - NEUTARO_INFO, - ORAIX_INFO, - [ - { - orai_swap: { - offer_asset_info: NEUTARO_INFO, - ask_asset_info: USDC_INFO - } - }, - { - orai_swap: { - offer_asset_info: USDC_INFO, - ask_asset_info: ORAI_INFO - } - }, - { - orai_swap: { - offer_asset_info: ORAI_INFO, - ask_asset_info: ORAIX_INFO - } - } - ] - ] - ])("test-generateSwapOperationMsgs", (offerAsset, askAsset, expectSwapRoute) => { - const getSwapOperationMsgsRoute = generateSwapOperationMsgs(offerAsset, askAsset); - expect(getSwapOperationMsgsRoute).toEqual(expect.arrayContaining(expectSwapRoute)); - getSwapOperationMsgsRoute.forEach((swap) => { - expect(swap).toMatchObject({ - orai_swap: expect.objectContaining({ - offer_asset_info: expect.any(Object), - ask_asset_info: expect.any(Object) - }) - }); - }); - }); - it.each<[AmountDetails, TokenItemType, Coin, number]>([ [ { diff --git a/packages/universal-swap/tests/index.spec.ts b/packages/universal-swap/tests/index.spec.ts index 8ddb4c6e..7b56c95f 100644 --- a/packages/universal-swap/tests/index.spec.ts +++ b/packages/universal-swap/tests/index.spec.ts @@ -25,7 +25,8 @@ import { BigDecimal, OSMOSIS_ROUTER_CONTRACT, network, - MIXED_ROUTER + MIXED_ROUTER, + toAmount } from "@oraichain/oraidex-common"; import * as dexCommonHelper from "@oraichain/oraidex-common/build/helper"; // import like this to enable vi.spyOn & avoid redefine property error import { DirectSecp256k1HdWallet, EncodeObject, OfflineSigner } from "@cosmjs/proto-signing"; @@ -59,8 +60,7 @@ import { checkFeeRelayerNotOrai, getBalanceIBCOraichain, getIbcInfo, - handleSimulateSwap, - simulateSwap + handleSimulateSwap } from "../src/helper"; import { alphaSmartRoute, @@ -483,8 +483,11 @@ describe("test universal swap handler functions", () => { (item) => item.coinGeckoId === fromDenom && item.chainId === fromChainId ); // TODO: run tests without mocking to simulate actual swap logic - vi.spyOn(UniversalSwapHelper, "simulateSwap").mockResolvedValue({ amount: relayerFeeAmount }); - const result = await checkFeeRelayer({ + vi.spyOn(UniversalSwapHelper, "handleSimulateSwap").mockResolvedValue({ + amount: relayerFeeAmount, + displayAmount: 0 + }); + const result = await UniversalSwapHelper.checkFeeRelayer({ originalFromToken: originalFromToken as TokenItemType, fromAmount: 1, relayerFee: { @@ -505,8 +508,11 @@ describe("test universal swap handler functions", () => { async (fromDenom, mockSimulateAmount, mockRelayerFee, isSufficient) => { const originalFromToken = oraichainTokens.find((item) => item.coinGeckoId === fromDenom); // TODO: run tests without mocking to simulate actual swap - vi.spyOn(UniversalSwapHelper, "simulateSwap").mockResolvedValue({ amount: mockSimulateAmount }); - const result = await checkFeeRelayerNotOrai({ + vi.spyOn(UniversalSwapHelper, "handleSimulateSwap").mockResolvedValue({ + amount: mockSimulateAmount, + displayAmount: 0 + }); + const result = await UniversalSwapHelper.checkFeeRelayerNotOrai({ fromTokenInOrai: originalFromToken as TokenItemType, fromAmount: 1, relayerAmount: mockRelayerFee, @@ -1098,22 +1104,28 @@ describe("test universal swap handler functions", () => { } }); - it.each<[CoinGeckoId, CoinGeckoId, string, string]>([ - ["oraichain-token", "oraichain-token", "1000000", "1000000"], - ["tron", "airight", "100000", "100000"] - ])( - "test simulateSwap-given-fromid-%s-toid-%s-input-amount-%d-returns-%d", - async (fromCoingeckoId, toCoingeckoId, amount, expectedSimulateData) => { - const fromToken = oraichainTokens.find((t) => t.coinGeckoId === fromCoingeckoId); - const toToken = oraichainTokens.find((t) => t.coinGeckoId === toCoingeckoId); - const routerClient = new OraiswapRouterClient(client, testSenderAddress, "foo"); - vi.spyOn(routerClient, "simulateSwapOperations").mockReturnValue(new Promise((resolve) => resolve({ amount }))); - const [fromInfo, toInfo] = [toTokenInfo(fromToken!), toTokenInfo(toToken!)]; - const query = { fromInfo, toInfo, amount, routerClient }; - const simulateData = await simulateSwap(query); - expect(simulateData.amount).toEqual(expectedSimulateData); - } - ); + // it.each<[CoinGeckoId, CoinGeckoId, number, string]>([ + // ["oraichain-token", "oraichain-token", 1, "1000000"], + // ["tron", "airight", 0.1, "100000"] + // ])( + // "test handleSimulateSwap-given-fromid-%s-toid-%s-input-amount-%d-returns-%d", + // async (fromCoingeckoId, toCoingeckoId, amount, expectedSimulateData) => { + // const fromToken = oraichainTokens.find((t) => t.coinGeckoId === fromCoingeckoId); + // const toToken = oraichainTokens.find((t) => t.coinGeckoId === toCoingeckoId); + // const routerClient = new OraiswapRouterClient(client, testSenderAddress, "foo"); + // vi.spyOn(routerClient, "simulateSwapOperations").mockReturnValue( + // new Promise((resolve) => resolve({ amount: toAmount(amount).toString() })) + // ); + // const [originalFromInfo, originalToInfo] = [toTokenInfo(fromToken!), toTokenInfo(toToken!)]; + // const simulateData = await UniversalSwapHelper.handleSimulateSwap({ + // originalFromInfo, + // originalToInfo, + // originalAmount: amount, + // routerClient + // }); + // expect(simulateData.amount).toEqual(expectedSimulateData); + // } + // ); it.each<[CoinGeckoId, CoinGeckoId, string, string]>([ ["oraichain-token", "oraichain-token", "1000000", "1000000"], @@ -1144,11 +1156,9 @@ describe("test universal swap handler functions", () => { ])( "test handleSimulateSwap", async (isSupportedNoPoolSwapEvmRes, isEvmSwappableRes, useSmartRoute, expectedSimulateAmount) => { - const simulateSwapSpy = vi.spyOn(UniversalSwapHelper, "simulateSwap"); const simulateSwapEvmSpy = vi.spyOn(UniversalSwapHelper, "simulateSwapEvm"); const simulateSwapUseSmartRoute = vi.spyOn(UniversalSwapHelper, "querySmartRoute"); - simulateSwapSpy.mockResolvedValue({ amount: "1" }); simulateSwapEvmSpy.mockResolvedValue({ amount: "2", displayAmount: 2 }); simulateSwapUseSmartRoute.mockResolvedValue({ returnAmount: "3", swapAmount: "3", routes: [] }); @@ -1156,7 +1166,7 @@ describe("test universal swap handler functions", () => { const isEvmSwappableSpy = vi.spyOn(UniversalSwapHelper, "isEvmSwappable"); isSupportedNoPoolSwapEvmSpy.mockReturnValue(isSupportedNoPoolSwapEvmRes); isEvmSwappableSpy.mockReturnValue(isEvmSwappableRes); - const simulateData = await handleSimulateSwap({ + const simulateData = await UniversalSwapHelper.handleSimulateSwap({ originalFromInfo: oraichainTokens[0], originalToInfo: oraichainTokens[1], originalAmount: 0,