Skip to content

Extending Client with ERC-7715

Setting up your Viem Client

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

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