@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.
Files changed (172) hide show
  1. package/README.md +80 -25
  2. package/dist/app-paths.d.ts +5 -6
  3. package/dist/app-paths.js +8 -16
  4. package/dist/art/balance.txt +10 -0
  5. package/dist/art/welcome.txt +16 -0
  6. package/dist/bitcoind/bootstrap/controller.d.ts +1 -0
  7. package/dist/bitcoind/bootstrap/controller.js +53 -1
  8. package/dist/bitcoind/client/follow-block-times.d.ts +1 -0
  9. package/dist/bitcoind/client/follow-block-times.js +1 -1
  10. package/dist/bitcoind/client/internal-types.d.ts +7 -3
  11. package/dist/bitcoind/client/managed-client.d.ts +4 -2
  12. package/dist/bitcoind/client/managed-client.js +14 -0
  13. package/dist/bitcoind/client/sync-engine.js +72 -11
  14. package/dist/bitcoind/hash-order.d.ts +4 -0
  15. package/dist/bitcoind/hash-order.js +13 -0
  16. package/dist/bitcoind/indexer-daemon-main.js +11 -3
  17. package/dist/bitcoind/normalize.js +3 -2
  18. package/dist/bitcoind/processing-start-height.d.ts +5 -0
  19. package/dist/bitcoind/processing-start-height.js +7 -0
  20. package/dist/bitcoind/progress/constants.d.ts +4 -0
  21. package/dist/bitcoind/progress/constants.js +4 -0
  22. package/dist/bitcoind/progress/controller.d.ts +2 -1
  23. package/dist/bitcoind/progress/controller.js +3 -3
  24. package/dist/bitcoind/progress/follow-scene.d.ts +6 -2
  25. package/dist/bitcoind/progress/follow-scene.js +29 -6
  26. package/dist/bitcoind/progress/formatting.d.ts +1 -0
  27. package/dist/bitcoind/progress/formatting.js +6 -0
  28. package/dist/bitcoind/progress/train-scene.js +37 -18
  29. package/dist/bitcoind/progress/tty-renderer.d.ts +6 -1
  30. package/dist/bitcoind/progress/tty-renderer.js +8 -4
  31. package/dist/bitcoind/rpc.d.ts +2 -1
  32. package/dist/bitcoind/rpc.js +3 -0
  33. package/dist/bitcoind/types.d.ts +6 -0
  34. package/dist/bytes.d.ts +1 -0
  35. package/dist/bytes.js +3 -0
  36. package/dist/cli/art.d.ts +2 -0
  37. package/dist/cli/art.js +37 -0
  38. package/dist/cli/commands/client-admin.d.ts +2 -0
  39. package/dist/cli/commands/client-admin.js +91 -0
  40. package/dist/cli/commands/follow.js +0 -2
  41. package/dist/cli/commands/mining-admin.js +6 -47
  42. package/dist/cli/commands/mining-read.js +11 -50
  43. package/dist/cli/commands/mining-runtime.js +38 -3
  44. package/dist/cli/commands/service-runtime.js +0 -2
  45. package/dist/cli/commands/status.js +8 -2
  46. package/dist/cli/commands/sync.js +51 -4
  47. package/dist/cli/commands/wallet-admin.js +142 -136
  48. package/dist/cli/commands/wallet-mutation.js +91 -79
  49. package/dist/cli/commands/wallet-read.js +15 -18
  50. package/dist/cli/context.js +4 -14
  51. package/dist/cli/mining-format.d.ts +0 -1
  52. package/dist/cli/mining-format.js +5 -37
  53. package/dist/cli/mining-json.d.ts +0 -18
  54. package/dist/cli/mining-json.js +0 -35
  55. package/dist/cli/mutation-command-groups.d.ts +1 -2
  56. package/dist/cli/mutation-command-groups.js +0 -5
  57. package/dist/cli/mutation-json.d.ts +24 -145
  58. package/dist/cli/mutation-json.js +30 -136
  59. package/dist/cli/mutation-resolved-json.d.ts +0 -7
  60. package/dist/cli/mutation-resolved-json.js +4 -10
  61. package/dist/cli/mutation-success.d.ts +2 -0
  62. package/dist/cli/mutation-success.js +11 -1
  63. package/dist/cli/mutation-text-format.js +1 -3
  64. package/dist/cli/output.d.ts +1 -1
  65. package/dist/cli/output.js +254 -231
  66. package/dist/cli/parse.d.ts +1 -1
  67. package/dist/cli/parse.js +93 -122
  68. package/dist/cli/preview-json.d.ts +17 -120
  69. package/dist/cli/preview-json.js +14 -97
  70. package/dist/cli/prompt.js +8 -13
  71. package/dist/cli/read-json.d.ts +15 -37
  72. package/dist/cli/read-json.js +44 -140
  73. package/dist/cli/runner.js +10 -13
  74. package/dist/cli/types.d.ts +8 -17
  75. package/dist/cli/types.js +0 -2
  76. package/dist/cli/wallet-format.d.ts +1 -0
  77. package/dist/cli/wallet-format.js +205 -144
  78. package/dist/cli/workflow-hints.d.ts +3 -3
  79. package/dist/cli/workflow-hints.js +11 -8
  80. package/dist/client/default-client.d.ts +3 -1
  81. package/dist/client/default-client.js +45 -2
  82. package/dist/client/factory.js +1 -1
  83. package/dist/client/initialization.js +23 -0
  84. package/dist/client/persistence.js +5 -5
  85. package/dist/client/store-adapter.js +1 -0
  86. package/dist/sqlite/checkpoints.d.ts +1 -0
  87. package/dist/sqlite/checkpoints.js +7 -0
  88. package/dist/sqlite/store.js +14 -1
  89. package/dist/types.d.ts +1 -0
  90. package/dist/wallet/coin-control.d.ts +41 -12
  91. package/dist/wallet/coin-control.js +100 -428
  92. package/dist/wallet/descriptor-normalization.d.ts +1 -3
  93. package/dist/wallet/descriptor-normalization.js +0 -16
  94. package/dist/wallet/lifecycle.d.ts +7 -99
  95. package/dist/wallet/lifecycle.js +513 -968
  96. package/dist/wallet/managed-core-wallet.d.ts +13 -0
  97. package/dist/wallet/managed-core-wallet.js +20 -0
  98. package/dist/wallet/mining/constants.d.ts +5 -12
  99. package/dist/wallet/mining/constants.js +5 -12
  100. package/dist/wallet/mining/control.d.ts +1 -13
  101. package/dist/wallet/mining/control.js +45 -349
  102. package/dist/wallet/mining/index.d.ts +3 -4
  103. package/dist/wallet/mining/index.js +1 -2
  104. package/dist/wallet/mining/runner.d.ts +116 -13
  105. package/dist/wallet/mining/runner.js +885 -501
  106. package/dist/wallet/mining/runtime-artifacts.js +23 -3
  107. package/dist/wallet/mining/sentence-protocol.d.ts +44 -0
  108. package/dist/wallet/mining/sentence-protocol.js +123 -0
  109. package/dist/wallet/mining/sentences.d.ts +4 -8
  110. package/dist/wallet/mining/sentences.js +3 -52
  111. package/dist/wallet/mining/state.d.ts +11 -6
  112. package/dist/wallet/mining/state.js +7 -6
  113. package/dist/wallet/mining/types.d.ts +2 -30
  114. package/dist/wallet/mining/visualizer.d.ts +31 -3
  115. package/dist/wallet/mining/visualizer.js +135 -13
  116. package/dist/wallet/read/context.d.ts +0 -2
  117. package/dist/wallet/read/context.js +119 -140
  118. package/dist/wallet/read/filter.js +2 -11
  119. package/dist/wallet/read/index.d.ts +1 -1
  120. package/dist/wallet/read/project.js +24 -77
  121. package/dist/wallet/read/types.d.ts +10 -25
  122. package/dist/wallet/reset.d.ts +0 -1
  123. package/dist/wallet/reset.js +60 -138
  124. package/dist/wallet/root-resolution.d.ts +1 -5
  125. package/dist/wallet/root-resolution.js +0 -18
  126. package/dist/wallet/runtime.d.ts +0 -6
  127. package/dist/wallet/runtime.js +0 -8
  128. package/dist/wallet/state/client-password-agent.js +208 -0
  129. package/dist/wallet/state/client-password.d.ts +65 -0
  130. package/dist/wallet/state/client-password.js +952 -0
  131. package/dist/wallet/state/crypto.d.ts +1 -20
  132. package/dist/wallet/state/crypto.js +0 -63
  133. package/dist/wallet/state/provider.d.ts +23 -11
  134. package/dist/wallet/state/provider.js +248 -290
  135. package/dist/wallet/state/storage.d.ts +2 -2
  136. package/dist/wallet/state/storage.js +48 -16
  137. package/dist/wallet/tx/anchor.d.ts +3 -28
  138. package/dist/wallet/tx/anchor.js +349 -1250
  139. package/dist/wallet/tx/bitcoin-transfer.d.ts +35 -0
  140. package/dist/wallet/tx/bitcoin-transfer.js +200 -0
  141. package/dist/wallet/tx/cog.d.ts +5 -1
  142. package/dist/wallet/tx/cog.js +149 -185
  143. package/dist/wallet/tx/common.d.ts +61 -8
  144. package/dist/wallet/tx/common.js +266 -146
  145. package/dist/wallet/tx/domain-admin.d.ts +3 -1
  146. package/dist/wallet/tx/domain-admin.js +61 -99
  147. package/dist/wallet/tx/domain-market.d.ts +5 -1
  148. package/dist/wallet/tx/domain-market.js +221 -228
  149. package/dist/wallet/tx/field.d.ts +4 -10
  150. package/dist/wallet/tx/field.js +83 -924
  151. package/dist/wallet/tx/identity-selector.d.ts +9 -3
  152. package/dist/wallet/tx/identity-selector.js +17 -35
  153. package/dist/wallet/tx/index.d.ts +3 -1
  154. package/dist/wallet/tx/index.js +2 -1
  155. package/dist/wallet/tx/register.d.ts +3 -1
  156. package/dist/wallet/tx/register.js +62 -220
  157. package/dist/wallet/tx/reputation.d.ts +3 -1
  158. package/dist/wallet/tx/reputation.js +58 -95
  159. package/dist/wallet/types.d.ts +8 -122
  160. package/package.json +5 -5
  161. package/dist/wallet/archive.d.ts +0 -4
  162. package/dist/wallet/archive.js +0 -41
  163. package/dist/wallet/mining/hook-protocol.d.ts +0 -47
  164. package/dist/wallet/mining/hook-protocol.js +0 -161
  165. package/dist/wallet/mining/hook-runner.js +0 -52
  166. package/dist/wallet/mining/hooks.d.ts +0 -38
  167. package/dist/wallet/mining/hooks.js +0 -520
  168. package/dist/wallet/state/explicit-lock.d.ts +0 -4
  169. package/dist/wallet/state/explicit-lock.js +0 -19
  170. package/dist/wallet/state/session.d.ts +0 -12
  171. package/dist/wallet/state/session.js +0 -23
  172. /package/dist/wallet/{mining/hook-runner.d.ts → state/client-password-agent.d.ts} +0 -0
@@ -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 { exportWallet, importWallet, initializeWallet, deleteImportedWalletSeed, lockWallet, previewResetWallet, repairWallet, resetWallet, restoreWalletFromMnemonic, showWalletMnemonic, unlockWallet, } from "../wallet/lifecycle.js";
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 { disableMiningHooks, enableMiningHooks, followMiningLog, inspectMiningControlPlane, readMiningLog, runForegroundMining, setupBuiltInMining, startBackgroundMining, stopBackgroundMining, } from "../wallet/mining/index.js";
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, clearPendingAnchor, 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";
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
- clearPendingAnchor: overrides.clearPendingAnchor ?? clearPendingAnchor,
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.liveMiningFamilyInMempool
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} hooks ${hookMode} (${mining.hook.operatorValidationState}) provider ${provider}${suffix}`;
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 mempool family to confirm, or rerun mining after the tip settles.");
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.liveMiningFamilyInMempool) {
150
- lines.push("Next: wait for the live mempool family to confirm, or rerun mining when you want replacements to resume.");
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: {
@@ -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", "anchor-clear", "domain-anchor", "domain-anchor-clear", "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"];
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, ClearPendingAnchorResult, CogMutationResult, DomainAdminMutationResult, DomainMarketMutationResult, FieldMutationResult, RegisterDomainResult, ReputationMutationResult } from "../wallet/tx/index.js";
2
- import type { WalletInitializationResult, WalletExportResult, WalletImportResult, WalletDeleteResult, WalletRepairResult, WalletResetResult, WalletRestoreResult, WalletUnlockResult } from "../wallet/lifecycle.js";
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
- intent: Record<string, unknown>;
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: "family-mutation";
206
- family: {
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
- transactions: {
214
- tx1: {
215
- txid: string | null;
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: {