diff options
Diffstat (limited to 'src/types.ts')
-rw-r--r-- | src/types.ts | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/types.ts b/src/types.ts index 9031b19b7..aabf4ffc0 100644 --- a/src/types.ts +++ b/src/types.ts @@ -798,9 +798,9 @@ export enum CoinStatus { */ Fresh, /** - * Currently planned to be sent to a merchant for a transaction. + * Currently planned to be sent to a merchant for a purchase. */ - TransactionPending, + PurchasePending, /** * Used for a completed transaction and now dirty. */ @@ -1662,3 +1662,31 @@ export class ReturnCoinsRequest { */ static checked: (obj: any) => ReturnCoinsRequest; } + + +export interface RefundPermission { + refund_amount: AmountJson; + refund_fee: AmountJson; + h_contract_terms: string; + coin_pub: string; + rtransaction_id: number; + merchant_pub: string; + merchant_sig: string; +} + + +export interface PurchaseRecord { + contractTermsHash: string; + contractTerms: ContractTerms; + payReq: PayReq; + merchantSig: string; + + /** + * The purchase isn't active anymore, it's either successfully paid or + * refunded/aborted. + */ + finished: boolean; + + refundsPending: { [refundSig: string]: RefundPermission }; + refundsDone: { [refundSig: string]: RefundPermission }; +} |