/** * Platform security: ledger integrity, alerts, withdrawal suspension, admin notifications. */ import * as ledgerIntegrityRepository from '../repositories/ledgerIntegrityRepository'; import type { SecurityAlert, SecurityAlertSeverity, SecurityAlertStatus } from '../models/security.model'; /** Ledger entry types that may credit or debit user balances. */ export declare const AUTHORIZED_LEDGER_TYPES: Set; export declare class SecurityBlockedError extends Error { constructor(message: string); } export declare function assertUserCanWithdraw(userId: string): Promise; export declare function suspendUserForSecurity(userId: string, reason: string, alertType: string, severity?: SecurityAlertSeverity): Promise; export declare function raiseAlert(input: { userId?: string | null; severity: SecurityAlertSeverity; alertType: string; title: string; details?: string; metadata?: Record; suspendUser?: boolean; }): Promise; export declare function notifyAdminsOfAlert(alert: SecurityAlert): Promise; export declare function resolveAlert(alertId: string, adminUserId: string, status: SecurityAlertStatus, resolutionNote?: string, reactivateWithdrawals?: boolean): Promise; export type IntegrityIssue = { userId: string; walletTypeId: number; accountId: string; available: string; locked: string; entriesSum: string; issue: string; entryId?: string; amount?: string; }; /** * Detects balance inflation/deflation without a matching ledger entry change. * * Lock/unlock (withdrawal reserve / cancel) reshuffles available↔locked while keeping * (available + locked) and entries_sum unchanged — that must NOT count as tamper. * Real direct tamper changes the total while entries stay the same. */ export declare function isDirectBalanceTamper(snap: Pick, meta: Pick): boolean; export declare function runLedgerIntegrityCheck(): Promise; export declare function getSecuritySettings(): Promise<{ alertEmails: string[]; }>; export declare function updateSecuritySettings(alertEmails: string[]): Promise<{ alertEmails: string[]; }>; export declare function listSecurityAlerts(opts: { status?: SecurityAlertStatus; userId?: string; limit?: number; offset?: number; }): Promise<{ items: { id: string; userId: string | null; severity: "low" | "medium" | "high" | "critical"; alertType: string; status: "open" | "investigating" | "resolved" | "dismissed"; title: string; details: string | null; metadata: Record | null; resolvedBy: string | null; resolvedAt: Date | null; resolutionNote: string | null; createdAt: Date; updatedAt: Date; }[]; total: number; }>; export declare function getIntegrityCheckIntervalMs(): number; /** Dismisses false-positive alerts caused by the security_alerts INSERT detection loop (pre-fix). */ export declare function dismissSpuriousTamperAlerts(adminUserId: string): Promise; //# sourceMappingURL=securityService.d.ts.map