Alchemy Logo

getAccountAddress

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

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

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

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

ParameterTypeDescription

params

GetAccountAddressParams

The configuration object

Promise<`0x${string}`>

A promise that resolves to the account address

Was this page helpful?