createSmartAccountClientFromExisting

Creates a smart account client using an existing client and specific configuration. This function can be used to reuse a pre-existing BundlerClient while customizing other aspects of the smart account.

Import

1import { createSmartAccountClientFromExisting } from "@aa-sdk/core";

Usage

1import {
2createBundlerClient,
3createSmartAccountClientFromExisting,
4toSmartContractAccount
5} from "@aa-sdk/core";
6
7const bundlerClient = createBundlerClient(...);
8const client = createSmartAccountClientFromExisting({
9client,
10account: toSmartContractAccount(...),
11})

Parameters

config

Omit<SmartAccountClientConfig, "transport" | "chain"> & {client: BundlerClient} the configuration object which includes the client

Returns

SmartAccountClient A smart account client created from the existing BundlerClient