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 thewallets array and switch it to your desired network, using the wallet’s switchChain method:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Get an ethers.js provider and signer from a Privy connected wallet for Ethereum interactions
wallets array and switch it to your desired network, using the wallet’s switchChain method:
const privyProvider = await wallet.getEthereumProvider();
const provider = new ethers.providers.Web3Provider(privyProvider);
const provider = await wallet.getEthereumProvider();
const ethersProvider = new ethers.BrowserProvider(provider);
const signer = ethersProvider.getSigner();
Was this page helpful?
