diff options
author | Florian Dold <florian@dold.me> | 2024-03-06 21:15:30 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-03-07 00:03:59 +0100 |
commit | 7ba1d1f3351e58a331e99337afea0fbedb6eb828 (patch) | |
tree | 60b7a485cd317c1fe55276acdc0e055cd9353bfb /packages/taler-wallet-core/src/pay-peer-common.ts | |
parent | 618caa117111b9fed6a792b6816fc724483eb349 (diff) | |
download | wallet-core-7ba1d1f3351e58a331e99337afea0fbedb6eb828.tar.xz |
refactor coin selection, report maxEffectiveSpendAmount
Diffstat (limited to 'packages/taler-wallet-core/src/pay-peer-common.ts')
-rw-r--r-- | packages/taler-wallet-core/src/pay-peer-common.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/taler-wallet-core/src/pay-peer-common.ts b/packages/taler-wallet-core/src/pay-peer-common.ts index ff035d5e5..599010c1d 100644 --- a/packages/taler-wallet-core/src/pay-peer-common.ts +++ b/packages/taler-wallet-core/src/pay-peer-common.ts @@ -22,6 +22,7 @@ import { AmountString, Amounts, Codec, + SelectedCoin, TalerProtocolTimestamp, buildCodecForObject, checkDbInvariant, @@ -29,9 +30,8 @@ import { codecForTimestamp, codecOptional, } from "@gnu-taler/taler-util"; -import type { SelectedPeerCoin } from "./coinSelection.js"; import { SpendCoinDetails } from "./crypto/cryptoImplementation.js"; -import { PeerPushPaymentCoinSelection, ReserveRecord } from "./db.js"; +import { DbPeerPushPaymentCoinSelection, ReserveRecord } from "./db.js"; import { getTotalRefreshCost } from "./refresh.js"; import { WalletExecutionContext, getDenomInfo } from "./wallet.js"; import { getCandidateWithdrawalDenomsTx } from "./withdraw.js"; @@ -41,7 +41,7 @@ import { getCandidateWithdrawalDenomsTx } from "./withdraw.js"; */ export async function queryCoinInfosForSelection( wex: WalletExecutionContext, - csel: PeerPushPaymentCoinSelection, + csel: DbPeerPushPaymentCoinSelection, ): Promise<SpendCoinDetails[]> { let infos: SpendCoinDetails[] = []; await wex.db.runReadOnlyTx(["coins", "denominations"], async (tx) => { @@ -74,7 +74,7 @@ export async function queryCoinInfosForSelection( export async function getTotalPeerPaymentCost( wex: WalletExecutionContext, - pcs: SelectedPeerCoin[], + pcs: SelectedCoin[], ): Promise<AmountJson> { const currency = Amounts.currencyOf(pcs[0].contribution); return wex.db.runReadOnlyTx(["coins", "denominations"], async (tx) => { |