@cogcoin/client 0.5.15 → 1.0.1
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 +80 -25
- package/dist/app-paths.d.ts +5 -6
- package/dist/app-paths.js +8 -16
- package/dist/art/balance.txt +10 -0
- package/dist/art/welcome.txt +16 -0
- package/dist/bitcoind/bootstrap/controller.d.ts +1 -0
- package/dist/bitcoind/bootstrap/controller.js +53 -1
- package/dist/bitcoind/client/follow-block-times.d.ts +1 -0
- package/dist/bitcoind/client/follow-block-times.js +1 -1
- package/dist/bitcoind/client/internal-types.d.ts +7 -3
- package/dist/bitcoind/client/managed-client.d.ts +4 -2
- package/dist/bitcoind/client/managed-client.js +14 -0
- package/dist/bitcoind/client/sync-engine.js +72 -11
- package/dist/bitcoind/hash-order.d.ts +4 -0
- package/dist/bitcoind/hash-order.js +13 -0
- package/dist/bitcoind/indexer-daemon-main.js +11 -3
- package/dist/bitcoind/normalize.js +3 -2
- package/dist/bitcoind/processing-start-height.d.ts +5 -0
- package/dist/bitcoind/processing-start-height.js +7 -0
- package/dist/bitcoind/progress/constants.d.ts +4 -0
- package/dist/bitcoind/progress/constants.js +4 -0
- package/dist/bitcoind/progress/controller.d.ts +2 -1
- package/dist/bitcoind/progress/controller.js +3 -3
- package/dist/bitcoind/progress/follow-scene.d.ts +6 -2
- package/dist/bitcoind/progress/follow-scene.js +29 -6
- package/dist/bitcoind/progress/formatting.d.ts +1 -0
- package/dist/bitcoind/progress/formatting.js +6 -0
- package/dist/bitcoind/progress/train-scene.js +37 -18
- package/dist/bitcoind/progress/tty-renderer.d.ts +6 -1
- package/dist/bitcoind/progress/tty-renderer.js +8 -4
- package/dist/bitcoind/rpc.d.ts +2 -1
- package/dist/bitcoind/rpc.js +3 -0
- package/dist/bitcoind/types.d.ts +6 -0
- package/dist/bytes.d.ts +1 -0
- package/dist/bytes.js +3 -0
- package/dist/cli/art.d.ts +2 -0
- package/dist/cli/art.js +37 -0
- package/dist/cli/commands/client-admin.d.ts +2 -0
- package/dist/cli/commands/client-admin.js +91 -0
- package/dist/cli/commands/follow.js +0 -2
- package/dist/cli/commands/mining-admin.js +6 -47
- package/dist/cli/commands/mining-read.js +11 -50
- package/dist/cli/commands/mining-runtime.js +142 -5
- package/dist/cli/commands/service-runtime.js +0 -2
- package/dist/cli/commands/status.js +8 -2
- package/dist/cli/commands/sync.js +49 -92
- package/dist/cli/commands/wallet-admin.js +142 -136
- package/dist/cli/commands/wallet-mutation.js +91 -79
- package/dist/cli/commands/wallet-read.js +15 -18
- package/dist/cli/context.js +5 -14
- package/dist/cli/mining-format.d.ts +0 -1
- package/dist/cli/mining-format.js +5 -37
- package/dist/cli/mining-json.d.ts +0 -18
- package/dist/cli/mining-json.js +0 -35
- package/dist/cli/mutation-command-groups.d.ts +1 -2
- package/dist/cli/mutation-command-groups.js +0 -5
- package/dist/cli/mutation-json.d.ts +24 -145
- package/dist/cli/mutation-json.js +30 -136
- package/dist/cli/mutation-resolved-json.d.ts +0 -7
- package/dist/cli/mutation-resolved-json.js +4 -10
- package/dist/cli/mutation-success.d.ts +2 -0
- package/dist/cli/mutation-success.js +11 -1
- package/dist/cli/mutation-text-format.js +1 -3
- package/dist/cli/output.d.ts +1 -1
- package/dist/cli/output.js +254 -231
- package/dist/cli/parse.d.ts +1 -1
- package/dist/cli/parse.js +93 -122
- package/dist/cli/preview-json.d.ts +17 -120
- package/dist/cli/preview-json.js +14 -97
- package/dist/cli/prompt.js +8 -13
- package/dist/cli/read-json.d.ts +15 -37
- package/dist/cli/read-json.js +44 -140
- package/dist/cli/runner.js +10 -13
- package/dist/cli/sync-progress.d.ts +6 -0
- package/dist/cli/sync-progress.js +91 -0
- package/dist/cli/types.d.ts +9 -17
- package/dist/cli/types.js +0 -2
- package/dist/cli/wallet-format.d.ts +1 -0
- package/dist/cli/wallet-format.js +208 -144
- package/dist/cli/workflow-hints.d.ts +3 -3
- package/dist/cli/workflow-hints.js +11 -8
- package/dist/client/default-client.d.ts +3 -1
- package/dist/client/default-client.js +45 -2
- package/dist/client/factory.js +1 -1
- package/dist/client/initialization.js +23 -0
- package/dist/client/persistence.js +5 -5
- package/dist/client/store-adapter.js +1 -0
- package/dist/sqlite/checkpoints.d.ts +1 -0
- package/dist/sqlite/checkpoints.js +7 -0
- package/dist/sqlite/store.js +14 -1
- package/dist/types.d.ts +1 -0
- package/dist/wallet/coin-control.d.ts +41 -12
- package/dist/wallet/coin-control.js +100 -428
- package/dist/wallet/descriptor-normalization.d.ts +1 -3
- package/dist/wallet/descriptor-normalization.js +0 -16
- package/dist/wallet/lifecycle.d.ts +7 -99
- package/dist/wallet/lifecycle.js +513 -968
- package/dist/wallet/managed-core-wallet.d.ts +13 -0
- package/dist/wallet/managed-core-wallet.js +20 -0
- package/dist/wallet/mining/constants.d.ts +5 -12
- package/dist/wallet/mining/constants.js +5 -12
- package/dist/wallet/mining/control.d.ts +1 -13
- package/dist/wallet/mining/control.js +45 -349
- package/dist/wallet/mining/index.d.ts +4 -5
- package/dist/wallet/mining/index.js +2 -3
- package/dist/wallet/mining/runner.d.ts +123 -13
- package/dist/wallet/mining/runner.js +899 -511
- package/dist/wallet/mining/runtime-artifacts.js +23 -3
- package/dist/wallet/mining/sentence-protocol.d.ts +44 -0
- package/dist/wallet/mining/sentence-protocol.js +123 -0
- package/dist/wallet/mining/sentences.d.ts +4 -8
- package/dist/wallet/mining/sentences.js +3 -52
- package/dist/wallet/mining/state.d.ts +11 -6
- package/dist/wallet/mining/state.js +7 -6
- package/dist/wallet/mining/types.d.ts +2 -30
- package/dist/wallet/mining/visualizer.d.ts +31 -3
- package/dist/wallet/mining/visualizer.js +135 -13
- package/dist/wallet/read/context.d.ts +0 -2
- package/dist/wallet/read/context.js +119 -140
- package/dist/wallet/read/filter.js +2 -11
- package/dist/wallet/read/index.d.ts +1 -1
- package/dist/wallet/read/project.js +24 -77
- package/dist/wallet/read/types.d.ts +10 -25
- package/dist/wallet/reset.d.ts +0 -1
- package/dist/wallet/reset.js +60 -138
- package/dist/wallet/root-resolution.d.ts +1 -5
- package/dist/wallet/root-resolution.js +0 -18
- package/dist/wallet/runtime.d.ts +0 -6
- package/dist/wallet/runtime.js +0 -8
- package/dist/wallet/state/client-password-agent.js +208 -0
- package/dist/wallet/state/client-password.d.ts +65 -0
- package/dist/wallet/state/client-password.js +952 -0
- package/dist/wallet/state/crypto.d.ts +1 -20
- package/dist/wallet/state/crypto.js +0 -63
- package/dist/wallet/state/provider.d.ts +23 -11
- package/dist/wallet/state/provider.js +248 -290
- package/dist/wallet/state/storage.d.ts +2 -2
- package/dist/wallet/state/storage.js +48 -16
- package/dist/wallet/tx/anchor.d.ts +3 -28
- package/dist/wallet/tx/anchor.js +349 -1250
- package/dist/wallet/tx/bitcoin-transfer.d.ts +35 -0
- package/dist/wallet/tx/bitcoin-transfer.js +200 -0
- package/dist/wallet/tx/cog.d.ts +5 -1
- package/dist/wallet/tx/cog.js +149 -185
- package/dist/wallet/tx/common.d.ts +61 -8
- package/dist/wallet/tx/common.js +266 -146
- package/dist/wallet/tx/domain-admin.d.ts +3 -1
- package/dist/wallet/tx/domain-admin.js +61 -99
- package/dist/wallet/tx/domain-market.d.ts +5 -1
- package/dist/wallet/tx/domain-market.js +221 -228
- package/dist/wallet/tx/field.d.ts +4 -10
- package/dist/wallet/tx/field.js +83 -924
- package/dist/wallet/tx/identity-selector.d.ts +9 -3
- package/dist/wallet/tx/identity-selector.js +17 -35
- package/dist/wallet/tx/index.d.ts +3 -1
- package/dist/wallet/tx/index.js +2 -1
- package/dist/wallet/tx/register.d.ts +3 -1
- package/dist/wallet/tx/register.js +62 -220
- package/dist/wallet/tx/reputation.d.ts +3 -1
- package/dist/wallet/tx/reputation.js +58 -95
- package/dist/wallet/types.d.ts +8 -122
- package/package.json +5 -5
- package/dist/wallet/archive.d.ts +0 -4
- package/dist/wallet/archive.js +0 -41
- package/dist/wallet/mining/hook-protocol.d.ts +0 -47
- package/dist/wallet/mining/hook-protocol.js +0 -161
- package/dist/wallet/mining/hook-runner.js +0 -52
- package/dist/wallet/mining/hooks.d.ts +0 -38
- package/dist/wallet/mining/hooks.js +0 -520
- package/dist/wallet/state/explicit-lock.d.ts +0 -4
- package/dist/wallet/state/explicit-lock.js +0 -19
- package/dist/wallet/state/session.d.ts +0 -12
- package/dist/wallet/state/session.js +0 -23
- /package/dist/wallet/{mining/hook-runner.d.ts → state/client-password-agent.d.ts} +0 -0
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { attachOrStartIndexerDaemon, probeIndexerDaemon } from "../bitcoind/indexer-daemon.js";
|
|
2
2
|
import { attachOrStartManagedBitcoindService, probeManagedBitcoindService } from "../bitcoind/service.js";
|
|
3
3
|
import { createRpcClient } from "../bitcoind/node.js";
|
|
4
|
-
import type { ManagedCoreWalletReplicaStatus } from "../bitcoind/types.js";
|
|
4
|
+
import type { ManagedCoreWalletReplicaStatus, RpcListUnspentEntry } from "../bitcoind/types.js";
|
|
5
5
|
import { type WalletRuntimePaths } from "./runtime.js";
|
|
6
|
-
import { requestMiningGenerationPreemption } from "./mining/coordination.js";
|
|
7
6
|
import { type WalletSecretProvider } from "./state/provider.js";
|
|
8
|
-
import type {
|
|
9
|
-
export declare const DEFAULT_UNLOCK_DURATION_MS: number;
|
|
7
|
+
import type { WalletStateV1 } from "./types.js";
|
|
10
8
|
export interface WalletPrompter {
|
|
11
9
|
readonly isInteractive: boolean;
|
|
12
10
|
writeLine(message: string): void;
|
|
@@ -15,37 +13,17 @@ export interface WalletPrompter {
|
|
|
15
13
|
clearSensitiveDisplay?(scope: "mnemonic-reveal" | "restore-mnemonic-entry"): void | Promise<void>;
|
|
16
14
|
}
|
|
17
15
|
export interface WalletInitializationResult {
|
|
16
|
+
passwordAction: "created" | "migrated" | "already-configured";
|
|
17
|
+
walletAction: "initialized" | "already-initialized";
|
|
18
18
|
walletRootId: string;
|
|
19
19
|
fundingAddress: string;
|
|
20
|
-
unlockUntilUnixMs: number;
|
|
21
|
-
state: WalletStateV1;
|
|
22
|
-
}
|
|
23
|
-
export interface WalletUnlockResult {
|
|
24
|
-
unlockUntilUnixMs: number;
|
|
25
|
-
state: WalletStateV1;
|
|
26
|
-
source: "primary" | "backup";
|
|
27
|
-
}
|
|
28
|
-
export interface LoadedUnlockedWalletState {
|
|
29
|
-
session: UnlockSessionStateV1;
|
|
30
|
-
state: WalletStateV1;
|
|
31
|
-
source: "primary" | "backup";
|
|
32
|
-
}
|
|
33
|
-
export interface WalletExportResult {
|
|
34
|
-
archivePath: string;
|
|
35
|
-
walletRootId: string;
|
|
36
|
-
}
|
|
37
|
-
export interface WalletImportResult {
|
|
38
|
-
archivePath: string;
|
|
39
|
-
walletRootId: string;
|
|
40
|
-
fundingAddress: string;
|
|
41
|
-
unlockUntilUnixMs: number;
|
|
42
20
|
state: WalletStateV1;
|
|
43
21
|
}
|
|
44
22
|
export interface WalletRestoreResult {
|
|
23
|
+
passwordAction: "created" | "migrated" | "already-configured";
|
|
45
24
|
seedName?: string | null;
|
|
46
25
|
walletRootId: string;
|
|
47
26
|
fundingAddress: string;
|
|
48
|
-
unlockUntilUnixMs: number;
|
|
49
27
|
state: WalletStateV1;
|
|
50
28
|
warnings?: string[];
|
|
51
29
|
}
|
|
@@ -113,20 +91,12 @@ interface WalletLifecycleRpcClient {
|
|
|
113
91
|
}>;
|
|
114
92
|
unloadWallet?(walletName: string, loadOnStartup?: boolean): Promise<null>;
|
|
115
93
|
listWallets(): Promise<string[]>;
|
|
94
|
+
listUnspent(walletName: string, minConf?: number): Promise<RpcListUnspentEntry[]>;
|
|
116
95
|
getBlockchainInfo(): Promise<{
|
|
117
96
|
blocks: number;
|
|
118
97
|
headers: number;
|
|
119
98
|
}>;
|
|
120
99
|
}
|
|
121
|
-
declare function readManagedSnapshotTip(options: {
|
|
122
|
-
dataDir: string;
|
|
123
|
-
databasePath: string;
|
|
124
|
-
walletRootId: string;
|
|
125
|
-
}): Promise<{
|
|
126
|
-
nodeBestHeight: number | null;
|
|
127
|
-
snapshotHeight: number | null;
|
|
128
|
-
}>;
|
|
129
|
-
export declare function parseUnlockDurationToMs(raw: string | null | undefined): number;
|
|
130
100
|
export declare function verifyManagedCoreWalletReplica(state: WalletStateV1, dataDir: string, dependencies?: {
|
|
131
101
|
nodeHandle?: {
|
|
132
102
|
rpc: Parameters<typeof createRpcClient>[0];
|
|
@@ -134,30 +104,11 @@ export declare function verifyManagedCoreWalletReplica(state: WalletStateV1, dat
|
|
|
134
104
|
attachService?: typeof attachOrStartManagedBitcoindService;
|
|
135
105
|
rpcFactory?: (config: Parameters<typeof createRpcClient>[0]) => WalletLifecycleRpcClient;
|
|
136
106
|
}): Promise<ManagedCoreWalletReplicaStatus>;
|
|
137
|
-
export declare function loadUnlockedWalletState(options?: {
|
|
138
|
-
provider?: WalletSecretProvider;
|
|
139
|
-
nowUnixMs?: number;
|
|
140
|
-
paths?: WalletRuntimePaths;
|
|
141
|
-
dataDir?: string;
|
|
142
|
-
attachService?: typeof attachOrStartManagedBitcoindService;
|
|
143
|
-
rpcFactory?: (config: Parameters<typeof createRpcClient>[0]) => WalletLifecycleRpcClient;
|
|
144
|
-
}): Promise<LoadedUnlockedWalletState | null>;
|
|
145
|
-
export declare function loadOrAutoUnlockWalletState(options?: {
|
|
146
|
-
provider?: WalletSecretProvider;
|
|
147
|
-
nowUnixMs?: number;
|
|
148
|
-
unlockDurationMs?: number;
|
|
149
|
-
paths?: WalletRuntimePaths;
|
|
150
|
-
dataDir?: string;
|
|
151
|
-
controlLockHeld?: boolean;
|
|
152
|
-
attachService?: typeof attachOrStartManagedBitcoindService;
|
|
153
|
-
rpcFactory?: (config: Parameters<typeof createRpcClient>[0]) => WalletLifecycleRpcClient;
|
|
154
|
-
}): Promise<LoadedUnlockedWalletState | null>;
|
|
155
107
|
export declare function initializeWallet(options: {
|
|
156
108
|
dataDir: string;
|
|
157
109
|
provider?: WalletSecretProvider;
|
|
158
110
|
prompter: WalletPrompter;
|
|
159
111
|
nowUnixMs?: number;
|
|
160
|
-
unlockDurationMs?: number;
|
|
161
112
|
paths?: WalletRuntimePaths;
|
|
162
113
|
attachService?: typeof attachOrStartManagedBitcoindService;
|
|
163
114
|
rpcFactory?: (config: Parameters<typeof createRpcClient>[0]) => WalletLifecycleRpcClient;
|
|
@@ -168,54 +119,11 @@ export declare function showWalletMnemonic(options: {
|
|
|
168
119
|
nowUnixMs?: number;
|
|
169
120
|
paths?: WalletRuntimePaths;
|
|
170
121
|
}): Promise<void>;
|
|
171
|
-
export declare function unlockWallet(options?: {
|
|
172
|
-
provider?: WalletSecretProvider;
|
|
173
|
-
nowUnixMs?: number;
|
|
174
|
-
unlockDurationMs?: number;
|
|
175
|
-
paths?: WalletRuntimePaths;
|
|
176
|
-
}): Promise<WalletUnlockResult>;
|
|
177
|
-
export declare function lockWallet(options: {
|
|
178
|
-
dataDir: string;
|
|
179
|
-
provider?: WalletSecretProvider;
|
|
180
|
-
nowUnixMs?: number;
|
|
181
|
-
paths?: WalletRuntimePaths;
|
|
182
|
-
attachService?: typeof attachOrStartManagedBitcoindService;
|
|
183
|
-
rpcFactory?: (config: Parameters<typeof createRpcClient>[0]) => WalletLifecycleRpcClient;
|
|
184
|
-
}): Promise<{
|
|
185
|
-
walletRootId: string | null;
|
|
186
|
-
coreLocked: boolean;
|
|
187
|
-
}>;
|
|
188
|
-
export declare function exportWallet(options: {
|
|
189
|
-
archivePath: string;
|
|
190
|
-
dataDir: string;
|
|
191
|
-
databasePath: string;
|
|
192
|
-
provider?: WalletSecretProvider;
|
|
193
|
-
prompter: WalletPrompter;
|
|
194
|
-
nowUnixMs?: number;
|
|
195
|
-
paths?: WalletRuntimePaths;
|
|
196
|
-
attachService?: typeof attachOrStartManagedBitcoindService;
|
|
197
|
-
rpcFactory?: (config: Parameters<typeof createRpcClient>[0]) => WalletLifecycleRpcClient;
|
|
198
|
-
readSnapshotTip?: typeof readManagedSnapshotTip;
|
|
199
|
-
}): Promise<WalletExportResult>;
|
|
200
|
-
export declare function importWallet(options: {
|
|
201
|
-
archivePath: string;
|
|
202
|
-
dataDir: string;
|
|
203
|
-
databasePath: string;
|
|
204
|
-
provider?: WalletSecretProvider;
|
|
205
|
-
prompter: WalletPrompter;
|
|
206
|
-
nowUnixMs?: number;
|
|
207
|
-
unlockDurationMs?: number;
|
|
208
|
-
paths?: WalletRuntimePaths;
|
|
209
|
-
attachService?: typeof attachOrStartManagedBitcoindService;
|
|
210
|
-
attachIndexerDaemon?: typeof attachOrStartIndexerDaemon;
|
|
211
|
-
rpcFactory?: (config: Parameters<typeof createRpcClient>[0]) => WalletLifecycleRpcClient;
|
|
212
|
-
}): Promise<WalletImportResult>;
|
|
213
122
|
export declare function restoreWalletFromMnemonic(options: {
|
|
214
123
|
dataDir: string;
|
|
215
124
|
provider?: WalletSecretProvider;
|
|
216
125
|
prompter: WalletPrompter;
|
|
217
126
|
nowUnixMs?: number;
|
|
218
|
-
unlockDurationMs?: number;
|
|
219
127
|
paths?: WalletRuntimePaths;
|
|
220
128
|
attachService?: typeof attachOrStartManagedBitcoindService;
|
|
221
129
|
rpcFactory?: (config: Parameters<typeof createRpcClient>[0]) => WalletLifecycleRpcClient;
|
|
@@ -243,6 +151,6 @@ export declare function repairWallet(options: {
|
|
|
243
151
|
rpcFactory?: (config: Parameters<typeof createRpcClient>[0]) => WalletLifecycleRpcClient;
|
|
244
152
|
attachIndexerDaemon?: typeof attachOrStartIndexerDaemon;
|
|
245
153
|
probeIndexerDaemon?: typeof probeIndexerDaemon;
|
|
246
|
-
requestMiningPreemption?: typeof requestMiningGenerationPreemption;
|
|
154
|
+
requestMiningPreemption?: typeof import("./mining/coordination.js").requestMiningGenerationPreemption;
|
|
247
155
|
startBackgroundMining?: typeof import("./mining/runner.js").startBackgroundMining;
|
|
248
156
|
}): Promise<WalletRepairResult>;
|