summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/types/walletTypes.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/types/walletTypes.ts')
-rw-r--r--packages/taler-wallet-core/src/types/walletTypes.ts20
1 files changed, 19 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/types/walletTypes.ts b/packages/taler-wallet-core/src/types/walletTypes.ts
index 6175c40eb..26d7e8e0c 100644
--- a/packages/taler-wallet-core/src/types/walletTypes.ts
+++ b/packages/taler-wallet-core/src/types/walletTypes.ts
@@ -45,6 +45,7 @@ import {
} from "../util/codec";
import { AmountString } from "./talerTypes";
import { codec } from "..";
+import { TransactionError } from "./transactions";
/**
* Response for the create reserve request to the wallet.
@@ -192,13 +193,30 @@ export function mkAmount(
return { value, fraction, currency };
}
+export const enum ConfirmPayResultType {
+ Done = "done",
+ Pending = "pending",
+}
+
/**
* Result for confirmPay
*/
-export interface ConfirmPayResult {
+export interface ConfirmPayResultDone {
+ type: ConfirmPayResultType.Done,
+
nextUrl: string;
}
+export interface ConfirmPayResultPending {
+ type: ConfirmPayResultType.Pending,
+
+ lastError: TransactionError;
+}
+
+export type ConfirmPayResult =
+ | ConfirmPayResultDone
+ | ConfirmPayResultPending
+
/**
* Information about all sender wire details known to the wallet,
* as well as exchanges that accept these wire types.