From 52020fa9b67dd0e5bbfe781005f1c012c00d2078 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Van Date: Fri, 29 Nov 2024 16:04:46 +0700 Subject: [PATCH] fix tonbridge --- package.json | 2 +- src/pages/UniversalSwap/helpers.ts | 11 +---------- yarn.lock | 12 ++++++------ 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 827663bb1..41ace2eca 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@oraichain/orai-bitcoin": "2.0.0", "@oraichain/oraidex-common-ui": "1.0.11", "@oraichain/oraidex-contracts-sdk": "1.0.55", - "@oraichain/oraidex-universal-swap": "1.1.22-beta.6", + "@oraichain/oraidex-universal-swap": "1.1.22-beta.9", "@oraichain/ton-bridge-contracts": "^0.15.8", "@oraichain/tonbridge-contracts-sdk": "^1.3.1", "@oraichain/tonbridge-sdk": "^1.3.6", diff --git a/src/pages/UniversalSwap/helpers.ts b/src/pages/UniversalSwap/helpers.ts index 86aea9990..c91e1e6ee 100644 --- a/src/pages/UniversalSwap/helpers.ts +++ b/src/pages/UniversalSwap/helpers.ts @@ -340,11 +340,6 @@ export const getDisableSwap = ({ simulateData, isLoadingSimulate }) => { - const mobileMode = isMobile(); - const canSwapToCosmos = !mobileMode && originalToToken.cosmosBased && !walletByNetworks.cosmos; - const canSwapToEvm = !mobileMode && !originalToToken.cosmosBased && !walletByNetworks.evm; - const canSwapToTron = !mobileMode && originalToToken.chainId === '0x2b6653dc' && !walletByNetworks.tron; - const canSwapTo = canSwapToCosmos || canSwapToEvm || canSwapToTron; const disabledSwapBtn = swapLoading || !fromAmountToken || @@ -352,15 +347,11 @@ export const getDisableSwap = ({ fromAmountTokenBalance > fromTokenBalance || // insufficent fund !addressTransfer || !validAddress.isValid || - isLoadingSimulate || - canSwapTo; + isLoadingSimulate; let disableMsg: string; if (!validAddress.isValid) disableMsg = `Recipient address not found`; if (!addressTransfer) disableMsg = `Recipient address not found`; - if (canSwapToCosmos) disableMsg = `Please connect cosmos wallet`; - if (canSwapToEvm) disableMsg = `Please connect evm wallet`; - if (canSwapToTron) disableMsg = `Please connect tron wallet`; if (!simulateData || simulateData.displayAmount <= 0) disableMsg = 'Enter an amount'; if (fromAmountTokenBalance > fromTokenBalance) disableMsg = `Insufficient funds`; if (isLoadingSimulate) disableMsg = `Swap`; diff --git a/yarn.lock b/yarn.lock index 0770eceb8..72c06965f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3347,7 +3347,7 @@ react-use "^17.4.0" react-use-websocket "^4.5.0" -"@oraichain/oraidex-common@1.1.32-beta.7", "@oraichain/oraidex-common@^1.1.32", "@oraichain/oraidex-common@^1.1.32-beta.5", "@oraichain/oraidex-common@^1.1.6": +"@oraichain/oraidex-common@1.1.32-beta.7", "@oraichain/oraidex-common@^1.1.32", "@oraichain/oraidex-common@^1.1.32-beta.7", "@oraichain/oraidex-common@^1.1.6": version "1.1.32-beta.7" resolved "https://registry.yarnpkg.com/@oraichain/oraidex-common/-/oraidex-common-1.1.32-beta.7.tgz#acc48b8fe003d639e7550edc8a3b9e4a6c3ee743" integrity sha512-73sKbCZUO6pn+/g14V5A9FaGmcl7QkrysFz1A7EiluZajMOFYMNqc1GHDHWpHCepwkfS8Qi+hgAPu8pJtJUYgA== @@ -3389,13 +3389,13 @@ resolved "https://registry.yarnpkg.com/@oraichain/oraidex-contracts-sdk/-/oraidex-contracts-sdk-1.0.45.tgz#42dae0fdd9e005f920ba305b987009f791acc365" integrity sha512-/nYztdxEX5LQM4DMJQmi9HvZrBVoY3nLAmYqSKZGZ0U1h1SxU7O/o22R3/pQwB+sAJdcibaI8ygC0ov7jC8paA== -"@oraichain/oraidex-universal-swap@1.1.22-beta.6": - version "1.1.22-beta.6" - resolved "https://registry.yarnpkg.com/@oraichain/oraidex-universal-swap/-/oraidex-universal-swap-1.1.22-beta.6.tgz#080c5bb5c6704a76cd929482397990e1c5a45b1b" - integrity sha512-o4sRlPZWIoxt/TLSJirt6fHmYvcoAPzWklvSCv7nMFdb7VywyTa7NMVJerM7wSLXJrfE1pfjv+81Kr1hO4FJsA== +"@oraichain/oraidex-universal-swap@1.1.22-beta.9": + version "1.1.22-beta.9" + resolved "https://registry.yarnpkg.com/@oraichain/oraidex-universal-swap/-/oraidex-universal-swap-1.1.22-beta.9.tgz#442b41e94e056ad30d90c23dfcb12c9811d03d32" + integrity sha512-I6hlUQ6LkTgA1ZAUmSqmkis1kHf3OxWepPwuYdN7xvMIvxihfxCfLYRzcZA3VXHfGbGS7Tp4y2rNqpds2F2+pw== dependencies: "@oraichain/common" "^1.0.3" - "@oraichain/oraidex-common" "^1.1.32-beta.5" + "@oraichain/oraidex-common" "^1.1.32-beta.7" "@oraichain/oraidex-contracts-sdk" "^1.0.49" "@oraichain/osor-api-contracts-sdk" "^1.0.2" bech32 "1.1.4"