getAccount

1function getAccount<TAccount>(params, config): GetAccountResult<TAccount>;

Defined in: account-kit/core/src/actions/getAccount.ts:34

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

Example

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);

Type Parameters

Type Parameter

TAccount extends SupportedAccountTypes

Parameters

ParameterTypeDescription

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