From 714ea1ad08c2d947e34af297c49343411c85b7e6 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Van Date: Wed, 20 Nov 2024 17:47:07 +0700 Subject: [PATCH 1/5] pumb version sdk --- package.json | 4 ++-- yarn.lock | 50 +++++++++++++++++++++++++------------------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index c4f72e10..a42d5b04 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@oraichain/oraidex-common": "^1.1.28", "@oraichain/oraidex-common-ui": "1.0.11", "@oraichain/oraidex-contracts-sdk": "^1.0.26", - "@oraichain/oraidex-universal-swap": "1.1.19", + "@oraichain/oraidex-universal-swap": "1.1.22", "@reduxjs/toolkit": "^1.9.3", "@sentry/react": "^7.47.0", "@tanstack/react-query": "^4.32.6", @@ -123,7 +123,7 @@ "bech32": "1.1.4", "bitcoinjs-lib": "5.2.0", "axios": "0.26.1", - "@oraichain/oraidex-common": "1.1.28", + "@oraichain/oraidex-common": "1.1.32", "@cosmjs/cosmwasm-stargate": "^0.32.4", "@cosmjs/proto-signing": "^0.32.4", "@cosmjs/stargate": "^0.32.4", diff --git a/yarn.lock b/yarn.lock index 24e54322..251aeb89 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1417,7 +1417,7 @@ ws "^7" xstream "^11.14.0" -"@cosmjs/stargate@0.31.3", "@cosmjs/stargate@^0.30.1", "@cosmjs/stargate@^0.31.0", "@cosmjs/stargate@^0.32.4": +"@cosmjs/stargate@^0.30.1", "@cosmjs/stargate@^0.31.0", "@cosmjs/stargate@^0.32.4": version "0.32.4" resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.32.4.tgz#bd0e4d3bf613b629addbf5f875d3d3b50f640af1" integrity sha512-usj08LxBSsPRq9sbpCeVdyLx2guEcOHfJS9mHGCLCXpdAPEIEQEtWLDpEUc0LEhWOx6+k/ChXTc5NpFkdrtGUQ== @@ -1440,7 +1440,7 @@ dependencies: xstream "^11.14.0" -"@cosmjs/tendermint-rpc@0.31.3", "@cosmjs/tendermint-rpc@^0.31.3", "@cosmjs/tendermint-rpc@^0.32.4": +"@cosmjs/tendermint-rpc@^0.31.3", "@cosmjs/tendermint-rpc@^0.32.4": version "0.32.4" resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.32.4.tgz#b36f9ec657498e42c97e21bb7368798ef6279752" integrity sha512-MWvUUno+4bCb/LmlMIErLypXxy7ckUuzEmpufYYYd9wgbdCXaTaO08SZzyFM5PI8UJ/0S2AmUrgWhldlbxO8mw== @@ -3007,17 +3007,17 @@ react-use "^17.4.0" react-use-websocket "^4.5.0" -"@oraichain/oraidex-common@1.1.28", "@oraichain/oraidex-common@^1.1.27": - version "1.1.28" - resolved "https://registry.yarnpkg.com/@oraichain/oraidex-common/-/oraidex-common-1.1.28.tgz#9bf25c825e3ee7a76bf8c00174579ca2b81d6fdb" - integrity sha512-+1CiI9E03MWtNQ3D7dDWtwbONikpdY1+USmvU6gOKd26uhDqDHKgi7MGnmz2t+Z8/4oqY36aySZhh3d9ybakxg== +"@oraichain/oraidex-common@1.1.32", "@oraichain/oraidex-common@^1.1.27": + version "1.1.32" + resolved "https://registry.yarnpkg.com/@oraichain/oraidex-common/-/oraidex-common-1.1.32.tgz#c787dc3451584ffccd63a20bb230a5dd0a2e383f" + integrity sha512-8DbfumZ26fKFN1yhiQbJOSoXdqHuoU3i2JvVLpSOtveYUd1Z5rBDs3XVS7odNcUAgF0osqzq5sg9+4yUzruZ8Q== dependencies: - "@cosmjs/amino" "0.31.3" - "@cosmjs/cosmwasm-stargate" "0.31.3" - "@cosmjs/crypto" "0.31.3" - "@cosmjs/proto-signing" "0.31.3" - "@cosmjs/stargate" "0.31.3" - "@cosmjs/tendermint-rpc" "0.31.3" + "@cosmjs/amino" "^0.32.4" + "@cosmjs/cosmwasm-stargate" "^0.32.4" + "@cosmjs/crypto" "^0.32.4" + "@cosmjs/proto-signing" "^0.32.4" + "@cosmjs/stargate" "^0.32.4" + "@cosmjs/tendermint-rpc" "^0.32.4" "@ethersproject/providers" "^5.0.10" "@injectivelabs/sdk-ts" "1.12.1" "@keplr-wallet/types" "^0.11.38" @@ -3025,7 +3025,7 @@ axios "1.7.2" axios-extensions "3.1.7" bignumber.js "^9.1.2" - cosmjs-types "0.8.0" + cosmjs-types "^0.9.0" ethers "^5.0.15" tronweb "6.0.0-beta.4" @@ -3071,10 +3071,10 @@ resolved "https://registry.yarnpkg.com/@oraichain/oraidex-contracts-sdk/-/oraidex-contracts-sdk-1.0.44.tgz#9ff41ec388dd92ba112c2eef545d11fd6e18c684" integrity sha512-fMY/QOzO/afPlAVkLGH1bcpJTs6V/URrJju2r4UoE9f5HUWC/6OC6+H5dWuIgq26frp8wjH23mNCQAlmHzji8g== -"@oraichain/oraidex-universal-swap@1.1.19": - version "1.1.19" - resolved "https://registry.yarnpkg.com/@oraichain/oraidex-universal-swap/-/oraidex-universal-swap-1.1.19.tgz#c960407c98501aeedd17dc058b3e4a428c81d4da" - integrity sha512-fv34AiSxGIPzI8zEIaWaI82FtP2CENdCqV4wYC5ucAXCGEuUArmxs6rD0M/Z1vVw0+GmZ8/J9YDZS485ZNE4Pw== +"@oraichain/oraidex-universal-swap@1.1.23": + version "1.1.22" + resolved "https://registry.yarnpkg.com/@oraichain/oraidex-universal-swap/-/oraidex-universal-swap-1.1.22.tgz#ee838ea72fbc912d381298db8f663c9106075969" + integrity sha512-pufQGemqxq6nMMDfuxuiA78pYYv2EQrkgT8wcrrf4GemBQdpgNLa9pwfr8OEBVOFKspbKnaK56sYOWv83bF4xQ== dependencies: "@oraichain/common" "^1.0.3" "@oraichain/oraidex-common" "^1.1.27" @@ -6702,14 +6702,6 @@ cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" -cosmjs-types@0.8.0, cosmjs-types@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.8.0.tgz#2ed78f3e990f770229726f95f3ef5bf9e2b6859b" - integrity sha512-Q2Mj95Fl0PYMWEhA2LuGEIhipF7mQwd9gTQ85DdP9jjjopeoGaDxvmPa5nakNzsq7FnO1DMTatXTAx6bxMH7Lg== - dependencies: - long "^4.0.0" - protobufjs "~6.11.2" - cosmjs-types@^0.7.1: version "0.7.2" resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.7.2.tgz#a757371abd340949c5bd5d49c6f8379ae1ffd7e2" @@ -6718,6 +6710,14 @@ cosmjs-types@^0.7.1: long "^4.0.0" protobufjs "~6.11.2" +cosmjs-types@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.8.0.tgz#2ed78f3e990f770229726f95f3ef5bf9e2b6859b" + integrity sha512-Q2Mj95Fl0PYMWEhA2LuGEIhipF7mQwd9gTQ85DdP9jjjopeoGaDxvmPa5nakNzsq7FnO1DMTatXTAx6bxMH7Lg== + dependencies: + long "^4.0.0" + protobufjs "~6.11.2" + cosmjs-types@^0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.9.0.tgz#c3bc482d28c7dfa25d1445093fdb2d9da1f6cfcc" From b9d9a14814e6bd6d9124b553f0315366a915214b Mon Sep 17 00:00:00 2001 From: Hau Nguyen Van Date: Wed, 20 Nov 2024 17:58:26 +0700 Subject: [PATCH 2/5] pumb version sdk --- package.json | 1 - yarn.lock | 24 +----------------------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/package.json b/package.json index a42d5b04..7beb49f9 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "@oraichain/ethereum-multicall": "^1.0.2", "@oraichain/kawaiiverse-txs": "^0.0.3", "@oraichain/orai-bitcoin": "^1.0.7", - "@oraichain/oraidex-common": "^1.1.28", "@oraichain/oraidex-common-ui": "1.0.11", "@oraichain/oraidex-contracts-sdk": "^1.0.26", "@oraichain/oraidex-universal-swap": "1.1.22", diff --git a/yarn.lock b/yarn.lock index 251aeb89..1cfdc132 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3029,28 +3029,6 @@ ethers "^5.0.15" tronweb "6.0.0-beta.4" -"@oraichain/oraidex-common@^1.1.28": - version "1.1.29" - resolved "https://registry.yarnpkg.com/@oraichain/oraidex-common/-/oraidex-common-1.1.29.tgz#01ee382164e0d98c4929b322917c4efebe99886c" - integrity sha512-GHKpObLpOJEZ0LsMomxBw5yInQduikL5+AKrL09/fhuMihfCKCk2Bgc9Uyfxjmw6z5bBUaN5LOTEPau1U1uQLw== - dependencies: - "@cosmjs/amino" "^0.32.4" - "@cosmjs/cosmwasm-stargate" "^0.32.4" - "@cosmjs/crypto" "^0.32.4" - "@cosmjs/proto-signing" "^0.32.4" - "@cosmjs/stargate" "^0.32.4" - "@cosmjs/tendermint-rpc" "^0.32.4" - "@ethersproject/providers" "^5.0.10" - "@injectivelabs/sdk-ts" "1.12.1" - "@keplr-wallet/types" "^0.11.38" - "@oraichain/oraidex-contracts-sdk" latest - axios "1.7.2" - axios-extensions "3.1.7" - bignumber.js "^9.1.2" - cosmjs-types "^0.9.0" - ethers "^5.0.15" - tronweb "6.0.0-beta.4" - "@oraichain/oraidex-contracts-build@^1.0.22": version "1.0.22" resolved "https://registry.yarnpkg.com/@oraichain/oraidex-contracts-build/-/oraidex-contracts-build-1.0.22.tgz#70b765dd8ea3b500a77cc37e6a45ea9d75f0c5c4" @@ -3071,7 +3049,7 @@ resolved "https://registry.yarnpkg.com/@oraichain/oraidex-contracts-sdk/-/oraidex-contracts-sdk-1.0.44.tgz#9ff41ec388dd92ba112c2eef545d11fd6e18c684" integrity sha512-fMY/QOzO/afPlAVkLGH1bcpJTs6V/URrJju2r4UoE9f5HUWC/6OC6+H5dWuIgq26frp8wjH23mNCQAlmHzji8g== -"@oraichain/oraidex-universal-swap@1.1.23": +"@oraichain/oraidex-universal-swap@1.1.22": version "1.1.22" resolved "https://registry.yarnpkg.com/@oraichain/oraidex-universal-swap/-/oraidex-universal-swap-1.1.22.tgz#ee838ea72fbc912d381298db8f663c9106075969" integrity sha512-pufQGemqxq6nMMDfuxuiA78pYYv2EQrkgT8wcrrf4GemBQdpgNLa9pwfr8OEBVOFKspbKnaK56sYOWv83bF4xQ== From 02ef2a272f682f846cb56cfc723ae194b2f19d2d Mon Sep 17 00:00:00 2001 From: Hau Nguyen Van Date: Wed, 27 Nov 2024 11:14:10 +0700 Subject: [PATCH 3/5] update swap --- package.json | 2 +- patches/@cosmjs+cosmwasm-stargate+0.32.4.patch | 16 ++++++++++++++++ .../Swap/hooks/useHandleEffectTokenChange.ts | 2 +- src/pages/UniversalSwap/Swap/index.tsx | 3 ++- yarn.lock | 8 ++++---- 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 7beb49f9..de707033 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@oraichain/orai-bitcoin": "^1.0.7", "@oraichain/oraidex-common-ui": "1.0.11", "@oraichain/oraidex-contracts-sdk": "^1.0.26", - "@oraichain/oraidex-universal-swap": "1.1.22", + "@oraichain/oraidex-universal-swap": "1.1.23", "@reduxjs/toolkit": "^1.9.3", "@sentry/react": "^7.47.0", "@tanstack/react-query": "^4.32.6", diff --git a/patches/@cosmjs+cosmwasm-stargate+0.32.4.patch b/patches/@cosmjs+cosmwasm-stargate+0.32.4.patch index 12b35992..4da5cf7c 100644 --- a/patches/@cosmjs+cosmwasm-stargate+0.32.4.patch +++ b/patches/@cosmjs+cosmwasm-stargate+0.32.4.patch @@ -62,3 +62,19 @@ index e5bf448..878f7e4 100644 // Use this service to get easy typed access to query methods // This cannot be used for proof verification const queryService = new query_1.QueryClientImpl(rpc); +diff --git a/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.js b/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.js +index 6eb95bb..24d3038 100644 +--- a/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.js ++++ b/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.js +@@ -397,7 +397,10 @@ class SigningCosmWasmClient extends cosmwasmclient_1.CosmWasmClient { + throw new Error("Failed to retrieve account from signer"); + } + const pubkey = (0, proto_signing_1.encodePubkey)((0, amino_1.encodeSecp256k1Pubkey)(accountFromSigner.pubkey)); +- const signMode = signing_1.SignMode.SIGN_MODE_LEGACY_AMINO_JSON; ++ let signMode = signing_1.SignMode.SIGN_MODE_LEGACY_AMINO_JSON; ++ if (this.signer.signEip191) { ++ signMode = signing_1.SignMode.SIGN_MODE_EIP_191; ++ } + const msgs = messages.map((msg) => this.aminoTypes.toAmino(msg)); + const signDoc = (0, amino_1.makeSignDoc)(msgs, fee, chainId, memo, accountNumber, sequence, timeoutHeight); + const { signature, signed } = await this.signer.signAmino(signerAddress, signDoc); diff --git a/src/pages/UniversalSwap/Swap/hooks/useHandleEffectTokenChange.ts b/src/pages/UniversalSwap/Swap/hooks/useHandleEffectTokenChange.ts index ab9889af..a89d5e95 100644 --- a/src/pages/UniversalSwap/Swap/hooks/useHandleEffectTokenChange.ts +++ b/src/pages/UniversalSwap/Swap/hooks/useHandleEffectTokenChange.ts @@ -72,7 +72,7 @@ const useHandleEffectTokenChange = ({ fromTokenDenomSwap, toTokenDenomSwap }) => } })(); }, [ - originalToToken, + originalToToken.chainId, oraiAddress, metamaskAddress, tronAddress, diff --git a/src/pages/UniversalSwap/Swap/index.tsx b/src/pages/UniversalSwap/Swap/index.tsx index be193abf..1dfceb95 100644 --- a/src/pages/UniversalSwap/Swap/index.tsx +++ b/src/pages/UniversalSwap/Swap/index.tsx @@ -570,8 +570,9 @@ const SwapComponent: React.FC<{ }; const getSwitchIcon = () => (isLightMode ? SwitchLightImg : SwitchDarkImg); - + const isEvmToEvm = originalFromToken.chainId === originalToToken.chainId && !originalFromToken.cosmosBased; const noRoutesFound = + !isEvmToEvm && !isAveragePreviousSimulate && (!averageSimulateData?.displayAmount || (averageSimulateData?.displayAmount && diff --git a/yarn.lock b/yarn.lock index 1cfdc132..aedf9f36 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3049,10 +3049,10 @@ resolved "https://registry.yarnpkg.com/@oraichain/oraidex-contracts-sdk/-/oraidex-contracts-sdk-1.0.44.tgz#9ff41ec388dd92ba112c2eef545d11fd6e18c684" integrity sha512-fMY/QOzO/afPlAVkLGH1bcpJTs6V/URrJju2r4UoE9f5HUWC/6OC6+H5dWuIgq26frp8wjH23mNCQAlmHzji8g== -"@oraichain/oraidex-universal-swap@1.1.22": - version "1.1.22" - resolved "https://registry.yarnpkg.com/@oraichain/oraidex-universal-swap/-/oraidex-universal-swap-1.1.22.tgz#ee838ea72fbc912d381298db8f663c9106075969" - integrity sha512-pufQGemqxq6nMMDfuxuiA78pYYv2EQrkgT8wcrrf4GemBQdpgNLa9pwfr8OEBVOFKspbKnaK56sYOWv83bF4xQ== +"@oraichain/oraidex-universal-swap@1.1.23": + version "1.1.23" + resolved "https://registry.yarnpkg.com/@oraichain/oraidex-universal-swap/-/oraidex-universal-swap-1.1.23.tgz#2f6c5485728f096cbc11fba517376737c899e610" + integrity sha512-gSk4B84kT2qGx7Nc2uqiRQevS1447DWgmNAOdx4mNDUB4a6nJ79ie/hYGYemddEv6UQ1T/ppao9oxVjWmBecmQ== dependencies: "@oraichain/common" "^1.0.3" "@oraichain/oraidex-common" "^1.1.27" From 015c1cd9995049c4034a04f3f29b1a7cf6f25372 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Van Date: Wed, 27 Nov 2024 11:14:55 +0700 Subject: [PATCH 4/5] update swap --- src/assets/icons/hmstr.svg | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/assets/icons/hmstr.svg b/src/assets/icons/hmstr.svg index 92354cac..0762db19 100644 --- a/src/assets/icons/hmstr.svg +++ b/src/assets/icons/hmstr.svg @@ -1,9 +1,9 @@ - - + + - - + + - + From 0a63619d73ee698613de771d9de5f6d60aaedd19 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Van Date: Wed, 27 Nov 2024 11:24:49 +0700 Subject: [PATCH 5/5] update swap --- src/assets/icons/dogecoin.svg | 1 + src/config/iconInfos.ts | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 src/assets/icons/dogecoin.svg diff --git a/src/assets/icons/dogecoin.svg b/src/assets/icons/dogecoin.svg new file mode 100644 index 00000000..c435731d --- /dev/null +++ b/src/assets/icons/dogecoin.svg @@ -0,0 +1 @@ +Dogecoin (DOGE) \ No newline at end of file diff --git a/src/config/iconInfos.ts b/src/config/iconInfos.ts index eeb4cfdd..909bc8ba 100644 --- a/src/config/iconInfos.ts +++ b/src/config/iconInfos.ts @@ -26,6 +26,7 @@ import { ReactComponent as BitcoinIcon } from 'assets/icons/bitcoin.svg'; import { ReactComponent as CelestiaIcon } from 'assets/icons/celestia.svg'; import { ReactComponent as TonIcon } from 'assets/icons/ton.svg'; import { ReactComponent as PepeIcon } from 'assets/icons/pepe.svg'; +import { ReactComponent as DogecoinIcon } from 'assets/icons/dogecoin.svg'; // import { ReactComponent as CatIcon } from 'assets/icons/icon-simoncat.svg'; import { ReactComponent as HmstrIcon } from 'assets/icons/hmstr.svg'; @@ -160,6 +161,11 @@ export const tokensIconInfos: TokenIcon[] = [ coinGeckoId: 'hamster-kombat', Icon: HmstrIcon, IconLight: HmstrIcon + }, + { + coinGeckoId: 'dogecoin', + Icon: DogecoinIcon, + IconLight: DogecoinIcon } ];