diff options
Diffstat (limited to 'packages/taler-util/src/notifications.ts')
-rw-r--r-- | packages/taler-util/src/notifications.ts | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/packages/taler-util/src/notifications.ts b/packages/taler-util/src/notifications.ts index b91d91777..571d8f036 100644 --- a/packages/taler-util/src/notifications.ts +++ b/packages/taler-util/src/notifications.ts @@ -23,15 +23,14 @@ * Imports. */ import { TransactionState } from "./transactions-types.js"; -import { TalerErrorDetail } from "./wallet-types.js"; +import { ExchangeEntryState, TalerErrorDetail } from "./wallet-types.js"; export enum NotificationType { BalanceChange = "balance-change", - ExchangeOperationError = "exchange-operation-error", - ExchangeAdded = "exchange-added", BackupOperationError = "backup-error", PendingOperationProcessed = "pending-operation-processed", TransactionStateTransition = "transaction-state-transition", + ExchangeStateTransition = "exchange-state-transition", } export interface ErrorInfoSummary { @@ -59,19 +58,29 @@ export interface TransactionStateTransitionNotification { experimentalUserData?: any; } -export interface ExchangeAddedNotification { - type: NotificationType.ExchangeAdded; +export interface ExchangeStateTransitionNotification { + type: NotificationType.ExchangeStateTransition; + /** + * Identification of the exchange entry that this + * notification is about. + */ + exchangeBaseUrl: string; + + /** + * If missing, the notification means that + * the exchange entry is newly created. + */ + oldExchangeState?: ExchangeEntryState; + + newExchangeState: ExchangeEntryState; + + errorInfo?: ErrorInfoSummary; } export interface BalanceChangeNotification { type: NotificationType.BalanceChange; } -export interface ExchangeOperationErrorNotification { - type: NotificationType.ExchangeOperationError; - error: TalerErrorDetail; -} - export interface BackupOperationErrorNotification { type: NotificationType.BackupOperationError; error: TalerErrorDetail; @@ -80,12 +89,12 @@ export interface BackupOperationErrorNotification { export interface PendingOperationProcessedNotification { type: NotificationType.PendingOperationProcessed; id: string; + taskResultType: string; } export type WalletNotification = | BalanceChangeNotification | BackupOperationErrorNotification - | ExchangeAddedNotification - | ExchangeOperationErrorNotification + | ExchangeStateTransitionNotification | PendingOperationProcessedNotification | TransactionStateTransitionNotification; |