taler-wallet-cli: allow exchange selection for handle-uri
This commit is contained in:
parent
2823b1cdf4
commit
451400b3a4
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user