833 B
833 B
Extending Client with ERC-7895 Actions [Setting up your Viem Client]
To use the experimental functionality of ERC-7895, you can extend your existing (or new) Viem Client with experimental ERC-7895 Actions.
import { createClient, http } from 'viem'
import { mainnet } from 'viem/chains'
import { erc7895Actions } from 'viem/experimental' // [!code focus]
const client = createClient({
chain: mainnet,
transport: http(),
}).extend(erc7895Actions()) // [!code focus]
const subAccount = await client.addSubAccount({
keys: [{ key: '0x0000000000000000000000000000000000000000', type: 'address' }],
type: 'create',
})