Files
mortgagefi-helper/types/notifications.ts

43 lines
1.2 KiB
TypeScript

export type NotificationProvider = 'ntfy' | 'gotify' | 'sns';
export type SchedulerProvider = 'schedy';
export interface NotificationSettings {
provider: NotificationProvider | '';
scheduler?: SchedulerProvider | '';
// Ntfy
ntfyServer?: string; // e.g., https://ntfy.sh or self-hosted
ntfyTopic?: string;
// Gotify
gotifyServer?: string; // base URL
gotifyToken?: string;
// Amazon SNS
snsRegion?: string;
snsTopicArn?: string;
snsAccessKeyId?: string;
snsSecretAccessKey?: string;
// Schedy
schedyBaseUrl?: string; // e.g., http://localhost:8080
schedyApiKey?: string;
// Contact details
email?: string;
// Lead time before liquidation in days
daysBefore?: number; // default 0
}
export interface PositionNotification {
chainId: number;
debtAddress: string;
nftAddress: string;
tokenId: string; // decimal string
// Legacy single-job fields (backward compat with already-stored values)
jobId?: string; // scheduler job id (from schedy)
scheduledAt?: number; // epoch seconds
// New multi-job support
jobs?: Array<{
id: string;
at: number; // epoch seconds
label: 'lead' | 'half' | 'last';
}>;
enabled: boolean;
}