aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-cli/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-cli/src')
-rw-r--r--packages/taler-wallet-cli/src/index.ts36
1 files changed, 23 insertions, 13 deletions
diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts
index ffe033b24..773379044 100644
--- a/packages/taler-wallet-cli/src/index.ts
+++ b/packages/taler-wallet-cli/src/index.ts
@@ -251,6 +251,7 @@ interface CreateWalletResult {
async function createLocalWallet(
walletCliArgs: WalletCliArgsType,
notificationHandler?: (n: WalletNotification) => void,
+ noInit?: boolean,
): Promise<CreateWalletResult> {
const dbPath = walletCliArgs.wallet.walletDbFile ?? defaultWalletDbPath;
const myHttpLib = createPlatformHttpLib({
@@ -267,23 +268,29 @@ async function createLocalWallet(
}
},
cryptoWorkerType: walletCliArgs.wallet.cryptoWorker as any,
- config: {
- features: {},
- testing: {
- devModeActive: checkEnvFlag("TALER_WALLET_DEV_MODE"),
- denomselAllowLate: checkEnvFlag(
- "TALER_WALLET_DEBUG_DENOMSEL_ALLOW_LATE",
- ),
- emitObservabilityEvents: observabilityEventFile != null,
- skipDefaults: walletCliArgs.wallet.skipDefaults,
- },
- },
});
applyVerbose(walletCliArgs.wallet.verbose);
+ const res = { wallet: wh.wallet, getStats: wh.getDbStats };
+
+ if (!noInit) {
+ return res;
+ }
try {
- await wh.wallet.handleCoreApiRequest("initWallet", "native-init", {});
- return { wallet: wh.wallet, getStats: wh.getDbStats };
+ await wh.wallet.handleCoreApiRequest("initWallet", "native-init", {
+ config: {
+ features: {},
+ testing: {
+ devModeActive: checkEnvFlag("TALER_WALLET_DEV_MODE"),
+ denomselAllowLate: checkEnvFlag(
+ "TALER_WALLET_DEBUG_DENOMSEL_ALLOW_LATE",
+ ),
+ emitObservabilityEvents: observabilityEventFile != null,
+ skipDefaults: walletCliArgs.wallet.skipDefaults,
+ },
+ },
+ });
+ return res;
} catch (e) {
const ed = getErrorDetailFromException(e);
console.error("Operation failed: " + summarizeTalerErrorDetail(ed));
@@ -1196,6 +1203,9 @@ advancedCli
.requiredOption("unixPath", ["--unix-path"], clk.STRING, {
default: "wallet-core.sock",
})
+ .flag("noInit", ["--no-init"], {
+ help: "Do not initialize the wallet. The client must send the initWallet message.",
+ })
.action(async (args) => {
logger.info(`serving at ${args.serve.unixPath}`);
const onNotif = (notif: WalletNotification) => {