From 3007419c98c24502c45409d4eea2e933662bc5e6 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 12 May 2020 16:19:40 +0530 Subject: show offered payments --- src/types/transactions.ts | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/types/transactions.ts') diff --git a/src/types/transactions.ts b/src/types/transactions.ts index 7dda46f73..263e08a4e 100644 --- a/src/types/transactions.ts +++ b/src/types/transactions.ts @@ -111,15 +111,31 @@ interface TransactionWithdrawal extends TransactionCommon { amountEffective?: AmountString; } -interface TransactionPayment extends TransactionCommon { +export const enum PaymentStatus { + // Explicitly aborted after timeout / failure + Aborted = "aborted", + + // Payment failed, wallet will auto-retry. + // User should be given the option to retry now / abort. + Failed = "failed", + + // Paid successfully + Paid = "paid", + + // Only offered, user must accept / decline + Offered = "offered", + + // User accepted, payment is processing. + Accepted = "accepted", +} + +export interface TransactionPayment extends TransactionCommon { type: TransactionType.Payment; // Additional information about the payment. info: PaymentShortInfo; - // true if the payment failed, false otherwise. - // Note that failed payments with zero effective amount will not be returned by the API. - failed: boolean; + status: PaymentStatus; // Amount that must be paid for the contract amountRaw: AmountString; -- cgit v1.2.3