@did-btcr2/cli 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +106 -17
- package/dist/.tsbuildinfo +1 -1
- package/dist/cjs/index.js +1160 -131
- package/dist/esm/src/cli.js +29 -5
- package/dist/esm/src/cli.js.map +1 -1
- package/dist/esm/src/commands/config.js +130 -18
- package/dist/esm/src/commands/config.js.map +1 -1
- package/dist/esm/src/commands/create.js +13 -1
- package/dist/esm/src/commands/create.js.map +1 -1
- package/dist/esm/src/commands/deactivate.js +16 -2
- package/dist/esm/src/commands/deactivate.js.map +1 -1
- package/dist/esm/src/commands/index.js +2 -0
- package/dist/esm/src/commands/index.js.map +1 -1
- package/dist/esm/src/commands/init.js +63 -0
- package/dist/esm/src/commands/init.js.map +1 -0
- package/dist/esm/src/commands/keystore.js +81 -0
- package/dist/esm/src/commands/keystore.js.map +1 -0
- package/dist/esm/src/commands/profile.js +6 -4
- package/dist/esm/src/commands/profile.js.map +1 -1
- package/dist/esm/src/commands/update.js +16 -2
- package/dist/esm/src/commands/update.js.map +1 -1
- package/dist/esm/src/config-schema.js +149 -0
- package/dist/esm/src/config-schema.js.map +1 -0
- package/dist/esm/src/config.js +579 -55
- package/dist/esm/src/config.js.map +1 -1
- package/dist/esm/src/keystore/file-key-store.js +340 -32
- package/dist/esm/src/keystore/file-key-store.js.map +1 -1
- package/dist/esm/src/keystore/passphrase.js +40 -10
- package/dist/esm/src/keystore/passphrase.js.map +1 -1
- package/dist/esm/src/keystore/paths.js +6 -17
- package/dist/esm/src/keystore/paths.js.map +1 -1
- package/dist/esm/src/output.js +49 -0
- package/dist/esm/src/output.js.map +1 -1
- package/dist/esm/src/paths.js +59 -0
- package/dist/esm/src/paths.js.map +1 -0
- package/dist/esm/src/types.js +11 -0
- package/dist/esm/src/types.js.map +1 -1
- package/dist/types/src/cli.d.ts.map +1 -1
- package/dist/types/src/commands/config.d.ts.map +1 -1
- package/dist/types/src/commands/create.d.ts.map +1 -1
- package/dist/types/src/commands/deactivate.d.ts.map +1 -1
- package/dist/types/src/commands/index.d.ts +2 -0
- package/dist/types/src/commands/index.d.ts.map +1 -1
- package/dist/types/src/commands/init.d.ts +13 -0
- package/dist/types/src/commands/init.d.ts.map +1 -0
- package/dist/types/src/commands/keystore.d.ts +10 -0
- package/dist/types/src/commands/keystore.d.ts.map +1 -0
- package/dist/types/src/commands/profile.d.ts.map +1 -1
- package/dist/types/src/commands/update.d.ts.map +1 -1
- package/dist/types/src/config-schema.d.ts +24 -0
- package/dist/types/src/config-schema.d.ts.map +1 -0
- package/dist/types/src/config.d.ts +252 -14
- package/dist/types/src/config.d.ts.map +1 -1
- package/dist/types/src/keystore/file-key-store.d.ts +86 -10
- package/dist/types/src/keystore/file-key-store.d.ts.map +1 -1
- package/dist/types/src/keystore/passphrase.d.ts +16 -1
- package/dist/types/src/keystore/passphrase.d.ts.map +1 -1
- package/dist/types/src/keystore/paths.d.ts +6 -10
- package/dist/types/src/keystore/paths.d.ts.map +1 -1
- package/dist/types/src/output.d.ts +22 -0
- package/dist/types/src/output.d.ts.map +1 -1
- package/dist/types/src/paths.d.ts +54 -0
- package/dist/types/src/paths.d.ts.map +1 -0
- package/dist/types/src/types.d.ts +70 -0
- package/dist/types/src/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/cli.ts +32 -4
- package/src/commands/config.ts +143 -18
- package/src/commands/create.ts +16 -1
- package/src/commands/deactivate.ts +24 -2
- package/src/commands/index.ts +2 -0
- package/src/commands/init.ts +74 -0
- package/src/commands/keystore.ts +98 -0
- package/src/commands/profile.ts +6 -4
- package/src/commands/update.ts +24 -2
- package/src/config-schema.ts +178 -0
- package/src/config.ts +752 -58
- package/src/keystore/file-key-store.ts +455 -43
- package/src/keystore/passphrase.ts +48 -8
- package/src/keystore/paths.ts +6 -18
- package/src/output.ts +53 -0
- package/src/paths.ts +79 -0
- package/src/types.ts +34 -0
|
@@ -12,6 +12,13 @@ export type PassphraseOptions = {
|
|
|
12
12
|
prompt?: string;
|
|
13
13
|
/** When true, prompt twice and require the entries to match (for a new keystore). */
|
|
14
14
|
confirm?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* When true, skip the environment variable and passphrase file and require a
|
|
17
|
+
* fresh terminal entry. Used for the *new* passphrase in `change-passphrase`,
|
|
18
|
+
* where the env var / file holds the *current* passphrase and must not silently
|
|
19
|
+
* satisfy the new one (which would make the change a no-op).
|
|
20
|
+
*/
|
|
21
|
+
forcePrompt?: boolean;
|
|
15
22
|
};
|
|
16
23
|
|
|
17
24
|
/**
|
|
@@ -19,16 +26,19 @@ export type PassphraseOptions = {
|
|
|
19
26
|
* (which would leak into process listings and shell history). Resolution order:
|
|
20
27
|
* the {@link ENV_KEYSTORE_PASSPHRASE} environment variable, a passphrase file,
|
|
21
28
|
* then a non-echoing terminal prompt. Throws if none is available and standard
|
|
22
|
-
* input is not a terminal.
|
|
29
|
+
* input is not a terminal. When `forcePrompt` is set, the env var and file are
|
|
30
|
+
* skipped and a terminal entry is required.
|
|
23
31
|
*/
|
|
24
32
|
export function acquirePassphrase(options: PassphraseOptions = {}): string {
|
|
25
33
|
// All sources are normalized identically (at most one trailing newline
|
|
26
34
|
// removed) so the KDF input is source-independent.
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
if (!options.forcePrompt) {
|
|
36
|
+
const fromEnv = process.env[ENV_KEYSTORE_PASSPHRASE];
|
|
37
|
+
if (fromEnv) return assertNonEmpty(fromEnv.replace(/\r?\n$/, ''));
|
|
29
38
|
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
if (options.passphraseFile) {
|
|
40
|
+
return assertNonEmpty(readFileSync(options.passphraseFile, 'utf-8').replace(/\r?\n$/, ''));
|
|
41
|
+
}
|
|
32
42
|
}
|
|
33
43
|
|
|
34
44
|
if (!process.stdin.isTTY) {
|
|
@@ -56,9 +66,34 @@ function assertNonEmpty(passphrase: string): string {
|
|
|
56
66
|
return passphrase;
|
|
57
67
|
}
|
|
58
68
|
|
|
69
|
+
/**
|
|
70
|
+
* A 4-byte shared buffer used only as an {@link Atomics.wait} target. It lets
|
|
71
|
+
* {@link promptHidden} block briefly on an empty non-blocking TTY instead of
|
|
72
|
+
* busy-spinning. It is never written to, so the wait always times out.
|
|
73
|
+
*/
|
|
74
|
+
const IDLE_WAIT = new Int32Array(new SharedArrayBuffer(4));
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Milliseconds to block on each empty read. Imperceptible to a typist yet long
|
|
78
|
+
* enough that an open prompt sits idle rather than pegging a CPU core.
|
|
79
|
+
*/
|
|
80
|
+
const IDLE_POLL_MS = 20;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Removes the last whole UTF-8 character from an accumulating byte array in
|
|
84
|
+
* place: pops any trailing continuation bytes (0b10xxxxxx) then the leading
|
|
85
|
+
* byte. Exported for testing; a backspace mid-entry must not strand a fragment
|
|
86
|
+
* that later decodes to U+FFFD.
|
|
87
|
+
*/
|
|
88
|
+
export function dropLastUtf8Char(bytes: number[]): void {
|
|
89
|
+
while (bytes.length > 0 && (bytes[bytes.length - 1] & 0xc0) === 0x80) bytes.pop();
|
|
90
|
+
bytes.pop();
|
|
91
|
+
}
|
|
92
|
+
|
|
59
93
|
/**
|
|
60
94
|
* Reads a line from the terminal synchronously without echoing keystrokes.
|
|
61
|
-
* Bytes are accumulated and decoded as UTF-8 so multibyte passphrases survive
|
|
95
|
+
* Bytes are accumulated and decoded as UTF-8 so multibyte passphrases survive,
|
|
96
|
+
* including a backspace that spans a whole multibyte character.
|
|
62
97
|
* This path runs only when standard input is a terminal.
|
|
63
98
|
*/
|
|
64
99
|
function promptHidden(label: string): string {
|
|
@@ -75,7 +110,12 @@ function promptHidden(label: string): string {
|
|
|
75
110
|
read = readSync(stdin.fd, byte, 0, 1, null);
|
|
76
111
|
} catch (error) {
|
|
77
112
|
const code = (error as { code?: string }).code;
|
|
78
|
-
if (code === 'EAGAIN')
|
|
113
|
+
if (code === 'EAGAIN') {
|
|
114
|
+
// No byte ready yet on a non-blocking TTY. Block briefly instead of
|
|
115
|
+
// spinning so an open prompt does not peg a CPU core while it waits.
|
|
116
|
+
Atomics.wait(IDLE_WAIT, 0, 0, IDLE_POLL_MS);
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
79
119
|
if (code === 'EOF') break;
|
|
80
120
|
throw error;
|
|
81
121
|
}
|
|
@@ -86,7 +126,7 @@ function promptHidden(label: string): string {
|
|
|
86
126
|
throw new KeyStoreError('Passphrase entry aborted.', 'PASSPHRASE_REQUIRED_ERROR');
|
|
87
127
|
}
|
|
88
128
|
if (ch === 0x7f || ch === 0x08) { // DEL or backspace
|
|
89
|
-
bytes
|
|
129
|
+
dropLastUtf8Char(bytes);
|
|
90
130
|
continue;
|
|
91
131
|
}
|
|
92
132
|
bytes.push(ch);
|
package/src/keystore/paths.ts
CHANGED
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
import { homedir } from 'node:os';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* Resolution order:
|
|
11
|
-
* 1. `$XDG_DATA_HOME/btcr2/keystore.json`
|
|
12
|
-
* 2. `%LOCALAPPDATA%/btcr2/keystore.json` (Windows)
|
|
13
|
-
* 3. `~/.local/share/btcr2/keystore.json` (fallback)
|
|
2
|
+
* The default keystore path now lives alongside the config file under a single
|
|
3
|
+
* CLI home root (`<home>/keystore.json`, ADR 079). The implementation lives in
|
|
4
|
+
* `../paths.ts` (the single source of truth for on-disk state locations); it is
|
|
5
|
+
* re-exported here so existing `./paths.js` importers in the keystore layer keep
|
|
6
|
+
* their import surface.
|
|
14
7
|
*/
|
|
15
|
-
export
|
|
16
|
-
const base = process.env.XDG_DATA_HOME
|
|
17
|
-
?? process.env.LOCALAPPDATA
|
|
18
|
-
?? join(homedir(), '.local', 'share');
|
|
19
|
-
return join(base, 'btcr2', 'keystore.json');
|
|
20
|
-
}
|
|
8
|
+
export { defaultKeystorePath } from '../paths.js';
|
package/src/output.ts
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
1
1
|
import type { CommandResult, GlobalOptions } from './types.js';
|
|
2
2
|
|
|
3
|
+
/** Placeholder printed in place of a redacted secret value. */
|
|
4
|
+
export const REDACTED = '********';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Key names whose (scalar) values are treated as secrets and redacted in printed
|
|
8
|
+
* output. Covers RPC passwords plus header credentials (`Authorization`, API
|
|
9
|
+
* keys, bearer tokens) that a profile can now carry in `btc.headers`/`rpcHeaders`.
|
|
10
|
+
*/
|
|
11
|
+
const SECRET_KEY = /(pass|secret|token|auth|api[-_]?key|credential|bearer)/i;
|
|
12
|
+
|
|
13
|
+
/** Whether a config key name looks like a secret (so its scalar value should be redacted). */
|
|
14
|
+
export function isSecretKey(key: string): boolean {
|
|
15
|
+
return SECRET_KEY.test(key);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Masks the password in a `scheme://user:pass@host` URL, leaving the rest of the
|
|
20
|
+
* value verbatim. A credential embedded in an endpoint URL (e.g. `rpcUrl`) is not
|
|
21
|
+
* caught by key-name matching, so it is scrubbed here regardless of the key.
|
|
22
|
+
*/
|
|
23
|
+
export function scrubUrlUserinfo(value: string | undefined): string | undefined {
|
|
24
|
+
if (value === undefined) return undefined;
|
|
25
|
+
return value.replace(/^([a-z][a-z0-9+.-]*:\/\/[^/@:]+):[^/@]*@/i, `$1:${REDACTED}@`);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Returns a deep copy of `value` with secret scalar values replaced by
|
|
30
|
+
* {@link REDACTED}, so routine introspection (`config get`/`list`/`effective`)
|
|
31
|
+
* does not print RPC passwords or other secrets into terminal scrollback and CI
|
|
32
|
+
* logs. A secret-named key redacts only a scalar value (an object under such a
|
|
33
|
+
* key, e.g. a profile named `access-token`, is still traversed, not wholesale
|
|
34
|
+
* masked). Passwords embedded in URL values are scrubbed regardless of key name.
|
|
35
|
+
* When `keyName` is a secret name, a directly-passed scalar value is redacted
|
|
36
|
+
* (used when a single leaf value is printed). Display-only: the stored config and
|
|
37
|
+
* the value used to connect are untouched.
|
|
38
|
+
*/
|
|
39
|
+
export function redactSecrets(value: unknown, keyName?: string): unknown {
|
|
40
|
+
if (Array.isArray(value)) {
|
|
41
|
+
return value.map(item => redactSecrets(item));
|
|
42
|
+
}
|
|
43
|
+
if (value !== null && typeof value === 'object') {
|
|
44
|
+
const out: Record<string, unknown> = {};
|
|
45
|
+
for (const [ key, val ] of Object.entries(value as Record<string, unknown>)) {
|
|
46
|
+
out[key] = redactSecrets(val, key);
|
|
47
|
+
}
|
|
48
|
+
return out;
|
|
49
|
+
}
|
|
50
|
+
if (keyName !== undefined && isSecretKey(keyName)) {
|
|
51
|
+
return value === undefined ? undefined : REDACTED;
|
|
52
|
+
}
|
|
53
|
+
return typeof value === 'string' ? scrubUrlUserinfo(value) : value;
|
|
54
|
+
}
|
|
55
|
+
|
|
3
56
|
/**
|
|
4
57
|
* Formats a CommandResult for console output.
|
|
5
58
|
* In 'json' mode, the full result is serialized.
|
package/src/paths.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { homedir } from 'node:os';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { blankToUndef } from './types.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* State-location overrides that influence where the CLI keeps its home
|
|
7
|
+
* directory and its two state files. A subset of the broader
|
|
8
|
+
* `ConnectionOverrides`, restated here so this module (the single source of
|
|
9
|
+
* truth for on-disk locations) has no runtime dependency on `config.ts`.
|
|
10
|
+
*/
|
|
11
|
+
export interface PathOverrides {
|
|
12
|
+
/** Explicit home root from the `--home` flag. Wins over `$BTCR2_HOME`. */
|
|
13
|
+
home? : string;
|
|
14
|
+
/** Explicit config-file path from the `--config` flag. Overrides the home default. */
|
|
15
|
+
config? : string;
|
|
16
|
+
/** Explicit keystore path from the `--keystore` flag. Overrides the home default. */
|
|
17
|
+
keystore? : string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Environment variable naming the CLI home directory (all state colocated). */
|
|
21
|
+
export const ENV_HOME = 'BTCR2_HOME';
|
|
22
|
+
|
|
23
|
+
/** The config and keystore file names, kept side by side under the home root. */
|
|
24
|
+
export const CONFIG_FILENAME = 'config.json';
|
|
25
|
+
export const KEYSTORE_FILENAME = 'keystore.json';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Resolves the CLI home directory: the single root that holds `config.json` and
|
|
29
|
+
* `keystore.json` side by side (ADR 079). Resolution order, highest wins:
|
|
30
|
+
*
|
|
31
|
+
* 1. `--home <dir>` (the {@link PathOverrides.home} flag)
|
|
32
|
+
* 2. `$BTCR2_HOME`
|
|
33
|
+
* 3. the platform default (see {@link platformDefaultHome})
|
|
34
|
+
*
|
|
35
|
+
* A blank value at any layer defers to the next, mirroring the `blankToUndef`
|
|
36
|
+
* treatment every other precedence layer uses, so an exported-but-empty
|
|
37
|
+
* `BTCR2_HOME` does not resolve the home to a bare relative path.
|
|
38
|
+
*/
|
|
39
|
+
export function resolveHome(overrides?: PathOverrides): string {
|
|
40
|
+
return blankToUndef(overrides?.home)
|
|
41
|
+
?? blankToUndef(process.env[ENV_HOME])
|
|
42
|
+
?? platformDefaultHome();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The default home when no `--home` / `$BTCR2_HOME` override is present, chosen
|
|
47
|
+
* per OS so the location is idiomatic while staying a single colocated dir:
|
|
48
|
+
*
|
|
49
|
+
* - Windows: `%LOCALAPPDATA%\btcr2` (fallback `%APPDATA%\btcr2`, then the user
|
|
50
|
+
* profile), the native place for per-user application state.
|
|
51
|
+
* - Linux / macOS: `~/.btcr2`, the short, teachable dot-directory in the same
|
|
52
|
+
* family as `~/.ssh`, `~/.aws`, and `~/.gnupg`.
|
|
53
|
+
*/
|
|
54
|
+
export function platformDefaultHome(): string {
|
|
55
|
+
if (process.platform === 'win32') {
|
|
56
|
+
const base = blankToUndef(process.env.LOCALAPPDATA)
|
|
57
|
+
?? blankToUndef(process.env.APPDATA)
|
|
58
|
+
?? homedir();
|
|
59
|
+
return join(base, 'btcr2');
|
|
60
|
+
}
|
|
61
|
+
return join(homedir(), '.btcr2');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Default config-file path: `<home>/config.json`. The `--config` flag, when
|
|
66
|
+
* present, overrides it wholesale (it names a specific file, not a home).
|
|
67
|
+
*/
|
|
68
|
+
export function defaultConfigPath(overrides?: PathOverrides): string {
|
|
69
|
+
return join(resolveHome(overrides), CONFIG_FILENAME);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Default keystore path: `<home>/keystore.json`. The `--keystore` flag and a
|
|
74
|
+
* profile's `identity.keystore` (resolved in `config.ts`) override it; this
|
|
75
|
+
* function is the final fallback in that chain.
|
|
76
|
+
*/
|
|
77
|
+
export function defaultKeystorePath(overrides?: PathOverrides): string {
|
|
78
|
+
return join(resolveHome(overrides), KEYSTORE_FILENAME);
|
|
79
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -2,14 +2,34 @@ import type { DidUpdateResult } from '@did-btcr2/api';
|
|
|
2
2
|
import type { PatchOperation } from '@did-btcr2/common';
|
|
3
3
|
import type { Btcr2DidDocument, ResolutionOptions } from '@did-btcr2/method';
|
|
4
4
|
import type { DidResolutionResult } from '@web5/dids';
|
|
5
|
+
import type { DoctorReport, EffectiveConfig } from './config.js';
|
|
6
|
+
import type { ConfigIssue } from './config-schema.js';
|
|
5
7
|
|
|
6
8
|
export type NetworkOption = 'bitcoin' | 'testnet3' | 'testnet4' | 'signet' | 'mutinynet' | 'regtest';
|
|
7
9
|
export type OutputFormat = 'json' | 'text';
|
|
8
10
|
|
|
11
|
+
/**
|
|
12
|
+
* How a keystore protects its secrets, as reported by `keystore status` and
|
|
13
|
+
* `btcr2 init`: `encrypted` (passphrase-sealed), `dev` (plaintext, testnet-only),
|
|
14
|
+
* or `absent` (no keystore file yet).
|
|
15
|
+
*/
|
|
16
|
+
export type KeystoreProtectionLabel = 'encrypted' | 'dev' | 'absent';
|
|
17
|
+
|
|
9
18
|
export const SUPPORTED_NETWORKS: NetworkOption[] = [
|
|
10
19
|
'bitcoin', 'testnet3', 'testnet4', 'signet', 'mutinynet', 'regtest'
|
|
11
20
|
];
|
|
12
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Normalizes a blank value (empty or whitespace-only) to `undefined`, so a
|
|
24
|
+
* blank at any precedence layer defers to the next layer instead of masking it.
|
|
25
|
+
* A non-blank value is returned unchanged. This mirrors the `|| undefined`
|
|
26
|
+
* treatment the environment layer already applies in `readEnvOverrides`.
|
|
27
|
+
*/
|
|
28
|
+
export function blankToUndef(value: string | undefined): string | undefined {
|
|
29
|
+
if (value === undefined) return undefined;
|
|
30
|
+
return value.trim() === '' ? undefined : value;
|
|
31
|
+
}
|
|
32
|
+
|
|
13
33
|
export interface ResolveCommandOptions {
|
|
14
34
|
identifier : string;
|
|
15
35
|
options? : ResolutionOptions;
|
|
@@ -35,11 +55,19 @@ export type CommandResult =
|
|
|
35
55
|
| { action: 'key-export'; data: { keyId: string; publicKey?: string; secretWrittenTo?: string } }
|
|
36
56
|
| { action: 'key-delete'; data: { keyId: string; deleted: true } }
|
|
37
57
|
| { action: 'key-use'; data: { keyId: string; active: true } }
|
|
58
|
+
| { action: 'init'; data: { home: string; config: string; keystore: string; created: string[]; protection: KeystoreProtectionLabel } }
|
|
38
59
|
| { action: 'config-init'; data: { path: string } }
|
|
39
60
|
| { action: 'config-get'; data: unknown }
|
|
40
61
|
| { action: 'config-set'; data: { path: string } }
|
|
41
62
|
| { action: 'config-unset'; data: { path: string } }
|
|
42
63
|
| { action: 'config-list'; data: unknown }
|
|
64
|
+
| { action: 'config-validate'; data: { ok: boolean; issues: ConfigIssue[] } }
|
|
65
|
+
| { action: 'config-effective'; data: EffectiveConfig }
|
|
66
|
+
| { action: 'config-path'; data: { home: string; config: string; keystore: string } }
|
|
67
|
+
| { action: 'config-doctor'; data: DoctorReport }
|
|
68
|
+
| { action: 'keystore-init'; data: { path: string; protection: 'encrypted' | 'dev' } }
|
|
69
|
+
| { action: 'keystore-status'; data: { path: string; protection: KeystoreProtectionLabel; established: boolean; keyCount: number; active: string | undefined } }
|
|
70
|
+
| { action: 'keystore-change-passphrase'; data: { path: string; rekeyed: number } }
|
|
43
71
|
| { action: 'profile-add'; data: { profile: string } }
|
|
44
72
|
| { action: 'profile-use'; data: { profile: string } }
|
|
45
73
|
| { action: 'profile-show'; data: unknown }
|
|
@@ -49,6 +77,7 @@ export interface GlobalOptions {
|
|
|
49
77
|
output : OutputFormat;
|
|
50
78
|
verbose : boolean;
|
|
51
79
|
quiet : boolean;
|
|
80
|
+
home? : string;
|
|
52
81
|
config? : string;
|
|
53
82
|
profile? : string;
|
|
54
83
|
btcRest? : string;
|
|
@@ -57,6 +86,11 @@ export interface GlobalOptions {
|
|
|
57
86
|
btcRpcPass? : string;
|
|
58
87
|
casGateway? : string;
|
|
59
88
|
casRpcUrl? : string;
|
|
89
|
+
btcTimeout? : string;
|
|
90
|
+
casTimeout? : string;
|
|
91
|
+
btcRestHeader? : string[];
|
|
92
|
+
btcRpcWallet? : string;
|
|
93
|
+
btcRpcHeader? : string[];
|
|
60
94
|
keystore? : string;
|
|
61
95
|
passphraseFile?: string;
|
|
62
96
|
signingKey? : string;
|