@cogcoin/client 0.5.14 → 1.0.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 +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 +16 -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 +38 -3
- package/dist/cli/commands/service-runtime.js +0 -2
- package/dist/cli/commands/status.js +8 -2
- package/dist/cli/commands/sync.js +51 -4
- 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 +4 -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/types.d.ts +8 -17
- package/dist/cli/types.js +0 -2
- package/dist/cli/wallet-format.d.ts +1 -0
- package/dist/cli/wallet-format.js +205 -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 -11
- package/dist/wallet/coin-control.js +100 -357
- 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 +3 -4
- package/dist/wallet/mining/index.js +1 -2
- package/dist/wallet/mining/runner.d.ts +179 -6
- package/dist/wallet/mining/runner.js +891 -501
- 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 -1240
- 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 +74 -10
- package/dist/wallet/tx/common.js +315 -138
- 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 +84 -914
- 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 {
|
|
2
|
+
export { followMiningLog, inspectMiningControlPlane, readMiningLog, refreshMiningRuntimeStatus, setupBuiltInMining, } from "./control.js";
|
|
3
3
|
export { 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";
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { attachOrStartManagedBitcoindService } from "../../bitcoind/service.js";
|
|
2
2
|
import { createRpcClient } from "../../bitcoind/node.js";
|
|
3
3
|
import type { ProgressOutputMode } from "../../bitcoind/types.js";
|
|
4
|
-
import { type MutationSender, type WalletMutationRpcClient } from "../tx/common.js";
|
|
5
|
-
import {
|
|
6
|
-
import { openWalletReadContext } from "../read/index.js";
|
|
4
|
+
import { type FixedWalletInput, type MutationSender, type WalletMutationRpcClient } from "../tx/common.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
|
-
import type { MiningStateRecord } from "../types.js";
|
|
10
|
-
import type { MiningRuntimeStatusV1 } from "./types.js";
|
|
9
|
+
import type { MiningStateRecord, OutpointRecord, WalletStateV1 } 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
|
}>;
|
|
@@ -64,12 +72,66 @@ type MiningRpcClient = WalletMutationRpcClient & {
|
|
|
64
72
|
sendRawTransaction(hex: string): Promise<string>;
|
|
65
73
|
saveMempool?(): Promise<null>;
|
|
66
74
|
};
|
|
75
|
+
interface MiningCandidate {
|
|
76
|
+
domainId: number;
|
|
77
|
+
domainName: string;
|
|
78
|
+
localIndex: number;
|
|
79
|
+
sender: MutationSender;
|
|
80
|
+
sentence: string;
|
|
81
|
+
encodedSentenceBytes: Uint8Array;
|
|
82
|
+
bip39WordIndices: number[];
|
|
83
|
+
bip39Words: readonly string[];
|
|
84
|
+
canonicalBlend: bigint;
|
|
85
|
+
referencedBlockHashDisplay: string;
|
|
86
|
+
referencedBlockHashInternal: Uint8Array;
|
|
87
|
+
targetBlockHeight: number;
|
|
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;
|
|
67
121
|
interface RunnerDependencies {
|
|
68
122
|
openReadContext?: typeof openWalletReadContext;
|
|
69
123
|
attachService?: typeof attachOrStartManagedBitcoindService;
|
|
70
124
|
rpcFactory?: (config: Parameters<typeof createRpcClient>[0]) => MiningRpcClient;
|
|
71
125
|
fetchImpl?: typeof fetch;
|
|
72
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
|
+
}
|
|
73
135
|
export interface RunForegroundMiningOptions extends RunnerDependencies {
|
|
74
136
|
dataDir: string;
|
|
75
137
|
databasePath: string;
|
|
@@ -104,6 +166,116 @@ export interface MiningStartResult {
|
|
|
104
166
|
started: boolean;
|
|
105
167
|
snapshot: MiningRuntimeStatusV1 | null;
|
|
106
168
|
}
|
|
169
|
+
export declare function createMiningLoopStateForTesting(): MiningLoopState;
|
|
170
|
+
export declare function resetMiningUiForTipForTesting(loopState: MiningLoopState, targetBlockHeight: number | null): void;
|
|
171
|
+
export declare function resolveSettledBoardForTesting(options: {
|
|
172
|
+
snapshotState: NonNullable<WalletReadContext["snapshot"]>["state"] | null | undefined;
|
|
173
|
+
snapshotTipHeight: number | null;
|
|
174
|
+
nodeBestHeight: number | null;
|
|
175
|
+
}): {
|
|
176
|
+
settledBlockHeight: number | null;
|
|
177
|
+
settledBoardEntries: MiningSentenceBoardEntry[];
|
|
178
|
+
};
|
|
179
|
+
export declare function getSelectedCandidateForTipForTesting(loopState: MiningLoopState, tipKey: string | null): MiningCandidate | null;
|
|
180
|
+
export declare function cacheSelectedCandidateForTipForTesting(loopState: MiningLoopState, tipKey: string | null, candidate: MiningCandidate): void;
|
|
181
|
+
export declare function resolveFundingDisplaySatsForTesting(state: WalletStateV1, rpc: MiningRpcClient): Promise<bigint>;
|
|
182
|
+
export declare function loadMiningVisibleFollowBlockTimesForTesting(options: {
|
|
183
|
+
rpc: MiningRpcClient;
|
|
184
|
+
indexedTipHeight: number | null;
|
|
185
|
+
indexedTipHashHex: string | null;
|
|
186
|
+
}): Promise<Record<number, number>>;
|
|
187
|
+
export declare function syncMiningVisualizerBlockTimesForTesting(loopState: MiningLoopState, blockTimesByHeight: Record<number, number>): void;
|
|
188
|
+
declare function appendEvent(paths: WalletRuntimePaths, event: MiningEventRecord): Promise<void>;
|
|
189
|
+
declare function createMiningPlan(options: {
|
|
190
|
+
state: WalletStateV1;
|
|
191
|
+
candidate: MiningCandidate;
|
|
192
|
+
conflictOutpoint: OutpointRecord | null;
|
|
193
|
+
allUtxos: Awaited<ReturnType<MiningRpcClient["listUnspent"]>>;
|
|
194
|
+
feeRateSatVb: number;
|
|
195
|
+
}): {
|
|
196
|
+
sender: MutationSender;
|
|
197
|
+
fixedInputs: FixedWalletInput[];
|
|
198
|
+
outputs: unknown[];
|
|
199
|
+
changeAddress: string;
|
|
200
|
+
changePosition: number;
|
|
201
|
+
expectedOpReturnScriptHex: string;
|
|
202
|
+
allowedFundingScriptPubKeyHex: string;
|
|
203
|
+
eligibleFundingOutpointKeys: Set<string>;
|
|
204
|
+
expectedConflictOutpoint: OutpointRecord | null;
|
|
205
|
+
feeRateSatVb: number;
|
|
206
|
+
};
|
|
207
|
+
export declare function createMiningPlanForTesting(options: {
|
|
208
|
+
state: WalletStateV1;
|
|
209
|
+
candidate: {
|
|
210
|
+
domainId: number;
|
|
211
|
+
domainName: string;
|
|
212
|
+
localIndex: number;
|
|
213
|
+
sender: MutationSender;
|
|
214
|
+
sentence: string;
|
|
215
|
+
encodedSentenceBytes: Uint8Array;
|
|
216
|
+
bip39WordIndices: number[];
|
|
217
|
+
bip39Words: readonly string[];
|
|
218
|
+
canonicalBlend: bigint;
|
|
219
|
+
referencedBlockHashDisplay: string;
|
|
220
|
+
referencedBlockHashInternal: Uint8Array;
|
|
221
|
+
targetBlockHeight: number;
|
|
222
|
+
};
|
|
223
|
+
conflictOutpoint: OutpointRecord;
|
|
224
|
+
allUtxos: Awaited<ReturnType<MiningRpcClient["listUnspent"]>>;
|
|
225
|
+
feeRateSatVb: number;
|
|
226
|
+
}): {
|
|
227
|
+
sender: MutationSender;
|
|
228
|
+
fixedInputs: FixedWalletInput[];
|
|
229
|
+
outputs: unknown[];
|
|
230
|
+
changeAddress: string;
|
|
231
|
+
changePosition: number;
|
|
232
|
+
expectedOpReturnScriptHex: string;
|
|
233
|
+
allowedFundingScriptPubKeyHex: string;
|
|
234
|
+
eligibleFundingOutpointKeys: Set<string>;
|
|
235
|
+
expectedConflictOutpoint: OutpointRecord | null;
|
|
236
|
+
feeRateSatVb: number;
|
|
237
|
+
};
|
|
238
|
+
export declare function validateMiningDraftForTesting(decoded: Awaited<ReturnType<MiningRpcClient["decodePsbt"]>>, funded: Awaited<ReturnType<MiningRpcClient["walletCreateFundedPsbt"]>>, plan: ReturnType<typeof createMiningPlan>): void;
|
|
239
|
+
export declare function refreshMiningCandidateFromCurrentStateForTesting(context: ReadyMiningReadContext, candidate: MiningCandidate): MiningCandidate | null;
|
|
240
|
+
export declare function resolveMiningConflictOutpointForTesting(options: {
|
|
241
|
+
state: WalletStateV1;
|
|
242
|
+
allUtxos: Awaited<ReturnType<MiningRpcClient["listUnspent"]>>;
|
|
243
|
+
}): OutpointRecord | null;
|
|
244
|
+
declare function publishCandidateOnce(options: {
|
|
245
|
+
readContext: WalletReadContext & {
|
|
246
|
+
localState: {
|
|
247
|
+
availability: "ready";
|
|
248
|
+
state: WalletStateV1;
|
|
249
|
+
};
|
|
250
|
+
snapshot: NonNullable<WalletReadContext["snapshot"]>;
|
|
251
|
+
model: NonNullable<WalletReadContext["model"]>;
|
|
252
|
+
};
|
|
253
|
+
candidate: MiningCandidate;
|
|
254
|
+
dataDir: string;
|
|
255
|
+
provider: WalletSecretProvider;
|
|
256
|
+
paths: WalletRuntimePaths;
|
|
257
|
+
attachService: typeof attachOrStartManagedBitcoindService;
|
|
258
|
+
rpcFactory: (config: Parameters<typeof createRpcClient>[0]) => MiningRpcClient;
|
|
259
|
+
runId: string | null;
|
|
260
|
+
}): Promise<{
|
|
261
|
+
state: WalletStateV1;
|
|
262
|
+
txid: string | null;
|
|
263
|
+
decision: string;
|
|
264
|
+
}>;
|
|
265
|
+
export declare function publishCandidateForTesting(options: {
|
|
266
|
+
candidate: MiningCandidate;
|
|
267
|
+
dataDir: string;
|
|
268
|
+
databasePath: string;
|
|
269
|
+
provider: WalletSecretProvider;
|
|
270
|
+
paths: WalletRuntimePaths;
|
|
271
|
+
fallbackState: WalletStateV1;
|
|
272
|
+
openReadContext: typeof openWalletReadContext;
|
|
273
|
+
attachService: typeof attachOrStartManagedBitcoindService;
|
|
274
|
+
rpcFactory: (config: Parameters<typeof createRpcClient>[0]) => MiningRpcClient;
|
|
275
|
+
runId: string | null;
|
|
276
|
+
publishAttempt?: typeof publishCandidateOnce;
|
|
277
|
+
appendEventFn?: typeof appendEvent;
|
|
278
|
+
}): Promise<MiningPublishOutcome>;
|
|
107
279
|
export declare function runForegroundMining(options: RunForegroundMiningOptions): Promise<void>;
|
|
108
280
|
export declare function startBackgroundMining(options: StartBackgroundMiningOptions): Promise<MiningStartResult>;
|
|
109
281
|
export declare function stopBackgroundMining(options: StopBackgroundMiningOptions): Promise<MiningRuntimeStatusV1 | null>;
|
|
@@ -141,8 +313,9 @@ export declare function performMiningCycleForTesting(options: {
|
|
|
141
313
|
stdout?: {
|
|
142
314
|
write(chunk: string): void;
|
|
143
315
|
};
|
|
316
|
+
loopState?: MiningLoopState;
|
|
144
317
|
}): Promise<void>;
|
|
145
|
-
export declare function
|
|
318
|
+
export declare function shouldKeepCurrentTipLivePublishForTesting(options: {
|
|
146
319
|
liveState: MiningStateRecord;
|
|
147
320
|
candidate: {
|
|
148
321
|
domainId: number;
|