Get an ethers.js provider and signer from a Privy connected wallet for Ethereum interactions
Ethers
Privy is fully compatible with ethers.js. To get an ethers provider for a user’s connected wallet, first find your desired wallet from the wallets array and switch it to your desired network, using the wallet’s switchChain method:
Ethers v5
const privyProvider = await wallet.getEthereumProvider();const provider = new ethers.providers.Web3Provider(privyProvider);