diff options
author | Sebastian <sebasjm@gmail.com> | 2022-08-18 16:01:47 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-08-18 16:02:16 -0300 |
commit | d1980c39fc2cf5054cfa9d3a03d685d75c2662d9 (patch) | |
tree | 3a605a565f975168bab6e67d1c1740bdd4310c79 /packages/taler-wallet-core/src/operations/withdraw.ts | |
parent | 23bb82f00cc83541527402bdd2d4309c530df674 (diff) | |
download | wallet-core-d1980c39fc2cf5054cfa9d3a03d685d75c2662d9.tar.xz |
moved wireInfo and denomInfo into taler-util so it can be used from the ui
Diffstat (limited to 'packages/taler-wallet-core/src/operations/withdraw.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/withdraw.ts | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index 484b9b962..721a043d7 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -241,7 +241,7 @@ export function selectWithdrawalDenominations( for (const d of denoms) { let count = 0; const cost = Amounts.add(d.value, d.feeWithdraw).amount; - for (;;) { + for (; ;) { if (Amounts.cmp(remaining, cost) < 0) { break; } @@ -898,8 +898,7 @@ export async function updateWithdrawalDenoms( denom.verificationStatus === DenominationVerificationStatus.Unverified ) { logger.trace( - `Validating denomination (${current + 1}/${ - denominations.length + `Validating denomination (${current + 1}/${denominations.length }) signature of ${denom.denomPubHash}`, ); let valid = false; @@ -1026,7 +1025,7 @@ async function queryReserve( if ( resp.status === 404 && result.talerErrorResponse.code === - TalerErrorCode.EXCHANGE_RESERVES_STATUS_UNKNOWN + TalerErrorCode.EXCHANGE_RESERVES_STATUS_UNKNOWN ) { ws.notify({ type: NotificationType.ReserveNotYetFound, @@ -1316,7 +1315,7 @@ export async function getExchangeWithdrawalInfo( ) { logger.warn( `wallet's support for exchange protocol version ${WALLET_EXCHANGE_PROTOCOL_VERSION} might be outdated ` + - `(exchange has ${exchangeDetails.protocolVersion}), checking for updates`, + `(exchange has ${exchangeDetails.protocolVersion}), checking for updates`, ); } } @@ -1395,12 +1394,17 @@ export async function getWithdrawalDetailsForUri( .mktx((x) => ({ exchanges: x.exchanges, exchangeDetails: x.exchangeDetails, + denominations: x.denominations, })) .runReadOnly(async (tx) => { const exchangeRecords = await tx.exchanges.iter().toArray(); for (const r of exchangeRecords) { const details = await ws.exchangeOps.getExchangeDetails(tx, r.baseUrl); - if (details) { + const denominations = await tx.denominations.indexes + .byExchangeBaseUrl.iter(r.baseUrl).toArray(); + if (details && denominations) { + + exchanges.push({ exchangeBaseUrl: details.exchangeBaseUrl, currency: details.currency, @@ -1411,6 +1415,9 @@ export async function getWithdrawalDetailsForUri( content: details.termsOfServiceText, }, paytoUris: details.wireInfo.accounts.map((x) => x.payto_uri), + auditors: details.auditors, + wireInfo: details.wireInfo, + denominations: denominations }); } } |