in Previous "Web3Modal" from "web3modal", can able to access, new Web3Modal().connect(). but in {Web3Modal} from "@web3modal/react", can't able to do. So, can't able to get a Provider.

I try to find a solution with implementation of a Manual button call for Connecting the wallet via web3modal and get a provider and signer provider using ethers.js and @web3modal/react

1

There are 1 best solutions below

0
On

To do this, i use not only web3modal/ethereum, but wagmi and viem:

import { EthereumClient, w3mConnectors, w3mProvider} from "@web3modal/ethereum";
import {configureChains, createConfig} from "@wagmi/core";
import {Web3Modal} from "@web3modal/html";
import {type HttpTransport} from 'viem'

in order to use a compatible provider and signer with web3modal, i will recommend you to implement this: Wagmi/ethers adapter.

I hope this will help you.