getBundlerClient
getBundlerClient
is a method on AccountSigner
that gets the underlying viem client which has EIP-4337 capability.
Usage
ts
import { accountSigner } from "./ethers-signer";
// get the account signer's underlying viem client with EIP-4337 capabilities
const client = accountSigner.getBundlerClient();
ts
import { createLightAccount } from "@alchemy/aa-accounts";
import {
LocalAccountSigner,
SmartAccountSigner,
polygonMumbai,
} from "@alchemy/aa-core";
import { http } from "viem";
import { provider } from "./ethers-provider.js";
const eoaSigner: SmartAccountSigner =
LocalAccountSigner.mnemonicToAccountSigner(process.env.YOUR_OWNER_MNEMONIC!);
const chain = polygonMumbai;
// 2. Connect the provider to the smart account signer
export const accountSigner = provider.connectToAccount(
await createLightAccount({
chain,
transport: http("RPC_URL"),
signer: eoaSigner,
})
);
Returns
BundlerClient
The provider's underlying BundlerClient