/** * Wallet Factory — CREATE2 smart wallet derivation for Nexus/ERC-4337 * * Pattern from: cross-chain-atomic-routing/scripts/base-volume-loop-gasless-v2.ts:370 * * Each worker gets a unique smart wallet derived from its private key: * ownerEOA → salt → CREATE2 address (deterministic, counterfactual) */ import { ethers } from 'ethers'; export interface WalletParams { ownerEOA: string; smartWalletAddress: string; salt: string; saltBytes32: string; initData: string; } /** * Derive worker wallet parameters from a private key. * * The smart wallet address is computed locally using CREATE2. * The wallet is counterfactual — it doesn't need to be deployed yet. * It gets deployed on the first UserOp via initCode. * * @param privateKey - Worker's EOA private key * @returns Wallet parameters including computed smart wallet address */ export declare function deriveWorkerWalletParams(privateKey: string): WalletParams; /** * Resolve the real smart wallet address using the factory's computeAccountAddress view. * This is the authoritative address the EntryPoint will use. */ export declare function resolveSmartWalletAddress(walletParams: WalletParams, provider: ethers.Provider): Promise; /** * Build initCode for a UserOp that deploys the wallet. * * @param walletParams - From deriveWorkerWalletParams. Pass null if wallet is already deployed. * @returns InitCode (factory address + createAccount calldata), or '0x' if already deployed */ export declare function buildInitCode(walletParams: WalletParams | null): string; /** * Compute the smart wallet address using an RPC call to the factory. * Use this to verify the locally-computed address matches on-chain. */ export declare function computeSmartWalletAddressOnChain(walletParams: WalletParams, provider: ethers.Provider): Promise; /** * Check if a smart wallet is already deployed. */ export declare function isWalletDeployed(address: string, provider: ethers.Provider): Promise;