notifications.ts
1 /** 2 * Notification types for ACDC Messenger companion app 3 */ 4 5 export type NotificationType = 'governance' | 'swap' | 'price' | 'system'; 6 7 export interface Notification { 8 id: string; 9 type: NotificationType; 10 title: string; 11 body: string; 12 timestamp: number; 13 read: boolean; 14 data?: Record<string, unknown>; 15 } 16 17 export interface GovernanceNotification extends Notification { 18 type: 'governance'; 19 data: { 20 proposalId: string; 21 proposalTitle: string; 22 status: 'new' | 'voting_ending' | 'executed'; 23 votingEndsAt?: number; 24 }; 25 } 26 27 export interface SwapNotification extends Notification { 28 type: 'swap'; 29 data: { 30 swapId: string; 31 offerAmount: string; 32 offerToken: 'AX' | 'DX'; 33 requestAmount: string; 34 requestToken: 'AX' | 'DX'; 35 status: 'offer_received' | 'completed'; 36 counterparty?: string; 37 }; 38 } 39 40 export interface PriceNotification extends Notification { 41 type: 'price'; 42 data: { 43 token: 'AX' | 'DX'; 44 price: number; 45 threshold: number; 46 direction: 'above' | 'below'; 47 }; 48 } 49 50 export interface SystemNotification extends Notification { 51 type: 'system'; 52 data: { 53 severity: 'info' | 'warning' | 'critical'; 54 category: 'network' | 'maintenance' | 'security'; 55 }; 56 } 57 58 export interface Subscription { 59 id: string; 60 type: NotificationType; 61 enabled: boolean; 62 label: string; 63 description: string; 64 } 65 66 export type FilterType = 'all' | NotificationType; 67 68 export { NOTIFICATION_TYPE_COLORS } from '../theme/colors'; 69 70 export const NOTIFICATION_TYPE_LABELS: Record<NotificationType, string> = { 71 governance: 'Governance', 72 swap: 'Swap', 73 price: 'Price Alert', 74 system: 'System', 75 };