[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: wallet-core: more details in
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: wallet-core: more details in refresh transaction |
Date: |
Tue, 14 Feb 2023 13:18:38 +0100 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository wallet-core.
The following commit(s) were added to refs/heads/master by this push:
new bb8bf3cb5 wallet-core: more details in refresh transaction
bb8bf3cb5 is described below
commit bb8bf3cb5596fe615359e4b984d6a7f51560e92b
Author: Florian Dold <florian@dold.me>
AuthorDate: Tue Feb 14 13:18:33 2023 +0100
wallet-core: more details in refresh transaction
---
packages/taler-util/src/transactions-types.ts | 7 +++++++
packages/taler-wallet-core/src/operations/transactions.ts | 7 +++++++
packages/taler-wallet-webextension/src/wallet/History.stories.tsx | 2 ++
.../taler-wallet-webextension/src/wallet/Transaction.stories.tsx | 2 ++
4 files changed, 18 insertions(+)
diff --git a/packages/taler-util/src/transactions-types.ts
b/packages/taler-util/src/transactions-types.ts
index 7d5cb9ae1..9623e25a9 100644
--- a/packages/taler-util/src/transactions-types.ts
+++ b/packages/taler-util/src/transactions-types.ts
@@ -535,8 +535,15 @@ export interface TransactionRefresh extends
TransactionCommon {
/**
* Fees, i.e. the effective, negative effect of the refresh
* on the balance.
+ *
+ * Only applicable for stand-alone refreshes, and zero for
+ * other refreshes where the transaction itself accounts for the
+ * refresh fee.
*/
amountEffective: AmountString;
+
+ refreshInputAmount: AmountString;
+ refreshOutputAmount: AmountString;
}
/**
diff --git a/packages/taler-wallet-core/src/operations/transactions.ts
b/packages/taler-wallet-core/src/operations/transactions.ts
index 3cefd2c4d..12037fe0e 100644
--- a/packages/taler-wallet-core/src/operations/transactions.ts
+++ b/packages/taler-wallet-core/src/operations/transactions.ts
@@ -596,6 +596,11 @@ function buildTransactionForRefresh(
default:
extendedStatus = ExtendedStatus.Pending;
}
+ const inputAmount = Amounts.sumOrZero(
+ refreshGroupRecord.currency,
+ refreshGroupRecord.inputPerCoin,
+ ).amount;
+ const outputAmount = Amounts.sumOrZero(refreshGroupRecord.currency,
refreshGroupRecord.estimatedOutputPerCoin).amount;
return {
type: TransactionType.Refresh,
refreshReason: refreshGroupRecord.reason,
@@ -605,6 +610,8 @@ function buildTransactionForRefresh(
amountRaw: Amounts.stringify(
Amounts.zeroOfCurrency(refreshGroupRecord.currency),
),
+ refreshInputAmount: Amounts.stringify(inputAmount),
+ refreshOutputAmount: Amounts.stringify(outputAmount),
extendedStatus:
refreshGroupRecord.operationStatus === RefreshOperationStatus.Finished ||
refreshGroupRecord.operationStatus ===
diff --git a/packages/taler-wallet-webextension/src/wallet/History.stories.tsx
b/packages/taler-wallet-webextension/src/wallet/History.stories.tsx
index 2ebaf8536..e7dcc18f4 100644
--- a/packages/taler-wallet-webextension/src/wallet/History.stories.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/History.stories.tsx
@@ -102,6 +102,8 @@ const exampleData = {
refresh: {
...commonTransaction(),
type: TransactionType.Refresh,
+ refreshInputAmount: "USD:1",
+ refreshOutputAmount: "USD:0.5",
exchangeBaseUrl: "http://exchange.taler",
refreshReason: RefreshReason.PayMerchant,
} as TransactionRefresh,
diff --git
a/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx
b/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx
index c29cd99cc..b2922de22 100644
--- a/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx
@@ -126,6 +126,8 @@ const exampleData = {
refresh: {
...commonTransaction,
type: TransactionType.Refresh,
+ refreshInputAmount: "KUDOS:1",
+ refreshOutputAmount: "KUDOS:0.5",
exchangeBaseUrl: "http://exchange.taler",
refreshReason: RefreshReason.Manual,
} as TransactionRefresh,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: wallet-core: more details in refresh transaction,
gnunet <=