/** * Watch Tower API response types * * @module features/watch-tower/types/WatchTowerResponse */ import type { WatchTowerWebPushKeys } from './WatchTowerRequest'; /** * Web push subscription as returned by the service (`webPushSubscription` field). * Mirrors the stored subscription shape (distinct request field name `webPushNotification`). */ export interface AddToWatchTowerWebPushEcho { endpoint: string; keys: WatchTowerWebPushKeys; } /** * `data` payload on successful `POST /addToWatchTower` */ export interface AddToWatchTowerResponseData { /** RGB invoice registered with Watch Tower */ invoice: string; /** Parsed recipient / UTXO identifier from the invoice */ recipient_id: string; /** RGB transport endpoint extracted from the invoice */ endpoint_url: string; /** Present when an FCM token was registered */ fcmToken?: string; /** Present when a web push subscription was registered */ webPushSubscription?: AddToWatchTowerWebPushEcho; /** Present when an email was registered */ email?: string; /** Watch Tower expiry for this registration (Unix seconds) */ expiry: number; } /** * Successful JSON body returned by `addToWatchTower` (HTTP 2xx). * Error responses are thrown as `Error` with optional `status` / `data`. */ export interface AddToWatchTowerResponse { status: string; message: string; data: AddToWatchTowerResponseData; }