forked from Streampay-Org/StreamPay-Frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
51 lines (46 loc) · 1.17 KB
/
Copy pathtypes.ts
File metadata and controls
51 lines (46 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
export interface MetricSnapshot {
tenantId: string;
streamCreations: number;
settleAttempts: number;
timestamp: number;
stellarSubmissionsTotal?: number;
stellarSubmissionsFailed?: number;
dlqDepth?: number;
oldestPendingJobSeconds?: number;
p95SettlementLatencySeconds?: number;
}
export interface AnomalyThresholds {
creationBurstLimit: number;
settleRateLimit: number;
submissionFailureThreshold?: number;
maxDlqDepth?: number;
}
export interface AnomalyAlert {
tenantId: string;
ruleName: "STREAM_CREATION_BURST" | "SETTLE_RATE_SPIKE" | "HIGH_SUBMISSION_FAILURE_RATE" | "DLQ_DEPTH_EXCEEDED";
observedValue: number;
threshold: number;
severity: 'low' | 'medium' | 'high';
detectedAt: string;
}
export enum ContractStreamStatus {
DRAFT = "DRAFT",
ACTIVE = "ACTIVE",
PAUSED = "PAUSED",
SETTLED = "SETTLED",
ENDED = "ENDED",
CANCELLED = "CANCELLED",
}
export interface OnChainStream {
id: string;
recipient_address: string;
total_amount: bigint;
released_amount: bigint;
velocity: bigint;
last_update_timestamp: number;
status: ContractStreamStatus;
}
export interface InvariantResult {
isValid: boolean;
error?: string;
}