taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit d5575c10ba81748f7d5fd9e67507bc800640c9de
parent 0fa2bc2f8f9506f80af58054d377065502bd83d1
Author: Florian Dold <florian@dold.me>
Date:   Sat, 18 Jul 2026 19:48:08 +0200

remove deprecated tosAccepted flag

Diffstat:
Mpackages/taler-util/src/types-taler-wallet.ts | 13-------------
Mpackages/taler-wallet-core/src/withdraw.ts | 16++++------------
Mpackages/taler-wallet-webextension/src/cta/Withdraw/Withdraw.test.ts | 4+---
3 files changed, 5 insertions(+), 28 deletions(-)

diff --git a/packages/taler-util/src/types-taler-wallet.ts b/packages/taler-util/src/types-taler-wallet.ts @@ -2099,14 +2099,6 @@ export interface WithdrawalDetailsForAmount { * @deprecated in favor of withdrawalAccountsList */ paytoUris: string[]; - - /** - * Did the user accept the current version of the exchange's - * terms of service? - * - * @deprecated the client should query the exchange entry instead - */ - tosAccepted: boolean; } export interface DenomSelItem { @@ -2154,11 +2146,6 @@ export interface ExchangeWithdrawalDetails { selectedDenoms: DenomSelectionState; /** - * Did the user already accept the current terms of service for the exchange? - */ - termsOfServiceAccepted: boolean; - - /** * Amount that will be subtracted from the reserve's balance. */ withdrawalAmountRaw: AmountString; diff --git a/packages/taler-wallet-core/src/withdraw.ts b/packages/taler-wallet-core/src/withdraw.ts @@ -59,6 +59,7 @@ import { Logger, NotificationType, ObservabilityEventType, + Paytos, PrepareBankIntegratedWithdrawalResponse, Result, ScopeInfo, @@ -104,7 +105,6 @@ import { getRandomBytes, j2s, makeErrorDetail, - Paytos, succeedOrThrow, } from "@gnu-taler/taler-util"; import { @@ -2950,14 +2950,6 @@ export async function getExchangeWithdrawalInfo( ); } } - - let tosAccepted = false; - if (exchange.tosAcceptedTimestamp) { - if (exchange.tosAcceptedEtag === exchange.tosCurrentEtag) { - tosAccepted = true; - } - } - const paytoUris = exchange.wireInfo.accounts.map((x) => x.payto_uri); if (!paytoUris) { throw Error("exchange is in invalid state"); @@ -2968,7 +2960,6 @@ export async function getExchangeWithdrawalInfo( exchangeWireAccounts, exchangeCreditAccountDetails: withdrawalAccountsList, selectedDenoms, - termsOfServiceAccepted: tosAccepted, withdrawalAmountEffective: Amounts.stringify(selectedDenoms.totalCoinValue), withdrawalAmountRaw: Amounts.stringify(instructedAmount), // TODO: remove hardcoding, this should be calculated from the denominations info @@ -3927,7 +3918,9 @@ export async function confirmWithdrawal( logger.warn(`empty list of withdrawal accounts`); } for (const acc of withdrawalAccountList) { - const parsedExchangeWire = Result.orUndefined(Paytos.fromString(acc.paytoUri)); + const parsedExchangeWire = Result.orUndefined( + Paytos.fromString(acc.paytoUri), + ); if (!parsedExchangeWire) { logger.warn( `unable to parse payto ${acc.paytoUri} of ${selectedExchange}`, @@ -4472,7 +4465,6 @@ export async function internalGetWithdrawalDetailsForAmount( amountRaw: req.amount, amountEffective: Amounts.stringify(wi.selectedDenoms.totalCoinValue), paytoUris: wi.exchangePaytoUris, - tosAccepted: wi.termsOfServiceAccepted, ageRestrictionOptions: wi.ageRestrictionOptions, withdrawalAccountsList: wi.exchangeCreditAccountDetails, numCoins, diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/Withdraw.test.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/Withdraw.test.ts @@ -19,7 +19,7 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { describe, it, before } from "node:test"; +import { describe, it } from "node:test"; import { AmountString, @@ -182,7 +182,6 @@ describe("Withdraw CTA states", () => { amountRaw: "ARS:2" as AmountString, amountEffective: "ARS:2" as AmountString, paytoUris: ["payto://"], - tosAccepted: true, scopeInfo: { currency: "ARS", type: ScopeType.Exchange, @@ -266,7 +265,6 @@ describe("Withdraw CTA states", () => { url: "http://asd", }, exchangeBaseUrl: "http://asd", - tosAccepted: false, withdrawalAccountsList: [], ageRestrictionOptions: [], numCoins: 42,