From f07436aa4910114a514235fb17879411dae0a555 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 24 Nov 2021 08:55:37 -0300 Subject: new exchange-added notifiaction and including tos information in the wxApi.listExchange api --- packages/taler-util/src/notifications.ts | 6 ++++++ packages/taler-util/src/walletTypes.ts | 15 +++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/notifications.ts b/packages/taler-util/src/notifications.ts index 289dcb689..e8f27062c 100644 --- a/packages/taler-util/src/notifications.ts +++ b/packages/taler-util/src/notifications.ts @@ -45,6 +45,7 @@ export enum NotificationType { RefundQueried = "refund-queried", RefundFinished = "refund-finished", ExchangeOperationError = "exchange-operation-error", + ExchangeAdded = "exchange-added", RefreshOperationError = "refresh-operation-error", RecoupOperationError = "recoup-operation-error", RefundApplyOperationError = "refund-apply-error", @@ -150,6 +151,10 @@ export interface RefundFinishedNotification { type: NotificationType.RefundFinished; } +export interface ExchangeAddedNotification { + type: NotificationType.ExchangeAdded; +} + export interface ExchangeOperationErrorNotification { type: NotificationType.ExchangeOperationError; error: TalerErrorDetails; @@ -243,6 +248,7 @@ export type WalletNotification = | BackupOperationErrorNotification | WithdrawOperationErrorNotification | ReserveOperationErrorNotification + | ExchangeAddedNotification | ExchangeOperationErrorNotification | RefreshOperationErrorNotification | RefundStatusOperationErrorNotification diff --git a/packages/taler-util/src/walletTypes.ts b/packages/taler-util/src/walletTypes.ts index 879640e82..f00e2907f 100644 --- a/packages/taler-util/src/walletTypes.ts +++ b/packages/taler-util/src/walletTypes.ts @@ -523,17 +523,32 @@ export interface ExchangesListRespose { exchanges: ExchangeListItem[]; } +export interface ExchangeTos { + acceptedVersion?: string; + currentVersion?: string; + contentType?: string; + content?: string; +} export interface ExchangeListItem { exchangeBaseUrl: string; currency: string; paytoUris: string[]; + tos: ExchangeTos; } +const codecForExchangeTos = (): Codec => buildCodecForObject() + .property("acceptedVersion", codecOptional(codecForString())) + .property("currentVersion", codecOptional(codecForString())) + .property("contentType", codecOptional(codecForString())) + .property("content", codecOptional(codecForString())) + .build("ExchangeTos") + export const codecForExchangeListItem = (): Codec => buildCodecForObject() .property("currency", codecForString()) .property("exchangeBaseUrl", codecForString()) .property("paytoUris", codecForList(codecForString())) + .property("tos", codecForExchangeTos()) .build("ExchangeListItem"); export const codecForExchangesListResponse = (): Codec => -- cgit v1.2.3