import { type WalletMetadata, type WalletAddresses } from "../utils/index.js"; import { type Network } from "../config/networks.js"; import type { Account } from "../transactions/builder.js"; /** * Base result for wallet operations that return addresses */ interface WalletResult extends WalletAddresses { walletId: string; } /** * Result from creating a new wallet (includes mnemonic shown once) */ export interface WalletCreateResult extends WalletResult { mnemonic: string; } /** * Result from importing a wallet */ export type WalletImportResult = WalletResult; /** * Wallet manager singleton - handles wallet creation, encryption, and session management */ declare class WalletManager { private static instance; private session; private lockTimer; private initialized; private constructor(); /** * Get singleton instance */ static getInstance(): WalletManager; /** * Ensure storage is initialized */ private ensureInitialized; /** * Store a wallet from mnemonic (shared logic for create/import) */ private storeWallet; /** * Create a new wallet with BIP39 mnemonic */ createWallet(name: string, password: string, network?: Network): Promise; /** * Import an existing wallet from mnemonic */ importWallet(name: string, mnemonic: string, password: string, network?: Network): Promise; /** * Unlock a wallet for use */ unlock(walletId: string, password: string): Promise; /** * Lock the wallet (clear session) */ lock(): Promise; /** * Get the active account if unlocked */ getActiveAccount(): Account | null; /** * Check if a wallet is unlocked */ isUnlocked(): boolean; /** * Get session info (without sensitive data) */ getSessionInfo(): (WalletAddresses & { walletId: string; expiresAt: Date | null; }) | null; /** * Get the full account (with private keys for signing) * WARNING: Returns sensitive data. Only use for transaction signing. */ getAccount(): Account | null; /** * List all wallets (metadata only) */ listWallets(): Promise; /** * Check if any wallets exist */ hasWallets(): Promise; /** * Get active wallet ID from config */ getActiveWalletId(): Promise; /** * Switch active wallet (note: requires unlock after switching) */ switchWallet(walletId: string): Promise; /** * Delete a wallet (requires password confirmation) */ deleteWallet(walletId: string, password: string): Promise; /** * Export mnemonic (requires password verification) */ exportMnemonic(walletId: string, password: string): Promise; /** * Rotate wallet password (atomic: backup → re-encrypt → verify → cleanup) */ rotatePassword(walletId: string, oldPassword: string, newPassword: string): Promise; /** * Set auto-lock timeout */ setAutoLockTimeout(minutes: number): Promise; /** * Start auto-lock timer */ private startAutoLockTimer; /** * Clear auto-lock timer */ private clearAutoLockTimer; } export declare function getWalletManager(): WalletManager; export {}; //# sourceMappingURL=wallet-manager.d.ts.map