Skip to content

useAccount

Hook to subscribe to account state and interactions, including creation, connection, and status monitoring. It synchronizes with external store updates and provides status-dependent results. The supported account types are: LightAccount, MultiOwnerLightAccount, and MultiOwnerModularAccount.

Import

import { useAccount } from "@account-kit/react";

Usage

import { useAccount } from "@account-kit/react";
 
const { account, address, isLoadingAccount } = useAccount({
  type: "LightAccount",
});

Parameters

params

UseAccountProps<TAccount> The parameters required for account management, including account type, specific account parameters, and optional mutation arguments

Returns

UseAccountResult<TAccount> An object containing the account information, address, and loading state