From 09b5bfe0db8271c0c7531e22e3123d7e29e2bb1e Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 3 Sep 2020 17:29:09 +0530 Subject: towards auto-refresh --- packages/taler-wallet-core/src/types/dbTypes.ts | 8 ++++++++ packages/taler-wallet-core/src/types/pending.ts | 11 +++++++++++ 2 files changed, 19 insertions(+) (limited to 'packages/taler-wallet-core/src/types') diff --git a/packages/taler-wallet-core/src/types/dbTypes.ts b/packages/taler-wallet-core/src/types/dbTypes.ts index 801bb4492..30a562822 100644 --- a/packages/taler-wallet-core/src/types/dbTypes.ts +++ b/packages/taler-wallet-core/src/types/dbTypes.ts @@ -648,6 +648,14 @@ export interface ExchangeRecord { * Retry status for fetching updated information about the exchange. */ retryInfo: RetryInfo; + + /** + * Next time that we should check if coins need to be refreshed. + * + * Updated whenever the exchange's denominations are updated or when + * the refresh check has been done. + */ + nextRefreshCheck?: Timestamp; } diff --git a/packages/taler-wallet-core/src/types/pending.ts b/packages/taler-wallet-core/src/types/pending.ts index 69613becb..d07754fe9 100644 --- a/packages/taler-wallet-core/src/types/pending.ts +++ b/packages/taler-wallet-core/src/types/pending.ts @@ -28,6 +28,7 @@ import { Timestamp, Duration } from "../util/time"; export enum PendingOperationType { Bug = "bug", ExchangeUpdate = "exchange-update", + ExchangeCheckRefresh = "exchange-check-refresh", Pay = "pay", ProposalChoice = "proposal-choice", ProposalDownload = "proposal-download", @@ -47,6 +48,7 @@ export type PendingOperationInfo = PendingOperationInfoCommon & ( | PendingBugOperation | PendingExchangeUpdateOperation + | PendingExchangeCheckRefreshOperation | PendingPayOperation | PendingProposalChoiceOperation | PendingProposalDownloadOperation @@ -70,6 +72,15 @@ export interface PendingExchangeUpdateOperation { lastError: TalerErrorDetails | undefined; } +/** + * The wallet should check whether coins from this exchange + * need to be auto-refreshed. + */ +export interface PendingExchangeCheckRefreshOperation { + type: PendingOperationType.ExchangeCheckRefresh; + exchangeBaseUrl: string; +} + /** * Some interal error happened in the wallet. This pending operation * should *only* be reported for problems in the wallet, not when -- cgit v1.2.3