import { Chain, Hex, SignAuthorizationReturnType } from "viem"; import { PrivateKeyAccount } from "viem/accounts"; import { ModularSigner } from "@zerodev/permissions"; import { BundlerManager } from "../services/bundler"; import { ModuleType } from "./kernel-modules"; import { SessionKeyPermissionRule } from "./session-keys"; export type KernelVersion = '0.3.3'; export type EntryPointVersion = '0.6' | '0.7'; export interface Call { to: Hex; value?: bigint; data?: Hex; } export interface BatchTransactionConfig { kernelAccount: KernelAccountInstance; bundlerManager: BundlerManager; authorization?: SignAuthorizationReturnType; calls: Call[]; } export interface SingleTransactionConfig { kernelAccount: KernelAccountInstance; bundlerManager: BundlerManager; authorization?: SignAuthorizationReturnType; to: Hex; value?: bigint; data?: Hex; } export interface KernelAccountConfig { chain: Chain; owner: PrivateKeyAccount; entryPointVersion?: EntryPointVersion; kernelVersion?: KernelVersion; aaConfig?: AA_SupportConfig; } export interface KernelAccountInstance { account: any; address: string; owner: PrivateKeyAccount; chain: Chain; entryPoint: { address: Hex; version: EntryPointVersion; }; } export interface AA_SupportConfig { enabled: boolean; entryPoints: { address: string; version: EntryPointVersion; }[]; bundlerUrl: string; paymasterUrl: string; kernelImplementations: { address: string; version: number; }[]; } export interface SmartWalletOptions { aaConfig?: AA_SupportConfig; bundlerUrl?: string; paymasterUrl?: string; entryPointVersion?: EntryPointVersion; autoInitialize?: boolean; } export interface SmartWalletTransactionResult { success: boolean; userOpHash: Hex; transactionHash?: string; error?: string; } export interface GasEstimate { callGasLimit: bigint; verificationGasLimit: bigint; preVerificationGas: bigint; total: bigint; } export interface SessionKeyApprovalOptions { sessionKeyAddress: Hex; sessionKeyPrivateKey: Hex; permissions?: SessionKeyPermissionRule[]; useSudoPolicy?: boolean; } export interface SessionKeyUsageOptions { approval: string; sessionKeySigner: ModularSigner; } export interface ModuleInstallOptions { moduleType: ModuleType; moduleAddress: Hex; initData?: Hex; } export interface ModuleUninstallOptions { moduleType: ModuleType; moduleAddress: Hex; deInitData?: Hex; } export interface MultiSigConfig { owners: Hex[]; threshold: number; } export interface RecoveryConfig { guardians: Hex[]; recoveryDelay?: number; } export interface PaymasterConfig { paymasterUrl: string; context?: any; } export interface SmartAccountInfo { address: Hex; ownerAddress: Hex; chain: Chain; entryPointVersion: EntryPointVersion; isDelegated: boolean; balance: bigint; } export declare class SmartWalletError extends Error { code: string; constructor(message: string, code?: string); } export declare class SessionKeyError extends SmartWalletError { constructor(message: string); } export declare class ModuleError extends SmartWalletError { constructor(message: string); } export declare class TransactionError extends SmartWalletError { constructor(message: string); }