taler-typescript-core

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

commit 451400b3a4a0d22a3b6f00cd7c66cec376bcb991
parent 2823b1cdf4b6e9a6c4dbdb752c7c7259775e18f5
Author: Florian Dold <florian@dold.me>
Date:   Wed,  5 Apr 2023 17:43:08 +0200

taler-wallet-cli: allow exchange selection for handle-uri

Diffstat:
Mpackages/taler-wallet-cli/src/index.ts | 13+++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts @@ -575,6 +575,10 @@ walletCli help: "Handle a taler:// URI.", }) .maybeArgument("uri", clk.STRING) + .maybeOption("withdrawalExchange", ["--withdrawal-exchange"], clk.STRING, { + help: "Exchange to use for withdrawal operations.", + }) + .maybeOption("restrictAge", ["--restrict-age"], clk.INT) .flag("autoYes", ["-y", "--yes"]) .action(async (args) => { await withWallet(args, async (wallet) => { @@ -616,12 +620,17 @@ walletCli WalletApiOperation.GetWithdrawalDetailsForUri, { talerWithdrawUri: uri, + restrictAge: args.handleUri.restrictAge, }, ); console.log("withdrawInfo", withdrawInfo); - const selectedExchange = withdrawInfo.defaultExchangeBaseUrl; + const selectedExchange = + args.handleUri.withdrawalExchange ?? + withdrawInfo.defaultExchangeBaseUrl; if (!selectedExchange) { - console.error("no suggested exchange!"); + console.error( + "no exchange specified for withdrawal (and no exchange suggested by the bank)", + ); processExit(1); return; }