From 2823b1cdf4b6e9a6c4dbdb752c7c7259775e18f5 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 5 Apr 2023 17:38:34 +0200 Subject: wallet-core: towards DD37 for deposits --- packages/taler-util/src/transactions-types.ts | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'packages/taler-util/src/transactions-types.ts') diff --git a/packages/taler-util/src/transactions-types.ts b/packages/taler-util/src/transactions-types.ts index eec173de6..474372c4f 100644 --- a/packages/taler-util/src/transactions-types.ts +++ b/packages/taler-util/src/transactions-types.ts @@ -59,6 +59,11 @@ export enum ExtendedStatus { KycRequired = "kyc-required", } +export interface TransactionStateInfo { + txState: TransactionState; + txSubstate: TransactionSubstate; +} + export interface TransactionsRequest { /** * return only transactions in the given currency @@ -76,6 +81,32 @@ export interface TransactionsRequest { includeRefreshes?: boolean; } +export enum TransactionState { + // No state, only used when reporting transitions into the initial state + None = "none", + Pending = "pending", + Done = "done", + Aborting = "aborting", + Aborted = "aborted", + Suspended = "suspended", + Failed = "failed", + // Only used for the notification, never in the transaction history + Deleted = "deleted", + // Placeholder until D37 is fully implemented + Unknown = "unknown", +} + +export enum TransactionSubstate { + // Placeholder until D37 is fully implemented + Unknown = "unknown", + // No substate + None = "none", + DepositPendingInitial = "initial", + DepositKycRequired = "kyc-required", + DepositPendingTrack = "track", + DepositAbortingRefresh = "refresh", +} + export interface TransactionsResponse { // a list of past and pending transactions sorted by pending, timestamp and transactionId. // In case two events are both pending and have the same timestamp, @@ -95,6 +126,13 @@ export interface TransactionCommon { // main timestamp of the transaction timestamp: TalerProtocolTimestamp; + txState: TransactionState; + + txSubstate: TransactionSubstate; + + /** + * @deprecated in favor of statusMajor and statusMinor + */ extendedStatus: ExtendedStatus; /** -- cgit v1.2.3