aboutsummaryrefslogtreecommitdiff
path: root/src/types/walletTypes.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/types/walletTypes.ts')
-rw-r--r--src/types/walletTypes.ts26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/types/walletTypes.ts b/src/types/walletTypes.ts
index 2ca95bf48..d68f41564 100644
--- a/src/types/walletTypes.ts
+++ b/src/types/walletTypes.ts
@@ -337,34 +337,36 @@ export interface NextUrlResult {
lastSessionId: string | undefined;
}
+export const enum PreparePayResultType {
+ PaymentPossible = "payment-possible",
+ InsufficientBalance = "insufficient-balance",
+ AlreadyConfirmed = "already-confirmed",
+}
+
export type PreparePayResult =
- | PreparePayResultError
| PreparePayResultInsufficientBalance
- | PreparePayResultPaid
+ | PreparePayResultAlreadyConfirmed
| PreparePayResultPaymentPossible;
export interface PreparePayResultPaymentPossible {
- status: "payment-possible";
+ status: PreparePayResultType.PaymentPossible;
proposalId: string;
contractTermsRaw: string;
totalFees: AmountJson;
}
export interface PreparePayResultInsufficientBalance {
- status: "insufficient-balance";
+ status: PreparePayResultType.InsufficientBalance;
proposalId: string;
contractTermsRaw: any;
}
-export interface PreparePayResultError {
- status: "error";
- error: string;
-}
-
-export interface PreparePayResultPaid {
- status: "paid";
+export interface PreparePayResultAlreadyConfirmed {
+ status: PreparePayResultType.AlreadyConfirmed;
contractTermsRaw: any;
- nextUrl: string;
+ paid: boolean;
+ // Only specified if paid.
+ nextUrl?: string;
}
export interface BankWithdrawDetails {