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: properly filter


From: gnunet
Subject: [taler-wallet-core] branch master updated: wallet-core: properly filter possible exchanges for withdrawals
Date: Mon, 08 Jan 2024 21:43:04 +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 e9683e5ae wallet-core: properly filter possible exchanges for 
withdrawals
e9683e5ae is described below

commit e9683e5ae9d3f7e6f3e16d01a280592075861548
Author: Florian Dold <florian@dold.me>
AuthorDate: Mon Jan 8 21:43:02 2024 +0100

    wallet-core: properly filter possible exchanges for withdrawals
---
 packages/taler-wallet-core/src/operations/withdraw.ts | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts 
b/packages/taler-wallet-core/src/operations/withdraw.ts
index 49c0e4a14..56f1d91bb 100644
--- a/packages/taler-wallet-core/src/operations/withdraw.ts
+++ b/packages/taler-wallet-core/src/operations/withdraw.ts
@@ -35,6 +35,7 @@ import {
   Duration,
   ExchangeBatchWithdrawRequest,
   ExchangeListItem,
+  ExchangeUpdateStatus,
   ExchangeWireAccount,
   ExchangeWithdrawBatchResponse,
   ExchangeWithdrawRequest,
@@ -1945,12 +1946,21 @@ export async function getWithdrawalDetailsForUri(
     }
   }
 
-  const possibleExchangesResp = await listExchanges(ws);
+  const currency = Amounts.currencyOf(info.amount);
+
+  const listExchangesResp = await listExchanges(ws);
+  const possibleExchanges = listExchangesResp.exchanges.filter((x) => {
+    return (
+      x.currency === currency &&
+      (x.exchangeUpdateStatus === ExchangeUpdateStatus.Ready ||
+        x.exchangeUpdateStatus === ExchangeUpdateStatus.ReadyUpdate)
+    );
+  });
 
   return {
     amount: Amounts.stringify(info.amount),
     defaultExchangeBaseUrl: info.suggestedExchange,
-    possibleExchanges: possibleExchangesResp.exchanges,
+    possibleExchanges,
   };
 }
 

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