Skip to content

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

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

Usage

import {
createBundlerClient,
createSmartAccountClientFromExisting,
toSmartContractAccount
} from "@aa-sdk/core";
 
const bundlerClient = createBundlerClient(...);
const client = createSmartAccountClientFromExisting({
client,
account: toSmartContractAccount(...),
})

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