From a11ac57535b0375f152ce115ee541cb8aca98e84 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 24 Aug 2022 22:17:19 +0200 Subject: wallet-core: p2p support for transactions list --- packages/taler-util/src/transactionsTypes.ts | 88 ++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 5 deletions(-) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/transactionsTypes.ts b/packages/taler-util/src/transactionsTypes.ts index 645f0120b..c4bd3d464 100644 --- a/packages/taler-util/src/transactionsTypes.ts +++ b/packages/taler-util/src/transactionsTypes.ts @@ -102,7 +102,11 @@ export type Transaction = | TransactionRefund | TransactionTip | TransactionRefresh - | TransactionDeposit; + | TransactionDeposit + | TransactionPeerPullCredit + | TransactionPeerPullDebit + | TransactionPeerPushCredit + | TransactionPeerPushDebit; export enum TransactionType { Withdrawal = "withdrawal", @@ -111,6 +115,10 @@ export enum TransactionType { Refresh = "refresh", Tip = "tip", Deposit = "deposit", + PeerPushDebit = "peer-push-debit", + PeerPushCredit = "peer-push-credit", + PeerPullDebit = "peer-pull-debit", + PeerPullCredit = "peer-pull-credit", } export enum WithdrawalType { @@ -179,6 +187,76 @@ export interface TransactionWithdrawal extends TransactionCommon { withdrawalDetails: WithdrawalDetails; } +export interface TransactionPeerPullCredit extends TransactionCommon { + type: TransactionType.PeerPullCredit; + + /** + * Exchange used. + */ + exchangeBaseUrl: string; + + /** + * Amount that got subtracted from the reserve balance. + */ + amountRaw: AmountString; + + /** + * Amount that actually was (or will be) added to the wallet's balance. + */ + amountEffective: AmountString; +} + +export interface TransactionPeerPullDebit extends TransactionCommon { + type: TransactionType.PeerPullDebit; + + /** + * Exchange used. + */ + exchangeBaseUrl: string; + + amountRaw: AmountString; + + amountEffective: AmountString; +} + +export interface TransactionPeerPushDebit extends TransactionCommon { + type: TransactionType.PeerPushDebit; + + /** + * Exchange used. + */ + exchangeBaseUrl: string; + + /** + * Amount that got subtracted from the reserve balance. + */ + amountRaw: AmountString; + + /** + * Amount that actually was (or will be) added to the wallet's balance. + */ + amountEffective: AmountString; +} + +export interface TransactionPeerPushCredit extends TransactionCommon { + type: TransactionType.PeerPushCredit; + + /** + * Exchange used. + */ + exchangeBaseUrl: string; + + /** + * Amount that got subtracted from the reserve balance. + */ + amountRaw: AmountString; + + /** + * Amount that actually was (or will be) added to the wallet's balance. + */ + amountEffective: AmountString; +} + export enum PaymentStatus { /** * Explicitly aborted after timeout / failure @@ -311,10 +389,10 @@ export interface OrderShortInfo { } export interface RefundInfoShort { - transactionId: string, - timestamp: TalerProtocolTimestamp, - amountEffective: AmountString, - amountRaw: AmountString, + transactionId: string; + timestamp: TalerProtocolTimestamp; + amountEffective: AmountString; + amountRaw: AmountString; } export interface TransactionRefund extends TransactionCommon { -- cgit v1.2.3