Skip to content

Commit

Permalink
fix bridge ton osmosis
Browse files Browse the repository at this point in the history
  • Loading branch information
haunv3 committed Dec 11, 2024
1 parent 68ea634 commit 78d1697
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 53 deletions.
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
"@lucky-canvas/react": "^0.1.13",
"@oraichain/bitcoin-bridge-contracts-sdk": "^1.1.9",
"@oraichain/bitcoin-bridge-lib-js": "^1.1.9",
"@oraichain/common": "1.2.0",
"@oraichain/common": "1.2.4",
"@oraichain/common-contracts-sdk": "^1.0.31",
"@oraichain/ethereum-multicall": "^1.0.2",
"@oraichain/kawaiiverse-txs": "^0.0.3",
"@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.23-beta.2",
"@oraichain/oraidex-universal-swap": "1.1.23-beta.4",
"@oraichain/ton-bridge-contracts": "^0.15.8",
"@oraichain/tonbridge-contracts-sdk": "^1.3.1",
"@oraichain/tonbridge-sdk": "^1.3.6",
Expand Down Expand Up @@ -169,6 +169,10 @@
"@sentry/react": "7.99.0",
"@oraichain/oraidex-common": "1.1.40-beta.1"
},
"overrides": {
"cosmjs-types@>0.7.0 <0.8.0": "0.7.1",
"cosmjs-types@>0.8.0 <1": "0.9.0"
},
"engines": {
"node": "^18 || ^20"
},
Expand Down
55 changes: 28 additions & 27 deletions src/pages/Balance/TransferConvertToken/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import { CWBitcoinFactoryDenom } from 'helper/constants';
import useGetFee from '../hooks/useGetFee';
import useTonBridgeHandler, { EXTERNAL_MESSAGE_FEE } from '../hooks/useTonBridgeHandler';
import { TonChainId } from 'context/ton-provider';
import { network } from 'config/networks';

interface TransferConvertProps {
token: TokenItemType;
Expand All @@ -64,11 +65,7 @@ const TransferConvertToken: FC<TransferConvertProps> = ({
isFastMode,
setIsFastMode
}) => {
// const bridgeNetworks = networks.filter((item) => filterChainBridge(token, item));
const bridgeNetworks = [...(token?.bridgeTo || ['Oraichain'])].map((chainId) => {
const net = findChainByChainId(chainId);
return net;
});
const bridgeNetworks = networks.filter((item) => filterChainBridge(token, item));
const [[convertAmount, convertUsd], setConvertAmount] = useState([undefined, 0]);
const [transferLoading, setTransferLoading] = useState(false);
const [copied, setCopied] = useState(false);
Expand Down Expand Up @@ -302,6 +299,8 @@ const TransferConvertToken: FC<TransferConvertProps> = ({

const isBTCLegacy = token?.contractAddress === BTC_CONTRACT;

console.log({ networks });

return (
<div className={classNames(styles.tokenFromGroup, styles.small)} style={{ flexWrap: 'wrap' }}>
<div className={styles.tokenSubAmouts}>
Expand Down Expand Up @@ -380,29 +379,31 @@ const TransferConvertToken: FC<TransferConvertProps> = ({
{isOpen && (
<div>
<ul className={classNames(styles.items, styles[theme])}>
{[...(token?.bridgeTo || ['Oraichain'])].map((chainId) => {
const net = findChainByChainId(chainId);
return (
<li
key={net.chainId}
onClick={async (e) => {
e.stopPropagation();
const address = await getAddressTransfer(net, walletByNetworks);
setAddressTransfer(address);
setIsOpen(false);
}}
>
{net && (
<div className={classNames(styles.items_chain)}>
<div>
<net.Icon width={44} height={44} />
{networks
.filter((item) => filterChainBridge(token, item))
.map((net) => {
return (
<li
key={net.chainId}
onClick={async (e) => {
e.stopPropagation();
const address = await getAddressTransfer(net, walletByNetworks);
setAddressTransfer(address);
setToNetworkChainId(net.chainId);
setIsOpen(false);
}}
>
{net && (
<div className={classNames(styles.items_chain)}>
<div>
<net.Icon width={44} height={44} />{' '}
</div>
<div className={classNames(styles.items_title, styles[theme])}>{net.chainName}</div>
</div>
<div className={classNames(styles.items_title, styles[theme])}>{net.chainName}</div>
</div>
)}
</li>
);
})}
)}
</li>
);
})}
</ul>
</div>
)}
Expand Down
35 changes: 11 additions & 24 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3729,30 +3729,16 @@
resolved "https://registry.yarnpkg.com/@oraichain/common-contracts-sdk/-/common-contracts-sdk-1.0.31.tgz#595f93b168438d69d64896909b37855c9afc92fb"
integrity sha512-s8H20RXy5gCnu3DnM7L5ClQyj2mdQpbSBpZrXCpIAX9qY0LKsDdZG3sYaDQ8+VN333jz9Pp/qGWdFSYD+6PBsg==

"@oraichain/[email protected].0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@oraichain/common/-/common-1.2.0.tgz#201dddcff7bbb0dd90a04cacf82dc3f6b9480788"
integrity sha512-gMTBSkLtHOMUfC5d3VJmEUtN17z5wL2YUrHLXCTcE6VA/K8nZ4jRt8yoO4JU/Lzy8LhZecQ2vM8r6kgLUpg8lw==
"@oraichain/[email protected].4", "@oraichain/common@^1.2.4":
version "1.2.4"
resolved "https://registry.yarnpkg.com/@oraichain/common/-/common-1.2.4.tgz#1a28dc288f3ada9d802541454585839e5c275deb"
integrity sha512-/2TIpqDrJKgh/gb50s+sz5lhsffsj6QOVrJh1QrlIsRlup3yQnahm06vwsiVOX75rbdAMO5c7tJiXjKkHbfkww==
dependencies:
"@keplr-wallet/types" "0.12.141"
axios "0.21.4"
axios-extensions "3.1.6"
bech32 "^1.1.4"
cosmjs-types "^0.8.0"
ethers "^5.5.1"
lodash "^4.17.21"

"@oraichain/common@^1.0.3":
version "1.0.3"
resolved "https://registry.yarnpkg.com/@oraichain/common/-/common-1.0.3.tgz#c6746473deed39622a1368a8f8f733a13f628a7e"
integrity sha512-4Rwwl8DF3bMNh5XSlP44LjUIKCOglDc/R1bUCeVFifZlrTGaz6Zo7Fdw6xwych7b4doxcuQBBh2gr7AZE6jQyQ==
dependencies:
"@cosmjs/cosmwasm-stargate" "0.31.3"
"@cosmjs/tendermint-rpc" "^0.31.3"
axios "0.21.4"
axios-extensions "3.1.6"
bech32 "^1.1.4"
cosmjs-types "^0.8.0"
cosmjs-types "^0.9.0"
ethers "^5.5.1"
lodash "^4.17.21"

Expand Down Expand Up @@ -3909,16 +3895,17 @@
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].2":
version "1.1.23-beta.2"
resolved "https://registry.yarnpkg.com/@oraichain/oraidex-universal-swap/-/oraidex-universal-swap-1.1.23-beta.2.tgz#85c1e388628ad9e4189d6260264f93f01a8e37a1"
integrity sha512-5Jd6ywb0ROhzYBSaRGaB8nVg/D7qR5uUIIVv5lA06Sri4GDTAf1jfD6tZ2I2aWF5Bej/t/eXWNTOIxEIDE9wjg==
"@oraichain/[email protected].4":
version "1.1.23-beta.4"
resolved "https://registry.yarnpkg.com/@oraichain/oraidex-universal-swap/-/oraidex-universal-swap-1.1.23-beta.4.tgz#4292a3e69775d011d79c7f096b98269e0da3128c"
integrity sha512-oilWCa68adseq0Dzx+4HRq6sntJJGnY3uC+kwWcX4CdAVx94Ftu9AKyE3l7CG4j+nLl8COpOfEfH6F+3llM74Q==
dependencies:
"@oraichain/common" "^1.0.3"
"@oraichain/common" "^1.2.4"
"@oraichain/oraidex-common" "1.1.32-beta.8"
"@oraichain/oraidex-contracts-sdk" "^1.0.49"
"@oraichain/osor-api-contracts-sdk" "^1.0.2"
bech32 "1.1.4"
cosmjs-types "^0.9.0"
ethers "^5.0.15"
tronweb "5.3.2"
ts-protoc-gen "^0.15.0"
Expand Down

0 comments on commit 78d1697

Please sign in to comment.