diff options
Diffstat (limited to 'packages/taler-wallet-core/src/coinSelection.ts')
-rw-r--r-- | packages/taler-wallet-core/src/coinSelection.ts | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/packages/taler-wallet-core/src/coinSelection.ts b/packages/taler-wallet-core/src/coinSelection.ts index 672d0ee79..7c22f63db 100644 --- a/packages/taler-wallet-core/src/coinSelection.ts +++ b/packages/taler-wallet-core/src/coinSelection.ts @@ -76,11 +76,6 @@ export interface CoinSelectionTally { amountPayRemaining: AmountJson; /** - * Allowance given by the merchant towards wire fees - */ - amountWireFeeLimitRemaining: AmountJson; - - /** * Allowance given by the merchant towards deposit fees * (and wire fees after wire fee limit is exhausted) */ @@ -110,17 +105,9 @@ function tallyFees( if (!tally.wireFeeCoveredForExchange.has(exchangeBaseUrl)) { const wf = wireFeesPerExchange[exchangeBaseUrl] ?? Amounts.zeroOfCurrency(currency); - const wfForgiven = Amounts.min(tally.amountWireFeeLimitRemaining, wf); - tally.amountWireFeeLimitRemaining = Amounts.sub( - tally.amountWireFeeLimitRemaining, - wfForgiven, - ).amount; // The remaining, amortized amount needs to be paid by the // wallet or covered by the deposit fee allowance. - let wfRemaining = Amounts.divide( - Amounts.sub(wf, wfForgiven).amount, - wireFeeAmortization, - ); + let wfRemaining = Amounts.divide(wf, wireFeeAmortization); // This is the amount forgiven via the deposit fee allowance. const wfDepositForgiven = Amounts.min( tally.amountDepositFeeLimitRemaining, @@ -183,7 +170,7 @@ export async function selectPayCoins( wex: WalletExecutionContext, req: SelectPayCoinRequestNg, ): Promise<SelectPayCoinsResult> { - const { contractTermsAmount, depositFeeLimit, wireFeeLimit } = req; + const { contractTermsAmount, depositFeeLimit } = req; if (logger.shouldLogTrace()) { logger.trace(`selecting coins for ${j2s(req)}`); @@ -218,7 +205,6 @@ export async function selectPayCoins( let tally: CoinSelectionTally = { amountPayRemaining: contractTermsAmount, - amountWireFeeLimitRemaining: wireFeeLimit, amountDepositFeeLimitRemaining: depositFeeLimit, customerDepositFees: Amounts.zeroOfCurrency(currency), customerWireFees: Amounts.zeroOfCurrency(currency), @@ -640,7 +626,6 @@ export interface SelectPayCoinRequestNg { restrictWireMethod: string; contractTermsAmount: AmountJson; depositFeeLimit: AmountJson; - wireFeeLimit: AmountJson; wireFeeAmortization: number; prevPayCoins?: PreviousPayCoins; requiredMinimumAge?: number; @@ -910,7 +895,6 @@ export function emptyTallyForPeerPayment( customerDepositFees: zero, lastDepositFee: zero, amountDepositFeeLimitRemaining: zero, - amountWireFeeLimitRemaining: zero, customerWireFees: zero, wireFeeCoveredForExchange: new Set(), }; |