diff options
Diffstat (limited to 'src/headless')
-rw-r--r-- | src/headless/bank.ts | 2 | ||||
-rw-r--r-- | src/headless/clk.ts | 8 | ||||
-rw-r--r-- | src/headless/helpers.ts | 4 | ||||
-rw-r--r-- | src/headless/merchant.ts | 2 | ||||
-rw-r--r-- | src/headless/taler-wallet-cli.ts | 13 |
5 files changed, 15 insertions, 14 deletions
diff --git a/src/headless/bank.ts b/src/headless/bank.ts index 81b5293bd..2177908a6 100644 --- a/src/headless/bank.ts +++ b/src/headless/bank.ts @@ -95,7 +95,7 @@ export class Bank { amount: string, reservePub: string, exchangePaytoUri: string, - ) { + ): Promise<void> { const reqUrl = new URL("testing/withdraw", this.bankBaseUrl).href; const body = { diff --git a/src/headless/clk.ts b/src/headless/clk.ts index 09f758ad4..a905464bd 100644 --- a/src/headless/clk.ts +++ b/src/headless/clk.ts @@ -117,7 +117,7 @@ export class CommandGroup<GN extends keyof any, TG> { private scArgs: SubcommandArgs, ) {} - action(f: ActionFn<TG>) { + action(f: ActionFn<TG>): void { if (this.myAction) { throw Error("only one action supported per command"); } @@ -269,7 +269,7 @@ export class CommandGroup<GN extends keyof any, TG> { return cg as any; } - printHelp(progName: string, parents: CommandGroup<any, any>[]) { + printHelp(progName: string, parents: CommandGroup<any, any>[]): void { let usageSpec = ""; for (const p of parents) { usageSpec += (p.name ?? progName) + " "; @@ -320,7 +320,7 @@ export class CommandGroup<GN extends keyof any, TG> { parents: CommandGroup<any, any>[], unparsedArgs: string[], parsedArgs: any, - ) { + ): void { let posArgIndex = 0; let argsTerminated = false; let i; @@ -507,7 +507,7 @@ export class Program<PN extends keyof any, T> { }); } - run() { + run(): void { const args = process.argv; if (args.length < 2) { console.error( diff --git a/src/headless/helpers.ts b/src/headless/helpers.ts index 11e2c90de..47a0844bd 100644 --- a/src/headless/helpers.ts +++ b/src/headless/helpers.ts @@ -106,7 +106,7 @@ export async function getDefaultNodeWallet( myHttpLib = new NodeHttpLib(); } - const myVersionChange = () => { + const myVersionChange = (): Promise<void> => { console.error("version change requested, should not happen"); throw Error(); }; @@ -141,7 +141,7 @@ export async function withdrawTestBalance( amount = "TESTKUDOS:10", bankBaseUrl = "https://bank.test.taler.net/", exchangeBaseUrl = "https://exchange.test.taler.net/", -) { +): Promise<void> { const reserveResponse = await myWallet.createReserve({ amount: amounts.parseOrThrow(amount), exchange: exchangeBaseUrl, diff --git a/src/headless/merchant.ts b/src/headless/merchant.ts index 27e7e3f21..b479c5a8a 100644 --- a/src/headless/merchant.ts +++ b/src/headless/merchant.ts @@ -65,7 +65,7 @@ export class MerchantBackendConnection { constructor(public merchantBaseUrl: string, public apiKey: string) {} - async authorizeTip(amount: string, justification: string) { + async authorizeTip(amount: string, justification: string): Promise<string> { const reqUrl = new URL("tip-authorize", this.merchantBaseUrl).href; const tipReq = { amount, diff --git a/src/headless/taler-wallet-cli.ts b/src/headless/taler-wallet-cli.ts index a7dcce9a3..3da01a2dd 100644 --- a/src/headless/taler-wallet-cli.ts +++ b/src/headless/taler-wallet-cli.ts @@ -22,7 +22,7 @@ import { runIntegrationTest, runIntegrationTestBasic } from "./integrationtest"; import { Wallet } from "../wallet"; import qrcodeGenerator from "qrcode-generator"; import * as clk from "./clk"; -import { BridgeIDBFactory, MemoryBackend } from "idb-bridge"; +import { BridgeIDBFactory } from "idb-bridge"; import { Logger } from "../util/logging"; import { Amounts } from "../util/amounts"; import { decodeCrock } from "../crypto/talerCrypto"; @@ -46,7 +46,7 @@ async function doPay( wallet: Wallet, payUrl: string, options: { alwaysYes: boolean } = { alwaysYes: true }, -) { +): Promise<void> { const result = await wallet.preparePayForUri(payUrl); if (result.status === "error") { console.error("Could not pay:", result.error); @@ -89,21 +89,22 @@ async function doPay( } if (pay) { - const payRes = await wallet.confirmPay(result.proposalId, undefined); + await wallet.confirmPay(result.proposalId, undefined); console.log("paid!"); } else { console.log("not paying"); } } -function applyVerbose(verbose: boolean) { +function applyVerbose(verbose: boolean): void { if (verbose) { console.log("enabled verbose logging"); BridgeIDBFactory.enableTracing = true; } } -function printVersion() { +function printVersion(): void { + // eslint-disable-next-line @typescript-eslint/no-var-requires const info = require("../../../package.json"); console.log(`${info.version}`); process.exit(0); @@ -329,7 +330,7 @@ exchangesCli .flag("force", ["-f", "--force"]) .action(async (args) => { await withWallet(args, async (wallet) => { - const res = await wallet.updateExchangeFromUrl( + await wallet.updateExchangeFromUrl( args.exchangesUpdateCmd.url, args.exchangesUpdateCmd.force, ); |