Skip to content

Extending Client with EIP-5792

Setting up your Viem Client

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

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