@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.
161 lines • 4.26 kB
TypeScript
/**
* Workflow Engine
*
* Central orchestration engine for multi-step financial workflows
* with cross-MCP server coordination and robust error handling
*/
import type { WorkflowTemplate, WorkflowStep, WorkflowExecution, WorkflowContext, MCPCallResult, MCPServerConfig } from '../types/venly.js';
import { WorkflowTriggerType } from '../types/venly.js';
import { VenlyClient } from '../venly/VenlyClient.js';
/**
* Workflow execution statistics
*/
interface WorkflowStats {
totalExecutions: number;
successfulExecutions: number;
failedExecutions: number;
averageExecutionTime: number;
activeExecutions: number;
}
/**
* Main workflow orchestration engine
*/
export declare class WorkflowEngine {
private readonly logger;
private readonly venlyClient;
private readonly activeWorkflows;
private readonly templates;
private readonly mcpServers;
private readonly stats;
constructor(venlyClient: VenlyClient);
/**
* Register a workflow template
*/
registerTemplate(template: WorkflowTemplate): void;
/**
* Get workflow template by ID
*/
getTemplate(templateId: string): WorkflowTemplate | undefined;
/**
* List all available templates
*/
listTemplates(): WorkflowTemplate[];
/**
* Remove workflow template
*/
removeTemplate(templateId: string): boolean;
/**
* Register an MCP server configuration
*/
registerMCPServer(config: MCPServerConfig): void;
/**
* Get MCP server configuration
*/
getMCPServer(serverName: string): MCPServerConfig | undefined;
/**
* Execute a workflow from template
*/
executeWorkflow(templateId: string, inputs: Record<string, unknown>, triggeredBy?: {
type: WorkflowTriggerType;
source?: string;
eventId?: string;
}): Promise<WorkflowExecution>;
/**
* Execute workflow steps sequentially with dependency management
*/
private executeWorkflowSteps;
/**
* Execute a single step with result tracking
*/
private executeStepWithTracking;
/**
* Execute a single workflow step
*/
executeStep(step: WorkflowStep, context: WorkflowContext): Promise<unknown>;
/**
* Execute Venly transaction step
*/
private executeVenlyTransaction;
/**
* Execute fiat conversion step
*/
private executeFiatConversion;
/**
* Execute webhook trigger step
*/
private executeWebhookTrigger;
/**
* Execute condition check step
*/
private executeConditionCheck;
/**
* Execute data export step
*/
private executeDataExport;
/**
* Handle cross-MCP server calls
*/
handleCrossMCPCall(serverName: string, action: string, parameters: Record<string, unknown>): Promise<MCPCallResult>;
/**
* Simulate MCP server calls (for demonstration)
*/
private simulateMCPCall;
/**
* Simulate Stripe MCP calls
*/
private simulateStripeCall;
/**
* Simulate PayPal MCP calls
*/
private simulatePayPalCall;
/**
* Simulate Modern Treasury MCP calls
*/
private simulateModernTreasuryCall;
/**
* Get workflow execution by ID
*/
getWorkflowExecution(executionId: string): WorkflowExecution | undefined;
/**
* List all active workflow executions
*/
listActiveWorkflows(): WorkflowExecution[];
/**
* Cancel workflow execution
*/
cancelWorkflow(executionId: string): Promise<boolean>;
/**
* Get workflow execution statistics
*/
getWorkflowStats(): WorkflowStats;
/**
* Generate unique execution ID
*/
private generateExecutionId;
/**
* Evaluate workflow conditions
*/
private evaluateConditions;
/**
* Evaluate single condition
*/
private evaluateCondition;
/**
* Get field value from context
*/
private getFieldValue;
/**
* Retry failed step
*/
private retryStep;
/**
* Update average execution time
*/
private updateAverageExecutionTime;
/**
* Create Winston logger instance
*/
private createLogger;
}
export {};
//# sourceMappingURL=WorkflowEngine.d.ts.map