@cogcoin/client 0.5.14 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -25
- package/dist/app-paths.d.ts +5 -6
- package/dist/app-paths.js +8 -16
- package/dist/art/balance.txt +10 -0
- package/dist/art/welcome.txt +16 -0
- package/dist/bitcoind/bootstrap/controller.d.ts +1 -0
- package/dist/bitcoind/bootstrap/controller.js +53 -1
- package/dist/bitcoind/client/follow-block-times.d.ts +1 -0
- package/dist/bitcoind/client/follow-block-times.js +1 -1
- package/dist/bitcoind/client/internal-types.d.ts +7 -3
- package/dist/bitcoind/client/managed-client.d.ts +4 -2
- package/dist/bitcoind/client/managed-client.js +14 -0
- package/dist/bitcoind/client/sync-engine.js +72 -11
- package/dist/bitcoind/hash-order.d.ts +4 -0
- package/dist/bitcoind/hash-order.js +13 -0
- package/dist/bitcoind/indexer-daemon-main.js +11 -3
- package/dist/bitcoind/normalize.js +3 -2
- package/dist/bitcoind/processing-start-height.d.ts +5 -0
- package/dist/bitcoind/processing-start-height.js +7 -0
- package/dist/bitcoind/progress/constants.d.ts +4 -0
- package/dist/bitcoind/progress/constants.js +4 -0
- package/dist/bitcoind/progress/controller.d.ts +2 -1
- package/dist/bitcoind/progress/controller.js +3 -3
- package/dist/bitcoind/progress/follow-scene.d.ts +6 -2
- package/dist/bitcoind/progress/follow-scene.js +29 -6
- package/dist/bitcoind/progress/formatting.d.ts +1 -0
- package/dist/bitcoind/progress/formatting.js +6 -0
- package/dist/bitcoind/progress/train-scene.js +37 -18
- package/dist/bitcoind/progress/tty-renderer.d.ts +6 -1
- package/dist/bitcoind/progress/tty-renderer.js +8 -4
- package/dist/bitcoind/rpc.d.ts +2 -1
- package/dist/bitcoind/rpc.js +3 -0
- package/dist/bitcoind/types.d.ts +16 -0
- package/dist/bytes.d.ts +1 -0
- package/dist/bytes.js +3 -0
- package/dist/cli/art.d.ts +2 -0
- package/dist/cli/art.js +37 -0
- package/dist/cli/commands/client-admin.d.ts +2 -0
- package/dist/cli/commands/client-admin.js +91 -0
- package/dist/cli/commands/follow.js +0 -2
- package/dist/cli/commands/mining-admin.js +6 -47
- package/dist/cli/commands/mining-read.js +11 -50
- package/dist/cli/commands/mining-runtime.js +38 -3
- package/dist/cli/commands/service-runtime.js +0 -2
- package/dist/cli/commands/status.js +8 -2
- package/dist/cli/commands/sync.js +51 -4
- package/dist/cli/commands/wallet-admin.js +142 -136
- package/dist/cli/commands/wallet-mutation.js +91 -79
- package/dist/cli/commands/wallet-read.js +15 -18
- package/dist/cli/context.js +4 -14
- package/dist/cli/mining-format.d.ts +0 -1
- package/dist/cli/mining-format.js +5 -37
- package/dist/cli/mining-json.d.ts +0 -18
- package/dist/cli/mining-json.js +0 -35
- package/dist/cli/mutation-command-groups.d.ts +1 -2
- package/dist/cli/mutation-command-groups.js +0 -5
- package/dist/cli/mutation-json.d.ts +24 -145
- package/dist/cli/mutation-json.js +30 -136
- package/dist/cli/mutation-resolved-json.d.ts +0 -7
- package/dist/cli/mutation-resolved-json.js +4 -10
- package/dist/cli/mutation-success.d.ts +2 -0
- package/dist/cli/mutation-success.js +11 -1
- package/dist/cli/mutation-text-format.js +1 -3
- package/dist/cli/output.d.ts +1 -1
- package/dist/cli/output.js +254 -231
- package/dist/cli/parse.d.ts +1 -1
- package/dist/cli/parse.js +93 -122
- package/dist/cli/preview-json.d.ts +17 -120
- package/dist/cli/preview-json.js +14 -97
- package/dist/cli/prompt.js +8 -13
- package/dist/cli/read-json.d.ts +15 -37
- package/dist/cli/read-json.js +44 -140
- package/dist/cli/runner.js +10 -13
- package/dist/cli/types.d.ts +8 -17
- package/dist/cli/types.js +0 -2
- package/dist/cli/wallet-format.d.ts +1 -0
- package/dist/cli/wallet-format.js +205 -144
- package/dist/cli/workflow-hints.d.ts +3 -3
- package/dist/cli/workflow-hints.js +11 -8
- package/dist/client/default-client.d.ts +3 -1
- package/dist/client/default-client.js +45 -2
- package/dist/client/factory.js +1 -1
- package/dist/client/initialization.js +23 -0
- package/dist/client/persistence.js +5 -5
- package/dist/client/store-adapter.js +1 -0
- package/dist/sqlite/checkpoints.d.ts +1 -0
- package/dist/sqlite/checkpoints.js +7 -0
- package/dist/sqlite/store.js +14 -1
- package/dist/types.d.ts +1 -0
- package/dist/wallet/coin-control.d.ts +41 -11
- package/dist/wallet/coin-control.js +100 -357
- package/dist/wallet/descriptor-normalization.d.ts +1 -3
- package/dist/wallet/descriptor-normalization.js +0 -16
- package/dist/wallet/lifecycle.d.ts +7 -99
- package/dist/wallet/lifecycle.js +513 -968
- package/dist/wallet/managed-core-wallet.d.ts +13 -0
- package/dist/wallet/managed-core-wallet.js +20 -0
- package/dist/wallet/mining/constants.d.ts +5 -12
- package/dist/wallet/mining/constants.js +5 -12
- package/dist/wallet/mining/control.d.ts +1 -13
- package/dist/wallet/mining/control.js +45 -349
- package/dist/wallet/mining/index.d.ts +3 -4
- package/dist/wallet/mining/index.js +1 -2
- package/dist/wallet/mining/runner.d.ts +179 -6
- package/dist/wallet/mining/runner.js +891 -501
- package/dist/wallet/mining/runtime-artifacts.js +23 -3
- package/dist/wallet/mining/sentence-protocol.d.ts +44 -0
- package/dist/wallet/mining/sentence-protocol.js +123 -0
- package/dist/wallet/mining/sentences.d.ts +4 -8
- package/dist/wallet/mining/sentences.js +3 -52
- package/dist/wallet/mining/state.d.ts +11 -6
- package/dist/wallet/mining/state.js +7 -6
- package/dist/wallet/mining/types.d.ts +2 -30
- package/dist/wallet/mining/visualizer.d.ts +31 -3
- package/dist/wallet/mining/visualizer.js +135 -13
- package/dist/wallet/read/context.d.ts +0 -2
- package/dist/wallet/read/context.js +119 -140
- package/dist/wallet/read/filter.js +2 -11
- package/dist/wallet/read/index.d.ts +1 -1
- package/dist/wallet/read/project.js +24 -77
- package/dist/wallet/read/types.d.ts +10 -25
- package/dist/wallet/reset.d.ts +0 -1
- package/dist/wallet/reset.js +60 -138
- package/dist/wallet/root-resolution.d.ts +1 -5
- package/dist/wallet/root-resolution.js +0 -18
- package/dist/wallet/runtime.d.ts +0 -6
- package/dist/wallet/runtime.js +0 -8
- package/dist/wallet/state/client-password-agent.js +208 -0
- package/dist/wallet/state/client-password.d.ts +65 -0
- package/dist/wallet/state/client-password.js +952 -0
- package/dist/wallet/state/crypto.d.ts +1 -20
- package/dist/wallet/state/crypto.js +0 -63
- package/dist/wallet/state/provider.d.ts +23 -11
- package/dist/wallet/state/provider.js +248 -290
- package/dist/wallet/state/storage.d.ts +2 -2
- package/dist/wallet/state/storage.js +48 -16
- package/dist/wallet/tx/anchor.d.ts +3 -28
- package/dist/wallet/tx/anchor.js +349 -1240
- package/dist/wallet/tx/bitcoin-transfer.d.ts +35 -0
- package/dist/wallet/tx/bitcoin-transfer.js +200 -0
- package/dist/wallet/tx/cog.d.ts +5 -1
- package/dist/wallet/tx/cog.js +149 -185
- package/dist/wallet/tx/common.d.ts +74 -10
- package/dist/wallet/tx/common.js +315 -138
- package/dist/wallet/tx/domain-admin.d.ts +3 -1
- package/dist/wallet/tx/domain-admin.js +61 -99
- package/dist/wallet/tx/domain-market.d.ts +5 -1
- package/dist/wallet/tx/domain-market.js +221 -228
- package/dist/wallet/tx/field.d.ts +4 -10
- package/dist/wallet/tx/field.js +84 -914
- package/dist/wallet/tx/identity-selector.d.ts +9 -3
- package/dist/wallet/tx/identity-selector.js +17 -35
- package/dist/wallet/tx/index.d.ts +3 -1
- package/dist/wallet/tx/index.js +2 -1
- package/dist/wallet/tx/register.d.ts +3 -1
- package/dist/wallet/tx/register.js +62 -220
- package/dist/wallet/tx/reputation.d.ts +3 -1
- package/dist/wallet/tx/reputation.js +58 -95
- package/dist/wallet/types.d.ts +8 -122
- package/package.json +5 -5
- package/dist/wallet/archive.d.ts +0 -4
- package/dist/wallet/archive.js +0 -41
- package/dist/wallet/mining/hook-protocol.d.ts +0 -47
- package/dist/wallet/mining/hook-protocol.js +0 -161
- package/dist/wallet/mining/hook-runner.js +0 -52
- package/dist/wallet/mining/hooks.d.ts +0 -38
- package/dist/wallet/mining/hooks.js +0 -520
- package/dist/wallet/state/explicit-lock.d.ts +0 -4
- package/dist/wallet/state/explicit-lock.js +0 -19
- package/dist/wallet/state/session.d.ts +0 -12
- package/dist/wallet/state/session.js +0 -23
- /package/dist/wallet/{mining/hook-runner.d.ts → state/client-password-agent.d.ts} +0 -0
|
@@ -1,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:
|
|
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) {
|
package/dist/client/factory.js
CHANGED
|
@@ -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 =
|
|
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 {
|
|
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:
|
|
7
|
-
previousHashHex: block.previousHash === null ? null :
|
|
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,
|
|
@@ -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 (?, ?, ?, ?)`, [
|
package/dist/sqlite/store.js
CHANGED
|
@@ -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,17 +1,49 @@
|
|
|
1
|
-
import type { RpcListUnspentEntry, RpcLockedUnspent } from "../bitcoind/types.js";
|
|
2
1
|
import { persistWalletStateUpdate } from "./descriptor-normalization.js";
|
|
3
2
|
import type { WalletRuntimePaths } from "./runtime.js";
|
|
4
|
-
import type { OutpointRecord,
|
|
5
|
-
|
|
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
8
|
}
|
|
11
9
|
export declare function outpointKey(outpoint: OutpointRecord): string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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[];
|
|
15
47
|
export declare function reconcilePersistentPolicyLocks(options: {
|
|
16
48
|
rpc: WalletCoinControlRpc;
|
|
17
49
|
walletName: string;
|
|
@@ -28,14 +60,12 @@ export declare function reconcilePersistentPolicyLocks(options: {
|
|
|
28
60
|
export declare function persistWalletCoinControlStateIfNeeded(options: {
|
|
29
61
|
state: WalletStateV1;
|
|
30
62
|
access: Parameters<typeof persistWalletStateUpdate>[0]["access"];
|
|
31
|
-
session?: UnlockSessionStateV1 | null;
|
|
32
63
|
paths: WalletRuntimePaths;
|
|
33
64
|
nowUnixMs: number;
|
|
34
65
|
replacePrimary?: boolean;
|
|
35
66
|
rpc: WalletCoinControlRpc;
|
|
36
|
-
cleanupInactiveTemporaryBuilderLocks?: boolean;
|
|
37
67
|
}): Promise<{
|
|
38
68
|
changed: boolean;
|
|
39
|
-
session: UnlockSessionStateV1 | null;
|
|
40
69
|
state: WalletStateV1;
|
|
41
70
|
}>;
|
|
71
|
+
export {};
|