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: also return top-


From: gnunet
Subject: [taler-wallet-core] branch master updated: wallet-core: also return top-level fee gap estimate
Date: Wed, 05 Apr 2023 11:06:25 +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 d5c5c7463 wallet-core: also return top-level fee gap estimate
d5c5c7463 is described below

commit d5c5c7463e5210916822c8030bb59c7b0f3ccc1c
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Apr 5 11:06:22 2023 +0200

    wallet-core: also return top-level fee gap estimate
---
 packages/taler-util/src/wallet-types.ts               | 6 ++++++
 packages/taler-wallet-core/src/operations/pay-peer.ts | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/packages/taler-util/src/wallet-types.ts 
b/packages/taler-util/src/wallet-types.ts
index a761c5cff..11162df14 100644
--- a/packages/taler-util/src/wallet-types.ts
+++ b/packages/taler-util/src/wallet-types.ts
@@ -2263,6 +2263,12 @@ export interface PayPeerInsufficientBalanceDetails {
    */
   balanceMaterial: AmountString;
 
+  /**
+   * If non-zero, the largest fee gap estimate of an exchange
+   * where we would otherwise have enough balance available.
+   */
+  feeGapEstimate: AmountString;
+
   perExchange: {
     [url: string]: {
       balanceAvailable: AmountString;
diff --git a/packages/taler-wallet-core/src/operations/pay-peer.ts 
b/packages/taler-wallet-core/src/operations/pay-peer.ts
index 92ec549dd..ebf521079 100644
--- a/packages/taler-wallet-core/src/operations/pay-peer.ts
+++ b/packages/taler-wallet-core/src/operations/pay-peer.ts
@@ -342,6 +342,8 @@ export async function selectPeerCoins(
 
       const perExchange: PayPeerInsufficientBalanceDetails["perExchange"] = {};
 
+      let maxFeeGapEstimate = Amounts.zeroOfCurrency(currency);
+
       for (const exch of exchanges) {
         if (exch.detailsPointer?.currency !== currency) {
           continue;
@@ -361,12 +363,15 @@ export async function selectPeerCoins(
           balanceMaterial: Amounts.stringify(infoExchange.balanceMaterial),
           feeGapEstimate: Amounts.stringify(gap),
         };
+
+        maxFeeGapEstimate = Amounts.max(maxFeeGapEstimate, gap);
       }
 
       const errDetails: PayPeerInsufficientBalanceDetails = {
         amountRequested: Amounts.stringify(instructedAmount),
         balanceAvailable: Amounts.stringify(infoGeneral.balanceAvailable),
         balanceMaterial: Amounts.stringify(infoGeneral.balanceMaterial),
+        feeGapEstimate: Amounts.stringify(maxFeeGapEstimate),
         perExchange,
       };
 

-- 
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]