@cogcoin/client 1.1.4 → 1.1.5
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 +4 -5
- package/dist/bitcoind/progress/tty-renderer.js +3 -2
- package/dist/bitcoind/service.js +1 -1
- package/dist/cli/command-registry.d.ts +39 -0
- package/dist/cli/command-registry.js +1132 -0
- package/dist/cli/commands/client-admin.js +6 -56
- package/dist/cli/commands/mining-admin.js +9 -32
- package/dist/cli/commands/mining-read.js +15 -56
- package/dist/cli/commands/mining-runtime.js +258 -57
- package/dist/cli/commands/service-runtime.js +1 -64
- package/dist/cli/commands/status.js +2 -15
- package/dist/cli/commands/update.js +6 -21
- package/dist/cli/commands/wallet-admin.js +18 -120
- package/dist/cli/commands/wallet-mutation.js +4 -7
- package/dist/cli/commands/wallet-read.js +31 -138
- package/dist/cli/context.js +2 -4
- package/dist/cli/mining-format.js +8 -2
- package/dist/cli/mutation-command-groups.d.ts +11 -11
- package/dist/cli/mutation-command-groups.js +9 -18
- package/dist/cli/mutation-json.d.ts +1 -17
- package/dist/cli/mutation-json.js +1 -28
- package/dist/cli/mutation-success.d.ts +0 -1
- package/dist/cli/mutation-success.js +0 -19
- package/dist/cli/output.d.ts +1 -10
- package/dist/cli/output.js +52 -481
- package/dist/cli/parse.d.ts +1 -1
- package/dist/cli/parse.js +38 -695
- package/dist/cli/runner.js +28 -113
- package/dist/cli/types.d.ts +7 -8
- package/dist/cli/update-notifier.js +1 -1
- package/dist/cli/wallet-format.js +1 -1
- package/dist/wallet/lifecycle/managed-core.d.ts +23 -0
- package/dist/wallet/lifecycle/managed-core.js +257 -0
- package/dist/wallet/lifecycle/repair-mining.d.ts +49 -0
- package/dist/wallet/lifecycle/repair-mining.js +304 -0
- package/dist/wallet/lifecycle/repair-runtime.d.ts +36 -0
- package/dist/wallet/lifecycle/repair-runtime.js +206 -0
- package/dist/wallet/lifecycle/repair.d.ts +11 -0
- package/dist/wallet/lifecycle/repair.js +368 -0
- package/dist/wallet/lifecycle/setup.d.ts +16 -0
- package/dist/wallet/lifecycle/setup.js +430 -0
- package/dist/wallet/lifecycle/types.d.ts +125 -0
- package/dist/wallet/lifecycle/types.js +1 -0
- package/dist/wallet/lifecycle.d.ts +4 -165
- package/dist/wallet/lifecycle.js +3 -1656
- package/dist/wallet/mining/candidate.d.ts +60 -0
- package/dist/wallet/mining/candidate.js +290 -0
- package/dist/wallet/mining/competitiveness.d.ts +22 -0
- package/dist/wallet/mining/competitiveness.js +640 -0
- package/dist/wallet/mining/control.js +7 -251
- package/dist/wallet/mining/cycle.d.ts +39 -0
- package/dist/wallet/mining/cycle.js +542 -0
- package/dist/wallet/mining/engine-state.d.ts +66 -0
- package/dist/wallet/mining/engine-state.js +211 -0
- package/dist/wallet/mining/engine-types.d.ts +173 -0
- package/dist/wallet/mining/engine-types.js +1 -0
- package/dist/wallet/mining/engine-utils.d.ts +7 -0
- package/dist/wallet/mining/engine-utils.js +75 -0
- package/dist/wallet/mining/events.d.ts +2 -0
- package/dist/wallet/mining/events.js +19 -0
- package/dist/wallet/mining/lifecycle.d.ts +71 -0
- package/dist/wallet/mining/lifecycle.js +355 -0
- package/dist/wallet/mining/projection.d.ts +61 -0
- package/dist/wallet/mining/projection.js +319 -0
- package/dist/wallet/mining/publish.d.ts +79 -0
- package/dist/wallet/mining/publish.js +614 -0
- package/dist/wallet/mining/runner.d.ts +12 -418
- package/dist/wallet/mining/runner.js +274 -3433
- package/dist/wallet/mining/supervisor.d.ts +134 -0
- package/dist/wallet/mining/supervisor.js +558 -0
- package/dist/wallet/mining/visualizer-sync.d.ts +42 -0
- package/dist/wallet/mining/visualizer-sync.js +166 -0
- package/dist/wallet/mining/visualizer.d.ts +1 -0
- package/dist/wallet/mining/visualizer.js +33 -18
- package/dist/wallet/reset.d.ts +1 -1
- package/dist/wallet/reset.js +35 -11
- package/dist/wallet/runtime.d.ts +0 -6
- package/dist/wallet/runtime.js +2 -38
- package/dist/wallet/tx/common.d.ts +18 -0
- package/dist/wallet/tx/common.js +40 -26
- package/package.json +1 -1
- package/dist/wallet/state/seed-index.d.ts +0 -43
- package/dist/wallet/state/seed-index.js +0 -151
|
@@ -1,166 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { attachOrStartManagedBitcoindService, probeManagedBitcoindService } from "../bitcoind/service.js";
|
|
3
|
-
import { createRpcClient } from "../bitcoind/node.js";
|
|
4
|
-
import type { ManagedCoreWalletReplicaStatus, RpcListUnspentEntry } from "../bitcoind/types.js";
|
|
5
|
-
import { type WalletRuntimePaths } from "./runtime.js";
|
|
6
|
-
import { type WalletSecretProvider } from "./state/provider.js";
|
|
7
|
-
import type { WalletStateV1 } from "./types.js";
|
|
8
|
-
export interface WalletPrompter {
|
|
9
|
-
readonly isInteractive: boolean;
|
|
10
|
-
writeLine(message: string): void;
|
|
11
|
-
prompt(message: string): Promise<string>;
|
|
12
|
-
promptHidden?(message: string): Promise<string>;
|
|
13
|
-
selectOption?(options: {
|
|
14
|
-
message: string;
|
|
15
|
-
options: Array<{
|
|
16
|
-
label: string;
|
|
17
|
-
description?: string | null;
|
|
18
|
-
value: string;
|
|
19
|
-
}>;
|
|
20
|
-
initialValue?: string | null;
|
|
21
|
-
footer?: string | null;
|
|
22
|
-
}): Promise<string>;
|
|
23
|
-
clearSensitiveDisplay?(scope: "mnemonic-reveal" | "restore-mnemonic-entry"): void | Promise<void>;
|
|
24
|
-
}
|
|
25
|
-
export interface WalletInitializationResult {
|
|
26
|
-
passwordAction: "created" | "migrated" | "already-configured";
|
|
27
|
-
walletAction: "initialized" | "already-initialized";
|
|
28
|
-
walletRootId: string;
|
|
29
|
-
fundingAddress: string;
|
|
30
|
-
state: WalletStateV1;
|
|
31
|
-
}
|
|
32
|
-
export interface WalletRestoreResult {
|
|
33
|
-
passwordAction: "created" | "migrated" | "already-configured";
|
|
34
|
-
seedName?: string | null;
|
|
35
|
-
walletRootId: string;
|
|
36
|
-
fundingAddress: string;
|
|
37
|
-
state: WalletStateV1;
|
|
38
|
-
warnings?: string[];
|
|
39
|
-
}
|
|
40
|
-
export interface WalletDeleteResult {
|
|
41
|
-
seedName: string;
|
|
42
|
-
walletRootId: string;
|
|
43
|
-
deleted: boolean;
|
|
44
|
-
}
|
|
45
|
-
export interface WalletRepairResult {
|
|
46
|
-
walletRootId: string;
|
|
47
|
-
recoveredFromBackup: boolean;
|
|
48
|
-
recreatedManagedCoreWallet: boolean;
|
|
49
|
-
resetIndexerDatabase: boolean;
|
|
50
|
-
bitcoindServiceAction: "none" | "cleared-stale-artifacts" | "stopped-incompatible-service" | "restarted-compatible-service";
|
|
51
|
-
bitcoindCompatibilityIssue: "none" | "service-version-mismatch" | "wallet-root-mismatch" | "runtime-mismatch";
|
|
52
|
-
managedCoreReplicaAction: "none" | "recreated";
|
|
53
|
-
bitcoindPostRepairHealth: "ready" | "catching-up" | "starting" | "failed" | "unavailable";
|
|
54
|
-
indexerDaemonAction: "none" | "cleared-stale-artifacts" | "stopped-incompatible-daemon" | "restarted-compatible-daemon";
|
|
55
|
-
indexerCompatibilityIssue: "none" | "service-version-mismatch" | "wallet-root-mismatch" | "schema-mismatch";
|
|
56
|
-
indexerPostRepairHealth: "starting" | "catching-up" | "synced" | "failed";
|
|
57
|
-
miningPreRepairRunMode: "stopped" | "foreground" | "background";
|
|
58
|
-
miningResumeAction: "none" | "skipped-not-resumable" | "skipped-post-repair-blocked" | "resumed-background" | "resume-failed";
|
|
59
|
-
miningPostRepairRunMode: "stopped" | "background";
|
|
60
|
-
miningResumeError: string | null;
|
|
61
|
-
note: string | null;
|
|
62
|
-
}
|
|
1
|
+
export type { WalletInitializationResult, WalletPrompter, WalletRepairResult, } from "./lifecycle/types.js";
|
|
63
2
|
export { previewResetWallet, resetWallet, type WalletResetPreview, type WalletResetResult, } from "./reset.js";
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
checksum: string;
|
|
68
|
-
}>;
|
|
69
|
-
createWallet(walletName: string, options: {
|
|
70
|
-
blank: boolean;
|
|
71
|
-
descriptors: boolean;
|
|
72
|
-
disablePrivateKeys: boolean;
|
|
73
|
-
loadOnStartup: boolean;
|
|
74
|
-
passphrase: string;
|
|
75
|
-
}): Promise<unknown>;
|
|
76
|
-
walletPassphrase(walletName: string, passphrase: string, timeoutSeconds: number): Promise<null>;
|
|
77
|
-
importDescriptors(walletName: string, requests: Array<{
|
|
78
|
-
desc: string;
|
|
79
|
-
timestamp: string | number;
|
|
80
|
-
active?: boolean;
|
|
81
|
-
internal?: boolean;
|
|
82
|
-
range?: number | [number, number];
|
|
83
|
-
}>): Promise<Array<{
|
|
84
|
-
success: boolean;
|
|
85
|
-
}>>;
|
|
86
|
-
walletLock(walletName: string): Promise<null>;
|
|
87
|
-
deriveAddresses(descriptor: string, range?: number | [number, number]): Promise<string[]>;
|
|
88
|
-
listDescriptors(walletName: string, privateOnly?: boolean): Promise<{
|
|
89
|
-
descriptors: Array<{
|
|
90
|
-
desc: string;
|
|
91
|
-
}>;
|
|
92
|
-
}>;
|
|
93
|
-
getWalletInfo(walletName: string): Promise<{
|
|
94
|
-
walletname: string;
|
|
95
|
-
private_keys_enabled: boolean;
|
|
96
|
-
descriptors: boolean;
|
|
97
|
-
}>;
|
|
98
|
-
loadWallet(walletName: string, loadOnStartup?: boolean): Promise<{
|
|
99
|
-
name: string;
|
|
100
|
-
warning: string;
|
|
101
|
-
}>;
|
|
102
|
-
unloadWallet?(walletName: string, loadOnStartup?: boolean): Promise<null>;
|
|
103
|
-
listWallets(): Promise<string[]>;
|
|
104
|
-
listUnspent(walletName: string, minConf?: number): Promise<RpcListUnspentEntry[]>;
|
|
105
|
-
getBlockchainInfo(): Promise<{
|
|
106
|
-
blocks: number;
|
|
107
|
-
headers: number;
|
|
108
|
-
}>;
|
|
109
|
-
}
|
|
110
|
-
export declare function verifyManagedCoreWalletReplica(state: WalletStateV1, dataDir: string, dependencies?: {
|
|
111
|
-
nodeHandle?: {
|
|
112
|
-
rpc: Parameters<typeof createRpcClient>[0];
|
|
113
|
-
};
|
|
114
|
-
attachService?: typeof attachOrStartManagedBitcoindService;
|
|
115
|
-
rpcFactory?: (config: Parameters<typeof createRpcClient>[0]) => WalletLifecycleRpcClient;
|
|
116
|
-
}): Promise<ManagedCoreWalletReplicaStatus>;
|
|
117
|
-
export declare function initializeWallet(options: {
|
|
118
|
-
dataDir: string;
|
|
119
|
-
provider?: WalletSecretProvider;
|
|
120
|
-
prompter: WalletPrompter;
|
|
121
|
-
nowUnixMs?: number;
|
|
122
|
-
paths?: WalletRuntimePaths;
|
|
123
|
-
attachService?: typeof attachOrStartManagedBitcoindService;
|
|
124
|
-
rpcFactory?: (config: Parameters<typeof createRpcClient>[0]) => WalletLifecycleRpcClient;
|
|
125
|
-
}): Promise<WalletInitializationResult>;
|
|
126
|
-
export declare function showWalletMnemonic(options: {
|
|
127
|
-
provider?: WalletSecretProvider;
|
|
128
|
-
prompter: WalletPrompter;
|
|
129
|
-
nowUnixMs?: number;
|
|
130
|
-
paths?: WalletRuntimePaths;
|
|
131
|
-
}): Promise<void>;
|
|
132
|
-
export declare function restoreWalletFromMnemonic(options: {
|
|
133
|
-
dataDir: string;
|
|
134
|
-
provider?: WalletSecretProvider;
|
|
135
|
-
prompter: WalletPrompter;
|
|
136
|
-
nowUnixMs?: number;
|
|
137
|
-
paths?: WalletRuntimePaths;
|
|
138
|
-
attachService?: typeof attachOrStartManagedBitcoindService;
|
|
139
|
-
rpcFactory?: (config: Parameters<typeof createRpcClient>[0]) => WalletLifecycleRpcClient;
|
|
140
|
-
}): Promise<WalletRestoreResult>;
|
|
141
|
-
export declare function deleteImportedWalletSeed(options: {
|
|
142
|
-
dataDir: string;
|
|
143
|
-
provider?: WalletSecretProvider;
|
|
144
|
-
prompter: WalletPrompter;
|
|
145
|
-
assumeYes?: boolean;
|
|
146
|
-
nowUnixMs?: number;
|
|
147
|
-
paths?: WalletRuntimePaths;
|
|
148
|
-
attachService?: typeof attachOrStartManagedBitcoindService;
|
|
149
|
-
probeBitcoindService?: typeof probeManagedBitcoindService;
|
|
150
|
-
rpcFactory?: (config: Parameters<typeof createRpcClient>[0]) => WalletLifecycleRpcClient;
|
|
151
|
-
}): Promise<WalletDeleteResult>;
|
|
152
|
-
export declare function repairWallet(options: {
|
|
153
|
-
dataDir: string;
|
|
154
|
-
databasePath: string;
|
|
155
|
-
provider?: WalletSecretProvider;
|
|
156
|
-
assumeYes?: boolean;
|
|
157
|
-
nowUnixMs?: number;
|
|
158
|
-
paths?: WalletRuntimePaths;
|
|
159
|
-
attachService?: typeof attachOrStartManagedBitcoindService;
|
|
160
|
-
probeBitcoindService?: typeof probeManagedBitcoindService;
|
|
161
|
-
rpcFactory?: (config: Parameters<typeof createRpcClient>[0]) => WalletLifecycleRpcClient;
|
|
162
|
-
attachIndexerDaemon?: typeof attachOrStartIndexerDaemon;
|
|
163
|
-
probeIndexerDaemon?: typeof probeIndexerDaemon;
|
|
164
|
-
requestMiningPreemption?: typeof import("./mining/coordination.js").requestMiningGenerationPreemption;
|
|
165
|
-
startBackgroundMining?: typeof import("./mining/runner.js").startBackgroundMining;
|
|
166
|
-
}): Promise<WalletRepairResult>;
|
|
3
|
+
export { verifyManagedCoreWalletReplica } from "./lifecycle/managed-core.js";
|
|
4
|
+
export { initializeWallet, showWalletMnemonic } from "./lifecycle/setup.js";
|
|
5
|
+
export { repairWallet } from "./lifecycle/repair.js";
|