diff options
author | Florian Dold <florian@dold.me> | 2023-04-05 17:43:08 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-04-05 17:43:08 +0200 |
commit | 451400b3a4a0d22a3b6f00cd7c66cec376bcb991 (patch) | |
tree | c9379b5ed3ea2c59cff91e65c9f304840bb6c9db /packages/taler-wallet-cli/src/index.ts | |
parent | 2823b1cdf4b6e9a6c4dbdb752c7c7259775e18f5 (diff) | |
download | wallet-core-451400b3a4a0d22a3b6f00cd7c66cec376bcb991.tar.xz |
taler-wallet-cli: allow exchange selection for handle-uri
Diffstat (limited to 'packages/taler-wallet-cli/src/index.ts')
-rw-r--r-- | packages/taler-wallet-cli/src/index.ts | 13 |
1 files changed, 11 insertions, 2 deletions
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; } |