Skip to content

Commit

Permalink
Merge branch 'feat/ton-bridge' into develop-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
haunv3 committed Nov 29, 2024
2 parents fd934f1 + 52020fa commit 843e0f1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 1 addition & 10 deletions src/pages/UniversalSwap/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,27 +340,18 @@ 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 ||
!toAmountToken ||
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`;
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3347,7 +3347,7 @@
react-use "^17.4.0"
react-use-websocket "^4.5.0"

"@oraichain/[email protected]", "@oraichain/oraidex-common@^1.1.32", "@oraichain/oraidex-common@^1.1.32-beta.5", "@oraichain/oraidex-common@^1.1.6":
"@oraichain/[email protected]", "@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==
Expand Down Expand Up @@ -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/[email protected].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/[email protected].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"
Expand Down

0 comments on commit 843e0f1

Please sign in to comment.