yarn add @web3-onboard/core @web3-onboard/injected
npm i @web3-onboard/core @web3-onboard/injected
import Onboard from '@web3-onboard/core'
import injectedModule from '@web3-onboard/injected-wallets'
import { ethers } from 'ethers'

const MAINNET_RPC_URL = 'https://mainnet.infura.io/v3/<INFURA_KEY>'

const injected = injectedModule()

const onboard = Onboard({
  wallets: [injected],
  chains: [
      id: '0x1',
      token: 'ETH',
      label: 'Ethereum Mainnet',
      rpcUrl: MAINNET_RPC_URL
      id: '0x2105',
      token: 'ETH',
      label: 'Base',
      rpcUrl: 'https://mainnet.base.org'

const wallets = await onboard.connectWallet()


if (wallets[0]) {
  // create an ethers provider with the last connected wallet provider
  const ethersProvider = new
ethers.providers.Web3Provider(wallets[0].provider, 'any')
  // if using ethers v6 this is:
  // ethersProvider = new ethers.BrowserProvider(wallet.provider, 'any')

  const signer = ethersProvider.getSigner()

  // send a transaction with the ethers provider
  const txn = await signer.sendTransaction({
    to: '0x',
    value: 100000000000000

  const receipt = await txn.wait()
npm i @web3-onboard/core @web3-onboard/injected-wallets
npm audit fix --force
accountCenter: {
      desktop: {
        enabled: true,
        position: 'topRight'
      mobile: {
        enabled: true,
        position: 'topRight'
Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org
To unsubscribe send an email to wikitech-l-le...@lists.wikimedia.org

Reply via email to