View Issue Details

IDProjectCategoryView StatusLast Update
0010829Talerwallet-corepublic2025-12-23 18:40
Reporterhtgoebel Assigned ToFlorian Dold  
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Versiongit (master) 
Target Version1.4 
Summary0010829: [PATCH] taler-wallet-cli: Enhancements to withdrawKudos
DescriptionWhen working with taler-walet-cli I discovered and fixed two minor issues:
- Improve help-message - did not mention default.
- Add options to specify bank and exchange - useful when working offline with sandcastle running on localhost.

Patches are included
TagsNo tags attached.
Attached Files
0001-wallet-cli-withdrawKudos-Improve-help-message.patch (1,011 bytes)   
From 65a3529cd76b7b1912561ffd1cae2d6d1514aa18 Mon Sep 17 00:00:00 2001
Message-ID: <65a3529cd76b7b1912561ffd1cae2d6d1514aa18.1766509799.git.h.goebel@crazy-compilers.com>
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
Date: Tue, 23 Dec 2025 17:48:08 +0100
Subject: [PATCH 1/3] wallet-cli: withdrawKudos: Improve help-message.

---
 packages/taler-wallet-cli/src/index.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts
index 4a9f044..d6e5370 100644
--- a/packages/taler-wallet-cli/src/index.ts
+++ b/packages/taler-wallet-cli/src/index.ts
@@ -2036,7 +2036,7 @@ testCli
   .subcommand("withdrawKudos", "withdraw-kudos")
   .flag("wait", ["--wait"])
   .maybeOption("amount", ["--amount"], clk.AMOUNT, {
-    help: "Amount to withdraw",
+    help: "Amount to withdraw (default: 50 KUDOS)",
   })
   .action(async (args) => {
     await withWallet(args, { lazyTaskLoop: true }, async (wallet) => {
-- 
2.41.3

0002-wallet-cli-withdrawKudos-Add-options-to-specify-bank.patch (1,992 bytes)   
From 21e3edd7cd26943a6fbda06e306adecf5a27707f Mon Sep 17 00:00:00 2001
Message-ID: <21e3edd7cd26943a6fbda06e306adecf5a27707f.1766509799.git.h.goebel@crazy-compilers.com>
In-Reply-To: <65a3529cd76b7b1912561ffd1cae2d6d1514aa18.1766509799.git.h.goebel@crazy-compilers.com>
References: <65a3529cd76b7b1912561ffd1cae2d6d1514aa18.1766509799.git.h.goebel@crazy-compilers.com>
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
Date: Tue, 23 Dec 2025 17:48:42 +0100
Subject: [PATCH 2/3] wallet-cli: withdrawKudos: Add options to specify bank
 and exchange.

---
 packages/taler-wallet-cli/src/index.ts | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts
index d6e5370..51261b0 100644
--- a/packages/taler-wallet-cli/src/index.ts
+++ b/packages/taler-wallet-cli/src/index.ts
@@ -2038,14 +2038,20 @@ testCli
   .maybeOption("amount", ["--amount"], clk.AMOUNT, {
     help: "Amount to withdraw (default: 50 KUDOS)",
   })
+  .maybeOption("bank", ["--bank-url"], clk.STRING, {
+    help: "Bank to use for operations (default: https://bank.demo.taler.net/).",
+  })
+  .maybeOption("exchange", ["--exchange-url"], clk.STRING, {
+    help: "Exchange to use for operations (default: https://exchange.demo.taler.net/).",
+  })
   .action(async (args) => {
     await withWallet(args, { lazyTaskLoop: true }, async (wallet) => {
       const resp = await wallet.client.call(
         WalletApiOperation.WithdrawTestBalance,
         {
           amount: (args.withdrawKudos.amount ?? "KUDOS:50") as AmountString,
-          corebankApiBaseUrl: "https://bank.demo.taler.net/",
-          exchangeBaseUrl: "https://exchange.demo.taler.net/",
+          corebankApiBaseUrl: (args.withdrawKudos.bank ?? "https://bank.demo.taler.net/"),
+          exchangeBaseUrl: (args.withdrawKudos.exchange ?? "https://exchange.demo.taler.net/"),
         },
       );
       if (args.withdrawKudos.wait) {
-- 
2.41.3

0003-wallet-cli-withdrawKudos-Cleanup-option-handling.patch (2,416 bytes)   
From b5b857ddaa798a67c0fda5ea299ebd5412929fbc Mon Sep 17 00:00:00 2001
Message-ID: <b5b857ddaa798a67c0fda5ea299ebd5412929fbc.1766509799.git.h.goebel@crazy-compilers.com>
In-Reply-To: <65a3529cd76b7b1912561ffd1cae2d6d1514aa18.1766509799.git.h.goebel@crazy-compilers.com>
References: <65a3529cd76b7b1912561ffd1cae2d6d1514aa18.1766509799.git.h.goebel@crazy-compilers.com>
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
Date: Tue, 23 Dec 2025 17:55:32 +0100
Subject: [PATCH 3/3] wallet-cli: withdrawKudos: Cleanup option handling.

---
 packages/taler-wallet-cli/src/index.ts | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts
index 51261b0..29c5966 100644
--- a/packages/taler-wallet-cli/src/index.ts
+++ b/packages/taler-wallet-cli/src/index.ts
@@ -2035,23 +2035,26 @@ testCli
 testCli
   .subcommand("withdrawKudos", "withdraw-kudos")
   .flag("wait", ["--wait"])
-  .maybeOption("amount", ["--amount"], clk.AMOUNT, {
+  .requiredOption("amount", ["--amount"], clk.AMOUNT, {
     help: "Amount to withdraw (default: 50 KUDOS)",
+    default: "KUDOS:50",
   })
-  .maybeOption("bank", ["--bank-url"], clk.STRING, {
+  .requiredOption("bank", ["--bank-url"], clk.STRING, {
     help: "Bank to use for operations (default: https://bank.demo.taler.net/).",
+    default: "https://bank.demo.taler.net/",
   })
-  .maybeOption("exchange", ["--exchange-url"], clk.STRING, {
+  .requiredOption("exchange", ["--exchange-url"], clk.STRING, {
     help: "Exchange to use for operations (default: https://exchange.demo.taler.net/).",
+    default: "https://exchange.demo.taler.net/",
   })
   .action(async (args) => {
     await withWallet(args, { lazyTaskLoop: true }, async (wallet) => {
       const resp = await wallet.client.call(
         WalletApiOperation.WithdrawTestBalance,
         {
-          amount: (args.withdrawKudos.amount ?? "KUDOS:50") as AmountString,
-          corebankApiBaseUrl: (args.withdrawKudos.bank ?? "https://bank.demo.taler.net/"),
-          exchangeBaseUrl: (args.withdrawKudos.exchange ?? "https://exchange.demo.taler.net/"),
+          amount: args.withdrawKudos.amount as AmountString,
+          corebankApiBaseUrl: args.withdrawKudos.bank,
+          exchangeBaseUrl: args.withdrawKudos.exchange,
         },
       );
       if (args.withdrawKudos.wait) {
-- 
2.41.3

Activities

Issue History

Date Modified Username Field Change
2025-12-23 18:10 htgoebel New Issue
2025-12-23 18:10 htgoebel File Added: 0001-wallet-cli-withdrawKudos-Improve-help-message.patch
2025-12-23 18:10 htgoebel File Added: 0002-wallet-cli-withdrawKudos-Add-options-to-specify-bank.patch
2025-12-23 18:10 htgoebel File Added: 0003-wallet-cli-withdrawKudos-Cleanup-option-handling.patch
2025-12-23 18:40 Christian Grothoff Assigned To => Florian Dold
2025-12-23 18:40 Christian Grothoff Status new => assigned
2025-12-23 18:40 Christian Grothoff Target Version => 1.4