From a84e5c21d12efcd0822c9fb1785e123e1667cbea Mon Sep 17 00:00:00 2001 From: Hau Nguyen Van Date: Thu, 24 Oct 2024 10:53:02 +0700 Subject: [PATCH 1/3] retire btc --- package.json | 4 +- src/config/chainInfos.ts | 1098 +---------------- .../Swap/hooks/useFilteredTokens.ts | 6 +- yarn.lock | 18 +- 4 files changed, 59 insertions(+), 1067 deletions(-) diff --git a/package.json b/package.json index 7f3a67e8a..5ce9a296d 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@oraichain/orai-bitcoin": "2.0.0", "@oraichain/oraidex-common-ui": "1.0.11", "@oraichain/oraidex-contracts-sdk": "1.0.51-beta.3", - "@oraichain/oraidex-universal-swap": "1.1.15", + "@oraichain/oraidex-universal-swap": "1.1.15-beta.1", "@react-spring/web": "^9.7.5", "@reduxjs/toolkit": "^1.9.3", "@sentry/react": "7.99.0", @@ -140,7 +140,7 @@ "bitcoinjs-lib": "5.2.0", "axios": "0.26.1", "@sentry/react": "7.99.0", - "@oraichain/oraidex-common": "1.1.23" + "@oraichain/oraidex-common": "1.1.26" }, "engines": { "node": "^18 || ^20" diff --git a/src/config/chainInfos.ts b/src/config/chainInfos.ts index 0fee47642..c4a6efb31 100644 --- a/src/config/chainInfos.ts +++ b/src/config/chainInfos.ts @@ -6,78 +6,7 @@ import { BridgeAppCurrency, CustomChainInfo, defaultBech32Config - // PEPE_ORAICHAIN_EXT_DENOM as PEPE_ORAICHAIN_DENOM - // PEPE_ETH_CONTRACT, - // PEPE_BSC_CONTRACT, - // TokenItemType, - // OsmoToken, - // AtomToken, - // InjectiveToken, - // AIRI_BSC_CONTRACT, - // AIRI_CONTRACT, - // ATOM_ORAICHAIN_DENOM, - // INJECTIVE_CONTRACT, - // INJECTIVE_ORAICHAIN_DENOM, - // KWTBSC_ORAICHAIN_DENOM, - // KWT_BSC_CONTRACT, - // KWT_CONTRACT, - // KWT_DENOM, - // KWT_SUB_NETWORK_DENOM, - // MILKYBSC_ORAICHAIN_DENOM, - // MILKY_BSC_CONTRACT, - // MILKY_CONTRACT, - // MILKY_DENOM, - // MILKY_ERC_CONTRACT, - // MILKY_SUB_NETWORK_DENOM, - // ORAIIBC_INJECTIVE_DENOM, - // ORAIX_CONTRACT, - // ORAI_BRIDGE_EVM_DENOM_PREFIX, - // ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX, - // ORAI_BRIDGE_EVM_TRON_DENOM_PREFIX, - // ORAI_BSC_CONTRACT, - // ORAI_ETH_CONTRACT, - // OSMOSIS_ORAICHAIN_DENOM, - // SCATOM_CONTRACT, - // SCORAI_CONTRACT, - // TRX_CONTRACT, - // USDC_CONTRACT, - // USDC_ETH_CONTRACT, - // USDT_BSC_CONTRACT, - // USDT_CONTRACT, - // USDT_TRON_CONTRACT, - // WRAP_BNB_CONTRACT, - // WRAP_ETH_CONTRACT, - // WRAP_TRON_TRX_CONTRACT, - // WETH_CONTRACT, - // USDT_ETH_CONTRACT, - // NEUTARO_ORAICHAIN_DENOM, - // OCH_CONTRACT, - // OCH_ETH_CONTRACT, - // ORAIX_ETH_CONTRACT, - // TON_ORAICHAIN_DENOM } from '@oraichain/oraidex-common'; -// import { ReactComponent as AiriIcon } from 'assets/icons/airi.svg'; -// import { ReactComponent as AtomIcon } from 'assets/icons/atom_cosmos.svg'; -// import { ReactComponent as BnbIcon } from 'assets/icons/bnb.svg'; -// import { ReactComponent as EthIcon } from 'assets/icons/ethereum.svg'; -// import { ReactComponent as KwtIcon } from 'assets/icons/kwt.svg'; -// import { ReactComponent as MilkyIcon } from 'assets/icons/milky-token.svg'; -// import { ReactComponent as OraixIcon } from 'assets/icons/oraix.svg'; -// import { ReactComponent as OraixLightIcon } from 'assets/icons/oraix_light.svg'; -// import { ReactComponent as OsmoIcon } from 'assets/icons/osmosis_light.svg'; -// import { ReactComponent as ScOraiIcon } from 'assets/icons/orchai.svg'; -// import { ReactComponent as UsdtIcon } from 'assets/icons/tether.svg'; -// import { ReactComponent as TronIcon } from 'assets/icons/tron.svg'; -// import { ReactComponent as UsdcIcon } from 'assets/icons/usd_coin.svg'; -// import { ReactComponent as ScAtomIcon } from 'assets/icons/scatom.svg'; -// import { ReactComponent as InjIcon } from 'assets/icons/inj.svg'; -// import { ReactComponent as NobleIcon } from 'assets/icons/noble.svg'; -// import { ReactComponent as TimpiIcon } from 'assets/icons/timpiIcon.svg'; -// import { ReactComponent as NeutaroIcon } from 'assets/icons/neutaro.svg'; -// import { ReactComponent as OrchaiIcon } from 'assets/icons/orchaiIcon.svg'; -// import { bitcoinChainId } from 'helper/constants'; -// import { OBTCContractAddress } from 'libs/nomic/models/ibc-chain'; -// import { listOsmosisToken } from './alphaNetwwork'; import { ReactComponent as BitcoinIcon } from 'assets/icons/bitcoin.svg'; import { ReactComponent as OraiIcon } from 'assets/icons/oraichain.svg'; @@ -92,6 +21,42 @@ export const tokensIcon = tokensIconInfos; export const chainIcons = chainIconsInfos; const [otherChainTokens, oraichainTokens] = tokens; +const OraiBTCToken: BridgeAppCurrency = { + coinDenom: 'ORAIBTC', + coinMinimalDenom: 'uoraibtc', + coinDecimals: 6, + gasPriceStep: { + low: 0, + average: 0, + high: 0 + } +}; + +const oraibtcNetwork = { + rpc: 'https://btc.rpc.orai.io', + rest: 'https://btc.lcd.orai.io/', + chainId: 'oraibtc-mainnet-1' as any, + chainName: 'OraiBTC' as any, + networkType: 'cosmos', + bip44: { + coinType: 118 + }, + Icon: BitcoinIcon, + IconLight: BitcoinIcon, + bech32Config: defaultBech32Config('oraibtc'), + feeCurrencies: [OraiBTCToken], + currencies: [ + { + coinDenom: 'BTC', + coinMinimalDenom: 'uoraibtc', + coinDecimals: 6, + coinGeckoId: 'bitcoin', + bridgeTo: ['Oraichain'], + Icon: BitcoinIcon, + IconLight: BitcoinIcon + } + ] +}; export const bitcoinMainnet: CustomChainInfo = { rest: 'https://blockstream.info/api', @@ -172,7 +137,6 @@ export const bitcoinMainnet: CustomChainInfo = { } }; -// mapped chain info with icon export const chainInfosWithIcon = mapListWithIcon([...customChainInfos, bitcoinMainnet], chainIcons, 'chainId'); export const oraichainTokensWithIcon = mapListWithIcon(oraichainTokens, tokensIcon, 'coinGeckoId'); export const otherTokensWithIcon = mapListWithIcon(otherChainTokens, tokensIcon, 'coinGeckoId'); @@ -195,287 +159,21 @@ export const OraiToken: BridgeAppCurrency = { } }; -// const OraiBToken: BridgeAppCurrency = { -// coinDenom: 'ORAIB', -// coinMinimalDenom: 'uoraib', -// coinDecimals: 6, -// gasPriceStep: { -// low: 0, -// average: 0, -// high: 0 -// } -// }; - -// const KawaiiToken: BridgeAppCurrency = { -// coinDenom: 'ORAIE', -// coinMinimalDenom: 'oraie', -// coinDecimals: 18, -// coinGeckoId: 'kawaii-islands', -// Icon: KwtIcon, -// gasPriceStep: { -// low: 0, -// average: 0.000025, -// high: 0.00004 -// } -// }; - export const oraichainNetwork: CustomChainInfo = { ...customOraichainNetwork, currencies: [ - ...customOraichainNetwork.currencies, - { - coinDenom: 'BTC V2', - coinGeckoId: 'bitcoin', - coinMinimalDenom: CWBitcoinFactoryDenom, - bridgeTo: ['bitcoin'] as any, - coinDecimals: 14 as any, - coinImageUrl: 'https://s2.coinmarketcap.com/static/img/coins/64x64/1.png' - } + ...customOraichainNetwork.currencies + // { + // coinDenom: 'BTC V2', + // coinGeckoId: 'bitcoin', + // coinMinimalDenom: CWBitcoinFactoryDenom, + // bridgeTo: ['bitcoin'] as any, + // coinDecimals: 14 as any, + // coinImageUrl: 'https://s2.coinmarketcap.com/static/img/coins/64x64/1.png' + // } ] }; -/** - * @deprecated - */ -// export const oraichainNetworkOld: CustomChainInfo = { -// rpc: 'https://rpc.orai.io', -// rest: 'https://lcd.orai.io', -// chainId: 'Oraichain', -// chainName: 'Oraichain', -// networkType: 'cosmos', -// stakeCurrency: OraiToken, -// bip44: { -// coinType: 118 -// }, -// bech32Config: defaultBech32Config('orai'), -// feeCurrencies: [OraiToken], - -// Icon: OraiIcon, -// IconLight: OraiLightIcon, -// features: ['ibc-transfer', 'cosmwasm', 'wasmd_0.24+'], -// currencies: [ -// OraiToken, -// { -// coinDenom: 'ATOM', -// coinGeckoId: 'cosmos', -// coinMinimalDenom: ATOM_ORAICHAIN_DENOM, -// bridgeTo: ['cosmoshub-4'], -// coinDecimals: 6, -// Icon: AtomIcon, -// IconLight: AtomIcon -// }, -// { -// coinDenom: 'NTMPI', -// coinGeckoId: 'neutaro', -// coinMinimalDenom: NEUTARO_ORAICHAIN_DENOM, -// bridgeTo: ['Neutaro-1'], -// coinDecimals: 6, -// Icon: TimpiIcon, -// IconLight: TimpiIcon -// }, -// // { -// // coinDenom: 'BEP20 AIRI', -// // coinGeckoId: 'airight', -// // coinMinimalDenom: AIRIBSC_ORAICHAIN_DENOM, -// // coinDecimals: 18, -// // Icon: AiriIcon -// // }, -// { -// coinDenom: 'AIRI', -// coinGeckoId: 'airight', -// coinMinimalDenom: 'airi', -// type: 'cw20', -// contractAddress: AIRI_CONTRACT, -// bridgeTo: ['0x38'], -// coinDecimals: 6, -// Icon: AiriIcon -// }, -// { -// coinDenom: 'USDT', -// coinGeckoId: 'tether', -// coinMinimalDenom: 'usdt', -// type: 'cw20', -// contractAddress: USDT_CONTRACT, -// bridgeTo: ['0x38', '0x2b6653dc', '0x01'], -// coinDecimals: 6, -// Icon: UsdtIcon -// }, -// { -// coinDenom: 'USDC', -// coinGeckoId: 'usd-coin', -// coinMinimalDenom: 'usdc', -// type: 'cw20', -// contractAddress: USDC_CONTRACT, -// bridgeTo: ['0x01', 'noble-1'], -// coinDecimals: 6, -// Icon: UsdcIcon -// }, -// { -// coinDenom: 'OSMO', -// coinMinimalDenom: OSMOSIS_ORAICHAIN_DENOM, -// coinDecimals: 6, -// coinGeckoId: 'osmosis', -// bridgeTo: ['osmosis-1'], -// Icon: OsmoIcon, -// IconLight: OsmoIcon -// }, -// { -// coinDenom: 'BEP20 KWT', -// coinGeckoId: 'kawaii-islands', -// coinMinimalDenom: KWTBSC_ORAICHAIN_DENOM, -// coinDecimals: 18, -// Icon: KwtIcon -// }, -// { -// coinDenom: 'KWT', -// coinGeckoId: 'kawaii-islands', -// coinMinimalDenom: 'kwt', -// type: 'cw20', -// contractAddress: KWT_CONTRACT, -// bridgeTo: ['kawaii_6886-1', '0x38'], -// coinDecimals: 6, -// Icon: KwtIcon -// }, -// { -// coinDenom: 'BEP20 MILKY', -// coinGeckoId: 'milky-token', -// coinMinimalDenom: MILKYBSC_ORAICHAIN_DENOM, -// coinDecimals: 18, -// Icon: MilkyIcon -// }, -// { -// coinDenom: 'MILKY', -// coinGeckoId: 'milky-token', -// coinMinimalDenom: 'milky', -// type: 'cw20', -// contractAddress: MILKY_CONTRACT, -// bridgeTo: ['kawaii_6886-1', '0x38'], -// coinDecimals: 6, -// Icon: MilkyIcon -// }, -// { -// coinDenom: 'ORAIX', -// coinMinimalDenom: 'oraix', -// type: 'cw20', -// contractAddress: ORAIX_CONTRACT, -// coinGeckoId: 'oraidex', -// coinDecimals: 6, -// bridgeTo: ['0x01'], -// Icon: OraixIcon, -// IconLight: OraixLightIcon -// }, -// { -// coinDenom: 'scORAI', -// coinMinimalDenom: 'scorai', -// type: 'cw20', -// contractAddress: SCORAI_CONTRACT, -// coinGeckoId: 'scorai', -// coinDecimals: 6, -// Icon: ScOraiIcon -// }, -// { -// coinDenom: 'wTRX', -// coinGeckoId: 'tron', -// coinMinimalDenom: 'trx', -// type: 'cw20', -// contractAddress: TRX_CONTRACT, -// bridgeTo: ['0x2b6653dc'], -// coinDecimals: 6, -// Icon: TronIcon -// }, -// { -// coinDenom: 'scATOM', -// coinMinimalDenom: 'scatom', -// type: 'cw20', -// contractAddress: SCATOM_CONTRACT, -// coinGeckoId: 'scatom', -// coinDecimals: 6, -// Icon: ScAtomIcon -// }, -// { -// coinDenom: 'IBC INJ', -// coinGeckoId: 'injective-protocol', -// coinMinimalDenom: INJECTIVE_ORAICHAIN_DENOM, -// coinDecimals: 18, -// Icon: InjIcon, -// IconLight: InjIcon -// }, -// { -// coinDenom: 'INJ', -// coinGeckoId: 'injective-protocol', -// coinMinimalDenom: 'injective', -// contractAddress: INJECTIVE_CONTRACT, -// bridgeTo: ['injective-1'], -// type: 'cw20', -// coinDecimals: 6, -// Icon: InjIcon, -// IconLight: InjIcon -// }, -// { -// coinDenom: 'WETH', -// coinGeckoId: 'weth', -// coinMinimalDenom: 'weth', -// type: 'cw20', -// contractAddress: WETH_CONTRACT, -// bridgeTo: ['0x01'], -// coinDecimals: 6, -// coinImageUrl: 'https://s2.coinmarketcap.com/static/img/coins/64x64/1027.png', -// Icon: EthIcon, -// IconLight: EthIcon -// }, -// { -// coinDenom: 'OCH', -// coinGeckoId: 'och', -// coinMinimalDenom: 'och', -// type: 'cw20', -// contractAddress: OCH_CONTRACT, -// bridgeTo: ['0x01'], -// coinDecimals: 6, -// coinImageUrl: -// 'https://assets.coingecko.com/coins/images/34236/standard/orchai_logo_white_copy_4x-8_%281%29.png?1704307670', -// Icon: OrchaiIcon, -// IconLight: OrchaiIcon -// }, -// { -// coinDenom: 'BTC', -// coinGeckoId: 'bitcoin', -// coinMinimalDenom: 'usat', -// type: 'cw20', -// contractAddress: OBTCContractAddress, -// bridgeTo: [bitcoinChainId], -// coinDecimals: 6, -// Icon: BTCIcon, -// IconLight: BTCIcon, -// coinImageUrl: 'https://s2.coinmarketcap.com/static/img/coins/64x64/1.png' -// }, -// { -// coinDenom: 'TON', -// coinMinimalDenom: TON_ORAICHAIN_DENOM, -// coinDecimals: 9, -// coinGeckoId: 'the-open-network', -// coinImageUrl: 'https://assets.coingecko.com/coins/images/17980/standard/ton_symbol.png?1696517498' -// }, -// { -// coinDenom: 'PEPE', -// coinGeckoId: 'pepe', -// coinMinimalDenom: PEPE_ORAICHAIN_DENOM, -// bridgeTo: ['0x38', '0x01'], -// coinDecimals: 6, -// coinImageUrl: 'https://assets.coingecko.com/coins/images/29850/standard/pepe-token.jpeg?1696528776' -// } -// // { -// // coinDenom: 'ATOM-CW20', -// // coinGeckoId: 'cosmos', -// // coinMinimalDenom: 'uatom', -// // type: 'cw20', -// // contractAddress: 'orai17l2zk3arrx0a0fyuneyx8raln68622a2lrsz8ph75u7gw9tgz3esayqryf', -// // bridgeTo: ['cosmoshub-4'], -// // coinDecimals: 6, -// // Icon: AtomIcon -// // } -// ] -// }; - export const OraiBTCBridgeNetwork = { chainId: 'oraibtc-mainnet-1', chainName: 'OraiBtc Bridge', @@ -530,715 +228,9 @@ export const OraiBTCBridgeNetwork = { } }; -const OraiBTCToken: BridgeAppCurrency = { - coinDenom: 'ORAIBTC', - coinMinimalDenom: 'uoraibtc', - coinDecimals: 6, - gasPriceStep: { - low: 0, - average: 0, - high: 0 - } -}; - -const oraibtcNetwork = { - rpc: 'https://btc.rpc.orai.io', - rest: 'https://btc.lcd.orai.io/', - chainId: 'oraibtc-mainnet-1' as any, - chainName: 'OraiBTC' as any, - networkType: 'cosmos', - bip44: { - coinType: 118 - }, - Icon: BitcoinIcon, - IconLight: BitcoinIcon, - bech32Config: defaultBech32Config('oraibtc'), - feeCurrencies: [OraiBTCToken], - currencies: [ - { - coinDenom: 'BTC', - coinMinimalDenom: 'uoraibtc', - coinDecimals: 6, - coinGeckoId: 'bitcoin', - bridgeTo: ['Oraichain'], - Icon: BitcoinIcon, - IconLight: BitcoinIcon - } - ] -}; - export const chainInfosWithSdk = [...customChainInfos, bitcoinMainnet, oraibtcNetwork]; export const chainInfos = mapListWithIcon(chainInfosWithSdk, chainIcons, 'chainId'); -/** - * @deprecated - */ -// export const chainInfosOld: CustomChainInfo[] = [ -// // networks to add on keplr -// oraichainNetwork, -// bitcoinMainnet, -// { -// rpc: 'https://bridge-v2.rpc.orai.io', -// rest: 'https://bridge-v2.lcd.orai.io', -// chainId: 'oraibridge-subnet-2', -// chainName: 'OraiBridge', -// networkType: 'cosmos', -// bip44: { -// coinType: 118 -// }, -// bech32Config: defaultBech32Config('oraib'), - -// features: ['ibc-transfer'], -// stakeCurrency: OraiBToken, -// feeCurrencies: [OraiBToken], -// // not use oraib as currency -// currencies: [ -// OraiBToken, -// { -// coinDenom: 'ORAI', -// coinMinimalDenom: ORAI_BRIDGE_EVM_DENOM_PREFIX + ORAI_BSC_CONTRACT, -// bridgeNetworkIdentifier: '0x38', -// coinDecimals: 18, -// coinGeckoId: 'oraichain-token', -// IconLight: OraiLightIcon, -// Icon: OraiIcon -// }, -// { -// coinDenom: 'ORAI', -// coinMinimalDenom: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX + ORAI_ETH_CONTRACT, -// bridgeNetworkIdentifier: '0x01', -// coinDecimals: 18, -// coinGeckoId: 'oraichain-token', -// IconLight: OraiLightIcon, -// prefixToken: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX, -// Icon: OraiIcon -// }, -// { -// coinDenom: 'USDC', -// coinMinimalDenom: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX + USDC_ETH_CONTRACT, -// bridgeNetworkIdentifier: '0x01', -// coinDecimals: 6, -// coinGeckoId: 'usd-coin', -// prefixToken: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX, -// Icon: UsdcIcon -// }, -// { -// coinDenom: 'WETH', -// coinMinimalDenom: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX + WRAP_ETH_CONTRACT, -// bridgeNetworkIdentifier: '0x01', -// coinDecimals: 6, -// coinGeckoId: 'weth', -// prefixToken: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX, -// Icon: EthIcon -// }, -// { -// coinDenom: 'AIRI', -// coinMinimalDenom: ORAI_BRIDGE_EVM_DENOM_PREFIX + AIRI_BSC_CONTRACT, -// bridgeNetworkIdentifier: '0x38', -// coinDecimals: 18, -// coinGeckoId: 'airight', -// Icon: AiriIcon -// }, -// { -// coinDenom: 'USDT', -// coinMinimalDenom: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX + USDT_ETH_CONTRACT, -// bridgeNetworkIdentifier: '0x01', -// coinDecimals: 6, -// coinGeckoId: 'tether', -// prefixToken: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX, -// Icon: UsdtIcon -// }, -// { -// coinDenom: 'USDT', -// coinMinimalDenom: ORAI_BRIDGE_EVM_DENOM_PREFIX + USDT_BSC_CONTRACT, -// bridgeNetworkIdentifier: '0x38', -// coinDecimals: 18, -// coinGeckoId: 'tether', -// Icon: UsdtIcon -// }, -// { -// coinDenom: 'USDT', -// coinMinimalDenom: ORAI_BRIDGE_EVM_TRON_DENOM_PREFIX + USDT_TRON_CONTRACT, -// bridgeNetworkIdentifier: '0x2b6653dc', -// prefixToken: ORAI_BRIDGE_EVM_TRON_DENOM_PREFIX, -// coinDecimals: 6, -// coinGeckoId: 'tether', -// Icon: UsdtIcon -// }, -// { -// coinDenom: 'wTRX', -// coinMinimalDenom: ORAI_BRIDGE_EVM_TRON_DENOM_PREFIX + WRAP_TRON_TRX_CONTRACT, -// bridgeNetworkIdentifier: '0x2b6653dc', -// coinDecimals: 6, -// coinGeckoId: 'tron', -// prefixToken: ORAI_BRIDGE_EVM_TRON_DENOM_PREFIX, -// Icon: TronIcon -// }, -// { -// coinDenom: 'KWT', -// bridgeNetworkIdentifier: '0x38', -// coinMinimalDenom: KWT_DENOM, -// coinDecimals: 18, -// coinGeckoId: 'kawaii-islands', -// Icon: KwtIcon -// }, -// { -// coinDenom: 'MILKY', -// bridgeNetworkIdentifier: '0x38', -// coinMinimalDenom: MILKY_DENOM, -// coinDecimals: 18, -// coinGeckoId: 'milky-token', -// Icon: MilkyIcon -// }, -// { -// coinDenom: 'OCH', -// coinMinimalDenom: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX + OCH_ETH_CONTRACT, -// bridgeNetworkIdentifier: '0x01', -// coinDecimals: 18, -// coinGeckoId: 'och', -// prefixToken: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX, -// coinImageUrl: -// 'https://assets.coingecko.com/coins/images/34236/standard/orchai_logo_white_copy_4x-8_%281%29.png?1704307670' -// }, -// { -// coinDenom: 'ORAIX', -// coinMinimalDenom: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX + ORAIX_ETH_CONTRACT, -// bridgeNetworkIdentifier: '0x01', -// coinDecimals: 18, -// coinGeckoId: 'oraidex', -// prefixToken: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX, -// coinImageUrl: 'https://i.ibb.co/VmMJtf7/oraix.png' -// }, -// { -// coinDenom: 'PEPE', -// coinMinimalDenom: ORAI_BRIDGE_EVM_DENOM_PREFIX + PEPE_BSC_CONTRACT, -// bridgeNetworkIdentifier: '0x38', -// coinDecimals: 18, -// coinGeckoId: 'pepe', -// prefixToken: ORAI_BRIDGE_EVM_DENOM_PREFIX, -// coinImageUrl: 'https://assets.coingecko.com/coins/images/29850/standard/pepe-token.jpeg?1696528776' -// }, -// { -// coinDenom: 'PEPE', -// coinMinimalDenom: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX + PEPE_ETH_CONTRACT, -// bridgeNetworkIdentifier: '0x01', -// coinDecimals: 18, -// coinGeckoId: 'pepe', -// prefixToken: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX, -// coinImageUrl: 'https://assets.coingecko.com/coins/images/29850/standard/pepe-token.jpeg?1696528776' -// } -// ] -// }, - -// { -// rpc: 'https://tendermint1.kawaii.global', -// rest: 'https://cosmos1.kawaii.global', -// chainId: 'kawaii_6886-1', -// chainName: 'Kawaiiverse', -// networkType: 'cosmos', -// stakeCurrency: KawaiiToken, -// bip44: { -// coinType: 60 -// }, -// bech32Config: defaultBech32Config('oraie'), -// feeCurrencies: [KawaiiToken], - -// Icon: KwtIcon, -// // features: ['ibc-transfer'], -// features: ['ibc-transfer', 'ibc-go', 'stargate', 'eth-address-gen', 'eth-key-sign'], -// currencies: [ -// KawaiiToken, -// { -// coinDenom: 'MILKY', -// coinGeckoId: 'milky-token', -// coinMinimalDenom: MILKY_SUB_NETWORK_DENOM, -// coinDecimals: 18, -// bridgeTo: ['Oraichain', 'kawaii_6886-1'], -// Icon: MilkyIcon -// }, -// { -// coinDenom: 'ERC20 MILKY', -// coinMinimalDenom: 'erc20_milky', -// bridgeTo: ['Oraichain', 'kawaii_6886-1'], -// contractAddress: MILKY_ERC_CONTRACT, -// coinDecimals: 18, -// coinGeckoId: 'milky-token', -// Icon: MilkyIcon -// }, -// { -// coinDenom: 'KWT', -// coinMinimalDenom: KWT_SUB_NETWORK_DENOM, -// coinDecimals: 18, -// bridgeTo: ['Oraichain', 'kawaii_6886-1'], -// coinGeckoId: 'kawaii-islands', -// Icon: KwtIcon -// }, -// { -// coinDenom: 'ERC20 KWT', -// bridgeTo: ['Oraichain', 'kawaii_6886-1'], -// coinMinimalDenom: 'erc20_kwt', -// contractAddress: '0x80b5a32E4F032B2a058b4F29EC95EEfEEB87aDcd', -// coinDecimals: 18, -// coinGeckoId: 'kawaii-islands', -// Icon: KwtIcon -// } -// ] -// }, - -// /// popular networks already included -// { -// rpc: 'https://osmosis.rpc.orai.io/', -// rest: 'https://osmosis.lcd.orai.io/', -// chainId: 'osmosis-1', -// chainName: 'Osmosis', -// networkType: 'cosmos', -// bip44: { -// coinType: 118 -// }, -// Icon: OsmoIcon, -// IconLight: OsmoIcon, -// bech32Config: defaultBech32Config('osmo'), -// feeCurrencies: [OsmoToken], -// currencies: [ -// { -// coinDenom: 'OSMO', -// coinMinimalDenom: 'uosmo', -// coinDecimals: 6, -// coinGeckoId: 'osmosis', -// bridgeTo: ['Oraichain'], -// Icon: OsmoIcon, -// IconLight: OsmoIcon -// }, -// ...listOsmosisToken -// ] -// }, -// { -// rpc: 'https://btc.rpc.orai.io', -// rest: 'https://btc.lcd.orai.io/', -// chainId: 'oraibtc-mainnet-1' as any, -// chainName: 'OraiBTC' as any, -// networkType: 'cosmos', -// bip44: { -// coinType: 118 -// }, -// Icon: BitcoinIcon, -// IconLight: BitcoinIcon, -// bech32Config: defaultBech32Config('oraibtc'), -// feeCurrencies: [OraiBTCToken], -// currencies: [ -// { -// coinDenom: 'BTC', -// coinMinimalDenom: 'uoraibtc', -// coinDecimals: 6, -// coinGeckoId: 'bitcoin', -// bridgeTo: ['Oraichain'], -// Icon: BitcoinIcon, -// IconLight: BitcoinIcon -// } -// ] -// }, -// /// popular networks already included -// { -// rpc: 'https://injective.rpc.orai.io', -// rest: 'https://injective.lcd.orai.io', -// chainId: 'injective-1', -// chainName: 'Injective', -// networkType: 'cosmos', -// bip44: { -// coinType: 60 -// }, -// Icon: InjIcon, -// IconLight: InjIcon, -// bech32Config: defaultBech32Config('inj'), -// feeCurrencies: [InjectiveToken], -// currencies: [ -// { -// coinDenom: 'INJ', -// coinMinimalDenom: 'inj', -// coinDecimals: 18, -// coinGeckoId: 'injective-protocol', -// bridgeTo: ['Oraichain'], -// Icon: InjIcon, -// IconLight: InjIcon -// }, -// { -// coinDenom: 'ORAI', -// coinMinimalDenom: ORAIIBC_INJECTIVE_DENOM, -// coinDecimals: 6, -// coinGeckoId: 'oraichain-token', -// bridgeTo: ['Oraichain'], -// Icon: OraiIcon, -// IconLight: OraiLightIcon -// } -// ] -// }, -// { -// rpc: 'https://noble-rpc.polkachu.com/', -// rest: 'https://noble-api.polkachu.com', -// chainId: 'noble-1', -// chainName: 'Noble', -// networkType: 'cosmos', -// bip44: { -// coinType: 118 -// }, -// bech32Config: defaultBech32Config('noble'), -// features: ['stargate', 'ibc-transfer', 'no-legacy-stdTx', 'ibc-go'], -// Icon: NobleIcon, -// IconLight: NobleIcon, -// currencies: [ -// { -// coinDenom: 'USDC', -// coinMinimalDenom: 'uusdc', -// coinDecimals: 6, -// coinGeckoId: 'usd-coin', -// coinImageUrl: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/noble/images/USDCoin.png', -// gasPriceStep: { -// low: 0, -// average: 0.025, -// high: 0.03 -// }, -// bridgeTo: ['Oraichain'], -// Icon: UsdcIcon, -// IconLight: UsdcIcon -// } -// ], -// feeCurrencies: [ -// { -// coinDenom: 'USDC', -// coinMinimalDenom: 'uusdc', -// coinDecimals: 6, -// coinGeckoId: 'usd-coin', -// coinImageUrl: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/noble/images/USDCoin.png', -// gasPriceStep: { -// low: 0, -// average: 0.025, -// high: 0.03 -// } -// } -// ], -// stakeCurrency: { -// coinDecimals: 6, -// coinDenom: 'STAKE', -// coinMinimalDenom: 'ustake', -// coinImageUrl: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/noble/images/stake.png' -// }, -// chainSymbolImageUrl: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/noble/images/stake.png', -// txExplorer: { -// name: 'Mintscan', -// txUrl: 'https://www.mintscan.io/noble/txs/{txHash}' -// } -// }, -// { -// // rpc: 'http://rpc.neutaro.tech:26657/', -// rpc: 'https://neutaro.rpc.orai.io', -// rest: 'https://neutaro.lcd.orai.io', -// // rest: 'http://api.neutaro.tech:1317/', -// chainId: 'Neutaro-1', -// chainName: 'Neutaro', -// networkType: 'cosmos', -// bip44: { -// coinType: 118 -// }, -// Icon: NeutaroIcon, -// IconLight: NeutaroIcon, -// bech32Config: defaultBech32Config('neutaro'), -// stakeCurrency: { -// coinDenom: 'ntmpi', -// coinMinimalDenom: 'uneutaro', -// coinDecimals: 6, -// coinImageUrl: 'https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/Neutaro/chain.png' -// }, -// feeCurrencies: [ -// { -// coinDenom: 'ntmpi', -// coinMinimalDenom: 'uneutaro', -// coinDecimals: 6, -// coinImageUrl: 'https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/Neutaro/chain.png', -// gasPriceStep: { -// low: 0.01, -// average: 0.025, -// high: 0.03 -// } -// } -// ], -// currencies: [ -// { -// coinDenom: 'NTMPI', -// coinMinimalDenom: 'uneutaro', -// coinDecimals: 6, -// bridgeTo: ['Oraichain'], -// coinGeckoId: 'neutaro', -// Icon: TimpiIcon, -// IconLight: TimpiIcon -// } -// ] -// }, -// { -// rpc: 'https://rpc-cosmos.oraidex.io', -// rest: 'https://lcd-cosmos.oraidex.io', -// chainId: 'cosmoshub-4', -// chainName: 'Cosmos Hub', -// networkType: 'cosmos', -// bip44: { -// coinType: 118 -// }, -// Icon: AtomIcon, -// IconLight: AtomIcon, -// bech32Config: defaultBech32Config('cosmos'), -// feeCurrencies: [AtomToken], -// currencies: [ -// { -// coinDenom: 'ATOM', -// coinGeckoId: 'cosmos', -// coinMinimalDenom: 'uatom', -// coinDecimals: 6, -// bridgeTo: ['Oraichain'], -// Icon: AtomIcon, -// IconLight: AtomIcon -// } -// ] -// }, - -// /// evm chain info -// { -// rpc: 'https://rpc.ankr.com/eth', -// chainId: '0x01', -// chainName: 'Ethereum', -// bip44: { -// coinType: 60 -// }, -// Icon: EthIcon, -// networkType: 'evm', -// currencies: [ -// { -// coinDenom: 'ORAI', -// coinMinimalDenom: 'erc20_orai', -// contractAddress: ORAI_ETH_CONTRACT, -// coinDecimals: 18, -// bridgeTo: ['Oraichain'], -// coinGeckoId: 'oraichain-token', -// IconLight: OraiLightIcon, -// prefixToken: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX, -// Icon: OraiIcon -// }, -// { -// coinDenom: 'USDC', -// coinMinimalDenom: 'erc20_usdc', -// contractAddress: USDC_ETH_CONTRACT, -// coinDecimals: 6, -// bridgeTo: ['Oraichain'], -// coinGeckoId: 'usd-coin', -// prefixToken: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX, -// Icon: UsdcIcon -// }, -// { -// coinDenom: 'WETH', -// coinMinimalDenom: 'erc20_eth', -// contractAddress: WRAP_ETH_CONTRACT, -// coinDecimals: 18, -// bridgeTo: ['Oraichain'], -// coinGeckoId: 'weth', -// prefixToken: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX, -// Icon: EthIcon -// }, -// { -// coinDenom: 'ETH', -// coinMinimalDenom: 'eth', -// contractAddress: '', -// coinDecimals: 18, -// bridgeTo: ['Oraichain'], -// coinGeckoId: 'ethereum', -// Icon: EthIcon, -// prefixToken: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX -// }, -// { -// coinDenom: 'USDT', -// coinMinimalDenom: 'erc20_usdt', -// contractAddress: USDT_ETH_CONTRACT, -// coinDecimals: 6, -// bridgeTo: ['Oraichain'], -// coinGeckoId: 'tether', -// prefixToken: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX, -// Icon: UsdtIcon -// }, -// { -// coinDenom: 'OCH', -// coinMinimalDenom: 'erc20_och', -// contractAddress: OCH_ETH_CONTRACT, -// coinDecimals: 18, -// bridgeTo: ['Oraichain'], -// coinGeckoId: 'och', -// prefixToken: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX, -// coinImageUrl: -// 'https://assets.coingecko.com/coins/images/34236/standard/orchai_logo_white_copy_4x-8_%281%29.png?1704307670', -// Icon: OrchaiIcon -// }, -// { -// coinDenom: 'ORAIX', -// coinMinimalDenom: 'erc20_oraix', -// contractAddress: ORAIX_ETH_CONTRACT, -// coinDecimals: 18, -// bridgeTo: ['Oraichain'], -// coinGeckoId: 'oraidex', -// prefixToken: ORAI_BRIDGE_EVM_ETH_DENOM_PREFIX, -// Icon: OraixIcon -// } -// ] -// }, -// { -// rpc: 'https://api.trongrid.io/jsonrpc', -// rest: 'https://api.trongrid.io', -// chainId: '0x2b6653dc', -// networkType: 'evm', -// chainName: 'Tron Network', -// Icon: TronIcon, -// currencies: [ -// { -// coinDenom: 'USDT', -// coinMinimalDenom: 'trx20_usdt', -// contractAddress: USDT_TRON_CONTRACT, -// bridgeTo: ['Oraichain'], -// coinDecimals: 6, -// coinGeckoId: 'tether', -// prefixToken: ORAI_BRIDGE_EVM_TRON_DENOM_PREFIX, -// Icon: UsdtIcon -// }, -// { -// coinDenom: 'wTRX', -// coinMinimalDenom: 'trx20_trx', -// contractAddress: WRAP_TRON_TRX_CONTRACT, -// bridgeTo: ['Oraichain'], -// coinDecimals: 6, -// coinGeckoId: 'tron', -// prefixToken: ORAI_BRIDGE_EVM_TRON_DENOM_PREFIX, -// Icon: TronIcon -// } -// ], -// bip44: { -// coinType: 195 -// } -// }, -// { -// rpc: 'https://bsc-dataseed1.binance.org', -// networkType: 'evm', -// Icon: BnbIcon, -// chainId: '0x38', -// chainName: 'BNB Chain', -// bip44: { -// coinType: 60 -// }, -// currencies: [ -// { -// coinDenom: 'ORAI', -// coinMinimalDenom: 'bep20_orai', -// contractAddress: ORAI_BSC_CONTRACT, -// bridgeTo: ['Oraichain'], -// coinDecimals: 18, -// coinGeckoId: 'oraichain-token', -// prefixToken: ORAI_BRIDGE_EVM_DENOM_PREFIX, -// Icon: OraiIcon, -// IconLight: OraiLightIcon -// }, -// { -// coinDenom: 'AIRI', -// coinMinimalDenom: 'bep20_airi', -// contractAddress: AIRI_BSC_CONTRACT, -// bridgeTo: ['Oraichain'], -// coinDecimals: 18, -// coinGeckoId: 'airight', -// prefixToken: ORAI_BRIDGE_EVM_DENOM_PREFIX, -// Icon: AiriIcon -// }, -// { -// coinDenom: 'USDT', -// coinMinimalDenom: 'bep20_usdt', -// contractAddress: USDT_BSC_CONTRACT, -// bridgeTo: ['Oraichain'], -// coinDecimals: 18, -// coinGeckoId: 'tether', -// prefixToken: ORAI_BRIDGE_EVM_DENOM_PREFIX, -// Icon: UsdtIcon -// }, -// { -// coinDenom: 'KWT', -// coinMinimalDenom: 'bep20_kwt', -// contractAddress: KWT_BSC_CONTRACT, -// bridgeTo: ['Oraichain'], -// coinDecimals: 18, -// coinGeckoId: 'kawaii-islands', -// Icon: KwtIcon -// }, -// { -// coinDenom: 'MILKY', -// coinMinimalDenom: 'bep20_milky', -// contractAddress: MILKY_BSC_CONTRACT, -// coinDecimals: 18, -// coinGeckoId: 'milky-token', -// bridgeTo: ['Oraichain'], -// Icon: MilkyIcon -// }, -// { -// coinDenom: 'WBNB', -// coinMinimalDenom: 'bep20_wbnb', -// contractAddress: WRAP_BNB_CONTRACT, -// coinDecimals: 18, -// coinGeckoId: 'wbnb', -// bridgeTo: ['Oraichain'], -// Icon: BnbIcon -// }, -// { -// coinDenom: 'BNB', -// coinMinimalDenom: 'bnb', -// contractAddress: '', -// coinDecimals: 18, -// coinGeckoId: 'binancecoin', -// bridgeTo: ['Oraichain'], -// prefixToken: ORAI_BRIDGE_EVM_DENOM_PREFIX, -// Icon: BnbIcon -// }, -// { -// coinDenom: 'PEPE', -// coinMinimalDenom: 'bep20_pepe', -// contractAddress: PEPE_BSC_CONTRACT, -// coinDecimals: 18, -// coinGeckoId: 'pepe', -// bridgeTo: ['Oraichain'], -// coinImageUrl: 'https://assets.coingecko.com/coins/images/29850/standard/pepe-token.jpeg?1696528776' -// } -// ] -// }, -// { -// rpc: 'https://endpoint1.kawaii.global', -// chainId: '0x1ae6', -// networkType: 'evm', -// chainName: 'Kawaiiverse EVM', -// Icon: KwtIcon, -// bip44: { -// coinType: 60 -// }, -// currencies: [ -// { -// coinDenom: 'ERC20 MILKY', -// coinMinimalDenom: 'erc20_milky', -// bridgeTo: ['Oraichain', 'kawaii_6886-1'], -// contractAddress: MILKY_ERC_CONTRACT, -// coinDecimals: 18, -// coinGeckoId: 'milky-token', -// Icon: MilkyIcon -// }, -// { -// coinDenom: 'ERC20 KWT', -// bridgeTo: ['Oraichain', 'kawaii_6886-1'], -// coinMinimalDenom: 'erc20_kwt', -// contractAddress: '0x80b5a32E4F032B2a058b4F29EC95EEfEEB87aDcd', -// coinDecimals: 18, -// coinGeckoId: 'kawaii-islands', -// Icon: KwtIcon -// } -// ] -// } -// ]; - // exclude kawaiverse subnet and other special evm that has different cointype export const evmChains = chainInfos.filter( (c) => c.networkType === 'evm' && c.bip44.coinType === 60 && c.chainId !== '0x1ae6' diff --git a/src/pages/UniversalSwap/Swap/hooks/useFilteredTokens.ts b/src/pages/UniversalSwap/Swap/hooks/useFilteredTokens.ts index 514f53589..d13cbf04b 100644 --- a/src/pages/UniversalSwap/Swap/hooks/useFilteredTokens.ts +++ b/src/pages/UniversalSwap/Swap/hooks/useFilteredTokens.ts @@ -1,6 +1,6 @@ import { SwapDirection, UniversalSwapHelper } from '@oraichain/oraidex-universal-swap'; import { useEffect, useState } from 'react'; -import { TokenItemType } from '@oraichain/oraidex-common'; +import { TokenItemType, BTC_CONTRACT } from '@oraichain/oraidex-common'; const useFilteredTokens = ( originalFromToken: TokenItemType, @@ -20,7 +20,7 @@ const useFilteredTokens = ( searchTokenName, SwapDirection.To ); - setFilteredToTokens(filteredToTokens); + setFilteredToTokens(filteredToTokens.filter((fi) => fi?.contractAddress !== BTC_CONTRACT)); const filteredFromTokens = UniversalSwapHelper.filterNonPoolEvmTokens( originalToToken.chainId, @@ -29,7 +29,7 @@ const useFilteredTokens = ( searchTokenName, SwapDirection.From ); - setFilteredFromTokens(filteredFromTokens); + setFilteredFromTokens(filteredFromTokens.filter((fi) => fi?.contractAddress !== BTC_CONTRACT)); }, [originalFromToken, originalToToken, searchTokenName, toTokenDenomSwap, fromTokenDenomSwap]); return { filteredToTokens, filteredFromTokens }; diff --git a/yarn.lock b/yarn.lock index c7b3789dd..a77862bc5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4300,10 +4300,10 @@ react-use "^17.4.0" react-use-websocket "^4.5.0" -"@oraichain/oraidex-common@1.1.23", "@oraichain/oraidex-common@^1.1.21": - version "1.1.23" - resolved "https://registry.yarnpkg.com/@oraichain/oraidex-common/-/oraidex-common-1.1.23.tgz#7f9b57182972dc4f2f3a9a1fe103c0b12b24fec8" - integrity sha512-f7JYAWZH0Hb0UAH1df5oORWZXeiEIX3gN1a5e+udUDuTqexzC2kVJ5TZyj4KDgJo6JyEjVr10zrzWm+tcFR4fg== +"@oraichain/oraidex-common@1.1.26", "@oraichain/oraidex-common@^1.1.21", "@oraichain/oraidex-common@^1.1.24": + version "1.1.26" + resolved "https://registry.yarnpkg.com/@oraichain/oraidex-common/-/oraidex-common-1.1.26.tgz#f333cbe144adc050c50997706cd2020cb63dc55c" + integrity sha512-RNnFc/thR4KXkI2vzH6qDVV9ojm2L3SqUTLyCmMWUFG98zTQ0mdZC1fXze0ijKiGQsvnZ9IBexbbeiDh96p41w== dependencies: "@cosmjs/amino" "0.31.3" "@cosmjs/cosmwasm-stargate" "0.31.3" @@ -4347,13 +4347,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.15": - version "1.1.15" - resolved "https://registry.yarnpkg.com/@oraichain/oraidex-universal-swap/-/oraidex-universal-swap-1.1.15.tgz#e1c987b896ec0cd56de1ba94cbddcf96f9b5c184" - integrity sha512-iK0nKrGC81MEBVKz4sTkFndjAPEvHXhHObZHtcJtYp7GIvmonHTFWIJWyw1rufAJYonfp5m/XFdm+Ai3ebxkjw== +"@oraichain/oraidex-universal-swap@1.1.15-beta.1": + version "1.1.15-beta.1" + resolved "https://registry.yarnpkg.com/@oraichain/oraidex-universal-swap/-/oraidex-universal-swap-1.1.15-beta.1.tgz#2c6df3f87590e3d1c9e53dbbe81ed54a59ae0066" + integrity sha512-wxfasH9Bz+plwZ/g0Zr261nxLiP6qVT5IXKsC9TrBQMfTDV/4qhse9hZ1rfmDOZMLXHuuYDFEoROfkxz5KNSWQ== dependencies: "@oraichain/common" "^1.0.3" - "@oraichain/oraidex-common" "^1.1.21" + "@oraichain/oraidex-common" "^1.1.24" "@oraichain/oraidex-contracts-sdk" "^1.0.49" "@oraichain/osor-api-contracts-sdk" "^1.0.2" bech32 "1.1.4" From 88efc070c1e9a58b8e63666184ef50dd8acb1d5b Mon Sep 17 00:00:00 2001 From: Hau Nguyen Van Date: Thu, 24 Oct 2024 14:28:44 +0700 Subject: [PATCH 2/3] change name btc v2 --- package.json | 2 +- src/config/chainInfos.ts | 21 +++---------------- .../Balance/TransferConvertToken/index.tsx | 2 +- src/pages/Balance/index.tsx | 6 +++--- .../PendingDeposits/PendingDeposits.tsx | 4 ++-- .../components/ConvertBitcoinV2/index.tsx | 4 ++-- yarn.lock | 8 +++---- 7 files changed, 16 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index 5ce9a296d..b4d5bc1b0 100644 --- a/package.json +++ b/package.json @@ -140,7 +140,7 @@ "bitcoinjs-lib": "5.2.0", "axios": "0.26.1", "@sentry/react": "7.99.0", - "@oraichain/oraidex-common": "1.1.26" + "@oraichain/oraidex-common": "1.1.27" }, "engines": { "node": "^18 || ^20" diff --git a/src/config/chainInfos.ts b/src/config/chainInfos.ts index c4a6efb31..9cbf0fd2d 100644 --- a/src/config/chainInfos.ts +++ b/src/config/chainInfos.ts @@ -70,7 +70,7 @@ export const bitcoinMainnet: CustomChainInfo = { Icon: BTCIcon, IconLight: BTCIcon, stakeCurrency: { - coinDenom: 'BTC', + coinDenom: 'BTC (Legacy)', coinMinimalDenom: 'btc', coinDecimals: 8, coinGeckoId: 'bitcoin', @@ -80,7 +80,7 @@ export const bitcoinMainnet: CustomChainInfo = { networkType: 'bitcoin' as any, currencies: [ { - coinDenom: 'BTC', + coinDenom: 'BTC (Legacy)', coinMinimalDenom: 'btc', prefixToken: 'oraibtc', coinDecimals: 8 as any, @@ -95,7 +95,7 @@ export const bitcoinMainnet: CustomChainInfo = { } }, { - coinDenom: 'BTC V2', + coinDenom: 'BTC', coinMinimalDenom: 'btc-v2', prefixToken: 'oraibtc', coinDecimals: 8 as any, @@ -109,21 +109,6 @@ export const bitcoinMainnet: CustomChainInfo = { high: 0 } } - // { - // coinDenom: 'BTC V2', - // coinMinimalDenom: 'btc-v2', - // prefixToken: 'oraibtc', - // coinDecimals: 8 as any, - // bridgeTo: ['Oraichain'], - // Icon: BTCIcon, - // coinGeckoId: 'bitcoin', - // coinImageUrl: 'https://assets.coingecko.com/coins/images/1/small/bitcoin.png', - // gasPriceStep: { - // low: 0, - // average: 0, - // high: 0 - // } - // } ], get feeCurrencies() { return this.currencies; diff --git a/src/pages/Balance/TransferConvertToken/index.tsx b/src/pages/Balance/TransferConvertToken/index.tsx index c9870c7ac..67ed3a38f 100644 --- a/src/pages/Balance/TransferConvertToken/index.tsx +++ b/src/pages/Balance/TransferConvertToken/index.tsx @@ -157,7 +157,7 @@ const TransferConvertToken: FC = ({ const isFromOraichainToBitcoin = token.chainId === 'Oraichain' && toNetworkChainId === ('bitcoin' as any); const isFromBitcoinToOraichain = token.chainId === ('bitcoin' as string) && toNetworkChainId === 'Oraichain'; - const isV2 = token.name === 'BTC V2'; + const isV2 = token.name === 'BTC'; let { relayerFee: relayerFeeTokenFee } = useRelayerFeeToken(token, to); const depositFeeBtcResult = useDepositFeesBitcoin(isFromBitcoinToOraichain); const withdrawalFeeBtcResult = useGetWithdrawlFeesBitcoin({ diff --git a/src/pages/Balance/index.tsx b/src/pages/Balance/index.tsx index 808e1daba..49bf61727 100644 --- a/src/pages/Balance/index.tsx +++ b/src/pages/Balance/index.tsx @@ -268,7 +268,7 @@ const Balance: React.FC = () => { }; const handleTransferBTCToOraichain = async (fromToken: TokenItemType, transferAmount: number, btcAddr: string) => { - const isV2 = fromToken.name === 'BTC V2'; + const isV2 = fromToken.name === 'BTC'; const utxos = await getUtxos(btcAddr, fromToken.rpc); const feeRate = await getFeeRate({ url: from.rpc @@ -341,7 +341,7 @@ const Balance: React.FC = () => { }; const handleTransferOraichainToBTC = async (fromToken: TokenItemType, transferAmount: number, btcAddr: string) => { - if (fromToken.name === 'BTC V2') { + if (fromToken.name === 'BTC') { try { if (!withdrawV2Fee?.withdrawal_fees) { throw Error('Withdrawal fees are not found!'); @@ -436,7 +436,7 @@ const Balance: React.FC = () => { const btcAddr = await window.Bitcoin.getAddress(); if (!btcAddr) throw Error('Not found your bitcoin address!'); if (isBTCToOraichain) { - if (fromToken.name !== 'BTC V2') { + if (fromToken.name !== 'BTC') { await handleRecoveryAddress(); } return handleTransferBTCToOraichain(fromToken, transferAmount, btcAddr); diff --git a/src/pages/BitcoinDashboard/components/PendingDeposits/PendingDeposits.tsx b/src/pages/BitcoinDashboard/components/PendingDeposits/PendingDeposits.tsx index 2ffc10d4f..540658b16 100644 --- a/src/pages/BitcoinDashboard/components/PendingDeposits/PendingDeposits.tsx +++ b/src/pages/BitcoinDashboard/components/PendingDeposits/PendingDeposits.tsx @@ -39,8 +39,8 @@ export const PendingDeposits: React.FC<{}> = ({}) => { const mobile = isMobile(); const [oraichainAddress] = useConfigReducer('address'); const fee = useRelayerFeeToken( - btcTokens.find((item) => item.name === 'BTC V2'), - oraichainTokens.find((item) => item.name === 'BTC V2') + btcTokens.find((item) => item.name === 'BTC'), + oraichainTokens.find((item) => item.name === 'BTC') ); const depositFee = useGetDepositFee(); const fetchedPendingDeposits = useGetPendingDeposits(oraichainAddress); diff --git a/src/pages/BitcoinDashboardV2/components/ConvertBitcoinV2/index.tsx b/src/pages/BitcoinDashboardV2/components/ConvertBitcoinV2/index.tsx index 61b4e6147..80af42c60 100644 --- a/src/pages/BitcoinDashboardV2/components/ConvertBitcoinV2/index.tsx +++ b/src/pages/BitcoinDashboardV2/components/ConvertBitcoinV2/index.tsx @@ -28,8 +28,8 @@ export const BTC_TOKEN = oraichainTokens.find((e) => e.coinGeckoId === 'bitcoin' const ConvertBitcoinV2: React.FC<{}> = ({}) => { const cwBitcoinContext = useContext(CwBitcoinContext); const { relayerFee } = useRelayerFeeToken( - btcTokens.find((item) => item.name === 'BTC V2'), - oraichainTokens.find((item) => item.name === 'BTC V2') + btcTokens.find((item) => item.name === 'BTC'), + oraichainTokens.find((item) => item.name === 'BTC') ); const withdrawFeeBtc = useGetWithdrawlFeesBitcoin({ enabled: true, diff --git a/yarn.lock b/yarn.lock index a77862bc5..0979d8d81 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4300,10 +4300,10 @@ react-use "^17.4.0" react-use-websocket "^4.5.0" -"@oraichain/oraidex-common@1.1.26", "@oraichain/oraidex-common@^1.1.21", "@oraichain/oraidex-common@^1.1.24": - version "1.1.26" - resolved "https://registry.yarnpkg.com/@oraichain/oraidex-common/-/oraidex-common-1.1.26.tgz#f333cbe144adc050c50997706cd2020cb63dc55c" - integrity sha512-RNnFc/thR4KXkI2vzH6qDVV9ojm2L3SqUTLyCmMWUFG98zTQ0mdZC1fXze0ijKiGQsvnZ9IBexbbeiDh96p41w== +"@oraichain/oraidex-common@1.1.27", "@oraichain/oraidex-common@^1.1.21", "@oraichain/oraidex-common@^1.1.24": + version "1.1.27" + resolved "https://registry.yarnpkg.com/@oraichain/oraidex-common/-/oraidex-common-1.1.27.tgz#446c35441c450e9db0c035b300a51c6cab916701" + integrity sha512-u4MiZYk3e7W1a/EaKhMQG/6RHImG6DsuuxNeDbuF7Ndv0h2of5BK8Bhc9D57fb+fYWzQcJFmaes1gMYTj4QJ2g== dependencies: "@cosmjs/amino" "0.31.3" "@cosmjs/cosmwasm-stargate" "0.31.3" From 88215f3055ff5cbf476d56946e177e01af5eccb2 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Van Date: Thu, 24 Oct 2024 15:42:05 +0700 Subject: [PATCH 3/3] pumb version --- package.json | 4 ++-- yarn.lock | 34 +++++++++++++++++----------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index b4d5bc1b0..b9ea6be80 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@oraichain/orai-bitcoin": "2.0.0", "@oraichain/oraidex-common-ui": "1.0.11", "@oraichain/oraidex-contracts-sdk": "1.0.51-beta.3", - "@oraichain/oraidex-universal-swap": "1.1.15-beta.1", + "@oraichain/oraidex-universal-swap": "1.1.16", "@react-spring/web": "^9.7.5", "@reduxjs/toolkit": "^1.9.3", "@sentry/react": "7.99.0", @@ -79,7 +79,7 @@ "@oraichain/common-contracts-build": "1.0.35", "@oraichain/cw-simulate": "^2.8.75", "@oraichain/oraidex-contracts-build": "1.0.22", - "@oraichain/oraiswap-v3": "0.1.20-beta.2", + "@oraichain/oraiswap-v3": "0.1.22", "@sentry/webpack-plugin": "^2.10.3", "@types/classnames": "^2.2.10", "@types/jest": "^29.5.10", diff --git a/yarn.lock b/yarn.lock index 0979d8d81..02b0d0dd5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4300,7 +4300,7 @@ react-use "^17.4.0" react-use-websocket "^4.5.0" -"@oraichain/oraidex-common@1.1.27", "@oraichain/oraidex-common@^1.1.21", "@oraichain/oraidex-common@^1.1.24": +"@oraichain/oraidex-common@1.1.27", "@oraichain/oraidex-common@^1.1.27": version "1.1.27" resolved "https://registry.yarnpkg.com/@oraichain/oraidex-common/-/oraidex-common-1.1.27.tgz#446c35441c450e9db0c035b300a51c6cab916701" integrity sha512-u4MiZYk3e7W1a/EaKhMQG/6RHImG6DsuuxNeDbuF7Ndv0h2of5BK8Bhc9D57fb+fYWzQcJFmaes1gMYTj4QJ2g== @@ -4332,28 +4332,28 @@ resolved "https://registry.yarnpkg.com/@oraichain/oraidex-contracts-sdk/-/oraidex-contracts-sdk-1.0.51-beta.3.tgz#cb7c369081bcb036cc78d91a35a51ff4fb2b42d0" integrity sha512-r1g0Ikzi21TAVIrB4I3MVF6rVTPdSHeBiQnwZTZuv0tw/muciuZHsiGSF5O2M5rcyMVHWjck9cQ3VVbAN+gFLg== -"@oraichain/oraidex-contracts-sdk@1.0.53-beta.2": - version "1.0.53-beta.2" - resolved "https://registry.yarnpkg.com/@oraichain/oraidex-contracts-sdk/-/oraidex-contracts-sdk-1.0.53-beta.2.tgz#67e70c81e86f6b3efe8c77a291844a20c8768413" - integrity sha512-qOJZWkYx8mTWKdkqpjaV2GowLHBq6z/+v7jP1UTx1c1Vz6MchnePFLgKS115oSkC5VjD5N1Zl9kv9le9g28a8g== - "@oraichain/oraidex-contracts-sdk@^1.0.49": version "1.0.49" resolved "https://registry.yarnpkg.com/@oraichain/oraidex-contracts-sdk/-/oraidex-contracts-sdk-1.0.49.tgz#093221564552e92901c73f6043ce4dc72208d857" integrity sha512-J15JR0+wueYMLMFjz/Omg5ADSKOmmTvsBstVf76NQjrvYpekzdlIGvoTIUCGjyf+DOdzu8MevOk5HDAnOrj3Fw== +"@oraichain/oraidex-contracts-sdk@^1.0.53": + version "1.0.53" + resolved "https://registry.yarnpkg.com/@oraichain/oraidex-contracts-sdk/-/oraidex-contracts-sdk-1.0.53.tgz#82fb40a1e1acb2b603c054b3eccaefa69079fa33" + integrity sha512-w7LA2SjcyPNu8PWx3IuxA+vG41bSHdv1M/oQ2Eu2hrH49mC4VOuXeqVjhrOYr5nb/w/Byb0vXX4sxrA96TAgqA== + "@oraichain/oraidex-contracts-sdk@latest": version "1.0.45" 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.15-beta.1": - version "1.1.15-beta.1" - resolved "https://registry.yarnpkg.com/@oraichain/oraidex-universal-swap/-/oraidex-universal-swap-1.1.15-beta.1.tgz#2c6df3f87590e3d1c9e53dbbe81ed54a59ae0066" - integrity sha512-wxfasH9Bz+plwZ/g0Zr261nxLiP6qVT5IXKsC9TrBQMfTDV/4qhse9hZ1rfmDOZMLXHuuYDFEoROfkxz5KNSWQ== +"@oraichain/oraidex-universal-swap@1.1.16": + version "1.1.16" + resolved "https://registry.yarnpkg.com/@oraichain/oraidex-universal-swap/-/oraidex-universal-swap-1.1.16.tgz#3fbc00b0773c82728e55f0ef6b551e5e7b97cd37" + integrity sha512-hv0D6CZ1udLN21g/zcsZ9iwC5o1Ws7Yc4cHqbT1Wyw3Vsom6hIJ0S8bZ5pkA2hysuO9F5TpO585oiBurBCHUyQ== dependencies: "@oraichain/common" "^1.0.3" - "@oraichain/oraidex-common" "^1.1.24" + "@oraichain/oraidex-common" "^1.1.27" "@oraichain/oraidex-contracts-sdk" "^1.0.49" "@oraichain/osor-api-contracts-sdk" "^1.0.2" bech32 "1.1.4" @@ -4361,14 +4361,14 @@ tronweb "5.3.2" ts-protoc-gen "^0.15.0" -"@oraichain/oraiswap-v3@0.1.20-beta.2": - version "0.1.20-beta.2" - resolved "https://registry.yarnpkg.com/@oraichain/oraiswap-v3/-/oraiswap-v3-0.1.20-beta.2.tgz#a5721f961b77ab8d0b69285d096e1d5c6b04ea14" - integrity sha512-BCW/P/BWrKo52C1kQLpoTevVAcAAccVOvQg/QQYImMc+XexGyiwlK7O4P/f+EWxb7rJYCJqJ9vwzunCsIgWaow== +"@oraichain/oraiswap-v3@0.1.22": + version "0.1.22" + resolved "https://registry.yarnpkg.com/@oraichain/oraiswap-v3/-/oraiswap-v3-0.1.22.tgz#25239c54a875f2a05179597290849415aa94b9ad" + integrity sha512-D9+u2B2N5t4bmP1wiamOPYPiXAB0QMFhhnbxDYxZHwvbNKw0k6p0fSZWcsqPneYESI8lDdRlqOuV9oW3oUJ1TQ== dependencies: "@cosmjs/cosmwasm-stargate" "^0.31.0" - "@oraichain/oraidex-common" "^1.1.21" - "@oraichain/oraidex-contracts-sdk" "1.0.53-beta.2" + "@oraichain/oraidex-common" "^1.1.27" + "@oraichain/oraidex-contracts-sdk" "^1.0.53" "@oraichain/osor-api-contracts-sdk@^1.0.2": version "1.0.2"