/** * Approval workflow for sensitive platform fund operations (N-of-M + auto-execute). */ import type { FundOperationRequestRow, FundOperationStatus, FundOperationType } from '../repositories/fundOperationRequestRepository'; import * as approvalPolicyRepository from '../repositories/approvalPolicyRepository'; import type { PolicyInput, QuorumSlot } from '../repositories/approvalPolicyRepository'; import type { RoleName } from '../models'; export declare class FundApprovalError extends Error { constructor(message: string); } export type FundRequestVoteDto = { voterId: string; decision: 'approve' | 'reject'; reason: string | null; voterRoles: string[]; createdAt: string; }; export type FundRequestDto = { id: string; operationType: FundOperationType; status: FundOperationStatus; payload: Record; requestedBy: string; approvedBy: string | null; rejectionReason: string | null; executionResult: Record | null; createdAt: string; approvedAt: string | null; executedAt: string | null; policyId: string | null; policyName: string | null; requiredQuorum: QuorumSlot[]; forbidSelfApprove: boolean; amountRaw: string | null; assetCode: string | null; network: string | null; fromAddress: string | null; toAddress: string | null; votes: FundRequestVoteDto[]; quorumProgress: { required: number; approved: number; }; canVote: boolean; }; export declare function executeApprovedRequest(request: FundOperationRequestRow, approverId: string): Promise>; export declare function createFundRequest(input: { operationType: FundOperationType; payload: Record; requestedBy: string; /** Skip fund_operation.request check (e.g. user withdrawal). */ skipRequestPermission?: boolean; /** Force queue even if policy says auto (unused reserved). */ forceQueue?: boolean; }): Promise; export declare function castVote(requestId: string, voterId: string, decision: 'approve' | 'reject', reason?: string): Promise; export declare function approveFundRequest(requestId: string, approverId: string): Promise; export declare function rejectFundRequest(requestId: string, approverId: string, reason: string): Promise; export declare function cancelFundRequest(requestId: string, actorId: string): Promise; export declare function getFundRequest(requestId: string, viewerId?: string): Promise; export declare function listFundRequests(filters: { status?: FundOperationStatus; operationType?: FundOperationType; limit?: number; offset?: number; }, viewerId?: string): Promise<{ items: FundRequestDto[]; total: number; }>; /** Submit a full policy set replacement via Approvals (does not apply immediately). */ export declare function draftPolicyChange(input: { after: PolicyInput[]; note?: string; requestedBy: string; }): Promise; export declare function listApprovalPolicies(actorId: string): Promise; export declare function listPolicyRevisions(actorId: string, limit?: number): Promise; export type UserRoleName = RoleName; export declare function updateUserRoles(targetUserId: string, roleNames: string[], adminUserId: string, notifyCtx?: { ipAddress?: string; userAgent?: string; }): Promise<{ userId: string; roles: string[]; }>; //# sourceMappingURL=fundApprovalService.d.ts.map