//#region extensions/crypto/src/services/allowance-manager.d.ts /** * Token Allowance Manager — batch ERC-20 allowance checking and tracking. * * Provides: * - Batch allowance checks across multiple tokens and spenders * - Permit2 allowance aggregation * - Unlimited/excessive allowance detection * - Revocation recommendations * - Common spender identification (Uniswap Router, 0x Exchange Proxy, etc.) * * Security concern: ERC-20 approvals are a major attack vector — unlimited * approvals to compromised contracts can drain tokens. This service helps * users audit and manage their exposure. */ interface AllowanceInfo { token: string; tokenAddress: string; spender: string; spenderName: string; spenderAddress: string; allowance: string; allowanceHuman: string; isUnlimited: boolean; riskLevel: 'safe' | 'moderate' | 'high' | 'critical'; chain: string; chainId: number; } interface AllowanceReport { owner: string; chainId: number; chain: string; totalChecked: number; unlimited: number; highRisk: number; allowances: AllowanceInfo[]; recommendations: string[]; timestamp: number; } interface AllowanceManagerConfig { /** Threshold (in human-readable units) above which an allowance is flagged. Default: 1e12 */ unlimitedThreshold?: number; } declare class AllowanceManager { private config; constructor(config?: AllowanceManagerConfig); /** * Check allowances for a wallet against known spenders. * Scans common tokens × common spenders on a given chain. */ auditAllowances(ownerAddress: string, chainId?: number, tokenAddresses?: string[]): Promise; /** * Check a single token's allowance for a specific spender. */ checkAllowance(ownerAddress: string, tokenAddress: string, spenderAddress: string, chainId?: number): Promise<{ allowance: string; decimals: number; isUnlimited: boolean; }>; /** * Get known spender names for a chain. */ getKnownSpenders(chainId?: number): Record; /** * Resolve a spender address to a human-readable name. */ resolveSpenderName(address: string, chainId?: number): string; private assessRisk; } declare function getAllowanceManager(config?: AllowanceManagerConfig): AllowanceManager; declare function resetAllowanceManager(): void; //#endregion export { AllowanceInfo, AllowanceManager, AllowanceManagerConfig, AllowanceReport, getAllowanceManager, resetAllowanceManager }; //# sourceMappingURL=allowance-manager.d.mts.map