diff --git a/src/components/EvmChainSelect.tsx b/src/components/EvmChainSelect.tsx index 2c78e76..b8baead 100644 --- a/src/components/EvmChainSelect.tsx +++ b/src/components/EvmChainSelect.tsx @@ -1,14 +1,5 @@ import React, { useEffect, useState } from "react"; -import { - Button, - Menu, - MenuButton, - MenuList, - MenuItem, - MenuGroup, - MenuDivider, -} from "@chakra-ui/react"; -import { ChevronDownIcon } from "@chakra-ui/icons"; +import { Select } from "@chakra-ui/react"; import { ReactJSXElement } from "@emotion/react/types/jsx-namespace"; import { supportedChains, bloctoSDK, useEthereum } from "../services/evm"; @@ -21,70 +12,31 @@ const supportedTestnetChains = supportedChains.filter( const EvmChainSelect: React.FC = ({}): ReactJSXElement => { const { chainId: currentChainId } = useEthereum(); - const [chainName, setChainName] = useState( - supportedChains.find(({ chainId }) => chainId === currentChainId)?.name || - "Ethereum Goerli" - ); - useEffect(() => { - const chainName = supportedChains.find( - ({ chainId }) => chainId === currentChainId - )?.name; - if (chainName) { - setChainName(chainName); - } - }, [currentChainId]); return ( -
+ ); }; diff --git a/src/components/EvmEditors/EvmTxForm.tsx b/src/components/EvmEditors/EvmTxForm.tsx index 9260169..5ae0cf3 100644 --- a/src/components/EvmEditors/EvmTxForm.tsx +++ b/src/components/EvmEditors/EvmTxForm.tsx @@ -34,7 +34,11 @@ const EvmTxForm = ({ sendObj.to = toString; } if (valueString) { - sendObj.value = web3.utils.toHex(valueString); + try { + sendObj.value = web3.utils.toHex(valueString); + } catch (e) { + setValue(""); + } } if (dataString) { sendObj.data = dataString;