Skip to content

Extending Client with ERC-7739 Actions

Setting up your Viem Client

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

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