import React from 'react' import ReactDOM from 'react-dom' import { DAppProvider, useSendTransaction, useEthers, Config, Goerli, Kovan, Rinkeby, Ropsten } from '@usedapp/core' import { getDefaultProvider } from 'ethers' import { MetamaskConnect } from './components/MetamaskConnect' const config: Config = { readOnlyChainId: Goerli.chainId, readOnlyUrls: { [Goerli.chainId]: getDefaultProvider('goerli'), [Kovan.chainId]: getDefaultProvider('kovan'), [Rinkeby.chainId]: getDefaultProvider('rinkeby'), [Ropsten.chainId]: getDefaultProvider('ropsten'), }, gasLimitBufferPercentage: 10, // The percentage by which the transaction may exceed the estimated gas limit. } ReactDOM.render( , document.getElementById('root') ) export function App() { const { chainId, account } = useEthers() const { sendTransaction, state } = useSendTransaction() if (!config.readOnlyUrls[chainId]) { return

Please use either Goerli, Kovan, Rinkeby or Ropsten testnet.

} const status = state.status const address = '0xe13610d0a3e4303c70791773C5DF8Bb16de185d1' const send = () => { void sendTransaction({ to: address, value: 1 }) } const WalletContent = () => (

Status: {status}

) return (
{account && }
) }