Skip to content

Commit

Permalink
Merge pull request #31 from oraichain/update/swap
Browse files Browse the repository at this point in the history
Update/swap
  • Loading branch information
haunv3 authored Nov 27, 2024
2 parents b37d604 + 0a63619 commit 137bd15
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 50 deletions.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
"@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.19",
"@oraichain/oraidex-universal-swap": "1.1.23",
"@reduxjs/toolkit": "^1.9.3",
"@sentry/react": "^7.47.0",
"@tanstack/react-query": "^4.32.6",
Expand Down Expand Up @@ -123,7 +122,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",
Expand Down
16 changes: 16 additions & 0 deletions patches/@cosmjs+cosmwasm-stargate+0.32.4.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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);
1 change: 1 addition & 0 deletions src/assets/icons/dogecoin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions src/assets/icons/hmstr.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/config/iconInfos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -160,6 +161,11 @@ export const tokensIconInfos: TokenIcon[] = [
coinGeckoId: 'hamster-kombat',
Icon: HmstrIcon,
IconLight: HmstrIcon
},
{
coinGeckoId: 'dogecoin',
Icon: DogecoinIcon,
IconLight: DogecoinIcon
}
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const useHandleEffectTokenChange = ({ fromTokenDenomSwap, toTokenDenomSwap }) =>
}
})();
}, [
originalToToken,
originalToToken.chainId,
oraiAddress,
metamaskAddress,
tronAddress,
Expand Down
3 changes: 2 additions & 1 deletion src/pages/UniversalSwap/Swap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
58 changes: 18 additions & 40 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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==
Expand All @@ -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==
Expand Down Expand Up @@ -3007,32 +3007,10 @@
react-use "^17.4.0"
react-use-websocket "^4.5.0"

"@oraichain/[email protected]", "@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==
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"
"@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.8.0"
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==
"@oraichain/[email protected]", "@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.32.4"
"@cosmjs/cosmwasm-stargate" "^0.32.4"
Expand Down Expand Up @@ -3071,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/[email protected].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/[email protected].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"
Expand Down Expand Up @@ -6702,14 +6680,6 @@ cosmiconfig@^7.0.0:
path-type "^4.0.0"
yaml "^1.10.0"

[email protected], 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"
Expand All @@ -6718,6 +6688,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"
Expand Down

0 comments on commit 137bd15

Please sign in to comment.