• Retrieves the account ID for a given smart account.

    Type Parameters

    • TSmartAccount extends undefined | object & Assign_<SmartAccountImplementation<Abi, EntryPointVersion, object>, {
          address: `0x${string}`;
          getNonce: ((parameters?) => Promise<bigint>);
          isDeployed: (() => Promise<boolean>);
          type: "smart";
      }> & {
          address: `0x${string}`;
          getNonce: ((parameters?) => Promise<bigint>);
          isDeployed: (() => Promise<boolean>);
          type: "smart";
      }

    Parameters

    • client: Client<Transport, undefined | Chain, TSmartAccount>

      The client instance.

    • Optional args: GetSmartAccountParameter<TSmartAccount>

      Optional parameters for getting the smart account.

    Returns Promise<string>

    The account ID as a string.

    Throws

    If the account is not found.

    Throws

    If the accountId result is empty.

    Example

    import { accountId } from '@biconomy/abstractjs'

    const id = await accountId(nexusClient)
    console.log(id) // 'example_account_id'