Replies: 1 comment
-
Creating ethers Signer from Wallet Client: import { createWalletClient, custom } from 'viem'
import { mainnet } from 'viem/chains'
import { providers } from 'ethers'
const account = '0x0000000000000000000000000000000000000000'
const client = createWalletClient({
account,
chain: mainnet,
transport: custom(window.ethereum)
})
// ethers.js
const provider = new providers.Web3Provider(window.ethereum, client.chain)
const signer = provider.getSigner(client.account.address) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a frontend with wagmi/viem, and an sdk with hardhat typechain (target:ethers-v5) generated types. Is there an easy way to create an ethers provider/signer from a viem client/wallet? Can somebody provide me a snippet?
Beta Was this translation helpful? Give feedback.
All reactions