taler-typescript-core

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

commit 92cfa4e7a07b97456d24ac1884d6354c0221e559
parent 76c4ad841a0e6a31673b79c0424a3aa941e6b08d
Author: Florian Dold <dold@taler.net>
Date:   Thu,  6 Aug 2026 15:40:18 +0200

wallet-cli: ask before accepting an exchange's terms of service

handle-uri accepted them on the user's behalf for both withdrawal flows,
which is not ours to agree to.

Diffstat:
Mpackages/taler-wallet-cli/src/index.ts | 20++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts @@ -1683,10 +1683,12 @@ walletCli exchangeBaseUrl, }, ); - // FIXME: Maybe prompt for this? - await wallet.client.call(WalletApiOperation.SetExchangeTosAccepted, { - exchangeBaseUrl, - }); + if (!(await cliHandleTos(wallet, exchangeBaseUrl))) { + console.error( + `error: the terms of service of ${exchangeBaseUrl} have to be accepted first`, + ); + processExit(EXIT_INPUT_REQUIRED); + } const res = await promptOrFail(`Amount (in ${exch.currency}): `); const amount = Amounts.stringify(Amounts.parseOrThrow(res)); const w = await wallet.client.call( @@ -1728,10 +1730,12 @@ walletCli processExit(1); return; } - // FIXME: Maybe prompt for this? - await wallet.client.call(WalletApiOperation.SetExchangeTosAccepted, { - exchangeBaseUrl: selectedExchange, - }); + if (!(await cliHandleTos(wallet, selectedExchange))) { + console.error( + `error: the terms of service of ${selectedExchange} have to be accepted first`, + ); + processExit(EXIT_INPUT_REQUIRED); + } const res = await wallet.client.call( WalletApiOperation.AcceptBankIntegratedWithdrawal, {