Add ECDSA signature verification and enhance ComboHandler functionality
- Integrated ECDSA for signature verification in ComboHandler. - Updated event emissions to include additional parameters for better tracking. - Improved gas tracking during execution of combo plans. - Enhanced database interactions for storing and retrieving plans, including conflict resolution and status updates. - Added new dependencies for security and database management in orchestrator.
This commit is contained in:
49
orchestrator/src/api/execution.ts
Normal file
49
orchestrator/src/api/execution.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { Request, Response } from "express";
|
||||
import { executionCoordinator } from "../services/execution";
|
||||
import { asyncHandler } from "../services/errorHandler";
|
||||
import { auditLog } from "../middleware";
|
||||
|
||||
/**
|
||||
* POST /api/plans/:planId/execute
|
||||
* Execute a plan
|
||||
*/
|
||||
export const executePlan = asyncHandler(async (req: Request, res: Response) => {
|
||||
const { planId } = req.params;
|
||||
|
||||
const result = await executionCoordinator.executePlan(planId);
|
||||
|
||||
res.json(result);
|
||||
});
|
||||
|
||||
/**
|
||||
* GET /api/plans/:planId/status
|
||||
* Get execution status
|
||||
*/
|
||||
export const getExecutionStatus = asyncHandler(async (req: Request, res: Response) => {
|
||||
const { planId } = req.params;
|
||||
const executionId = req.query.executionId as string;
|
||||
|
||||
if (executionId) {
|
||||
const status = await executionCoordinator.getExecutionStatus(executionId);
|
||||
return res.json(status);
|
||||
}
|
||||
|
||||
// Get latest execution for plan
|
||||
res.json({ status: "pending" });
|
||||
});
|
||||
|
||||
/**
|
||||
* POST /api/plans/:planId/abort
|
||||
* Abort execution
|
||||
*/
|
||||
export const abortExecution = asyncHandler(async (req: Request, res: Response) => {
|
||||
const { planId } = req.params;
|
||||
const executionId = req.query.executionId as string;
|
||||
|
||||
if (executionId) {
|
||||
await executionCoordinator.abortExecution(executionId, planId, "User aborted");
|
||||
}
|
||||
|
||||
res.json({ success: true });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user