From eff3920bd5a2bff58d66ac72ba8bd2c1577f452f Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 23 Apr 2023 22:49:42 +0200 Subject: wallet-core: further towards deposit DD37 --- packages/taler-wallet-cli/src/index.ts | 38 ++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'packages/taler-wallet-cli/src') diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts index cc7c119b9..a31aec2eb 100644 --- a/packages/taler-wallet-cli/src/index.ts +++ b/packages/taler-wallet-cli/src/index.ts @@ -386,8 +386,12 @@ walletCli const transactionsCli = walletCli .subcommand("transactions", "transactions", { help: "Manage transactions." }) - .maybeOption("currency", ["--currency"], clk.STRING) - .maybeOption("search", ["--search"], clk.STRING) + .maybeOption("currency", ["--currency"], clk.STRING, { + help: "Filter by currency.", + }) + .maybeOption("search", ["--search"], clk.STRING, { + help: "Filter by search string", + }) .flag("includeRefreshes", ["--include-refreshes"]); // Default action @@ -420,6 +424,36 @@ transactionsCli }); }); +transactionsCli + .subcommand("suspendTransaction", "suspend", { + help: "Suspend a transaction.", + }) + .requiredArgument("transactionId", clk.STRING, { + help: "Identifier of the transaction to suspend.", + }) + .action(async (args) => { + await withWallet(args, async (wallet) => { + await wallet.client.call(WalletApiOperation.SuspendTransaction, { + transactionId: args.suspendTransaction.transactionId, + }); + }); + }); + +transactionsCli + .subcommand("resumeTransaction", "resume", { + help: "Resume a transaction.", + }) + .requiredArgument("transactionId", clk.STRING, { + help: "Identifier of the transaction to suspend.", + }) + .action(async (args) => { + await withWallet(args, async (wallet) => { + await wallet.client.call(WalletApiOperation.ResumeTransaction, { + transactionId: args.resumeTransaction.transactionId, + }); + }); + }); + transactionsCli .subcommand("lookup", "lookup", { help: "Look up a single transaction based on the transaction identifier.", -- cgit v1.2.3