getSmartAccountClient
Obtains a smart account client based on the provided parameters and configuration. Supports creating any of the SupportAccountTypes in Account Kit. If the signer is not connected, or an account is already being intializes, this results in a loading state.
Import
import { getSmartAccountClient } from "@account-kit/core";
Usage
import { getSmartAccountClient } from "@account-kit/core";
// see createConfig for more information on how to create a config
import { config } from "./config";
const { client, address, isLoadingClient } = getSmartAccountClient(
{
type: "LightAccount",
},
config
);
Parameters
params
GetSmartAccountClientParams
Parameters for getting the smart account client, including account parameters and client parameters
config
AlchemyAccountsConfig
The configuration containing the client store and other necessary information
Returns
GetSmartAccountClientResult
The result object which includes the client, address, and loading status of the client