From 451400b3a4a0d22a3b6f00cd7c66cec376bcb991 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 5 Apr 2023 17:43:08 +0200 Subject: taler-wallet-cli: allow exchange selection for handle-uri --- packages/taler-wallet-cli/src/index.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'packages/taler-wallet-cli') diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts index 3bdb5d350..e4e43808c 100644 --- 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; } -- cgit v1.2.3