getBundlerClient

Retrieves the BundlerClient instance from the provider.

Import

1import { AccountSigner } from "@aa-sdk/ethers";

Usage

1import { AccountSigner, EthersProviderAdapter } from "@aa-sdk/ethers";
2import { LocalAccountSigner } from "@aa-sdk/core";
3import { sepolia } from "@account-kit/infra";
4import { createLightAccount } from "@account-kit/smart-contracts";
5import { http } from "viem";
6
7const account = await createLightAccount({
8 transport: http("https://rpc.testnet.aepps.com"),
9 chain: sepolia,
10 signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey()),
11});
12
13const provider = new EthersProviderAdapter();
14const signer = new AccountSigner(provider, account);
15
16const bundler = signer.getBundlerClient();

Returns

BundlerClient<Transport> The BundlerClient instance