@dynamic-labs/viem-extension
v3.9.5
Published
This extension allows clients to create viem public and wallet clients for evm wallets connected through dynamic.
Downloads
3,093
Readme
viem-extension
This extension allows clients to create viem public and wallet clients for evm wallets connected through dynamic.
Installation
npm install @dynamic-labs/viem-extension
Usage
import { ViemExtension } from '@dynamic-labs/viem-extension'
import { createClient } from '@dynamic-labs/client'
import { optimism, mainnet } from 'viem/chains'
const dynamicClient = createClient({...}).extend(ViemExtension())
const viemPublicClient = dynamicClient.viem.createPublicClient({
chain: mainnet,
})
const viemWalletClient = dynamicClient.viem.createWalletClient({
wallet: dynamicClient.wallets.primary,
chain: optimism,
})
const signedMessage = await viemWalletClient.signMessage({ message: 'hello' })