createAccount

1function createAccount<TAccount>(params, config): Promise<SupportedAccounts>;

Defined in: account-kit/core/src/actions/createAccount.ts:78

Creates an account of a specified type using the provided parameters and configuration. Supports creating LightAccount and MultiOwnerModularAccount types.

Example

1import { createAccount } from "@account-kit/core";
2// see createConfig for more information on how to create a config
3import { config } from "./config";
4
5const account = createAccount(
6 {
7 type: "LightAccount",
8 },
9 config,
10);

Type Parameters

Type Parameter

TAccount extends SupportedAccountTypes

Parameters

ParameterTypeDescription

params

CreateAccountParams<TAccount>

The parameters required to create the account, including the type and account parameters

config

AlchemyAccountsConfig

The configuration object for Alchemy accounts

Returns

Promise<SupportedAccounts>

A promise that resolves to the created account object