gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: wallet-core: report number of


From: gnunet
Subject: [taler-wallet-core] branch master updated: wallet-core: report number of coins in withdrawal details
Date: Wed, 24 May 2023 12:58:36 +0200

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 4627c0781 wallet-core: report number of coins in withdrawal details
4627c0781 is described below

commit 4627c0781c982421585e4adf9e3320b56f644965
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed May 24 12:58:33 2023 +0200

    wallet-core: report number of coins in withdrawal details
---
 packages/taler-util/src/wallet-types.ts  | 7 +++++++
 packages/taler-wallet-core/src/wallet.ts | 5 +++++
 2 files changed, 12 insertions(+)

diff --git a/packages/taler-util/src/wallet-types.ts 
b/packages/taler-util/src/wallet-types.ts
index 41b0d5574..d20eb5173 100644
--- a/packages/taler-util/src/wallet-types.ts
+++ b/packages/taler-util/src/wallet-types.ts
@@ -1134,6 +1134,13 @@ export interface ManualWithdrawalDetails {
    */
   amountEffective: AmountString;
 
+  /**
+   * Number of coins that would be used for withdrawal.
+   * 
+   * The UIs should warn if this number is too high (rougly at >100).
+   */
+  numCoins: number;
+
   /**
    * Ways to pay the exchange.
    */
diff --git a/packages/taler-wallet-core/src/wallet.ts 
b/packages/taler-wallet-core/src/wallet.ts
index 6009ff096..da9445602 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -1107,12 +1107,17 @@ async function dispatchRequestInternal<Op extends 
WalletApiOperation>(
         Amounts.parseOrThrow(req.amount),
         req.restrictAge,
       );
+      let numCoins = 0;
+      for (const x of wi.selectedDenoms.selectedDenoms) {
+        numCoins += x.count;
+      }
       const resp: ManualWithdrawalDetails = {
         amountRaw: req.amount,
         amountEffective: Amounts.stringify(wi.selectedDenoms.totalCoinValue),
         paytoUris: wi.exchangePaytoUris,
         tosAccepted: wi.termsOfServiceAccepted,
         ageRestrictionOptions: wi.ageRestrictionOptions,
+        numCoins,
       };
       return resp;
     }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]