@cogcoin/client 0.5.15 → 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 +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 +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 -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 +3 -4
- package/dist/wallet/mining/index.js +1 -2
- package/dist/wallet/mining/runner.d.ts +116 -13
- package/dist/wallet/mining/runner.js +885 -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 -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
package/dist/cli/context.js
CHANGED
|
@@ -6,15 +6,13 @@ import { resolveDefaultBitcoindDataDirForTesting, resolveDefaultClientDatabasePa
|
|
|
6
6
|
import { openManagedBitcoindClient } from "../bitcoind/index.js";
|
|
7
7
|
import { inspectPassiveClientStatus } from "../passive-status.js";
|
|
8
8
|
import { openSqliteStore } from "../sqlite/index.js";
|
|
9
|
-
import {
|
|
9
|
+
import { initializeWallet, deleteImportedWalletSeed, previewResetWallet, repairWallet, resetWallet, restoreWalletFromMnemonic, showWalletMnemonic, } from "../wallet/lifecycle.js";
|
|
10
10
|
import { resolveWalletRuntimePathsForTesting } from "../wallet/runtime.js";
|
|
11
11
|
import { openWalletReadContext } from "../wallet/read/index.js";
|
|
12
|
-
import { loadWalletExplicitLock } from "../wallet/state/explicit-lock.js";
|
|
13
|
-
import { loadUnlockSession } from "../wallet/state/session.js";
|
|
14
12
|
import { loadRawWalletStateEnvelope, loadWalletState } from "../wallet/state/storage.js";
|
|
15
|
-
import {
|
|
13
|
+
import { followMiningLog, inspectMiningControlPlane, readMiningLog, runForegroundMining, setupBuiltInMining, startBackgroundMining, stopBackgroundMining, } from "../wallet/mining/index.js";
|
|
16
14
|
import { createLazyDefaultWalletSecretProvider } from "../wallet/state/provider.js";
|
|
17
|
-
import { anchorDomain,
|
|
15
|
+
import { anchorDomain, transferBitcoin, buyDomain, claimCogLock, clearDomainDelegate, clearDomainEndpoint, clearDomainMiner, clearField, createField, giveReputation, lockCogToDomain, registerDomain, reclaimCogLock, revokeReputation, sendCog, setField, setDomainCanonical, setDomainDelegate, setDomainEndpoint, setDomainMiner, sellDomain, transferDomain, } from "../wallet/tx/index.js";
|
|
18
16
|
import { createTerminalPrompter } from "./prompt.js";
|
|
19
17
|
export async function readPackageVersionFromDisk() {
|
|
20
18
|
const packageUrls = [
|
|
@@ -57,15 +55,11 @@ export function createDefaultContext(overrides = {}) {
|
|
|
57
55
|
initializeWallet: overrides.initializeWallet ?? initializeWallet,
|
|
58
56
|
restoreWalletFromMnemonic: overrides.restoreWalletFromMnemonic ?? restoreWalletFromMnemonic,
|
|
59
57
|
previewResetWallet: overrides.previewResetWallet ?? previewResetWallet,
|
|
60
|
-
exportWallet: overrides.exportWallet ?? exportWallet,
|
|
61
|
-
importWallet: overrides.importWallet ?? importWallet,
|
|
62
58
|
deleteImportedWalletSeed: overrides.deleteImportedWalletSeed ?? deleteImportedWalletSeed,
|
|
63
59
|
showWalletMnemonic: overrides.showWalletMnemonic ?? showWalletMnemonic,
|
|
64
|
-
unlockWallet: overrides.unlockWallet ?? unlockWallet,
|
|
65
|
-
lockWallet: overrides.lockWallet ?? lockWallet,
|
|
66
60
|
registerDomain: overrides.registerDomain ?? registerDomain,
|
|
67
61
|
anchorDomain: overrides.anchorDomain ?? anchorDomain,
|
|
68
|
-
|
|
62
|
+
transferBitcoin: overrides.transferBitcoin ?? transferBitcoin,
|
|
69
63
|
transferDomain: overrides.transferDomain ?? transferDomain,
|
|
70
64
|
sellDomain: overrides.sellDomain ?? sellDomain,
|
|
71
65
|
buyDomain: overrides.buyDomain ?? buyDomain,
|
|
@@ -85,8 +79,6 @@ export function createDefaultContext(overrides = {}) {
|
|
|
85
79
|
clearField: overrides.clearField ?? clearField,
|
|
86
80
|
giveReputation: overrides.giveReputation ?? giveReputation,
|
|
87
81
|
revokeReputation: overrides.revokeReputation ?? revokeReputation,
|
|
88
|
-
enableMiningHooks: overrides.enableMiningHooks ?? enableMiningHooks,
|
|
89
|
-
disableMiningHooks: overrides.disableMiningHooks ?? disableMiningHooks,
|
|
90
82
|
inspectMiningControlPlane: overrides.inspectMiningControlPlane ?? inspectMiningControlPlane,
|
|
91
83
|
runForegroundMining: overrides.runForegroundMining ?? runForegroundMining,
|
|
92
84
|
startBackgroundMining: overrides.startBackgroundMining ?? startBackgroundMining,
|
|
@@ -112,8 +104,6 @@ export function createDefaultContext(overrides = {}) {
|
|
|
112
104
|
readPackageVersion: overrides.readPackageVersion ?? readPackageVersionFromDisk,
|
|
113
105
|
loadWalletState: overrides.loadWalletState ?? loadWalletState,
|
|
114
106
|
loadRawWalletStateEnvelope: overrides.loadRawWalletStateEnvelope ?? loadRawWalletStateEnvelope,
|
|
115
|
-
loadUnlockSession: overrides.loadUnlockSession ?? loadUnlockSession,
|
|
116
|
-
loadWalletExplicitLock: overrides.loadWalletExplicitLock ?? loadWalletExplicitLock,
|
|
117
107
|
resolveDefaultBitcoindDataDir: overrides.resolveDefaultBitcoindDataDir ?? resolveDefaultBitcoindDataDirForTesting,
|
|
118
108
|
resolveDefaultClientDatabasePath: overrides.resolveDefaultClientDatabasePath ?? resolveDefaultClientDatabasePathForTesting,
|
|
119
109
|
resolveUpdateCheckStatePath: overrides.resolveUpdateCheckStatePath ?? resolveDefaultUpdateCheckStatePathForTesting,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { MiningControlPlaneView, MiningEventRecord } from "../wallet/mining/index.js";
|
|
2
2
|
export declare function formatMiningSummaryLine(mining: MiningControlPlaneView): string;
|
|
3
|
-
export declare function formatHooksStatusReport(mining: MiningControlPlaneView): string;
|
|
4
3
|
export declare function formatMineStatusReport(mining: MiningControlPlaneView): string;
|
|
5
4
|
export declare function formatMiningEventRecord(event: MiningEventRecord): string;
|
|
@@ -14,7 +14,6 @@ function formatIndexerTruthSource(source) {
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
export function formatMiningSummaryLine(mining) {
|
|
17
|
-
const hookMode = mining.hook.mode === "unavailable" ? "unavailable" : mining.hook.mode;
|
|
18
17
|
const provider = mining.provider.configured
|
|
19
18
|
? `${mining.provider.provider} configured`
|
|
20
19
|
: mining.provider.status === "error"
|
|
@@ -24,39 +23,12 @@ export function formatMiningSummaryLine(mining) {
|
|
|
24
23
|
? " next repair"
|
|
25
24
|
: mining.runtime.miningState === "paused-stale"
|
|
26
25
|
? " next wait-or-rerun"
|
|
27
|
-
: mining.runtime.miningState === "paused" && mining.runtime.
|
|
26
|
+
: mining.runtime.miningState === "paused" && mining.runtime.livePublishInMempool
|
|
28
27
|
? " next wait-or-rerun"
|
|
29
28
|
: mining.runtime.pauseReason === "zero-reward"
|
|
30
29
|
? " zero-reward"
|
|
31
30
|
: "";
|
|
32
|
-
return `${mining.runtime.runMode} / ${mining.runtime.miningState} / ${mining.runtime.currentPhase}
|
|
33
|
-
}
|
|
34
|
-
export function formatHooksStatusReport(mining) {
|
|
35
|
-
const lines = ["Mining Hook Status"];
|
|
36
|
-
lines.push(`Mode: ${mining.hook.mode}`);
|
|
37
|
-
lines.push(`Entrypoint: ${mining.hook.entrypointPath}`);
|
|
38
|
-
lines.push(`Entrypoint present: ${mining.hook.entrypointExists ? "yes" : "no"}`);
|
|
39
|
-
lines.push(`Package: ${mining.hook.packageStatus}`);
|
|
40
|
-
if (mining.hook.packageMessage !== null) {
|
|
41
|
-
lines.push(`Package note: ${mining.hook.packageMessage}`);
|
|
42
|
-
}
|
|
43
|
-
lines.push(`Trust: ${mining.hook.trustStatus}`);
|
|
44
|
-
if (mining.hook.trustMessage !== null) {
|
|
45
|
-
lines.push(`Trust note: ${mining.hook.trustMessage}`);
|
|
46
|
-
}
|
|
47
|
-
lines.push(`Validation: ${mining.hook.operatorValidationState}`);
|
|
48
|
-
if (mining.hook.validationError !== null) {
|
|
49
|
-
lines.push(`Validation note: ${mining.hook.validationError}`);
|
|
50
|
-
}
|
|
51
|
-
lines.push(`Validated at: ${formatMaybeIso(mining.hook.validatedAtUnixMs)}`);
|
|
52
|
-
lines.push(`Launch fingerprint: ${mining.hook.currentLaunchFingerprint ?? "unavailable"}`);
|
|
53
|
-
lines.push(`Validated launch fingerprint: ${mining.hook.validatedLaunchFingerprint ?? "none"}`);
|
|
54
|
-
lines.push(`Full fingerprint: ${mining.hook.currentFullFingerprint ?? (mining.hook.verifyUsed ? "unavailable" : "not requested")}`);
|
|
55
|
-
lines.push(`Validated full fingerprint: ${mining.hook.validatedFullFingerprint ?? "none"}`);
|
|
56
|
-
lines.push(`Cooldown until: ${formatMaybeIso(mining.hook.cooldownUntilUnixMs)}`);
|
|
57
|
-
lines.push(`Cooldown active: ${mining.hook.cooldownActive ? "yes" : "no"}`);
|
|
58
|
-
lines.push(`Consecutive failures: ${mining.hook.consecutiveFailureCount}`);
|
|
59
|
-
return lines.join("\n");
|
|
31
|
+
return `${mining.runtime.runMode} / ${mining.runtime.miningState} / ${mining.runtime.currentPhase} provider ${provider}${suffix}`;
|
|
60
32
|
}
|
|
61
33
|
export function formatMineStatusReport(mining) {
|
|
62
34
|
const lines = ["Mining Status"];
|
|
@@ -69,14 +41,11 @@ export function formatMineStatusReport(mining) {
|
|
|
69
41
|
if (mining.runtime.lastSuspendDetectedAtUnixMs !== null) {
|
|
70
42
|
lines.push(`Last suspend detected: ${formatMaybeIso(mining.runtime.lastSuspendDetectedAtUnixMs)}`);
|
|
71
43
|
}
|
|
72
|
-
lines.push(`Hook mode: ${mining.runtime.hookMode}`);
|
|
73
|
-
lines.push(`Hook validation: ${mining.hook.operatorValidationState}`);
|
|
74
44
|
lines.push(`Provider: ${mining.provider.configured ? `${mining.provider.provider} configured` : mining.provider.status}`);
|
|
75
45
|
if (mining.provider.message !== null) {
|
|
76
46
|
lines.push(`Provider note: ${mining.provider.message}`);
|
|
77
47
|
}
|
|
78
48
|
lines.push(`Provider runtime: ${mining.runtime.providerState ?? "unknown"}`);
|
|
79
|
-
lines.push(`Hook cooldown: ${mining.hook.cooldownActive ? "active" : "inactive"}`);
|
|
80
49
|
lines.push(`Managed bitcoind: ${mining.runtime.bitcoindHealth}`);
|
|
81
50
|
if (mining.runtime.bitcoindReplicaStatus !== null) {
|
|
82
51
|
lines.push(`Managed Core wallet: ${mining.runtime.bitcoindReplicaStatus}`);
|
|
@@ -126,7 +95,6 @@ export function formatMineStatusReport(mining) {
|
|
|
126
95
|
if (mining.runtime.mempoolSequenceCacheStatus !== null) {
|
|
127
96
|
lines.push(`Gate cache: ${mining.runtime.mempoolSequenceCacheStatus}`);
|
|
128
97
|
}
|
|
129
|
-
lines.push(`Last validation: ${formatMaybeIso(mining.runtime.lastValidationAtUnixMs)}`);
|
|
130
98
|
lines.push(`Last event: ${formatMaybeIso(mining.runtime.lastEventAtUnixMs)}`);
|
|
131
99
|
if (mining.runtime.lastError !== null) {
|
|
132
100
|
lines.push(`Last error: ${mining.runtime.lastError}`);
|
|
@@ -144,10 +112,10 @@ export function formatMineStatusReport(mining) {
|
|
|
144
112
|
lines.push("Next: wait for mining to finish rechecking health after the local runtime resumed.");
|
|
145
113
|
}
|
|
146
114
|
else if (mining.runtime.miningState === "paused-stale") {
|
|
147
|
-
lines.push("Next: wait for the live
|
|
115
|
+
lines.push("Next: wait for the live mining publish to confirm, or rerun mining after the tip settles.");
|
|
148
116
|
}
|
|
149
|
-
else if (mining.runtime.miningState === "paused" && mining.runtime.
|
|
150
|
-
lines.push("Next: wait for the live
|
|
117
|
+
else if (mining.runtime.miningState === "paused" && mining.runtime.livePublishInMempool) {
|
|
118
|
+
lines.push("Next: wait for the live mining publish to confirm, or rerun mining when you want replacements to resume.");
|
|
151
119
|
}
|
|
152
120
|
return lines.join("\n");
|
|
153
121
|
}
|
|
@@ -1,22 +1,4 @@
|
|
|
1
1
|
import type { MiningControlPlaneView, MiningRuntimeStatusV1 } from "../wallet/mining/index.js";
|
|
2
|
-
export declare function buildHooksDisableMiningData(view: MiningControlPlaneView): {
|
|
3
|
-
resultType: "state-change";
|
|
4
|
-
stateChange: {
|
|
5
|
-
kind: string;
|
|
6
|
-
before: Record<string, unknown> | null;
|
|
7
|
-
after: Record<string, unknown> | null;
|
|
8
|
-
};
|
|
9
|
-
state: Record<string, unknown>;
|
|
10
|
-
};
|
|
11
|
-
export declare function buildHooksEnableMiningData(view: MiningControlPlaneView): {
|
|
12
|
-
resultType: "state-change";
|
|
13
|
-
stateChange: {
|
|
14
|
-
kind: string;
|
|
15
|
-
before: Record<string, unknown> | null;
|
|
16
|
-
after: Record<string, unknown> | null;
|
|
17
|
-
};
|
|
18
|
-
state: Record<string, unknown>;
|
|
19
|
-
};
|
|
20
2
|
export declare function buildMineSetupData(view: MiningControlPlaneView): {
|
|
21
3
|
resultType: "state-change";
|
|
22
4
|
stateChange: {
|
package/dist/cli/mining-json.js
CHANGED
|
@@ -12,21 +12,8 @@ function summarizeRuntime(snapshot) {
|
|
|
12
12
|
note: snapshot.note,
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
export function buildHooksDisableMiningData(view) {
|
|
16
|
-
return buildHooksStateChangeData("hooks-disable-mining", view);
|
|
17
|
-
}
|
|
18
|
-
export function buildHooksEnableMiningData(view) {
|
|
19
|
-
return buildHooksStateChangeData("hooks-enable-mining", view);
|
|
20
|
-
}
|
|
21
15
|
export function buildMineSetupData(view) {
|
|
22
16
|
const after = {
|
|
23
|
-
hook: {
|
|
24
|
-
mode: view.hook.mode,
|
|
25
|
-
validationState: view.hook.validationState,
|
|
26
|
-
operatorValidationState: view.hook.operatorValidationState,
|
|
27
|
-
validationError: view.hook.validationError,
|
|
28
|
-
cooldownActive: view.hook.cooldownActive,
|
|
29
|
-
},
|
|
30
17
|
provider: {
|
|
31
18
|
configured: view.provider.configured,
|
|
32
19
|
provider: view.provider.provider,
|
|
@@ -42,28 +29,6 @@ export function buildMineSetupData(view) {
|
|
|
42
29
|
after,
|
|
43
30
|
});
|
|
44
31
|
}
|
|
45
|
-
function buildHooksStateChangeData(kind, view) {
|
|
46
|
-
const after = {
|
|
47
|
-
hook: {
|
|
48
|
-
mode: view.hook.mode,
|
|
49
|
-
validationState: view.hook.validationState,
|
|
50
|
-
operatorValidationState: view.hook.operatorValidationState,
|
|
51
|
-
validationError: view.hook.validationError,
|
|
52
|
-
cooldownActive: view.hook.cooldownActive,
|
|
53
|
-
},
|
|
54
|
-
provider: {
|
|
55
|
-
configured: view.provider.configured,
|
|
56
|
-
provider: view.provider.provider,
|
|
57
|
-
status: view.provider.status,
|
|
58
|
-
},
|
|
59
|
-
runtime: summarizeRuntime(view.runtime),
|
|
60
|
-
};
|
|
61
|
-
return buildStateChangeData({
|
|
62
|
-
kind,
|
|
63
|
-
state: after,
|
|
64
|
-
after,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
32
|
export function buildMineStartData(result) {
|
|
68
33
|
const after = {
|
|
69
34
|
started: result.started,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { CommandName } from "./types.js";
|
|
2
|
-
export declare const walletMutationCommands: readonly ["anchor", "
|
|
2
|
+
export declare const walletMutationCommands: readonly ["anchor", "domain-anchor", "register", "domain-register", "transfer", "domain-transfer", "sell", "domain-sell", "unsell", "domain-unsell", "buy", "domain-buy", "domain-endpoint-set", "domain-endpoint-clear", "domain-delegate-set", "domain-delegate-clear", "domain-miner-set", "domain-miner-clear", "domain-canonical", "field-create", "field-set", "field-clear", "send", "cog-send", "claim", "cog-claim", "reclaim", "cog-reclaim", "cog-lock", "rep-give", "rep-revoke"];
|
|
3
3
|
export type WalletMutationCommand = (typeof walletMutationCommands)[number];
|
|
4
4
|
export declare function isWalletMutationCommand(command: CommandName | null): command is WalletMutationCommand;
|
|
5
5
|
export declare function isAnchorMutationCommand(command: CommandName | null): command is "anchor" | "domain-anchor";
|
|
6
|
-
export declare function isAnchorClearMutationCommand(command: CommandName | null): command is "anchor-clear" | "domain-anchor-clear";
|
|
7
6
|
export declare function isRegisterMutationCommand(command: CommandName | null): command is "register" | "domain-register";
|
|
8
7
|
export declare function isTransferMutationCommand(command: CommandName | null): command is "transfer" | "domain-transfer";
|
|
9
8
|
export declare function isSellMutationCommand(command: CommandName | null): command is "sell" | "domain-sell";
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export const walletMutationCommands = [
|
|
2
2
|
"anchor",
|
|
3
|
-
"anchor-clear",
|
|
4
3
|
"domain-anchor",
|
|
5
|
-
"domain-anchor-clear",
|
|
6
4
|
"register",
|
|
7
5
|
"domain-register",
|
|
8
6
|
"transfer",
|
|
@@ -41,9 +39,6 @@ export function isWalletMutationCommand(command) {
|
|
|
41
39
|
export function isAnchorMutationCommand(command) {
|
|
42
40
|
return command === "anchor" || command === "domain-anchor";
|
|
43
41
|
}
|
|
44
|
-
export function isAnchorClearMutationCommand(command) {
|
|
45
|
-
return command === "anchor-clear" || command === "domain-anchor-clear";
|
|
46
|
-
}
|
|
47
42
|
export function isRegisterMutationCommand(command) {
|
|
48
43
|
return command === "register" || command === "domain-register";
|
|
49
44
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AnchorDomainResult,
|
|
2
|
-
import type { WalletInitializationResult,
|
|
1
|
+
import type { AnchorDomainResult, BitcoinTransferResult, CogMutationResult, DomainAdminMutationResult, DomainMarketMutationResult, FieldMutationResult, RegisterDomainResult, ReputationMutationResult, WalletMutationFeeSummary } from "../wallet/tx/index.js";
|
|
2
|
+
import type { WalletInitializationResult, WalletDeleteResult, WalletRepairResult, WalletResetResult, WalletRestoreResult } from "../wallet/lifecycle.js";
|
|
3
3
|
export declare function buildSingleTxMutationData(options: {
|
|
4
4
|
kind: string;
|
|
5
5
|
localStatus: string;
|
|
@@ -7,6 +7,7 @@ export declare function buildSingleTxMutationData(options: {
|
|
|
7
7
|
wtxid?: string | null | undefined;
|
|
8
8
|
reusedExisting: boolean;
|
|
9
9
|
intent: Record<string, unknown>;
|
|
10
|
+
fees: WalletMutationFeeSummary;
|
|
10
11
|
journalKind?: string | null;
|
|
11
12
|
intentFingerprintHex?: string | null;
|
|
12
13
|
}): {
|
|
@@ -22,38 +23,7 @@ export declare function buildSingleTxMutationData(options: {
|
|
|
22
23
|
txid: string | null;
|
|
23
24
|
wtxid: string | null;
|
|
24
25
|
};
|
|
25
|
-
|
|
26
|
-
};
|
|
27
|
-
export declare function buildFamilyMutationData(options: {
|
|
28
|
-
familyKind: string;
|
|
29
|
-
familyStatus: string;
|
|
30
|
-
reusedExisting: boolean;
|
|
31
|
-
intent: Record<string, unknown>;
|
|
32
|
-
currentStep?: string | null;
|
|
33
|
-
tx1Txid?: string | null | undefined;
|
|
34
|
-
tx1Wtxid?: string | null | undefined;
|
|
35
|
-
tx2Txid?: string | null | undefined;
|
|
36
|
-
tx2Wtxid?: string | null | undefined;
|
|
37
|
-
intentFingerprintHex?: string | null;
|
|
38
|
-
}): {
|
|
39
|
-
resultType: "family-mutation";
|
|
40
|
-
family: {
|
|
41
|
-
kind: string;
|
|
42
|
-
localStatus: string;
|
|
43
|
-
reusedExisting: boolean;
|
|
44
|
-
currentStep: string | null;
|
|
45
|
-
intentFingerprintHex: string | null;
|
|
46
|
-
};
|
|
47
|
-
transactions: {
|
|
48
|
-
tx1: {
|
|
49
|
-
txid: string | null;
|
|
50
|
-
wtxid: string | null;
|
|
51
|
-
};
|
|
52
|
-
tx2: {
|
|
53
|
-
txid: string | null;
|
|
54
|
-
wtxid: string | null;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
26
|
+
fees: WalletMutationFeeSummary;
|
|
57
27
|
intent: Record<string, unknown>;
|
|
58
28
|
};
|
|
59
29
|
export declare function buildStateChangeData(options: {
|
|
@@ -81,9 +51,15 @@ export declare function buildOperationData(options: {
|
|
|
81
51
|
};
|
|
82
52
|
state: Record<string, unknown> | null;
|
|
83
53
|
};
|
|
54
|
+
export declare function buildBitcoinTransferData(result: BitcoinTransferResult): {
|
|
55
|
+
resultType: "operation";
|
|
56
|
+
operation: {
|
|
57
|
+
kind: string;
|
|
58
|
+
};
|
|
59
|
+
state: Record<string, unknown> | null;
|
|
60
|
+
};
|
|
84
61
|
export declare function buildRegisterMutationData(result: RegisterDomainResult, options: {
|
|
85
62
|
forceRace: boolean;
|
|
86
|
-
fromIdentity: string | null;
|
|
87
63
|
}): {
|
|
88
64
|
resolved: {
|
|
89
65
|
path: "root" | "subdomain";
|
|
@@ -111,11 +87,11 @@ export declare function buildRegisterMutationData(result: RegisterDomainResult,
|
|
|
111
87
|
txid: string | null;
|
|
112
88
|
wtxid: string | null;
|
|
113
89
|
};
|
|
90
|
+
fees: WalletMutationFeeSummary;
|
|
114
91
|
intent: Record<string, unknown>;
|
|
115
92
|
};
|
|
116
93
|
export declare function buildDomainMarketMutationData(result: DomainMarketMutationResult, options: {
|
|
117
94
|
commandKind: "transfer" | "sell" | "unsell" | "buy";
|
|
118
|
-
fromIdentity?: string | null;
|
|
119
95
|
}): {
|
|
120
96
|
resolved: {
|
|
121
97
|
buyer: {
|
|
@@ -167,11 +143,11 @@ export declare function buildDomainMarketMutationData(result: DomainMarketMutati
|
|
|
167
143
|
txid: string | null;
|
|
168
144
|
wtxid: string | null;
|
|
169
145
|
};
|
|
146
|
+
fees: WalletMutationFeeSummary;
|
|
170
147
|
intent: Record<string, unknown>;
|
|
171
148
|
};
|
|
172
149
|
export declare function buildCogMutationData(result: CogMutationResult, options: {
|
|
173
150
|
commandKind: "send" | "claim" | "reclaim" | "cog-lock";
|
|
174
|
-
fromIdentity: string | null;
|
|
175
151
|
timeoutBlocksOrDuration?: string | null;
|
|
176
152
|
timeoutHeight?: string | null;
|
|
177
153
|
conditionHex?: string | null;
|
|
@@ -197,40 +173,27 @@ export declare function buildCogMutationData(result: CogMutationResult, options:
|
|
|
197
173
|
txid: string | null;
|
|
198
174
|
wtxid: string | null;
|
|
199
175
|
};
|
|
176
|
+
fees: WalletMutationFeeSummary;
|
|
200
177
|
intent: Record<string, unknown>;
|
|
201
178
|
};
|
|
202
179
|
export declare function buildAnchorMutationData(result: AnchorDomainResult, options: {
|
|
203
180
|
foundingMessageText: string | null;
|
|
204
181
|
}): {
|
|
205
|
-
resultType: "
|
|
206
|
-
|
|
182
|
+
resultType: "single-tx-mutation";
|
|
183
|
+
mutation: {
|
|
207
184
|
kind: string;
|
|
185
|
+
journalKind: string;
|
|
208
186
|
localStatus: string;
|
|
209
187
|
reusedExisting: boolean;
|
|
210
|
-
currentStep: string | null;
|
|
211
188
|
intentFingerprintHex: string | null;
|
|
212
189
|
};
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
wtxid: string | null;
|
|
217
|
-
};
|
|
218
|
-
tx2: {
|
|
219
|
-
txid: string | null;
|
|
220
|
-
wtxid: string | null;
|
|
221
|
-
};
|
|
190
|
+
transaction: {
|
|
191
|
+
txid: string | null;
|
|
192
|
+
wtxid: string | null;
|
|
222
193
|
};
|
|
194
|
+
fees: WalletMutationFeeSummary;
|
|
223
195
|
intent: Record<string, unknown>;
|
|
224
196
|
};
|
|
225
|
-
export declare function buildAnchorClearMutationData(result: ClearPendingAnchorResult): {
|
|
226
|
-
resultType: "state-change";
|
|
227
|
-
stateChange: {
|
|
228
|
-
kind: string;
|
|
229
|
-
before: Record<string, unknown> | null;
|
|
230
|
-
after: Record<string, unknown> | null;
|
|
231
|
-
};
|
|
232
|
-
state: Record<string, unknown>;
|
|
233
|
-
};
|
|
234
197
|
export declare function buildResetMutationData(result: WalletResetResult): {
|
|
235
198
|
resultType: "operation";
|
|
236
199
|
operation: {
|
|
@@ -280,6 +243,7 @@ export declare function buildDomainAdminMutationData(result: DomainAdminMutation
|
|
|
280
243
|
txid: string | null;
|
|
281
244
|
wtxid: string | null;
|
|
282
245
|
};
|
|
246
|
+
fees: WalletMutationFeeSummary;
|
|
283
247
|
intent: Record<string, unknown>;
|
|
284
248
|
};
|
|
285
249
|
export declare function buildFieldMutationData(result: FieldMutationResult): {
|
|
@@ -296,59 +260,8 @@ export declare function buildFieldMutationData(result: FieldMutationResult): {
|
|
|
296
260
|
byteLength: number;
|
|
297
261
|
} | null;
|
|
298
262
|
effect: {
|
|
299
|
-
kind: "create-and-initialize-field";
|
|
300
|
-
tx1BurnCogtoshi: "100";
|
|
301
|
-
tx2AdditionalBurnCogtoshi: "1";
|
|
302
|
-
burnCogtoshi?: undefined;
|
|
303
|
-
} | {
|
|
304
263
|
kind: "create-empty-field" | "write-field-value" | "clear-field-value";
|
|
305
264
|
burnCogtoshi: "0" | "1" | "100";
|
|
306
|
-
tx1BurnCogtoshi?: undefined;
|
|
307
|
-
tx2AdditionalBurnCogtoshi?: undefined;
|
|
308
|
-
};
|
|
309
|
-
} | null;
|
|
310
|
-
resultType: "family-mutation";
|
|
311
|
-
family: {
|
|
312
|
-
kind: string;
|
|
313
|
-
localStatus: string;
|
|
314
|
-
reusedExisting: boolean;
|
|
315
|
-
currentStep: string | null;
|
|
316
|
-
intentFingerprintHex: string | null;
|
|
317
|
-
};
|
|
318
|
-
transactions: {
|
|
319
|
-
tx1: {
|
|
320
|
-
txid: string | null;
|
|
321
|
-
wtxid: string | null;
|
|
322
|
-
};
|
|
323
|
-
tx2: {
|
|
324
|
-
txid: string | null;
|
|
325
|
-
wtxid: string | null;
|
|
326
|
-
};
|
|
327
|
-
};
|
|
328
|
-
intent: Record<string, unknown>;
|
|
329
|
-
} | {
|
|
330
|
-
resolved: {
|
|
331
|
-
sender: {
|
|
332
|
-
selector: string;
|
|
333
|
-
localIndex: number;
|
|
334
|
-
scriptPubKeyHex: string;
|
|
335
|
-
address: string;
|
|
336
|
-
};
|
|
337
|
-
path: import("../wallet/tx/field.js").FieldResolvedPath;
|
|
338
|
-
value: {
|
|
339
|
-
format: number;
|
|
340
|
-
byteLength: number;
|
|
341
|
-
} | null;
|
|
342
|
-
effect: {
|
|
343
|
-
kind: "create-and-initialize-field";
|
|
344
|
-
tx1BurnCogtoshi: "100";
|
|
345
|
-
tx2AdditionalBurnCogtoshi: "1";
|
|
346
|
-
burnCogtoshi?: undefined;
|
|
347
|
-
} | {
|
|
348
|
-
kind: "create-empty-field" | "write-field-value" | "clear-field-value";
|
|
349
|
-
burnCogtoshi: "0" | "1" | "100";
|
|
350
|
-
tx1BurnCogtoshi?: undefined;
|
|
351
|
-
tx2AdditionalBurnCogtoshi?: undefined;
|
|
352
265
|
};
|
|
353
266
|
} | null;
|
|
354
267
|
resultType: "single-tx-mutation";
|
|
@@ -363,6 +276,7 @@ export declare function buildFieldMutationData(result: FieldMutationResult): {
|
|
|
363
276
|
txid: string | null;
|
|
364
277
|
wtxid: string | null;
|
|
365
278
|
};
|
|
279
|
+
fees: WalletMutationFeeSummary;
|
|
366
280
|
intent: Record<string, unknown>;
|
|
367
281
|
};
|
|
368
282
|
export declare function buildReputationMutationData(result: ReputationMutationResult): {
|
|
@@ -395,19 +309,9 @@ export declare function buildReputationMutationData(result: ReputationMutationRe
|
|
|
395
309
|
txid: string | null;
|
|
396
310
|
wtxid: string | null;
|
|
397
311
|
};
|
|
312
|
+
fees: WalletMutationFeeSummary;
|
|
398
313
|
intent: Record<string, unknown>;
|
|
399
314
|
};
|
|
400
|
-
export declare function buildWalletLockMutationData(result: {
|
|
401
|
-
walletRootId: string | null;
|
|
402
|
-
}): {
|
|
403
|
-
resultType: "state-change";
|
|
404
|
-
stateChange: {
|
|
405
|
-
kind: string;
|
|
406
|
-
before: Record<string, unknown> | null;
|
|
407
|
-
after: Record<string, unknown> | null;
|
|
408
|
-
};
|
|
409
|
-
state: Record<string, unknown>;
|
|
410
|
-
};
|
|
411
315
|
export declare function buildInitMutationData(result: WalletInitializationResult): {
|
|
412
316
|
resultType: "state-change";
|
|
413
317
|
stateChange: {
|
|
@@ -426,31 +330,6 @@ export declare function buildRestoreMutationData(result: WalletRestoreResult): {
|
|
|
426
330
|
};
|
|
427
331
|
state: Record<string, unknown>;
|
|
428
332
|
};
|
|
429
|
-
export declare function buildUnlockMutationData(result: WalletUnlockResult): {
|
|
430
|
-
resultType: "state-change";
|
|
431
|
-
stateChange: {
|
|
432
|
-
kind: string;
|
|
433
|
-
before: Record<string, unknown> | null;
|
|
434
|
-
after: Record<string, unknown> | null;
|
|
435
|
-
};
|
|
436
|
-
state: Record<string, unknown>;
|
|
437
|
-
};
|
|
438
|
-
export declare function buildWalletExportMutationData(result: WalletExportResult): {
|
|
439
|
-
resultType: "operation";
|
|
440
|
-
operation: {
|
|
441
|
-
kind: string;
|
|
442
|
-
};
|
|
443
|
-
state: Record<string, unknown> | null;
|
|
444
|
-
};
|
|
445
|
-
export declare function buildWalletImportMutationData(result: WalletImportResult): {
|
|
446
|
-
resultType: "state-change";
|
|
447
|
-
stateChange: {
|
|
448
|
-
kind: string;
|
|
449
|
-
before: Record<string, unknown> | null;
|
|
450
|
-
after: Record<string, unknown> | null;
|
|
451
|
-
};
|
|
452
|
-
state: Record<string, unknown>;
|
|
453
|
-
};
|
|
454
333
|
export declare function buildRepairMutationData(result: WalletRepairResult): {
|
|
455
334
|
resultType: "state-change";
|
|
456
335
|
stateChange: {
|