getAccountAddress

1function getAccountAddress(params): Promise<`0x${string}`>;

Defined in: aa-sdk/core/src/account/smartContractAccount.ts:229

Retrieves the account address. Uses a provided accountAddress if available; otherwise, it computes the address using the entry point contract and the initial code.

Example

1import { getEntryPoint, getAccountAddress } from "@aa-sdk/core";
2
3const accountAddress = await getAccountAddress({
4 client,
5 entryPoint: getEntryPoint(chain),
6 getAccountInitCode: async () => "0x{factoryAddress}{factoryCallData}",
7});

Parameters

ParameterTypeDescription

params

GetAccountAddressParams

The configuration object

Returns

Promise<`0x${string}`>

A promise that resolves to the account address