diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-08-11 17:32:11 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-08-11 17:32:11 +0530 |
commit | ff3f96566151d390462931574184ed9e6b84db5b (patch) | |
tree | c8616b7acbe6f8a7ccdcd069de0ac9a3b0741df7 /packages/taler-wallet-core/src/types/walletTypes.ts | |
parent | 172a51a43a5cfebd06876206ec3a0cd75ad86e43 (diff) | |
download | wallet-core-ff3f96566151d390462931574184ed9e6b84db5b.tar.xz |
towards the improved confirmPay API
Diffstat (limited to 'packages/taler-wallet-core/src/types/walletTypes.ts')
-rw-r--r-- | packages/taler-wallet-core/src/types/walletTypes.ts | 20 |
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. |