From 68c95a9196bd02a87dc9a8527339bb43cb65fbb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20Ba=C4=8Dianskas?= Date: Thu, 1 Feb 2024 11:40:49 +0100 Subject: [PATCH] Main build fix and error message (#439) * fix(quota): api showing outdated results * removed missing module imports * better error messaging on smart account creation (#438) * feat: removes tezos & cosmos --------- Co-authored-by: Derek Co-authored-by: Gancho Radkov --- .../src/components/ChainAddressMini.tsx | 2 - .../src/components/ChainDataMini.tsx | 13 +--- .../src/components/RequestDetalilsCard.tsx | 6 +- .../src/components/SessionChainCard.tsx | 2 - .../components/SessionProposalChainCard.tsx | 2 - .../src/components/SmartAccountCard.tsx | 4 +- .../react-wallet-v2/src/data/COSMOSData.ts | 26 ------- .../react-wallet-v2/src/data/TezosData.ts | 49 ------------- .../react-wallet-v2/src/data/chainsUtil.ts | 4 - .../src/hooks/useSmartAccount.ts | 8 ++ .../hooks/useWalletConnectEventsManager.ts | 10 --- .../react-wallet-v2/src/pages/index.tsx | 73 +++++-------------- .../react-wallet-v2/src/pages/settings.tsx | 28 +------ .../react-wallet-v2/src/store/ModalStore.ts | 2 - .../src/store/SettingsStore.ts | 12 --- .../react-wallet-v2/src/utils/HelperUtil.ts | 18 ----- .../src/views/SessionProposalModal.tsx | 9 --- 17 files changed, 36 insertions(+), 232 deletions(-) delete mode 100644 advanced/wallets/react-wallet-v2/src/data/COSMOSData.ts delete mode 100644 advanced/wallets/react-wallet-v2/src/data/TezosData.ts diff --git a/advanced/wallets/react-wallet-v2/src/components/ChainAddressMini.tsx b/advanced/wallets/react-wallet-v2/src/components/ChainAddressMini.tsx index abc70c894..40104d56f 100644 --- a/advanced/wallets/react-wallet-v2/src/components/ChainAddressMini.tsx +++ b/advanced/wallets/react-wallet-v2/src/components/ChainAddressMini.tsx @@ -1,9 +1,7 @@ -import { cosmosAddresses } from '@/utils/CosmosWalletUtil' import { eip155Addresses } from '@/utils/EIP155WalletUtil' import { polkadotAddresses } from '@/utils/PolkadotWalletUtil' import { multiversxAddresses } from '@/utils/MultiversxWalletUtil' import { tronAddresses } from '@/utils/TronWalletUtil' -import { tezosAddresses } from '@/utils/TezosWalletUtil' import { solanaAddresses } from '@/utils/SolanaWalletUtil' import { nearAddresses } from '@/utils/NearWalletUtil' import { kadenaAddresses } from '@/utils/KadenaWalletUtil' diff --git a/advanced/wallets/react-wallet-v2/src/components/ChainDataMini.tsx b/advanced/wallets/react-wallet-v2/src/components/ChainDataMini.tsx index bef86a8b5..3a88ec037 100644 --- a/advanced/wallets/react-wallet-v2/src/components/ChainDataMini.tsx +++ b/advanced/wallets/react-wallet-v2/src/components/ChainDataMini.tsx @@ -1,15 +1,6 @@ -import { COSMOS_MAINNET_CHAINS } from '@/data/COSMOSData' -import { EIP155_CHAINS } from '@/data/EIP155Data' -import { KADENA_CHAINS } from '@/data/KadenaData' -import { MULTIVERSX_CHAINS } from '@/data/MultiversxData' -import { NEAR_CHAINS } from '@/data/NEARData' -import { POLKADOT_CHAINS } from '@/data/PolkadotData' -import { SOLANA_CHAINS } from '@/data/SolanaData' -import { TEZOS_CHAINS } from '@/data/TezosData' -import { TRON_CHAINS } from '@/data/TronData' import { getChainData } from '@/data/chainsUtil' -import { Card, Row, styled, Image, Avatar } from '@nextui-org/react' -import { ReactNode, useMemo } from 'react' +import { Row, Avatar } from '@nextui-org/react' +import { useMemo } from 'react' interface Props { chainId?: string // namespace + ":" + reference diff --git a/advanced/wallets/react-wallet-v2/src/components/RequestDetalilsCard.tsx b/advanced/wallets/react-wallet-v2/src/components/RequestDetalilsCard.tsx index 06bb053a3..8191d77db 100644 --- a/advanced/wallets/react-wallet-v2/src/components/RequestDetalilsCard.tsx +++ b/advanced/wallets/react-wallet-v2/src/components/RequestDetalilsCard.tsx @@ -1,4 +1,3 @@ -import { COSMOS_MAINNET_CHAINS, TCosmosChain } from '@/data/COSMOSData' import { EIP155_CHAINS, TEIP155Chain } from '@/data/EIP155Data' import { KADENA_CHAINS, TKadenaChain } from '@/data/KadenaData' import { NEAR_TEST_CHAINS, TNearChain } from '@/data/NEARData' @@ -30,7 +29,6 @@ export default function RequestDetailsCard({ chains, protocol }: IProps) { .map( chain => EIP155_CHAINS[chain as TEIP155Chain]?.name ?? - COSMOS_MAINNET_CHAINS[chain as TCosmosChain]?.name ?? SOLANA_CHAINS[chain as TSolanaChain]?.name ?? NEAR_TEST_CHAINS[chain as TNearChain]?.name ?? MULTIVERSX_CHAINS[chain as TMultiversxChain]?.name ?? @@ -48,7 +46,9 @@ export default function RequestDetailsCard({ chains, protocol }: IProps) { Relay Protocol - {protocol} + + {protocol} + diff --git a/advanced/wallets/react-wallet-v2/src/components/SessionChainCard.tsx b/advanced/wallets/react-wallet-v2/src/components/SessionChainCard.tsx index 64b72c0aa..79b7cbd8a 100644 --- a/advanced/wallets/react-wallet-v2/src/components/SessionChainCard.tsx +++ b/advanced/wallets/react-wallet-v2/src/components/SessionChainCard.tsx @@ -1,5 +1,4 @@ import ChainCard from '@/components/ChainCard' -import { COSMOS_MAINNET_CHAINS } from '@/data/COSMOSData' import { EIP155_MAINNET_CHAINS, EIP155_TEST_CHAINS } from '@/data/EIP155Data' import { NEAR_TEST_CHAINS } from '@/data/NEARData' import { SOLANA_MAINNET_CHAINS, SOLANA_TEST_CHAINS } from '@/data/SolanaData' @@ -14,7 +13,6 @@ import { Fragment } from 'react' * Utilities */ const CHAIN_METADATA = { - ...COSMOS_MAINNET_CHAINS, ...SOLANA_MAINNET_CHAINS, ...MULTIVERSX_MAINNET_CHAINS, ...TRON_MAINNET_CHAINS, diff --git a/advanced/wallets/react-wallet-v2/src/components/SessionProposalChainCard.tsx b/advanced/wallets/react-wallet-v2/src/components/SessionProposalChainCard.tsx index eab288e86..d89365c33 100644 --- a/advanced/wallets/react-wallet-v2/src/components/SessionProposalChainCard.tsx +++ b/advanced/wallets/react-wallet-v2/src/components/SessionProposalChainCard.tsx @@ -1,5 +1,4 @@ import ChainCard from '@/components/ChainCard' -import { COSMOS_MAINNET_CHAINS } from '@/data/COSMOSData' import { EIP155_MAINNET_CHAINS, EIP155_TEST_CHAINS } from '@/data/EIP155Data' import { NEAR_TEST_CHAINS } from '@/data/NEARData' import { SOLANA_MAINNET_CHAINS, SOLANA_TEST_CHAINS } from '@/data/SolanaData' @@ -14,7 +13,6 @@ import { Fragment } from 'react' * Utilities */ const CHAIN_METADATA = { - ...COSMOS_MAINNET_CHAINS, ...SOLANA_MAINNET_CHAINS, ...MULTIVERSX_MAINNET_CHAINS, ...TRON_MAINNET_CHAINS, diff --git a/advanced/wallets/react-wallet-v2/src/components/SmartAccountCard.tsx b/advanced/wallets/react-wallet-v2/src/components/SmartAccountCard.tsx index 3c3354bb8..4df793dec 100644 --- a/advanced/wallets/react-wallet-v2/src/components/SmartAccountCard.tsx +++ b/advanced/wallets/react-wallet-v2/src/components/SmartAccountCard.tsx @@ -1,6 +1,6 @@ import ChainCard from '@/components/ChainCard' import SettingsStore from '@/store/SettingsStore' -import { truncate } from '@/utils/HelperUtil' +import { styledToast, truncate } from '@/utils/HelperUtil' import { updateSignClientChainId } from '@/utils/WalletConnectUtil' import { Avatar, Button, Text, Tooltip, Loading } from '@nextui-org/react' import { eip155Wallets } from '@/utils/EIP155WalletUtil' @@ -134,7 +134,7 @@ export default function SmartAccountCard({ css={{ marginTop: 10, width: '100%' }} onClick={onCreateSmartAccount} > - {loading ? : 'Create Smart Account'} + {loading ? : 'Create Smart Account'} )} diff --git a/advanced/wallets/react-wallet-v2/src/data/COSMOSData.ts b/advanced/wallets/react-wallet-v2/src/data/COSMOSData.ts deleted file mode 100644 index be93fdc37..000000000 --- a/advanced/wallets/react-wallet-v2/src/data/COSMOSData.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Types - */ -export type TCosmosChain = keyof typeof COSMOS_MAINNET_CHAINS - -/** - * Chains - */ -export const COSMOS_MAINNET_CHAINS = { - 'cosmos:cosmoshub-4': { - chainId: 'cosmoshub-4', - name: 'Cosmos Hub', - logo: '/chain-logos/cosmos-cosmoshub-4.png', - rgb: '107, 111, 147', - rpc: '', - namespace: 'cosmos' - } -} - -/** - * Methods - */ -export const COSMOS_SIGNING_METHODS = { - COSMOS_SIGN_DIRECT: 'cosmos_signDirect', - COSMOS_SIGN_AMINO: 'cosmos_signAmino' -} diff --git a/advanced/wallets/react-wallet-v2/src/data/TezosData.ts b/advanced/wallets/react-wallet-v2/src/data/TezosData.ts deleted file mode 100644 index 725fce06b..000000000 --- a/advanced/wallets/react-wallet-v2/src/data/TezosData.ts +++ /dev/null @@ -1,49 +0,0 @@ -type ChainMetadata = { - chainId: string - name: string - logo: string - rgb: string - rpc: string - namespace: string -} - -/** - * Types - */ -export type TTezosChain = keyof typeof TEZOS_MAINNET_CHAINS - -/** - * Chains - */ -export const TEZOS_MAINNET_CHAINS: Record = { - 'tezos:mainnet': { - chainId: 'mainnet', - name: 'Tezos', - logo: '/chain-logos/tezos.svg', - rgb: '44, 125, 247', - rpc: 'https://mainnet.api.tez.ie', - namespace: 'tezos' - } -} - -export const TEZOS_TEST_CHAINS: Record = { - 'tezos:testnet': { - chainId: 'testnet', - name: 'Tezos Testnet', - logo: '/chain-logos/tezos.svg', - rgb: '44, 125, 247', - rpc: 'https://ghostnet.ecadinfra.com', - namespace: 'tezos' - } -} - -export const TEZOS_CHAINS = { ...TEZOS_MAINNET_CHAINS, ...TEZOS_TEST_CHAINS } - -/** - * Methods - */ -export const TEZOS_SIGNING_METHODS = { - TEZOS_GET_ACCOUNTS: 'tezos_getAccounts', - TEZOS_SEND: 'tezos_send', - TEZOS_SIGN: 'tezos_sign' -} diff --git a/advanced/wallets/react-wallet-v2/src/data/chainsUtil.ts b/advanced/wallets/react-wallet-v2/src/data/chainsUtil.ts index e3cc0af15..0a877ce68 100644 --- a/advanced/wallets/react-wallet-v2/src/data/chainsUtil.ts +++ b/advanced/wallets/react-wallet-v2/src/data/chainsUtil.ts @@ -1,22 +1,18 @@ -import { COSMOS_MAINNET_CHAINS } from './COSMOSData' import { EIP155_CHAINS } from './EIP155Data' import { KADENA_CHAINS } from './KadenaData' import { MULTIVERSX_CHAINS } from './MultiversxData' import { NEAR_CHAINS } from './NEARData' import { POLKADOT_CHAINS } from './PolkadotData' import { SOLANA_CHAINS } from './SolanaData' -import { TEZOS_CHAINS } from './TezosData' import { TRON_CHAINS } from './TronData' export const ALL_CHAINS = { ...EIP155_CHAINS, - ...COSMOS_MAINNET_CHAINS, ...KADENA_CHAINS, ...MULTIVERSX_CHAINS, ...NEAR_CHAINS, ...POLKADOT_CHAINS, ...SOLANA_CHAINS, - ...TEZOS_CHAINS, ...TRON_CHAINS } diff --git a/advanced/wallets/react-wallet-v2/src/hooks/useSmartAccount.ts b/advanced/wallets/react-wallet-v2/src/hooks/useSmartAccount.ts index aae507209..a3f307487 100644 --- a/advanced/wallets/react-wallet-v2/src/hooks/useSmartAccount.ts +++ b/advanced/wallets/react-wallet-v2/src/hooks/useSmartAccount.ts @@ -1,5 +1,7 @@ import { SmartAccountLib } from "@/lib/SmartAccountLib"; +import { styledToast } from "@/utils/HelperUtil"; import { useCallback, useEffect, useState } from "react"; +import { TransactionExecutionError } from "viem"; export default function useSmartAccount(signerPrivateKey: `0x${string}`) { const [loading, setLoading] = useState(false) @@ -14,6 +16,12 @@ export default function useSmartAccount(signerPrivateKey: `0x${string}`) { setLoading(false) } catch (e) { + if (e instanceof TransactionExecutionError) { + // shorten the error message + styledToast(e.cause.message, 'error') + } else if (e instanceof Error) { + styledToast(e.message, 'error') + } console.error(e) setLoading(false) } diff --git a/advanced/wallets/react-wallet-v2/src/hooks/useWalletConnectEventsManager.ts b/advanced/wallets/react-wallet-v2/src/hooks/useWalletConnectEventsManager.ts index af4f6c2be..abdf17b15 100644 --- a/advanced/wallets/react-wallet-v2/src/hooks/useWalletConnectEventsManager.ts +++ b/advanced/wallets/react-wallet-v2/src/hooks/useWalletConnectEventsManager.ts @@ -1,5 +1,4 @@ import { Web3WalletTypes } from '@walletconnect/web3wallet' -import { COSMOS_SIGNING_METHODS } from '@/data/COSMOSData' import { EIP155_SIGNING_METHODS } from '@/data/EIP155Data' import { SOLANA_SIGNING_METHODS } from '@/data/SolanaData' import { POLKADOT_SIGNING_METHODS } from '@/data/PolkadotData' @@ -12,7 +11,6 @@ import { SignClientTypes } from '@walletconnect/types' import { useCallback, useEffect } from 'react' import { NEAR_SIGNING_METHODS } from '@/data/NEARData' import { approveNearRequest } from '@/utils/NearRequestHandlerUtil' -import { TEZOS_SIGNING_METHODS } from '@/data/TezosData' import { KADENA_SIGNING_METHODS } from '@/data/KadenaData' export default function useWalletConnectEventsManager(initialized: boolean) { @@ -60,10 +58,6 @@ export default function useWalletConnectEventsManager(initialized: boolean) { case EIP155_SIGNING_METHODS.ETH_SIGN_TRANSACTION: return ModalStore.open('SessionSendTransactionModal', { requestEvent, requestSession }) - case COSMOS_SIGNING_METHODS.COSMOS_SIGN_DIRECT: - case COSMOS_SIGNING_METHODS.COSMOS_SIGN_AMINO: - return ModalStore.open('SessionSignCosmosModal', { requestEvent, requestSession }) - case SOLANA_SIGNING_METHODS.SOLANA_SIGN_MESSAGE: case SOLANA_SIGNING_METHODS.SOLANA_SIGN_TRANSACTION: return ModalStore.open('SessionSignSolanaModal', { requestEvent, requestSession }) @@ -98,10 +92,6 @@ export default function useWalletConnectEventsManager(initialized: boolean) { case TRON_SIGNING_METHODS.TRON_SIGN_MESSAGE: case TRON_SIGNING_METHODS.TRON_SIGN_TRANSACTION: return ModalStore.open('SessionSignTronModal', { requestEvent, requestSession }) - case TEZOS_SIGNING_METHODS.TEZOS_GET_ACCOUNTS: - case TEZOS_SIGNING_METHODS.TEZOS_SEND: - case TEZOS_SIGNING_METHODS.TEZOS_SIGN: - return ModalStore.open('SessionSignTezosModal', { requestEvent, requestSession }) case KADENA_SIGNING_METHODS.KADENA_GET_ACCOUNTS: case KADENA_SIGNING_METHODS.KADENA_SIGN: case KADENA_SIGNING_METHODS.KADENA_QUICKSIGN: diff --git a/advanced/wallets/react-wallet-v2/src/pages/index.tsx b/advanced/wallets/react-wallet-v2/src/pages/index.tsx index 1794b16a5..8efd0fdf2 100644 --- a/advanced/wallets/react-wallet-v2/src/pages/index.tsx +++ b/advanced/wallets/react-wallet-v2/src/pages/index.tsx @@ -1,14 +1,12 @@ import AccountCard from '@/components/AccountCard' import AccountPicker from '@/components/AccountPicker' import PageHeader from '@/components/PageHeader' -import { COSMOS_MAINNET_CHAINS } from '@/data/COSMOSData' import { EIP155_MAINNET_CHAINS, EIP155_TEST_CHAINS } from '@/data/EIP155Data' import { SOLANA_MAINNET_CHAINS, SOLANA_TEST_CHAINS } from '@/data/SolanaData' import { POLKADOT_MAINNET_CHAINS, POLKADOT_TEST_CHAINS } from '@/data/PolkadotData' import { MULTIVERSX_MAINNET_CHAINS, MULTIVERSX_TEST_CHAINS } from '@/data/MultiversxData' import { TRON_MAINNET_CHAINS, TRON_TEST_CHAINS } from '@/data/TronData' import { NEAR_TEST_CHAINS } from '@/data/NEARData' -import { TEZOS_MAINNET_CHAINS, TEZOS_TEST_CHAINS } from '@/data/TezosData' import { KADENA_MAINNET_CHAINS, KADENA_TEST_CHAINS } from '@/data/KadenaData' import SettingsStore from '@/store/SettingsStore' import { Text } from '@nextui-org/react' @@ -21,13 +19,11 @@ export default function HomePage() { testNets, eip155Address, activeChainId, - cosmosAddress, solanaAddress, polkadotAddress, nearAddress, multiversxAddress, tronAddress, - tezosAddress, kadenaAddress } = useSnapshot(SettingsStore.state) @@ -50,17 +46,6 @@ export default function HomePage() { data-testid={'chain-card-' + caip10.toString()} /> ))} - {Object.entries(COSMOS_MAINNET_CHAINS).map(([caip10, { name, logo, rgb }]) => ( - - ))} {Object.entries(SOLANA_MAINNET_CHAINS).map(([caip10, { name, logo, rgb }]) => ( ))} - {Object.entries(TEZOS_MAINNET_CHAINS).map(([caip10, { name, logo, rgb }]) => ( - - ))} {Object.entries(KADENA_MAINNET_CHAINS).map(([caip10, { name, logo, rgb }]) => ( Testnets - {Object.entries(EIP155_TEST_CHAINS).map(([caip10, { name, logo, rgb, chainId, smartAccountEnabled }]) => { - if (smartAccountEnabled) { + {Object.entries(EIP155_TEST_CHAINS).map( + ([caip10, { name, logo, rgb, chainId, smartAccountEnabled }]) => { + if (smartAccountEnabled) { + return ( + + ) + } + return ( - ) } - - return ( - - ) - })} + )} {Object.entries(SOLANA_TEST_CHAINS).map(([caip10, { name, logo, rgb }]) => ( ))} - {Object.entries(TEZOS_TEST_CHAINS).map(([caip10, { name, logo, rgb }]) => ( - - ))} {Object.entries(KADENA_TEST_CHAINS).map(([caip10, { name, logo, rgb }]) => ( @@ -74,13 +64,6 @@ export default function SettingsPage() { {eip155Wallets[eip155Address].getMnemonic()} - - Cosmos Mnemonic - - - {cosmosWallets[cosmosAddress].getMnemonic()} - - Solana Secret Key @@ -104,13 +87,6 @@ export default function SettingsPage() { {tronWallets[tronAddress].privateKey} - - Tezos Mnemonic - - - {tezosWallets[tezosAddress].getMnemonic()} - - Kadena Secret Key diff --git a/advanced/wallets/react-wallet-v2/src/store/ModalStore.ts b/advanced/wallets/react-wallet-v2/src/store/ModalStore.ts index 2de686acc..530097a89 100644 --- a/advanced/wallets/react-wallet-v2/src/store/ModalStore.ts +++ b/advanced/wallets/react-wallet-v2/src/store/ModalStore.ts @@ -21,13 +21,11 @@ interface State { | 'SessionSignTypedDataModal' | 'SessionSendTransactionModal' | 'SessionUnsuportedMethodModal' - | 'SessionSignCosmosModal' | 'SessionSignSolanaModal' | 'SessionSignPolkadotModal' | 'SessionSignNearModal' | 'SessionSignMultiversxModal' | 'SessionSignTronModal' - | 'SessionSignTezosModal' | 'SessionSignKadenaModal' | 'AuthRequestModal' | 'LoadingModal' diff --git a/advanced/wallets/react-wallet-v2/src/store/SettingsStore.ts b/advanced/wallets/react-wallet-v2/src/store/SettingsStore.ts index 56edf6ad2..9695d590b 100644 --- a/advanced/wallets/react-wallet-v2/src/store/SettingsStore.ts +++ b/advanced/wallets/react-wallet-v2/src/store/SettingsStore.ts @@ -8,13 +8,11 @@ interface State { testNets: boolean account: number eip155Address: string - cosmosAddress: string solanaAddress: string polkadotAddress: string nearAddress: string multiversxAddress: string tronAddress: string - tezosAddress: string kadenaAddress: string relayerRegionURL: string activeChainId: string @@ -30,13 +28,11 @@ const state = proxy({ account: 0, activeChainId: '1', eip155Address: '', - cosmosAddress: '', solanaAddress: '', polkadotAddress: '', nearAddress: '', multiversxAddress: '', tronAddress: '', - tezosAddress: '', kadenaAddress: '', relayerRegionURL: '', sessions: [] @@ -56,10 +52,6 @@ const SettingsStore = { state.eip155Address = eip155Address }, - setCosmosAddress(cosmosAddresses: string) { - state.cosmosAddress = cosmosAddresses - }, - setSolanaAddress(solanaAddress: string) { state.solanaAddress = solanaAddress }, @@ -85,10 +77,6 @@ const SettingsStore = { state.tronAddress = tronAddress }, - setTezosAddress(tezosAddress: string) { - state.tezosAddress = tezosAddress - }, - setActiveChainId(value: string) { state.activeChainId = value }, diff --git a/advanced/wallets/react-wallet-v2/src/utils/HelperUtil.ts b/advanced/wallets/react-wallet-v2/src/utils/HelperUtil.ts index 79b50706b..dfc246d05 100644 --- a/advanced/wallets/react-wallet-v2/src/utils/HelperUtil.ts +++ b/advanced/wallets/react-wallet-v2/src/utils/HelperUtil.ts @@ -1,11 +1,9 @@ import toast from 'react-hot-toast' -import { COSMOS_MAINNET_CHAINS, TCosmosChain } from '@/data/COSMOSData' import { EIP155_CHAINS, TEIP155Chain } from '@/data/EIP155Data' import { MULTIVERSX_CHAINS, TMultiversxChain } from '@/data/MultiversxData' import { NEAR_CHAINS, NEAR_TEST_CHAINS, TNearChain } from '@/data/NEARData' import { POLKADOT_CHAINS, TPolkadotChain } from '@/data/PolkadotData' import { SOLANA_CHAINS, TSolanaChain } from '@/data/SolanaData' -import { TEZOS_CHAINS, TTezosChain } from '@/data/TezosData' import { TRON_CHAINS, TTronChain } from '@/data/TronData' import { KADENA_CHAINS, TKadenaChain } from '@/data/KadenaData' @@ -89,13 +87,6 @@ export function isEIP155Chain(chain: string) { return chain.includes('eip155') } -/** - * Check if chain is part of COSMOS standard - */ -export function isCosmosChain(chain: string) { - return chain.includes('cosmos') -} - /** * Check if chain is part of SOLANA standard */ @@ -138,26 +129,17 @@ export function isTronChain(chain: string) { return chain.includes('tron') } -/** - * Check if chain is part of Tezos standard - */ -export function isTezosChain(chain: string) { - return chain.includes('tezos') -} - /** * Formats chainId to its name */ export function formatChainName(chainId: string) { return ( - COSMOS_MAINNET_CHAINS[chainId as TCosmosChain]?.name ?? EIP155_CHAINS[chainId as TEIP155Chain]?.name ?? MULTIVERSX_CHAINS[chainId as TMultiversxChain]?.name ?? NEAR_TEST_CHAINS[chainId as TNearChain]?.name ?? POLKADOT_CHAINS[chainId as TPolkadotChain]?.name ?? SOLANA_CHAINS[chainId as TSolanaChain]?.name ?? TRON_CHAINS[chainId as TTronChain]?.name ?? - TEZOS_CHAINS[chainId as TTezosChain]?.name ?? KADENA_CHAINS[chainId as TKadenaChain]?.name ?? chainId ) diff --git a/advanced/wallets/react-wallet-v2/src/views/SessionProposalModal.tsx b/advanced/wallets/react-wallet-v2/src/views/SessionProposalModal.tsx index 472763f59..e2c212091 100644 --- a/advanced/wallets/react-wallet-v2/src/views/SessionProposalModal.tsx +++ b/advanced/wallets/react-wallet-v2/src/views/SessionProposalModal.tsx @@ -19,13 +19,11 @@ import { kadenaAddresses } from '@/utils/KadenaWalletUtil' import { styledToast } from '@/utils/HelperUtil' import { web3wallet } from '@/utils/WalletConnectUtil' import { EIP155_CHAINS, EIP155_SIGNING_METHODS } from '@/data/EIP155Data' -import { COSMOS_MAINNET_CHAINS, COSMOS_SIGNING_METHODS } from '@/data/COSMOSData' import { KADENA_CHAINS, KADENA_SIGNING_METHODS } from '@/data/KadenaData' import { MULTIVERSX_CHAINS, MULTIVERSX_SIGNING_METHODS } from '@/data/MultiversxData' import { NEAR_CHAINS, NEAR_SIGNING_METHODS } from '@/data/NEARData' import { POLKADOT_CHAINS, POLKADOT_SIGNING_METHODS } from '@/data/PolkadotData' import { SOLANA_CHAINS, SOLANA_SIGNING_METHODS } from '@/data/SolanaData' -import { TEZOS_CHAINS, TEZOS_SIGNING_METHODS } from '@/data/TezosData' import { TRON_CHAINS, TRON_SIGNING_METHODS } from '@/data/TronData' import ChainDataMini from '@/components/ChainDataMini' import ChainAddressMini from '@/components/ChainAddressMini' @@ -54,9 +52,6 @@ export default function SessionProposalModal() { // eip155 const eip155Chains = Object.keys(EIP155_CHAINS) const eip155Methods = Object.values(EIP155_SIGNING_METHODS) - // cosmos - const cosmosChains = Object.keys(COSMOS_MAINNET_CHAINS) - const cosmosMethods = Object.values(COSMOS_SIGNING_METHODS) // Kadena const kadenaChains = Object.keys(KADENA_CHAINS) @@ -78,10 +73,6 @@ export default function SessionProposalModal() { const solanaChains = Object.keys(SOLANA_CHAINS) const solanaMethods = Object.values(SOLANA_SIGNING_METHODS) - // tezos - const tezosChains = Object.keys(TEZOS_CHAINS) - const tezosMethods = Object.values(TEZOS_SIGNING_METHODS) - // tron const tronChains = Object.keys(TRON_CHAINS) const tronMethods = Object.values(TRON_SIGNING_METHODS)