aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/coinSelection.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/coinSelection.ts')
-rw-r--r--packages/taler-wallet-core/src/coinSelection.ts13
1 files changed, 1 insertions, 12 deletions
diff --git a/packages/taler-wallet-core/src/coinSelection.ts b/packages/taler-wallet-core/src/coinSelection.ts
index 0027241c4..6a7d79d83 100644
--- a/packages/taler-wallet-core/src/coinSelection.ts
+++ b/packages/taler-wallet-core/src/coinSelection.ts
@@ -99,7 +99,6 @@ export interface CoinSelectionTally {
function tallyFees(
tally: CoinSelectionTally,
wireFeesPerExchange: Record<string, AmountJson>,
- wireFeeAmortization: number,
exchangeBaseUrl: string,
feeDeposit: AmountJson,
): void {
@@ -110,7 +109,7 @@ function tallyFees(
wireFeesPerExchange[exchangeBaseUrl] ?? Amounts.zeroOfCurrency(currency);
// The remaining, amortized amount needs to be paid by the
// wallet or covered by the deposit fee allowance.
- let wfRemaining = Amounts.divide(wf, wireFeeAmortization);
+ let wfRemaining = wf;
// This is the amount forgiven via the deposit fee allowance.
const wfDepositForgiven = Amounts.min(
tally.amountDepositFeeLimitRemaining,
@@ -222,7 +221,6 @@ async function internalSelectPayCoins(
coinRes,
tally,
{
- wireFeeAmortization: req.wireFeeAmortization,
wireFeesPerExchange: wireFeesPerExchange,
},
);
@@ -237,7 +235,6 @@ async function internalSelectPayCoins(
// amount.
selectedDenom = selectGreedy(
{
- wireFeeAmortization: req.wireFeeAmortization,
wireFeesPerExchange: wireFeesPerExchange,
},
candidateDenoms,
@@ -358,7 +355,6 @@ async function maybeRepairCoinSelection(
coinRes: SelectedCoin[],
tally: CoinSelectionTally,
feeInfo: {
- wireFeeAmortization: number;
wireFeesPerExchange: Record<string, AmountJson>;
},
): Promise<void> {
@@ -380,7 +376,6 @@ async function maybeRepairCoinSelection(
tallyFees(
tally,
feeInfo.wireFeesPerExchange,
- feeInfo.wireFeeAmortization,
coin.exchangeBaseUrl,
Amounts.parseOrThrow(denom.feeDeposit),
);
@@ -576,7 +571,6 @@ export function testing_selectGreedy(
}
export interface SelectGreedyRequest {
- wireFeeAmortization: number;
wireFeesPerExchange: Record<string, AmountJson>;
}
@@ -585,7 +579,6 @@ function selectGreedy(
candidateDenoms: AvailableDenom[],
tally: CoinSelectionTally,
): SelResult | undefined {
- const { wireFeeAmortization } = req;
const selectedDenom: SelResult = {};
for (const denom of candidateDenoms) {
const contributions: AmountJson[] = [];
@@ -605,7 +598,6 @@ function selectGreedy(
tallyFees(
tally,
req.wireFeesPerExchange,
- wireFeeAmortization,
denom.exchangeBaseUrl,
Amounts.parseOrThrow(denom.feeDeposit),
);
@@ -718,7 +710,6 @@ export interface SelectPayCoinRequestNg {
restrictWireMethod: string;
contractTermsAmount: AmountJson;
depositFeeLimit: AmountJson;
- wireFeeAmortization: number;
prevPayCoins?: PreviousPayCoins;
requiredMinimumAge?: number;
forcedSelection?: ForcedCoinSel;
@@ -1110,7 +1101,6 @@ async function internalSelectPeerCoins(
const resCoins: SelectedCoin[] = [];
await maybeRepairCoinSelection(wex, tx, req.repair ?? [], resCoins, tally, {
- wireFeeAmortization: 1,
wireFeesPerExchange: {},
});
@@ -1122,7 +1112,6 @@ async function internalSelectPeerCoins(
const selRes = selectGreedy(
{
- wireFeeAmortization: 1,
wireFeesPerExchange: {},
},
candidates,