If you are using yarn instead of npm, even if you want to use Ethers, you will need to install viem manually:
@dynamic-labs/ethers-v6
directly in the component where you are using them.
yarn i viem
@dynamic-labs/ethers-v6
directly in the component where you are using them.
npm i @dynamic-labs/ethers-v6
import { useDynamicContext } from '@dynamic-labs/sdk-react-core'
import { getWeb3Provider,getSigner, } from '@dynamic-labs/ethers-v6'
const { primaryWallet } = useDynamicContext()
const provider = await getWeb3Provider(primaryWallet)
const signer = await getSigner(primaryWallet)
// do your thing
Was this page helpful?