Skip to content

Client

Setting up your Viem Client

To use the experimental functionality of Viem, you must extend your existing (or new) Viem Client with experimental Actions.

Extensions

walletActionsEip5792

A suite of EIP-5792 Wallet Actions for suited for development with wallet's that support batch transactions.

import { createPublicClient, createWalletClient, http } from 'viem'
import { mainnet } from 'viem/chains'
import { walletActionsEip5792 } from 'viem/experimental'
 
const walletClient = createWalletClient({
  chain: mainnet,
  transport: custom(window.ethereum!),
}).extend(walletActionsEip5792()) 
 
const id = await walletClient.sendCalls({/* ... */})