@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,6 +1,5 @@
|
|
|
1
1
|
export { isMiningGenerationAbortRequested, markMiningGenerationActive, markMiningGenerationInactive, readMiningGenerationActivity, readMiningPreemptionRequest, requestMiningGenerationPreemption, } from "./coordination.js";
|
|
2
|
-
export {
|
|
3
|
-
export { runBackgroundMiningWorker, runForegroundMining, startBackgroundMining, stopBackgroundMining, } from "./runner.js";
|
|
2
|
+
export { followMiningLog, inspectMiningControlPlane, readMiningLog, refreshMiningRuntimeStatus, setupBuiltInMining, } from "./control.js";
|
|
3
|
+
export { ensureBuiltInMiningSetupIfNeeded, runBackgroundMiningWorker, runForegroundMining, startBackgroundMining, stopBackgroundMining, } from "./runner.js";
|
|
4
4
|
export { appendMiningEvent, loadMiningRuntimeStatus, readMiningEvents, resolveRotatedMiningEventsPath, saveMiningRuntimeStatus, } from "./runtime-artifacts.js";
|
|
5
|
-
export { ensureMiningHookTemplate, inspectMiningHookState, runGenerateSentencesHookRequest, validateCustomMiningHook, } from "./hooks.js";
|
|
6
5
|
export { loadClientConfig, saveBuiltInMiningProviderConfig, saveClientConfig, } from "./config.js";
|
|
@@ -2,12 +2,13 @@ import { attachOrStartManagedBitcoindService } from "../../bitcoind/service.js";
|
|
|
2
2
|
import { createRpcClient } from "../../bitcoind/node.js";
|
|
3
3
|
import type { ProgressOutputMode } from "../../bitcoind/types.js";
|
|
4
4
|
import { type FixedWalletInput, type MutationSender, type WalletMutationRpcClient } from "../tx/common.js";
|
|
5
|
-
import {
|
|
6
|
-
import { openWalletReadContext } from "../read/index.js";
|
|
5
|
+
import type { WalletPrompter } from "../lifecycle.js";
|
|
6
|
+
import { openWalletReadContext, type WalletReadContext } from "../read/index.js";
|
|
7
7
|
import { type WalletRuntimePaths } from "../runtime.js";
|
|
8
8
|
import { type WalletSecretProvider } from "../state/provider.js";
|
|
9
9
|
import type { MiningStateRecord, OutpointRecord, WalletStateV1 } from "../types.js";
|
|
10
|
-
import type { MiningRuntimeStatusV1 } from "./types.js";
|
|
10
|
+
import type { MiningEventRecord, MiningRuntimeStatusV1 } from "./types.js";
|
|
11
|
+
import { type MiningFollowVisualizerState, type MiningSentenceBoardEntry } from "./visualizer.js";
|
|
11
12
|
type MiningRpcClient = WalletMutationRpcClient & {
|
|
12
13
|
getBlockchainInfo(): Promise<{
|
|
13
14
|
blocks: number;
|
|
@@ -18,6 +19,13 @@ type MiningRpcClient = WalletMutationRpcClient & {
|
|
|
18
19
|
networkactive: boolean;
|
|
19
20
|
connections_out?: number;
|
|
20
21
|
}>;
|
|
22
|
+
getBlockHash(height: number): Promise<string>;
|
|
23
|
+
getBlock(hashHex: string): Promise<{
|
|
24
|
+
hash: string;
|
|
25
|
+
previousblockhash?: string;
|
|
26
|
+
height: number;
|
|
27
|
+
time?: number;
|
|
28
|
+
}>;
|
|
21
29
|
getMempoolInfo(): Promise<{
|
|
22
30
|
loaded: boolean;
|
|
23
31
|
}>;
|
|
@@ -69,7 +77,6 @@ interface MiningCandidate {
|
|
|
69
77
|
domainName: string;
|
|
70
78
|
localIndex: number;
|
|
71
79
|
sender: MutationSender;
|
|
72
|
-
anchorOutpoint: OutpointRecord;
|
|
73
80
|
sentence: string;
|
|
74
81
|
encodedSentenceBytes: Uint8Array;
|
|
75
82
|
bip39WordIndices: number[];
|
|
@@ -79,17 +86,58 @@ interface MiningCandidate {
|
|
|
79
86
|
referencedBlockHashInternal: Uint8Array;
|
|
80
87
|
targetBlockHeight: number;
|
|
81
88
|
}
|
|
89
|
+
type ReadyMiningReadContext = WalletReadContext & {
|
|
90
|
+
localState: {
|
|
91
|
+
availability: "ready";
|
|
92
|
+
state: WalletStateV1;
|
|
93
|
+
};
|
|
94
|
+
snapshot: NonNullable<WalletReadContext["snapshot"]>;
|
|
95
|
+
model: NonNullable<WalletReadContext["model"]>;
|
|
96
|
+
};
|
|
97
|
+
interface MiningPublishSkipResult {
|
|
98
|
+
state: WalletStateV1;
|
|
99
|
+
txid: null;
|
|
100
|
+
decision: "publish-skipped-stale-candidate";
|
|
101
|
+
note: string;
|
|
102
|
+
skipped: true;
|
|
103
|
+
retryable?: false;
|
|
104
|
+
candidate: null;
|
|
105
|
+
}
|
|
106
|
+
interface MiningPublishRetryResult {
|
|
107
|
+
state: WalletStateV1;
|
|
108
|
+
txid: null;
|
|
109
|
+
decision: "publish-retry-pending";
|
|
110
|
+
note: string;
|
|
111
|
+
skipped?: false;
|
|
112
|
+
retryable: true;
|
|
113
|
+
candidate: MiningCandidate;
|
|
114
|
+
}
|
|
115
|
+
type MiningPublishOutcome = ({
|
|
116
|
+
skipped?: false;
|
|
117
|
+
retryable?: false;
|
|
118
|
+
note?: null;
|
|
119
|
+
candidate: MiningCandidate;
|
|
120
|
+
} & Awaited<ReturnType<typeof publishCandidateOnce>>) | MiningPublishSkipResult | MiningPublishRetryResult;
|
|
82
121
|
interface RunnerDependencies {
|
|
83
122
|
openReadContext?: typeof openWalletReadContext;
|
|
84
123
|
attachService?: typeof attachOrStartManagedBitcoindService;
|
|
85
124
|
rpcFactory?: (config: Parameters<typeof createRpcClient>[0]) => MiningRpcClient;
|
|
86
125
|
fetchImpl?: typeof fetch;
|
|
87
126
|
}
|
|
127
|
+
interface MiningLoopState {
|
|
128
|
+
attemptedTipKey: string | null;
|
|
129
|
+
currentTipKey: string | null;
|
|
130
|
+
selectedCandidateTipKey: string | null;
|
|
131
|
+
selectedCandidate: MiningCandidate | null;
|
|
132
|
+
ui: MiningFollowVisualizerState;
|
|
133
|
+
waitingNote: string | null;
|
|
134
|
+
}
|
|
88
135
|
export interface RunForegroundMiningOptions extends RunnerDependencies {
|
|
89
136
|
dataDir: string;
|
|
90
137
|
databasePath: string;
|
|
91
138
|
provider?: WalletSecretProvider;
|
|
92
139
|
prompter: WalletPrompter;
|
|
140
|
+
builtInSetupEnsured?: boolean;
|
|
93
141
|
stdout?: {
|
|
94
142
|
write(chunk: string): void;
|
|
95
143
|
};
|
|
@@ -107,6 +155,7 @@ export interface StartBackgroundMiningOptions extends RunnerDependencies {
|
|
|
107
155
|
databasePath: string;
|
|
108
156
|
provider?: WalletSecretProvider;
|
|
109
157
|
prompter: WalletPrompter;
|
|
158
|
+
builtInSetupEnsured?: boolean;
|
|
110
159
|
paths?: WalletRuntimePaths;
|
|
111
160
|
}
|
|
112
161
|
export interface StopBackgroundMiningOptions extends RunnerDependencies {
|
|
@@ -119,10 +168,30 @@ export interface MiningStartResult {
|
|
|
119
168
|
started: boolean;
|
|
120
169
|
snapshot: MiningRuntimeStatusV1 | null;
|
|
121
170
|
}
|
|
171
|
+
export declare function createMiningLoopStateForTesting(): MiningLoopState;
|
|
172
|
+
export declare function resetMiningUiForTipForTesting(loopState: MiningLoopState, targetBlockHeight: number | null): void;
|
|
173
|
+
export declare function resolveSettledBoardForTesting(options: {
|
|
174
|
+
snapshotState: NonNullable<WalletReadContext["snapshot"]>["state"] | null | undefined;
|
|
175
|
+
snapshotTipHeight: number | null;
|
|
176
|
+
nodeBestHeight: number | null;
|
|
177
|
+
}): {
|
|
178
|
+
settledBlockHeight: number | null;
|
|
179
|
+
settledBoardEntries: MiningSentenceBoardEntry[];
|
|
180
|
+
};
|
|
181
|
+
export declare function getSelectedCandidateForTipForTesting(loopState: MiningLoopState, tipKey: string | null): MiningCandidate | null;
|
|
182
|
+
export declare function cacheSelectedCandidateForTipForTesting(loopState: MiningLoopState, tipKey: string | null, candidate: MiningCandidate): void;
|
|
183
|
+
export declare function resolveFundingDisplaySatsForTesting(state: WalletStateV1, rpc: MiningRpcClient): Promise<bigint>;
|
|
184
|
+
export declare function loadMiningVisibleFollowBlockTimesForTesting(options: {
|
|
185
|
+
rpc: MiningRpcClient;
|
|
186
|
+
indexedTipHeight: number | null;
|
|
187
|
+
indexedTipHashHex: string | null;
|
|
188
|
+
}): Promise<Record<number, number>>;
|
|
189
|
+
export declare function syncMiningVisualizerBlockTimesForTesting(loopState: MiningLoopState, blockTimesByHeight: Record<number, number>): void;
|
|
190
|
+
declare function appendEvent(paths: WalletRuntimePaths, event: MiningEventRecord): Promise<void>;
|
|
122
191
|
declare function createMiningPlan(options: {
|
|
123
192
|
state: WalletStateV1;
|
|
124
193
|
candidate: MiningCandidate;
|
|
125
|
-
conflictOutpoint: OutpointRecord;
|
|
194
|
+
conflictOutpoint: OutpointRecord | null;
|
|
126
195
|
allUtxos: Awaited<ReturnType<MiningRpcClient["listUnspent"]>>;
|
|
127
196
|
feeRateSatVb: number;
|
|
128
197
|
}): {
|
|
@@ -132,11 +201,9 @@ declare function createMiningPlan(options: {
|
|
|
132
201
|
changeAddress: string;
|
|
133
202
|
changePosition: number;
|
|
134
203
|
expectedOpReturnScriptHex: string;
|
|
135
|
-
expectedAnchorScriptHex: string;
|
|
136
|
-
expectedAnchorValueSats: bigint;
|
|
137
204
|
allowedFundingScriptPubKeyHex: string;
|
|
138
205
|
eligibleFundingOutpointKeys: Set<string>;
|
|
139
|
-
expectedConflictOutpoint: OutpointRecord;
|
|
206
|
+
expectedConflictOutpoint: OutpointRecord | null;
|
|
140
207
|
feeRateSatVb: number;
|
|
141
208
|
};
|
|
142
209
|
export declare function createMiningPlanForTesting(options: {
|
|
@@ -146,7 +213,6 @@ export declare function createMiningPlanForTesting(options: {
|
|
|
146
213
|
domainName: string;
|
|
147
214
|
localIndex: number;
|
|
148
215
|
sender: MutationSender;
|
|
149
|
-
anchorOutpoint: OutpointRecord;
|
|
150
216
|
sentence: string;
|
|
151
217
|
encodedSentenceBytes: Uint8Array;
|
|
152
218
|
bip39WordIndices: number[];
|
|
@@ -166,14 +232,57 @@ export declare function createMiningPlanForTesting(options: {
|
|
|
166
232
|
changeAddress: string;
|
|
167
233
|
changePosition: number;
|
|
168
234
|
expectedOpReturnScriptHex: string;
|
|
169
|
-
expectedAnchorScriptHex: string;
|
|
170
|
-
expectedAnchorValueSats: bigint;
|
|
171
235
|
allowedFundingScriptPubKeyHex: string;
|
|
172
236
|
eligibleFundingOutpointKeys: Set<string>;
|
|
173
|
-
expectedConflictOutpoint: OutpointRecord;
|
|
237
|
+
expectedConflictOutpoint: OutpointRecord | null;
|
|
174
238
|
feeRateSatVb: number;
|
|
175
239
|
};
|
|
176
240
|
export declare function validateMiningDraftForTesting(decoded: Awaited<ReturnType<MiningRpcClient["decodePsbt"]>>, funded: Awaited<ReturnType<MiningRpcClient["walletCreateFundedPsbt"]>>, plan: ReturnType<typeof createMiningPlan>): void;
|
|
241
|
+
export declare function refreshMiningCandidateFromCurrentStateForTesting(context: ReadyMiningReadContext, candidate: MiningCandidate): MiningCandidate | null;
|
|
242
|
+
export declare function resolveMiningConflictOutpointForTesting(options: {
|
|
243
|
+
state: WalletStateV1;
|
|
244
|
+
allUtxos: Awaited<ReturnType<MiningRpcClient["listUnspent"]>>;
|
|
245
|
+
}): OutpointRecord | null;
|
|
246
|
+
declare function publishCandidateOnce(options: {
|
|
247
|
+
readContext: WalletReadContext & {
|
|
248
|
+
localState: {
|
|
249
|
+
availability: "ready";
|
|
250
|
+
state: WalletStateV1;
|
|
251
|
+
};
|
|
252
|
+
snapshot: NonNullable<WalletReadContext["snapshot"]>;
|
|
253
|
+
model: NonNullable<WalletReadContext["model"]>;
|
|
254
|
+
};
|
|
255
|
+
candidate: MiningCandidate;
|
|
256
|
+
dataDir: string;
|
|
257
|
+
provider: WalletSecretProvider;
|
|
258
|
+
paths: WalletRuntimePaths;
|
|
259
|
+
attachService: typeof attachOrStartManagedBitcoindService;
|
|
260
|
+
rpcFactory: (config: Parameters<typeof createRpcClient>[0]) => MiningRpcClient;
|
|
261
|
+
runId: string | null;
|
|
262
|
+
}): Promise<{
|
|
263
|
+
state: WalletStateV1;
|
|
264
|
+
txid: string | null;
|
|
265
|
+
decision: string;
|
|
266
|
+
}>;
|
|
267
|
+
export declare function publishCandidateForTesting(options: {
|
|
268
|
+
candidate: MiningCandidate;
|
|
269
|
+
dataDir: string;
|
|
270
|
+
databasePath: string;
|
|
271
|
+
provider: WalletSecretProvider;
|
|
272
|
+
paths: WalletRuntimePaths;
|
|
273
|
+
fallbackState: WalletStateV1;
|
|
274
|
+
openReadContext: typeof openWalletReadContext;
|
|
275
|
+
attachService: typeof attachOrStartManagedBitcoindService;
|
|
276
|
+
rpcFactory: (config: Parameters<typeof createRpcClient>[0]) => MiningRpcClient;
|
|
277
|
+
runId: string | null;
|
|
278
|
+
publishAttempt?: typeof publishCandidateOnce;
|
|
279
|
+
appendEventFn?: typeof appendEvent;
|
|
280
|
+
}): Promise<MiningPublishOutcome>;
|
|
281
|
+
export declare function ensureBuiltInMiningSetupIfNeeded(options: {
|
|
282
|
+
provider: WalletSecretProvider;
|
|
283
|
+
prompter: WalletPrompter;
|
|
284
|
+
paths: WalletRuntimePaths;
|
|
285
|
+
}): Promise<boolean>;
|
|
177
286
|
export declare function runForegroundMining(options: RunForegroundMiningOptions): Promise<void>;
|
|
178
287
|
export declare function startBackgroundMining(options: StartBackgroundMiningOptions): Promise<MiningStartResult>;
|
|
179
288
|
export declare function stopBackgroundMining(options: StopBackgroundMiningOptions): Promise<MiningRuntimeStatusV1 | null>;
|
|
@@ -211,8 +320,9 @@ export declare function performMiningCycleForTesting(options: {
|
|
|
211
320
|
stdout?: {
|
|
212
321
|
write(chunk: string): void;
|
|
213
322
|
};
|
|
323
|
+
loopState?: MiningLoopState;
|
|
214
324
|
}): Promise<void>;
|
|
215
|
-
export declare function
|
|
325
|
+
export declare function shouldKeepCurrentTipLivePublishForTesting(options: {
|
|
216
326
|
liveState: MiningStateRecord;
|
|
217
327
|
candidate: {
|
|
218
328
|
domainId: number;
|