AccountFactory
Interact with ERC-4337 account factory contracts
Exposes useful functions available on the account factory contract.
const contract = await sdk.getContract("{{contract_address}}");await contract.accountFactory.predictAccountAddress(walletAddress);
class AccountFactory implements DetectableFeature {}
function constructor( contractWrapper: ContractWrapper<IAccountFactory>,
Get all accounts on which the given signer has authority
const allAccounts = await contract.accountFactory.getAssociatedAccounts(admin);
function getAssociatedAccounts( signer: string,): Promise<Array<string>>;
Check if a account has been deployed for the given admin
function isAccountDeployed( admin: string, extraData?: BytesLike,): Promise<boolean>;
Get the deterministic address of the account that will be created
const accountAddress = await contract.accountFactory.predictAccountAddress(admin);
function predictAccountAddress( admin: string, extraData?: BytesLike,): Promise<string>;
function createAccount( accountAdmin: string, extraData: BytesLike,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling createAccount.prepare()
with same arguments. Learn more
let featureName: "AccountFactory";