aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-util/src/transactions-types.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-util/src/transactions-types.ts')
-rw-r--r--packages/taler-util/src/transactions-types.ts38
1 files changed, 38 insertions, 0 deletions
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;
/**