getAccount

Retrieves the account of the specified type from the client store based on the provided configuration.

Import

1import { getAccount } from "@account-kit/core";

Usage

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

Parameters

params

GetAccountParams<TAccount> The parameters containing the type of the account to retrieve

config

AlchemyAccountsConfig The configuration containing the client store

Returns

GetAccountResult<TAccount> The result which includes the account if found and its status