/** * Standalone Nonce Manager Utility * Provides nonce management functionality that can be imported and used independently */ import { ApiClient } from '../api/api-client'; export interface NonceManagerConfig { accountIndex: number; apiKeyIndex: number; batchSize?: number; maxCacheAge?: number; } export declare class NonceManager { private nonceCache; private transactionApi; private config; constructor(apiClient: ApiClient, config: NonceManagerConfig); /** * Get next nonce for current API key */ getNextNonce(): Promise; /** * Get multiple nonces for batch operations */ getNextNonces(count: number): Promise; /** * Pre-warm the nonce cache for better performance */ preWarmCache(): Promise; /** * Clear nonce cache */ clearCache(): void; /** * Get cache statistics */ getCacheStats(): Record; /** * Check if nonce manager is healthy */ isHealthy(): boolean; /** * Acknowledge transaction failure and rollback nonce * This prevents nonce gaps when transactions fail */ acknowledgeFailure(apiKeyIndex: number): void; /** * Hard refresh nonce from API (used when invalid nonce error occurs) */ hardRefreshNonce(apiKeyIndex: number): Promise; /** * Check if error is nonce-related */ isNonceError(error: any): boolean; /** * Get current configuration */ getConfig(): NonceManagerConfig; /** * Update configuration */ updateConfig(newConfig: Partial): void; } /** * Factory function to create a nonce manager */ export declare function createNonceManager(apiClient: ApiClient, config: NonceManagerConfig): NonceManager; /** * Standalone nonce fetching function (without caching) */ export declare function fetchNextNonce(apiClient: ApiClient, accountIndex: number, apiKeyIndex: number): Promise; /** * Standalone batch nonce fetching function (without caching) */ export declare function fetchNextNonces(apiClient: ApiClient, accountIndex: number, apiKeyIndex: number, count: number): Promise; //# sourceMappingURL=nonce-manager.d.ts.map