diff options
-rw-r--r-- | packages/taler-wallet-core/src/operations/withdraw.ts | 14 |
1 files 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, }; } |