[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] 01/02: also query for the currency spec
From: |
gnunet |
Subject: |
[taler-wallet-core] 01/02: also query for the currency spec |
Date: |
Fri, 01 Dec 2023 16:18:53 +0100 |
This is an automated email from the git hooks/post-receive script.
sebasjm pushed a commit to branch master
in repository wallet-core.
commit dbfa3b78bea8dfa71a219f9c01ecc32a5339e154
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Fri Dec 1 12:01:44 2023 -0300
also query for the currency spec
---
packages/taler-wallet-core/src/operations/withdraw.ts | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts
b/packages/taler-wallet-core/src/operations/withdraw.ts
index 868ac3adc..24e8d3f8f 100644
--- a/packages/taler-wallet-core/src/operations/withdraw.ts
+++ b/packages/taler-wallet-core/src/operations/withdraw.ts
@@ -29,6 +29,7 @@ import {
BankWithdrawDetails,
CancellationToken,
CoinStatus,
+ CurrencySpecification,
DenomKeyType,
DenomSelectionState,
Duration,
@@ -61,6 +62,7 @@ import {
canonicalizeBaseUrl,
codecForBankWithdrawalOperationPostResponse,
codecForCashinConversionResponse,
+ codecForConversionBankConfig,
codecForExchangeWithdrawBatchResponse,
codecForIntegrationBankConfig,
codecForReserveStatus,
@@ -2600,6 +2602,7 @@ async function fetchWithdrawalAccountInfo(
for (let acct of exchangeDetails.wireInfo.accounts) {
let paytoUri: string;
let transferAmount: AmountString | undefined = undefined;
+ let currencySpecification: CurrencySpecification | undefined = undefined;
if (acct.conversion_url != null) {
const reqUrl = new URL("cashin-rate", acct.conversion_url);
reqUrl.searchParams.set(
@@ -2613,6 +2616,13 @@ async function fetchWithdrawalAccountInfo(
);
paytoUri = acct.payto_uri;
transferAmount = resp.amount_debit;
+ const configUrl = new URL("config", acct.conversion_url);
+ const configResp = await ws.http.fetch(configUrl.href);
+ const configParsed = await readSuccessResponseJsonOrThrow(
+ configResp,
+ codecForConversionBankConfig(),
+ );
+ currencySpecification = configParsed.fiat_currency_specification
if (req.reservePub) {
}
} else {
@@ -2630,6 +2640,7 @@ async function fetchWithdrawalAccountInfo(
const acctInfo: WithdrawalExchangeAccountDetails = {
paytoUri,
transferAmount,
+ currencySpecification,
creditRestrictions: acct.credit_restrictions,
};
if (transferAmount != null) {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.