diff options
Diffstat (limited to 'packages/taler-wallet-core/src/util/instructedAmountConversion.ts')
-rw-r--r-- | packages/taler-wallet-core/src/util/instructedAmountConversion.ts | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/packages/taler-wallet-core/src/util/instructedAmountConversion.ts b/packages/taler-wallet-core/src/util/instructedAmountConversion.ts index 4365e6d32..caa3fdca5 100644 --- a/packages/taler-wallet-core/src/util/instructedAmountConversion.ts +++ b/packages/taler-wallet-core/src/util/instructedAmountConversion.ts @@ -33,7 +33,7 @@ import { import { DenominationRecord, InternalWalletState, - getExchangeDetails, + getExchangeWireDetailsInTx, timestampProtocolFromDb, } from "../index.js"; import { CoinInfo } from "./coinSelection.js"; @@ -61,8 +61,8 @@ function getOperationType(txType: TransactionType): OperationType { txType === TransactionType.Withdrawal ? OperationType.Credit : txType === TransactionType.Deposit - ? OperationType.Debit - : undefined; + ? OperationType.Debit + : undefined; if (!operationType) { throw Error(`operation type ${txType} not yet supported`); } @@ -155,7 +155,10 @@ async function getAvailableDenoms( filters.exchanges ?? databaseExchanges.map((e) => e.baseUrl); for (const exchangeBaseUrl of filteredExchanges) { - const exchangeDetails = await getExchangeDetails(tx, exchangeBaseUrl); + const exchangeDetails = await getExchangeWireDetailsInTx( + tx, + exchangeBaseUrl, + ); // 1.- exchange has same currency if (exchangeDetails?.currency !== currency) { continue; @@ -221,9 +224,10 @@ async function getAvailableDenoms( //4.- filter coins restricted by age if (operationType === OperationType.Credit) { // FIXME: Use denom groups instead of querying all denominations! - const ds = await tx.denominations.indexes.byExchangeBaseUrl.getAll( - exchangeBaseUrl, - ); + const ds = + await tx.denominations.indexes.byExchangeBaseUrl.getAll( + exchangeBaseUrl, + ); for (const denom of ds) { const expiresWithdraw = AbsoluteTime.fromProtocolTimestamp( timestampProtocolFromDb(denom.stampExpireWithdraw), |