aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-12-01 12:01:44 -0300
committerSebastian <sebasjm@gmail.com>2023-12-01 12:01:44 -0300
commitdbfa3b78bea8dfa71a219f9c01ecc32a5339e154 (patch)
treefb6b780526b064695011f31473072e6fb9d73387 /packages/taler-wallet-core
parent1e5abb5b2aa9545e194f6db879e7480162f6d481 (diff)
downloadwallet-core-dbfa3b78bea8dfa71a219f9c01ecc32a5339e154.tar.xz
also query for the currency spec
Diffstat (limited to 'packages/taler-wallet-core')
-rw-r--r--packages/taler-wallet-core/src/operations/withdraw.ts11
1 files changed, 11 insertions, 0 deletions
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) {