Usage With Viem
If you're using Viem (opens in a new tab), this is how you initialize WalletClient
(opens in a new tab) with the embedded wallet's EIP-1193 (opens in a new tab) provider:
import { createWallet } from '@passkeys/core';
import { createWalletClient, custom } from 'viem';
import { mainnet } from 'viem/chains';
const wallet = createWallet({
providers: {
ethereum: true,
},
});
const client = createWalletClient({
chain: mainnet,
transport: custom(wallet.providers.ethereum!),
});