@cogcoin/client 1.1.7 → 1.1.8
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 +1 -1
- package/dist/bitcoind/service.js +1 -1
- package/dist/wallet/mining/engine-state.js +10 -0
- package/dist/wallet/mining/visualizer-sync.js +79 -15
- package/dist/wallet/read/context.js +1 -1
- package/dist/wallet/reset/artifacts.d.ts +16 -0
- package/dist/wallet/reset/artifacts.js +141 -0
- package/dist/wallet/reset/execution.d.ts +38 -0
- package/dist/wallet/reset/execution.js +458 -0
- package/dist/wallet/reset/preflight.d.ts +7 -0
- package/dist/wallet/reset/preflight.js +116 -0
- package/dist/wallet/reset/preview.d.ts +2 -0
- package/dist/wallet/reset/preview.js +50 -0
- package/dist/wallet/reset/process-cleanup.d.ts +12 -0
- package/dist/wallet/reset/process-cleanup.js +179 -0
- package/dist/wallet/reset/types.d.ts +189 -0
- package/dist/wallet/reset/types.js +1 -0
- package/dist/wallet/reset.d.ts +4 -119
- package/dist/wallet/reset.js +4 -882
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `@cogcoin/client`
|
|
2
2
|
|
|
3
|
-
`@cogcoin/client@1.1.
|
|
3
|
+
`@cogcoin/client@1.1.8` is the reference Cogcoin client package for applications that want a local wallet, durable SQLite-backed state, and a managed Bitcoin Core integration around `@cogcoin/indexer`. It publishes the reusable client APIs, the SQLite adapter, the managed `bitcoind` integration, and the first-party `cogcoin` CLI in one package.
|
|
4
4
|
|
|
5
5
|
Use Node 22 or newer.
|
|
6
6
|
|
package/dist/bitcoind/service.js
CHANGED
|
@@ -20,7 +20,7 @@ import { DEFAULT_MANAGED_BITCOIND_FOLLOW_POLL_INTERVAL_MS, MANAGED_BITCOIND_SERV
|
|
|
20
20
|
const execFileAsync = promisify(execFile);
|
|
21
21
|
const LOCAL_HOST = "127.0.0.1";
|
|
22
22
|
const SUPPORTED_BITCOIND_VERSION = "30.2.0";
|
|
23
|
-
const DEFAULT_STARTUP_TIMEOUT_MS =
|
|
23
|
+
const DEFAULT_STARTUP_TIMEOUT_MS = 60_000;
|
|
24
24
|
const DEFAULT_SHUTDOWN_TIMEOUT_MS = 15_000;
|
|
25
25
|
const DEFAULT_DBCACHE_MIB = 450;
|
|
26
26
|
const claimedUninitializedRuntimeKeys = new Set();
|
|
@@ -135,13 +135,23 @@ export function buildMiningTipKey(bestBlockHash, targetBlockHeight) {
|
|
|
135
135
|
}
|
|
136
136
|
return `${bestBlockHash}:${targetBlockHeight}`;
|
|
137
137
|
}
|
|
138
|
+
function cloneSettledBoardEntries(entries) {
|
|
139
|
+
return entries.map((entry) => ({
|
|
140
|
+
...entry,
|
|
141
|
+
requiredWords: [...entry.requiredWords],
|
|
142
|
+
}));
|
|
143
|
+
}
|
|
138
144
|
export function resetMiningUiForTip(loopState, _targetBlockHeight) {
|
|
139
145
|
const preservedTxid = loopState.ui.latestTxid;
|
|
140
146
|
const preservedFundingAddress = loopState.ui.fundingAddress;
|
|
147
|
+
const preservedSettledBlockHeight = loopState.ui.settledBlockHeight;
|
|
148
|
+
const preservedSettledBoardEntries = cloneSettledBoardEntries(loopState.ui.settledBoardEntries);
|
|
141
149
|
loopState.ui = {
|
|
142
150
|
...createEmptyMiningFollowVisualizerState(),
|
|
143
151
|
fundingAddress: preservedFundingAddress,
|
|
144
152
|
latestTxid: preservedTxid,
|
|
153
|
+
settledBlockHeight: preservedSettledBlockHeight,
|
|
154
|
+
settledBoardEntries: preservedSettledBoardEntries,
|
|
145
155
|
};
|
|
146
156
|
loopState.selectedCandidateTipKey = null;
|
|
147
157
|
loopState.selectedCandidate = null;
|
|
@@ -4,6 +4,12 @@ import { FOLLOW_VISIBLE_PRIOR_BLOCKS } from "../../bitcoind/client/follow-block-
|
|
|
4
4
|
import { buildMiningTipKey, resetMiningUiForTip } from "./engine-state.js";
|
|
5
5
|
import { deriveMiningWordIndices, numberToSats, resolveBip39WordsFromIndices, } from "./engine-utils.js";
|
|
6
6
|
import { createEmptyMiningFollowVisualizerState } from "./visualizer.js";
|
|
7
|
+
function cloneSettledBoardEntries(entries) {
|
|
8
|
+
return entries.map((entry) => ({
|
|
9
|
+
...entry,
|
|
10
|
+
requiredWords: [...entry.requiredWords],
|
|
11
|
+
}));
|
|
12
|
+
}
|
|
7
13
|
function resolveSettledWinnerRequiredWords(options) {
|
|
8
14
|
const storedWords = resolveBip39WordsFromIndices(options.bip39WordIndices);
|
|
9
15
|
if (storedWords.length > 0) {
|
|
@@ -20,6 +26,46 @@ function resolveSettledWinnerRequiredWords(options) {
|
|
|
20
26
|
function fallbackSettledWinnerDomainName(domainId) {
|
|
21
27
|
return `domain-${domainId}`;
|
|
22
28
|
}
|
|
29
|
+
function resolveSettledBoardEntriesForHeight(options) {
|
|
30
|
+
if (options.snapshotState === null || options.snapshotState === undefined) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
const winners = getBlockWinners(options.snapshotState, options.blockHeight);
|
|
34
|
+
if (winners === null) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
const snapshotState = options.snapshotState;
|
|
38
|
+
return winners
|
|
39
|
+
.slice()
|
|
40
|
+
.sort((left, right) => left.rank - right.rank || left.txIndex - right.txIndex)
|
|
41
|
+
.slice(0, 5)
|
|
42
|
+
.map((winner) => ({
|
|
43
|
+
rank: winner.rank,
|
|
44
|
+
domainName: lookupDomainById(snapshotState, winner.domainId)?.name ?? fallbackSettledWinnerDomainName(winner.domainId),
|
|
45
|
+
sentence: winner.sentenceText ?? "[unavailable]",
|
|
46
|
+
requiredWords: resolveSettledWinnerRequiredWords({
|
|
47
|
+
domainId: winner.domainId,
|
|
48
|
+
bip39WordIndices: winner.bip39WordIndices,
|
|
49
|
+
snapshotTipPreviousHashHex: options.blockPreviousHashHex,
|
|
50
|
+
}),
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
function resolveLatestPriorNonEmptySettledBoard(options) {
|
|
54
|
+
for (let blockHeight = options.snapshotTipHeight - 1; blockHeight >= 0; blockHeight -= 1) {
|
|
55
|
+
const settledBoardEntries = resolveSettledBoardEntriesForHeight({
|
|
56
|
+
snapshotState: options.snapshotState,
|
|
57
|
+
blockHeight,
|
|
58
|
+
blockPreviousHashHex: null,
|
|
59
|
+
});
|
|
60
|
+
if (settledBoardEntries !== null && settledBoardEntries.length > 0) {
|
|
61
|
+
return {
|
|
62
|
+
settledBlockHeight: blockHeight,
|
|
63
|
+
settledBoardEntries,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
23
69
|
function resolveCurrentMinedBlockBoard(options) {
|
|
24
70
|
const settledBlockHeight = options.snapshotTipHeight ?? null;
|
|
25
71
|
if (settledBlockHeight === null) {
|
|
@@ -34,23 +80,37 @@ function resolveCurrentMinedBlockBoard(options) {
|
|
|
34
80
|
settledBoardEntries: [],
|
|
35
81
|
};
|
|
36
82
|
}
|
|
37
|
-
const settledBoardEntries = (
|
|
38
|
-
.
|
|
39
|
-
|
|
40
|
-
.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
83
|
+
const settledBoardEntries = resolveSettledBoardEntriesForHeight({
|
|
84
|
+
snapshotState: options.snapshotState,
|
|
85
|
+
blockHeight: settledBlockHeight,
|
|
86
|
+
blockPreviousHashHex: options.snapshotTipPreviousHashHex,
|
|
87
|
+
});
|
|
88
|
+
if (settledBoardEntries !== null) {
|
|
89
|
+
return {
|
|
90
|
+
settledBlockHeight,
|
|
91
|
+
settledBoardEntries,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
const currentDisplayedBlockHeight = options.currentDisplayedBoard?.settledBlockHeight ?? null;
|
|
95
|
+
const currentDisplayedEntries = options.currentDisplayedBoard?.settledBoardEntries ?? [];
|
|
96
|
+
if (currentDisplayedBlockHeight !== null
|
|
97
|
+
&& currentDisplayedBlockHeight <= settledBlockHeight
|
|
98
|
+
&& currentDisplayedEntries.length > 0) {
|
|
99
|
+
return {
|
|
100
|
+
settledBlockHeight: currentDisplayedBlockHeight,
|
|
101
|
+
settledBoardEntries: cloneSettledBoardEntries(currentDisplayedEntries),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
const latestPriorNonEmptyBoard = resolveLatestPriorNonEmptySettledBoard({
|
|
105
|
+
snapshotState: options.snapshotState,
|
|
106
|
+
snapshotTipHeight: settledBlockHeight,
|
|
107
|
+
});
|
|
108
|
+
if (latestPriorNonEmptyBoard !== null) {
|
|
109
|
+
return latestPriorNonEmptyBoard;
|
|
110
|
+
}
|
|
51
111
|
return {
|
|
52
112
|
settledBlockHeight,
|
|
53
|
-
settledBoardEntries,
|
|
113
|
+
settledBoardEntries: [],
|
|
54
114
|
};
|
|
55
115
|
}
|
|
56
116
|
export function resolveSettledBoard(options) {
|
|
@@ -66,6 +126,10 @@ function syncMiningUiSettledBoard(loopState, snapshotState, snapshotTipHeight, s
|
|
|
66
126
|
snapshotState,
|
|
67
127
|
snapshotTipHeight,
|
|
68
128
|
snapshotTipPreviousHashHex,
|
|
129
|
+
currentDisplayedBoard: {
|
|
130
|
+
settledBlockHeight: loopState.ui.settledBlockHeight,
|
|
131
|
+
settledBoardEntries: loopState.ui.settledBoardEntries,
|
|
132
|
+
},
|
|
69
133
|
});
|
|
70
134
|
loopState.ui.settledBlockHeight = settledBoard.settledBlockHeight;
|
|
71
135
|
loopState.ui.settledBoardEntries = settledBoard.settledBoardEntries;
|
|
@@ -16,7 +16,7 @@ import { createDefaultWalletSecretProvider, createWalletSecretReference, inspect
|
|
|
16
16
|
import { describeClientPasswordLockedMessage, describeClientPasswordMigrationMessage, describeClientPasswordSetupMessage, } from "../state/client-password.js";
|
|
17
17
|
import { openManagedWalletReadServiceBundle } from "./managed-services.js";
|
|
18
18
|
import { createWalletReadModel } from "./project.js";
|
|
19
|
-
const DEFAULT_SERVICE_START_TIMEOUT_MS =
|
|
19
|
+
const DEFAULT_SERVICE_START_TIMEOUT_MS = 60_000;
|
|
20
20
|
function btcAmountToSats(value) {
|
|
21
21
|
return BigInt(Math.round(value * 100_000_000));
|
|
22
22
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { WalletRuntimePaths } from "../runtime.js";
|
|
2
|
+
import type { StagedArtifact, WalletResetArtifactDependencies } from "./types.js";
|
|
3
|
+
export declare function pathExists(path: string, deps?: WalletResetArtifactDependencies): Promise<boolean>;
|
|
4
|
+
export declare function readJsonFileOrNull<T>(path: string, deps?: WalletResetArtifactDependencies): Promise<T | null>;
|
|
5
|
+
export declare function isPathWithin(root: string, target: string): boolean;
|
|
6
|
+
export declare function dedupeSortedPaths(candidates: readonly string[]): string[];
|
|
7
|
+
export declare function resolveDefaultRemovedRoots(paths: WalletRuntimePaths): string[];
|
|
8
|
+
export declare function resolveBitcoindPreservingRemovedRoots(paths: WalletRuntimePaths): string[];
|
|
9
|
+
export declare function resolveRemovedRoots(paths: WalletRuntimePaths, options?: {
|
|
10
|
+
preserveBitcoinDataDir: boolean;
|
|
11
|
+
}): string[];
|
|
12
|
+
export declare function isDeletedByRemovalPlan(removedRoots: readonly string[], targetPath: string): boolean;
|
|
13
|
+
export declare function stageArtifact(sourcePath: string, stagingRoot: string, label: string, deps?: WalletResetArtifactDependencies): Promise<StagedArtifact | null>;
|
|
14
|
+
export declare function restoreStagedArtifacts(artifacts: readonly StagedArtifact[], deps?: WalletResetArtifactDependencies): Promise<void>;
|
|
15
|
+
export declare function deleteRemovedRoots(roots: readonly string[], deps?: WalletResetArtifactDependencies): Promise<void>;
|
|
16
|
+
export declare function deleteBootstrapSnapshotArtifacts(dataDir: string, deps?: WalletResetArtifactDependencies): Promise<void>;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { access, constants, copyFile, mkdir, readFile, rename, rm } from "node:fs/promises";
|
|
2
|
+
import { dirname, join, relative } from "node:path";
|
|
3
|
+
import { DEFAULT_SNAPSHOT_METADATA } from "../../bitcoind/bootstrap/constants.js";
|
|
4
|
+
import { resolveBootstrapPathsForTesting } from "../../bitcoind/bootstrap/paths.js";
|
|
5
|
+
import { resolveLegacyHooksRootPath } from "../../app-paths.js";
|
|
6
|
+
function resolveArtifactDependencies(overrides = {}) {
|
|
7
|
+
return {
|
|
8
|
+
access: overrides.access ?? access,
|
|
9
|
+
copyFile: overrides.copyFile ?? copyFile,
|
|
10
|
+
mkdir: overrides.mkdir ?? mkdir,
|
|
11
|
+
readFile: overrides.readFile ?? readFile,
|
|
12
|
+
rename: overrides.rename ?? rename,
|
|
13
|
+
remove: overrides.remove ?? rm,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export async function pathExists(path, deps = {}) {
|
|
17
|
+
const resolved = resolveArtifactDependencies(deps);
|
|
18
|
+
try {
|
|
19
|
+
await resolved.access(path, constants.F_OK);
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
throw error;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export async function readJsonFileOrNull(path, deps = {}) {
|
|
30
|
+
const resolved = resolveArtifactDependencies(deps);
|
|
31
|
+
try {
|
|
32
|
+
return JSON.parse(await resolved.readFile(path, "utf8"));
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export function isPathWithin(root, target) {
|
|
42
|
+
const rel = relative(root, target);
|
|
43
|
+
return rel === "" || (!rel.startsWith("..") && rel !== ".");
|
|
44
|
+
}
|
|
45
|
+
export function dedupeSortedPaths(candidates) {
|
|
46
|
+
return [...new Set(candidates)].sort((left, right) => right.length - left.length);
|
|
47
|
+
}
|
|
48
|
+
export function resolveDefaultRemovedRoots(paths) {
|
|
49
|
+
const configRoot = dirname(paths.clientConfigPath);
|
|
50
|
+
return dedupeSortedPaths([
|
|
51
|
+
paths.dataRoot,
|
|
52
|
+
paths.stateRoot,
|
|
53
|
+
paths.runtimeRoot,
|
|
54
|
+
configRoot,
|
|
55
|
+
]);
|
|
56
|
+
}
|
|
57
|
+
export function resolveBitcoindPreservingRemovedRoots(paths) {
|
|
58
|
+
const configRoot = dirname(paths.clientConfigPath);
|
|
59
|
+
return dedupeSortedPaths([
|
|
60
|
+
paths.clientDataDir,
|
|
61
|
+
paths.indexerRoot,
|
|
62
|
+
paths.stateRoot,
|
|
63
|
+
paths.runtimeRoot,
|
|
64
|
+
configRoot,
|
|
65
|
+
resolveLegacyHooksRootPath({
|
|
66
|
+
dataRoot: paths.dataRoot,
|
|
67
|
+
clientConfigPath: paths.clientConfigPath,
|
|
68
|
+
}),
|
|
69
|
+
]);
|
|
70
|
+
}
|
|
71
|
+
export function resolveRemovedRoots(paths, options = {
|
|
72
|
+
preserveBitcoinDataDir: false,
|
|
73
|
+
}) {
|
|
74
|
+
return options.preserveBitcoinDataDir
|
|
75
|
+
? resolveBitcoindPreservingRemovedRoots(paths)
|
|
76
|
+
: resolveDefaultRemovedRoots(paths);
|
|
77
|
+
}
|
|
78
|
+
export function isDeletedByRemovalPlan(removedRoots, targetPath) {
|
|
79
|
+
return removedRoots.some((root) => isPathWithin(root, targetPath));
|
|
80
|
+
}
|
|
81
|
+
async function moveFile(sourcePath, destinationPath, deps = {}) {
|
|
82
|
+
const resolved = resolveArtifactDependencies(deps);
|
|
83
|
+
await resolved.mkdir(dirname(destinationPath), { recursive: true });
|
|
84
|
+
try {
|
|
85
|
+
await resolved.rename(sourcePath, destinationPath);
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
if (!(error instanceof Error) || !("code" in error) || error.code !== "EXDEV") {
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
91
|
+
await resolved.copyFile(sourcePath, destinationPath);
|
|
92
|
+
await resolved.remove(sourcePath, { force: true });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
export async function stageArtifact(sourcePath, stagingRoot, label, deps = {}) {
|
|
96
|
+
if (!await pathExists(sourcePath, deps)) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
const stagedPath = join(stagingRoot, label);
|
|
100
|
+
await moveFile(sourcePath, stagedPath, deps);
|
|
101
|
+
return {
|
|
102
|
+
originalPath: sourcePath,
|
|
103
|
+
stagedPath,
|
|
104
|
+
restorePath: sourcePath,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
export async function restoreStagedArtifacts(artifacts, deps = {}) {
|
|
108
|
+
for (const artifact of artifacts) {
|
|
109
|
+
if (!await pathExists(artifact.stagedPath, deps)) {
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
await moveFile(artifact.stagedPath, artifact.restorePath, deps);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
export async function deleteRemovedRoots(roots, deps = {}) {
|
|
116
|
+
const resolved = resolveArtifactDependencies(deps);
|
|
117
|
+
try {
|
|
118
|
+
for (const root of roots) {
|
|
119
|
+
await resolved.remove(root, {
|
|
120
|
+
recursive: true,
|
|
121
|
+
force: true,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
throw new Error("reset_data_root_delete_failed");
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
export async function deleteBootstrapSnapshotArtifacts(dataDir, deps = {}) {
|
|
130
|
+
const resolved = resolveArtifactDependencies(deps);
|
|
131
|
+
const snapshotPaths = resolveBootstrapPathsForTesting(dataDir, DEFAULT_SNAPSHOT_METADATA);
|
|
132
|
+
await Promise.all([
|
|
133
|
+
snapshotPaths.snapshotPath,
|
|
134
|
+
snapshotPaths.partialSnapshotPath,
|
|
135
|
+
snapshotPaths.statePath,
|
|
136
|
+
snapshotPaths.quoteStatePath,
|
|
137
|
+
].map(async (path) => resolved.remove(path, {
|
|
138
|
+
recursive: false,
|
|
139
|
+
force: true,
|
|
140
|
+
})));
|
|
141
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type WalletRuntimePaths } from "../runtime.js";
|
|
2
|
+
import { type WalletSecretProvider } from "../state/provider.js";
|
|
3
|
+
import { type WalletStateSaveAccess } from "../state/storage.js";
|
|
4
|
+
import type { WalletStateV1 } from "../types.js";
|
|
5
|
+
import { preflightReset } from "./preflight.js";
|
|
6
|
+
import type { ResetExecutionDecision, WalletAccessForReset, WalletResetAction, WalletResetBitcoinDataDirResultStatus, WalletResetExecutionOptions, WalletResetPreflight, WalletResetResult, WalletResetSnapshotResultStatus } from "./types.js";
|
|
7
|
+
export declare function loadWalletForEntropyReset(options: {
|
|
8
|
+
wallet: WalletResetPreflight["wallet"];
|
|
9
|
+
paths: WalletRuntimePaths;
|
|
10
|
+
provider: WalletSecretProvider;
|
|
11
|
+
}): Promise<WalletAccessForReset>;
|
|
12
|
+
export declare function createEntropyRetainedWalletState(previousState: WalletStateV1, nowUnixMs: number): WalletStateV1;
|
|
13
|
+
export declare function recreateManagedCoreWalletReplicaForReset(options: {
|
|
14
|
+
state: WalletStateV1;
|
|
15
|
+
access: WalletStateSaveAccess;
|
|
16
|
+
paths: NonNullable<WalletResetExecutionOptions["paths"]>;
|
|
17
|
+
dataDir: string;
|
|
18
|
+
nowUnixMs: number;
|
|
19
|
+
attachService?: WalletResetExecutionOptions["attachService"];
|
|
20
|
+
rpcFactory?: WalletResetExecutionOptions["rpcFactory"];
|
|
21
|
+
}): Promise<WalletStateV1>;
|
|
22
|
+
export declare function resolveResetExecutionDecision(options: {
|
|
23
|
+
preflight: Awaited<ReturnType<typeof preflightReset>>;
|
|
24
|
+
provider: NonNullable<WalletResetExecutionOptions["provider"]>;
|
|
25
|
+
prompter: WalletResetExecutionOptions["prompter"];
|
|
26
|
+
paths: NonNullable<WalletResetExecutionOptions["paths"]>;
|
|
27
|
+
}): Promise<ResetExecutionDecision>;
|
|
28
|
+
export declare function determineWalletAction(walletPresent: boolean, walletChoice: ResetExecutionDecision["walletChoice"]): WalletResetAction;
|
|
29
|
+
export declare function determineSnapshotResultStatus(options: {
|
|
30
|
+
snapshotStatus: Awaited<ReturnType<typeof preflightReset>>["snapshot"]["status"];
|
|
31
|
+
deleteSnapshot: boolean;
|
|
32
|
+
}): WalletResetSnapshotResultStatus;
|
|
33
|
+
export declare function determineBitcoinDataDirResultStatus(options: {
|
|
34
|
+
bitcoinDataDirStatus: Awaited<ReturnType<typeof preflightReset>>["bitcoinDataDir"]["status"];
|
|
35
|
+
deleteSnapshot: boolean;
|
|
36
|
+
deleteBitcoinDataDir: boolean;
|
|
37
|
+
}): WalletResetBitcoinDataDirResultStatus;
|
|
38
|
+
export declare function resetWallet(options: WalletResetExecutionOptions): Promise<WalletResetResult>;
|