import { type PublicClient, type WalletClient, type Chain, type Transport, type Account } from 'viem'; import { type SmartAccount, type BundlerClient } from 'viem/account-abstraction'; import { type SmartAccountClient as PermissionlessSmartAccountClient } from 'permissionless'; import { type PaymasterPolicy } from './paymaster.js'; /** SmartAccountClient type with concrete SmartAccount (not `SmartAccount | undefined`). * This ensures sendTransaction() doesn't require explicit `account` parameter. */ export type AzethSmartAccountClient = PermissionlessSmartAccountClient; export interface SmartAccountClientConfig { publicClient: PublicClient; walletClient: WalletClient; smartAccountAddress: `0x${string}`; bundlerUrl?: string; paymasterUrl?: string; /** Client-side sponsorship policy for paymaster gas sponsorship. * Only applies when paymasterUrl is configured. */ paymasterPolicy?: PaymasterPolicy; /** Optional guardian co-signing key. When set, every UserOperation gets a * 130-byte dual signature (owner 65 bytes + guardian 65 bytes), enabling * operations that exceed standard spending limits. */ guardianKey?: `0x${string}`; /** Self-guardian fast path: when the account's on-chain guardian IS the owner EOA, * the owner signature doubles as the guardian signature (same key, same userOpHash * → byte-identical 65-byte ECDSA sig). Setting this appends a copy of the owner * signature to produce the 130-byte dual layout GuardianModule expects for * guardian-tier operations (batch executions, guardrail changes, stale-oracle * transfers) — without any separate guardian key. Adds no security and removes * none: the caller already holds the only key the guardian check verifies. * Ignored when guardianKey is set. */ selfGuardianCosign?: boolean; /** Azeth server URL. Used as bundler fallback on testnet — the server * proxies bundler requests using its own PIMLICO_API_KEY so developers * don't need their own key for getting started. */ serverUrl?: string; } /** * Create a viem SmartAccount implementation for an existing deployed AzethAccount. * * This wraps a deployed AzethAccount v12 smart account as a viem SmartAccount * that can be used with permissionless's createSmartAccountClient to submit * UserOperations through ERC-4337 EntryPoint v0.7. * * The signing flow matches GuardianModule expectations: * - Computes getUserOperationHash (ERC-4337 standard) * - Signs with walletClient.signMessage({ message: { raw: hash } }) * - This produces sign(keccak256("\x19Ethereum Signed Message:\n32" + userOpHash)) * - GuardianModule._splitSignature expects ECDSA owner sig as first 65 bytes */ export declare function createAzethSmartAccount(publicClient: PublicClient, walletClient: WalletClient, smartAccountAddress: `0x${string}`, guardianKey?: `0x${string}`, estimateBundlerClient?: BundlerClient, selfGuardianCosign?: boolean): Promise; /** Apply the verification-gas safety buffer to a bundler estimate. * See {@link VERIFICATION_GAS_BUFFER_NUMERATOR} for why this is needed. */ export declare function applyVerificationGasBuffer(verificationGasLimit: bigint): bigint; /** * Create a permissionless SmartAccountClient for an AzethAccount. * * The SmartAccountClient handles the full ERC-4337 flow: * 1. Encodes calls via account.encodeCalls() * 2. Gets nonce from EntryPoint * 3. Estimates gas via bundler * 4. Signs UserOp via account.signUserOperation() * 5. Submits to bundler via eth_sendUserOperation * 6. Waits for receipt and returns transaction hash * * @param config - Configuration with clients, smart account address, and bundler URL * @returns A SmartAccountClient that can be used for sendTransaction/writeContract */ export declare function createAzethSmartAccountClient(config: SmartAccountClientConfig): Promise; //# sourceMappingURL=userop.d.ts.map