@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
@@ -1,4 +1,5 @@
1
- import { applyBlockWithScoring, deserializeBlockRecord, rewindBlock, serializeIndexerState, } from "@cogcoin/indexer";
1
+ import { applyBlockWithScoring, createInitialState, deserializeBlockRecord, deserializeIndexerState, rewindBlock, serializeIndexerState, } from "@cogcoin/indexer";
2
+ import { internalHashHexToDisplayHashHex } from "../bitcoind/hash-order.js";
2
3
  import { createCheckpoint, createStoredBlockRecord, createTip } from "./persistence.js";
3
4
  export class DefaultClient {
4
5
  #store;
@@ -78,7 +79,8 @@ export class DefaultClient {
78
79
  const currentRecord = await this.#store.loadBlockRecord(currentHeight);
79
80
  nextTip = {
80
81
  height: currentHeight,
81
- blockHashHex: nextState.history.currentHashHex ?? currentRecord?.blockHashHex ?? "",
82
+ blockHashHex: currentRecord?.blockHashHex
83
+ ?? (nextState.history.currentHashHex === null ? "" : internalHashHexToDisplayHashHex(nextState.history.currentHashHex)),
82
84
  previousHashHex: currentRecord?.previousHashHex ?? null,
83
85
  stateHashHex: nextState.history.stateHashByHeight.get(currentHeight) ?? null,
84
86
  };
@@ -96,6 +98,47 @@ export class DefaultClient {
96
98
  return nextTip === null ? null : { ...nextTip };
97
99
  });
98
100
  }
101
+ async restoreCheckpoint(checkpoint) {
102
+ return this.#enqueue(async () => {
103
+ this.#assertOpen();
104
+ const nextState = deserializeIndexerState(checkpoint.stateBytes);
105
+ if (nextState.history.currentHeight !== checkpoint.height) {
106
+ throw new Error("client_checkpoint_height_mismatch");
107
+ }
108
+ const nextTip = {
109
+ height: checkpoint.height,
110
+ blockHashHex: checkpoint.blockHashHex,
111
+ previousHashHex: null,
112
+ stateHashHex: nextState.history.stateHashByHeight.get(checkpoint.height) ?? null,
113
+ };
114
+ await this.#store.writeAppliedBlock({
115
+ tip: nextTip,
116
+ stateBytes: checkpoint.stateBytes,
117
+ blockRecord: null,
118
+ checkpoint,
119
+ deleteAboveHeight: checkpoint.height,
120
+ });
121
+ this.#state = nextState;
122
+ this.#tip = nextTip;
123
+ return { ...nextTip };
124
+ });
125
+ }
126
+ async resetToInitialState() {
127
+ return this.#enqueue(async () => {
128
+ this.#assertOpen();
129
+ const nextState = createInitialState(this.#genesisParameters);
130
+ await this.#store.writeAppliedBlock({
131
+ tip: null,
132
+ stateBytes: null,
133
+ blockRecord: null,
134
+ checkpoint: null,
135
+ deleteAboveHeight: -1,
136
+ });
137
+ this.#state = nextState;
138
+ this.#tip = null;
139
+ return null;
140
+ });
141
+ }
99
142
  async close() {
100
143
  await this.#enqueue(async () => {
101
144
  if (this.#closed) {
@@ -3,7 +3,7 @@ import { DefaultClient } from "./default-client.js";
3
3
  import { initializeState } from "./initialization.js";
4
4
  import { createClientStoreAdapter } from "./store-adapter.js";
5
5
  const DEFAULT_SNAPSHOT_INTERVAL = 1000;
6
- const DEFAULT_BLOCK_RECORD_RETENTION = 1000;
6
+ const DEFAULT_BLOCK_RECORD_RETENTION = 100;
7
7
  export async function openClient(options) {
8
8
  const store = createClientStoreAdapter(options.store);
9
9
  const genesisParameters = options.genesisParameters ?? await loadBundledGenesisParameters();
@@ -1,4 +1,20 @@
1
1
  import { createInitialState, deserializeIndexerState, } from "@cogcoin/indexer";
2
+ import { internalHashHexToDisplayHashHex } from "../bitcoind/hash-order.js";
3
+ function createResetEntry() {
4
+ return {
5
+ tip: null,
6
+ stateBytes: null,
7
+ blockRecord: null,
8
+ checkpoint: null,
9
+ deleteAboveHeight: -1,
10
+ };
11
+ }
12
+ function snapshotUsesLegacyHashOrder(state, snapshotHashHex) {
13
+ const currentHashHex = state.history.currentHashHex;
14
+ return currentHashHex !== null
15
+ && currentHashHex === snapshotHashHex
16
+ && internalHashHexToDisplayHashHex(currentHashHex) !== snapshotHashHex;
17
+ }
2
18
  export async function initializeState(store, genesisParameters) {
3
19
  const tip = await store.loadTip();
4
20
  const snapshot = await store.loadLatestSnapshot();
@@ -12,6 +28,13 @@ export async function initializeState(store, genesisParameters) {
12
28
  };
13
29
  }
14
30
  const state = deserializeIndexerState(snapshot.stateBytes);
31
+ if (snapshotUsesLegacyHashOrder(state, snapshot.blockHashHex)) {
32
+ await store.writeAppliedBlock(createResetEntry());
33
+ return {
34
+ state: createInitialState(genesisParameters),
35
+ tip: null,
36
+ };
37
+ }
15
38
  if (tip === null) {
16
39
  return {
17
40
  state,
@@ -1,18 +1,18 @@
1
1
  import { serializeBlockRecord } from "@cogcoin/indexer";
2
- import { bytesToHex } from "../bytes.js";
2
+ import { internalBytesToDisplayHashHex, internalHashHexToDisplayHashHex } from "../bitcoind/hash-order.js";
3
3
  export function createTip(block, stateHashHex) {
4
4
  return {
5
5
  height: block.height,
6
- blockHashHex: bytesToHex(block.hash),
7
- previousHashHex: block.previousHash === null ? null : bytesToHex(block.previousHash),
6
+ blockHashHex: internalBytesToDisplayHashHex(block.hash),
7
+ previousHashHex: block.previousHash === null ? null : internalBytesToDisplayHashHex(block.previousHash),
8
8
  stateHashHex,
9
9
  };
10
10
  }
11
11
  export function createStoredBlockRecord(blockRecord, createdAt) {
12
12
  return {
13
13
  height: blockRecord.height,
14
- blockHashHex: blockRecord.hashHex,
15
- previousHashHex: blockRecord.previousHashHex,
14
+ blockHashHex: internalHashHexToDisplayHashHex(blockRecord.hashHex),
15
+ previousHashHex: blockRecord.previousHashHex === null ? null : internalHashHexToDisplayHashHex(blockRecord.previousHashHex),
16
16
  stateHashHex: blockRecord.stateHashHex,
17
17
  recordBytes: serializeBlockRecord(blockRecord),
18
18
  createdAt,
@@ -2,6 +2,7 @@ export function assertClientStoreAdapter(store) {
2
2
  const requiredMethods = [
3
3
  "loadTip",
4
4
  "loadLatestSnapshot",
5
+ "loadLatestCheckpointAtOrBelow",
5
6
  "loadBlockRecordsAfter",
6
7
  "writeAppliedBlock",
7
8
  "deleteBlockRecordsAbove",
@@ -7,5 +7,6 @@ export interface StoredCheckpointRow {
7
7
  createdAt: number;
8
8
  }
9
9
  export declare function loadLatestCheckpoint(database: SqliteDatabase): Promise<StoredCheckpointRow | null>;
10
+ export declare function loadLatestCheckpointAtOrBelow(database: SqliteDatabase, height: number): Promise<StoredCheckpointRow | null>;
10
11
  export declare function replaceCheckpoint(database: SqliteDatabase, checkpoint: ClientCheckpoint): Promise<void>;
11
12
  export declare function deleteCheckpointsAbove(database: SqliteDatabase, height: number): Promise<void>;
@@ -13,6 +13,13 @@ function decodeCheckpointRow(row) {
13
13
  export async function loadLatestCheckpoint(database) {
14
14
  return decodeCheckpointRow(await database.get(`SELECT height, block_hash, state_bytes, created_at FROM checkpoints ORDER BY height DESC LIMIT 1`));
15
15
  }
16
+ export async function loadLatestCheckpointAtOrBelow(database, height) {
17
+ return decodeCheckpointRow(await database.get(`SELECT height, block_hash, state_bytes, created_at
18
+ FROM checkpoints
19
+ WHERE height <= ?
20
+ ORDER BY height DESC
21
+ LIMIT 1`, [height]));
22
+ }
16
23
  export async function replaceCheckpoint(database, checkpoint) {
17
24
  await database.run(`INSERT OR REPLACE INTO checkpoints (height, block_hash, state_bytes, created_at)
18
25
  VALUES (?, ?, ?, ?)`, [
@@ -1,5 +1,5 @@
1
1
  import { bytesToHex, cloneBytes, hexToBytes, } from "../bytes.js";
2
- import { deleteCheckpointsAbove, loadLatestCheckpoint, replaceCheckpoint, } from "./checkpoints.js";
2
+ import { deleteCheckpointsAbove, loadLatestCheckpoint, loadLatestCheckpointAtOrBelow, replaceCheckpoint, } from "./checkpoints.js";
3
3
  import { loadTipSnapshotMeta, writeTipMeta, } from "./tip-meta.js";
4
4
  export function createSqliteStoreAdapter(database) {
5
5
  let writeQueue = Promise.resolve();
@@ -42,6 +42,19 @@ export function createSqliteStoreAdapter(database) {
42
42
  createdAt: row.createdAt,
43
43
  };
44
44
  },
45
+ async loadLatestCheckpointAtOrBelow(height) {
46
+ assertOpen();
47
+ const row = await loadLatestCheckpointAtOrBelow(database, height);
48
+ if (row === null) {
49
+ return null;
50
+ }
51
+ return {
52
+ height: row.height,
53
+ blockHashHex: row.blockHashHex,
54
+ stateBytes: row.stateBytes,
55
+ createdAt: row.createdAt,
56
+ };
57
+ },
45
58
  async loadBlockRecordsAfter(height) {
46
59
  assertOpen();
47
60
  const rows = await database.all(`SELECT height, block_hash, previous_hash, record_bytes, state_hash_hex, created_at
package/dist/types.d.ts CHANGED
@@ -30,6 +30,7 @@ export interface WriteAppliedBlockEntry {
30
30
  export interface ClientStoreAdapter {
31
31
  loadTip(): Promise<ClientTip | null>;
32
32
  loadLatestSnapshot(): Promise<ClientCheckpoint | null>;
33
+ loadLatestCheckpointAtOrBelow(height: number): Promise<ClientCheckpoint | null>;
33
34
  loadBlockRecordsAfter(height: number): Promise<StoredBlockRecord[]>;
34
35
  writeAppliedBlock(entry: WriteAppliedBlockEntry): Promise<void>;
35
36
  deleteBlockRecordsAbove(height: number): Promise<void>;
@@ -1,18 +1,49 @@
1
- import type { RpcListUnspentEntry, RpcLockedUnspent, RpcWalletTransaction } from "../bitcoind/types.js";
2
1
  import { persistWalletStateUpdate } from "./descriptor-normalization.js";
3
2
  import type { WalletRuntimePaths } from "./runtime.js";
4
- import type { OutpointRecord, PortableWalletArchivePayloadV1, UnlockSessionStateV1, WalletStateV1 } from "./types.js";
5
- export declare const DEFAULT_PROACTIVE_RESERVE_SATS = 1000;
3
+ import type { OutpointRecord, WalletStateV1 } from "./types.js";
4
+ import type { RpcListUnspentEntry } from "../bitcoind/types.js";
5
+ export declare const DEFAULT_PROACTIVE_RESERVE_SATS = 0;
6
6
  export interface WalletCoinControlRpc {
7
7
  listUnspent(walletName: string, minConf?: number): Promise<RpcListUnspentEntry[]>;
8
- listLockUnspent(walletName: string): Promise<RpcLockedUnspent[]>;
9
- lockUnspent(walletName: string, unlock: boolean, outputs: RpcLockedUnspent[]): Promise<boolean>;
10
- getTransaction?(walletName: string, txid: string): Promise<RpcWalletTransaction>;
11
8
  }
12
9
  export declare function outpointKey(outpoint: OutpointRecord): string;
13
- export declare function normalizeWalletStateRecord(state: WalletStateV1): WalletStateV1;
14
- export declare function normalizePortableWalletArchivePayload(payload: PortableWalletArchivePayloadV1): PortableWalletArchivePayloadV1;
15
- export declare function computeDesignatedProactiveReserveOutpoints(state: WalletStateV1, spendableUtxos: readonly RpcListUnspentEntry[]): OutpointRecord[];
10
+ type LegacyManagedCoreWallet = {
11
+ walletAddress?: string | null;
12
+ walletScriptPubKeyHex?: string | null;
13
+ fundingAddress0?: string | null;
14
+ fundingScriptPubKeyHex0?: string | null;
15
+ walletName?: string;
16
+ internalPassphrase?: string;
17
+ descriptorChecksum?: string | null;
18
+ proofStatus?: "not-proven" | "ready" | "missing" | "mismatch";
19
+ lastImportedAtUnixMs?: number | null;
20
+ lastVerifiedAtUnixMs?: number | null;
21
+ };
22
+ type LegacyWalletStateRecord = Partial<WalletStateV1> & {
23
+ schemaVersion?: number;
24
+ hookClientState?: unknown;
25
+ anchorValueSats?: number;
26
+ localScriptPubKeyHexes?: string[] | null;
27
+ funding?: {
28
+ address?: string | null;
29
+ scriptPubKeyHex?: string | null;
30
+ } | null;
31
+ identities?: Array<{
32
+ scriptPubKeyHex?: string | null;
33
+ }> | null;
34
+ managedCoreWallet?: LegacyManagedCoreWallet | null;
35
+ domains?: Array<Partial<WalletStateV1["domains"][number]> & {
36
+ name?: string | null;
37
+ domainId?: number | null;
38
+ currentOwnerScriptPubKeyHex?: string | null;
39
+ canonicalChainStatus?: WalletStateV1["domains"][number]["canonicalChainStatus"];
40
+ foundingMessageText?: string | null;
41
+ birthTime?: number | null;
42
+ }> | null;
43
+ pendingMutations?: WalletStateV1["pendingMutations"] | null;
44
+ };
45
+ export declare function normalizeWalletStateRecord(rawState: LegacyWalletStateRecord): WalletStateV1;
46
+ export declare function computeDesignatedProactiveReserveOutpoints(_state?: WalletStateV1, _spendableUtxos?: readonly RpcListUnspentEntry[]): OutpointRecord[];
16
47
  export declare function reconcilePersistentPolicyLocks(options: {
17
48
  rpc: WalletCoinControlRpc;
18
49
  walletName: string;
@@ -29,14 +60,12 @@ export declare function reconcilePersistentPolicyLocks(options: {
29
60
  export declare function persistWalletCoinControlStateIfNeeded(options: {
30
61
  state: WalletStateV1;
31
62
  access: Parameters<typeof persistWalletStateUpdate>[0]["access"];
32
- session?: UnlockSessionStateV1 | null;
33
63
  paths: WalletRuntimePaths;
34
64
  nowUnixMs: number;
35
65
  replacePrimary?: boolean;
36
66
  rpc: WalletCoinControlRpc;
37
- cleanupInactiveTemporaryBuilderLocks?: boolean;
38
67
  }): Promise<{
39
68
  changed: boolean;
40
- session: UnlockSessionStateV1 | null;
41
69
  state: WalletStateV1;
42
70
  }>;
71
+ export {};