diff options
Diffstat (limited to 'src/headless/taler-wallet-cli.ts')
-rw-r--r-- | src/headless/taler-wallet-cli.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/headless/taler-wallet-cli.ts b/src/headless/taler-wallet-cli.ts index 71bccadef..2073c2573 100644 --- a/src/headless/taler-wallet-cli.ts +++ b/src/headless/taler-wallet-cli.ts @@ -27,6 +27,7 @@ import { Logger } from "../util/logging"; import * as Amounts from "../util/amounts"; import { decodeCrock } from "../crypto/talerCrypto"; import { OperationFailedAndReportedError } from "../wallet-impl/errors"; +import { Bank } from "./bank"; const logger = new Logger("taler-wallet-cli.ts"); @@ -435,6 +436,23 @@ testCli }); testCli + .subcommand("genWithdrawUri", "gen-withdraw-uri", { + help: "Generate a taler://withdraw URI.", + }) + .requiredOption("amount", ["-a", "--amount"], clk.STRING, { + default: "TESTKUDOS:20", + }) + .requiredOption("bank", ["-b", "--bank"], clk.STRING, { + default: "https://bank.test.taler.net/", + }) + .action(async (args) => { + const b = new Bank(args.genWithdrawUri.bank); + const user = await b.registerRandomUser(); + const url = await b.generateWithdrawUri(user, args.genWithdrawUri.amount); + console.log(url); + }); + +testCli .subcommand("genRefundUri", "gen-refund-uri", { help: "Generate a taler://refund URI.", }) |