import algosdk from 'algosdk'; import type { WalletAdapter, WalletAdapterConfig, WalletAccount, SigningOptions, SignAndSendResult } from './types.js'; /** * Abstract base class for wallet adapters. * Provides common functionality for signing and sending transactions. */ export declare abstract class BaseWalletAdapter implements WalletAdapter { abstract readonly id: string; abstract readonly name: string; abstract readonly icon: string; abstract readonly supportsAuth: boolean; readonly isWatchOnly = false; protected config: WalletAdapterConfig | null; protected _connected: boolean; protected _accounts: WalletAccount[]; /** * Initialize the adapter with network configuration. */ initialize(config: WalletAdapterConfig): Promise; /** * Called after config is set. Override to perform wallet-specific initialization. */ protected abstract onInitialize(): Promise; /** * Connect to the wallet. */ abstract connect(): Promise; /** * Disconnect from the wallet. */ abstract disconnect(): Promise; /** * Reconnect using persisted session. */ abstract reconnect(): Promise; /** * Sign transaction groups. */ abstract signTransactions(transactions: algosdk.Transaction[][], options?: SigningOptions): Promise; /** * Check if currently connected. */ isConnected(): boolean; /** * Get the current accounts. */ get accounts(): WalletAccount[]; /** * Get the configuration, throwing if not initialized. */ protected requireConfig(): WalletAdapterConfig; /** * Sign and send transaction groups to the network. * Default implementation that can be overridden by specific wallets. */ signAndSendTransactions(transactions: algosdk.Transaction[][], options?: SigningOptions): Promise; /** * Create an authentication token. * Default implementation that uses the wallet's signing capability. */ authenticate(address: string): Promise; /** * Create an authentication transaction for the given address. */ protected createAuthTransaction(address: string): Promise; /** * Set connected state and accounts. */ protected setConnected(accounts: WalletAccount[]): void; /** * Clear connected state. */ protected clearConnected(): void; }