UNPKG

@venly/wallet-mcp

Version:

Production-ready MCP server enabling AI agents to perform Web3 wallet operations through Venly's blockchain infrastructure. Supports 14+ networks including Ethereum, Polygon, Arbitrum, and stablecoin operations.

158 lines 3.99 kB
/** * Webhook Event Processor * * Handles webhook event processing, filtering, and insights generation * for the Venly MCP Server real-time event system */ import type { WebhookEvent, WebhookConfig, WebhookFilters, EventInsights } from '../types/venly.js'; /** * Event processing statistics */ interface ProcessingStats { totalProcessed: number; successfullyProcessed: number; filtered: number; errors: number; averageProcessingTime: number; } /** * Main webhook event processor class */ export declare class WebhookEventProcessor { private readonly logger; private readonly activeWebhooks; private readonly eventQueue; private readonly processingStats; private readonly eventHistory; private readonly maxEventHistory; private readonly maxQueueSize; constructor(); /** * Register a webhook configuration */ registerWebhook(config: WebhookConfig): void; /** * Unregister a webhook configuration */ unregisterWebhook(webhookId: string): boolean; /** * Get webhook configuration */ getWebhook(webhookId: string): WebhookConfig | undefined; /** * List all active webhooks */ listWebhooks(): WebhookConfig[]; /** * Update webhook configuration */ updateWebhook(webhookId: string, updates: Partial<WebhookConfig>): boolean; /** * Process a webhook event */ processEvent(event: WebhookEvent): Promise<void>; /** * Add event to processing queue */ queueEvent(event: WebhookEvent): void; /** * Process all queued events */ processQueuedEvents(): Promise<void>; /** * Filter event based on webhook filters */ filterEvent(event: WebhookEvent, filters: WebhookFilters): Promise<boolean>; /** * Generate insights from processed events */ generateInsights(timeRange?: { start: string; end: string; }): Promise<EventInsights>; /** * Verify webhook signature using HMAC-SHA256 */ verifyWebhookSignature(payload: string, signature: string, secret: string): boolean; /** * Generate webhook signature for outgoing webhooks */ generateWebhookSignature(payload: string, secret: string): string; /** * Get processing statistics */ getProcessingStats(): ProcessingStats & { queueSize: number; historySize: number; }; /** * Reset processing statistics */ resetProcessingStats(): void; /** * Clear event history */ clearEventHistory(): void; /** * Find webhooks relevant to an event */ private findRelevantWebhooks; /** * Process event for a specific webhook */ private processEventForWebhook; /** * Add event to history for insights */ private addToEventHistory; /** * Update processing statistics */ private updateProcessingStats; /** * Extract amount from event data */ private extractEventAmount; /** * Extract token address from event data */ private extractTokenAddress; /** * Extract contract address from event data */ private extractContractAddress; /** * Extract from address from event data */ private extractFromAddress; /** * Extract to address from event data */ private extractToAddress; /** * Filter events by time range */ private filterEventsByTimeRange; /** * Group events by type for insights */ private groupEventsByType; /** * Analyze event patterns */ private analyzeEventPatterns; /** * Calculate performance metrics */ private calculatePerformanceMetrics; /** * Create empty insights object */ private createEmptyInsights; /** * Create Winston logger instance */ private createLogger; } export {}; //# sourceMappingURL=WebhookEventProcessor.d.ts.map