import "@ethersproject/shims"; import { BigNumber, BigNumberish } from 'ethers'; import { SimpleWallet, SimpleWalletDeployer } from '@account-abstraction/contracts'; import { Signer } from '@ethersproject/abstract-signer'; import { BaseApiParams, BaseWalletAPI } from './BaseWalletAPI'; /** * constructor params, added no top of base params: * @param owner the signer object for the wallet owner * @param factoryAddress address of contract "factory" to deploy new contracts (not needed if wallet already deployed) * @param index nonce value used when creating multiple wallets for the same owner */ export interface SimpleWalletApiParams extends BaseApiParams { owner: Signer; factoryAddress?: string; index?: number; } /** * An implementation of the BaseWalletAPI using the SimpleWallet contract. * - contract deployer gets "entrypoint", "owner" addresses and "index" nonce * - owner signs requests using normal "Ethereum Signed Message" (ether's signer.signMessage()) * - nonce method is "nonce()" * - execute method is "execFromEntryPoint()" */ export declare class SimpleWalletAPI extends BaseWalletAPI { factoryAddress?: string; owner: Signer; index: number; /** * our wallet contract. * should support the "execFromEntryPoint" and "nonce" methods */ walletContract?: SimpleWallet; factory?: SimpleWalletDeployer; constructor(params: SimpleWalletApiParams); _getWalletContract(): Promise; /** * return the value to put into the "initCode" field, if the wallet is not yet deployed. * this value holds the "factory" address, followed by this wallet's information */ getWalletInitCode(): Promise; getNonce(): Promise; /** * encode a method call from entryPoint to our contract * @param target * @param value * @param data */ encodeExecute(target: string, value: BigNumberish, data: string): Promise; signRequestId(requestId: string): Promise; /** * calculate the wallet address even before it is deployed. * We know our factory: it just calls CREATE2 to construct the wallet. * NOTE: getWalletAddress works with any contract/factory (but only before creation) * This method is tied to SimpleWallet implementation */ getCreate2Address(): Promise; }