@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,4 @@
|
|
|
1
|
-
import type { AnchorDomainResult,
|
|
1
|
+
import type { AnchorDomainResult, CogMutationResult, DomainAdminMutationResult, DomainMarketMutationResult, FieldMutationResult, RegisterDomainResult, ReputationMutationResult, WalletMutationFeeSummary } from "../wallet/tx/index.js";
|
|
2
2
|
import type { WalletRepairResult, WalletResetPreview } from "../wallet/lifecycle.js";
|
|
3
3
|
import type { MiningControlPlaneView, MiningRuntimeStatusV1 } from "../wallet/mining/index.js";
|
|
4
4
|
export declare function buildSingleTxMutationPreviewData(options: {
|
|
@@ -8,6 +8,7 @@ export declare function buildSingleTxMutationPreviewData(options: {
|
|
|
8
8
|
wtxid?: string | null | undefined;
|
|
9
9
|
reusedExisting: boolean;
|
|
10
10
|
intent: Record<string, unknown>;
|
|
11
|
+
fees: WalletMutationFeeSummary;
|
|
11
12
|
journalKind?: string | null;
|
|
12
13
|
intentFingerprintHex?: string | null;
|
|
13
14
|
}): {
|
|
@@ -23,38 +24,7 @@ export declare function buildSingleTxMutationPreviewData(options: {
|
|
|
23
24
|
txid: string | null;
|
|
24
25
|
wtxid: string | null;
|
|
25
26
|
};
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
export declare function buildFamilyMutationPreviewData(options: {
|
|
29
|
-
familyKind: string;
|
|
30
|
-
familyStatus: string;
|
|
31
|
-
reusedExisting: boolean;
|
|
32
|
-
intent: Record<string, unknown>;
|
|
33
|
-
currentStep?: string | null;
|
|
34
|
-
tx1Txid?: string | null | undefined;
|
|
35
|
-
tx1Wtxid?: string | null | undefined;
|
|
36
|
-
tx2Txid?: string | null | undefined;
|
|
37
|
-
tx2Wtxid?: string | null | undefined;
|
|
38
|
-
intentFingerprintHex?: string | null;
|
|
39
|
-
}): {
|
|
40
|
-
resultType: "family-mutation";
|
|
41
|
-
family: {
|
|
42
|
-
kind: string;
|
|
43
|
-
localStatus: string;
|
|
44
|
-
reusedExisting: boolean;
|
|
45
|
-
currentStep: string | null;
|
|
46
|
-
intentFingerprintHex: string | null;
|
|
47
|
-
};
|
|
48
|
-
transactions: {
|
|
49
|
-
tx1: {
|
|
50
|
-
txid: string | null;
|
|
51
|
-
wtxid: string | null;
|
|
52
|
-
};
|
|
53
|
-
tx2: {
|
|
54
|
-
txid: string | null;
|
|
55
|
-
wtxid: string | null;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
27
|
+
fees: WalletMutationFeeSummary;
|
|
58
28
|
intent: Record<string, unknown>;
|
|
59
29
|
};
|
|
60
30
|
export declare function buildStateChangePreviewData(options: {
|
|
@@ -84,7 +54,6 @@ export declare function buildOperationPreviewData(options: {
|
|
|
84
54
|
};
|
|
85
55
|
export declare function buildRegisterPreviewData(result: RegisterDomainResult, options: {
|
|
86
56
|
forceRace: boolean;
|
|
87
|
-
fromIdentity: string | null;
|
|
88
57
|
}): {
|
|
89
58
|
resolved: {
|
|
90
59
|
path: "root" | "subdomain";
|
|
@@ -112,11 +81,11 @@ export declare function buildRegisterPreviewData(result: RegisterDomainResult, o
|
|
|
112
81
|
txid: string | null;
|
|
113
82
|
wtxid: string | null;
|
|
114
83
|
};
|
|
84
|
+
fees: WalletMutationFeeSummary;
|
|
115
85
|
intent: Record<string, unknown>;
|
|
116
86
|
};
|
|
117
87
|
export declare function buildDomainMarketPreviewData(result: DomainMarketMutationResult, options: {
|
|
118
88
|
commandKind: "transfer" | "sell" | "unsell" | "buy";
|
|
119
|
-
fromIdentity?: string | null;
|
|
120
89
|
}): {
|
|
121
90
|
resolved: {
|
|
122
91
|
buyer: {
|
|
@@ -168,11 +137,11 @@ export declare function buildDomainMarketPreviewData(result: DomainMarketMutatio
|
|
|
168
137
|
txid: string | null;
|
|
169
138
|
wtxid: string | null;
|
|
170
139
|
};
|
|
140
|
+
fees: WalletMutationFeeSummary;
|
|
171
141
|
intent: Record<string, unknown>;
|
|
172
142
|
};
|
|
173
143
|
export declare function buildCogPreviewData(result: CogMutationResult, options: {
|
|
174
144
|
commandKind: "send" | "claim" | "reclaim" | "cog-lock";
|
|
175
|
-
fromIdentity: string | null;
|
|
176
145
|
timeoutBlocksOrDuration?: string | null;
|
|
177
146
|
timeoutHeight?: string | null;
|
|
178
147
|
conditionHex?: string | null;
|
|
@@ -198,40 +167,27 @@ export declare function buildCogPreviewData(result: CogMutationResult, options:
|
|
|
198
167
|
txid: string | null;
|
|
199
168
|
wtxid: string | null;
|
|
200
169
|
};
|
|
170
|
+
fees: WalletMutationFeeSummary;
|
|
201
171
|
intent: Record<string, unknown>;
|
|
202
172
|
};
|
|
203
173
|
export declare function buildAnchorPreviewData(result: AnchorDomainResult, options: {
|
|
204
174
|
foundingMessageText: string | null;
|
|
205
175
|
}): {
|
|
206
|
-
resultType: "
|
|
207
|
-
|
|
176
|
+
resultType: "single-tx-mutation";
|
|
177
|
+
mutation: {
|
|
208
178
|
kind: string;
|
|
179
|
+
journalKind: string;
|
|
209
180
|
localStatus: string;
|
|
210
181
|
reusedExisting: boolean;
|
|
211
|
-
currentStep: string | null;
|
|
212
182
|
intentFingerprintHex: string | null;
|
|
213
183
|
};
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
wtxid: string | null;
|
|
218
|
-
};
|
|
219
|
-
tx2: {
|
|
220
|
-
txid: string | null;
|
|
221
|
-
wtxid: string | null;
|
|
222
|
-
};
|
|
184
|
+
transaction: {
|
|
185
|
+
txid: string | null;
|
|
186
|
+
wtxid: string | null;
|
|
223
187
|
};
|
|
188
|
+
fees: WalletMutationFeeSummary;
|
|
224
189
|
intent: Record<string, unknown>;
|
|
225
190
|
};
|
|
226
|
-
export declare function buildAnchorClearPreviewData(result: ClearPendingAnchorResult): {
|
|
227
|
-
resultType: "state-change";
|
|
228
|
-
stateChange: {
|
|
229
|
-
kind: string;
|
|
230
|
-
before: Record<string, unknown> | null;
|
|
231
|
-
after: Record<string, unknown> | null;
|
|
232
|
-
};
|
|
233
|
-
state: Record<string, unknown>;
|
|
234
|
-
};
|
|
235
191
|
export declare function buildDomainAdminPreviewData(result: DomainAdminMutationResult, options: {
|
|
236
192
|
commandKind: "domain-endpoint-set" | "domain-endpoint-clear" | "domain-delegate-set" | "domain-delegate-clear" | "domain-miner-set" | "domain-miner-clear" | "domain-canonical";
|
|
237
193
|
}): {
|
|
@@ -267,6 +223,7 @@ export declare function buildDomainAdminPreviewData(result: DomainAdminMutationR
|
|
|
267
223
|
txid: string | null;
|
|
268
224
|
wtxid: string | null;
|
|
269
225
|
};
|
|
226
|
+
fees: WalletMutationFeeSummary;
|
|
270
227
|
intent: Record<string, unknown>;
|
|
271
228
|
};
|
|
272
229
|
export declare function buildFieldPreviewData(result: FieldMutationResult): {
|
|
@@ -283,59 +240,8 @@ export declare function buildFieldPreviewData(result: FieldMutationResult): {
|
|
|
283
240
|
byteLength: number;
|
|
284
241
|
} | null;
|
|
285
242
|
effect: {
|
|
286
|
-
kind: "create-and-initialize-field";
|
|
287
|
-
tx1BurnCogtoshi: "100";
|
|
288
|
-
tx2AdditionalBurnCogtoshi: "1";
|
|
289
|
-
burnCogtoshi?: undefined;
|
|
290
|
-
} | {
|
|
291
243
|
kind: "create-empty-field" | "write-field-value" | "clear-field-value";
|
|
292
244
|
burnCogtoshi: "0" | "1" | "100";
|
|
293
|
-
tx1BurnCogtoshi?: undefined;
|
|
294
|
-
tx2AdditionalBurnCogtoshi?: undefined;
|
|
295
|
-
};
|
|
296
|
-
} | null;
|
|
297
|
-
resultType: "family-mutation";
|
|
298
|
-
family: {
|
|
299
|
-
kind: string;
|
|
300
|
-
localStatus: string;
|
|
301
|
-
reusedExisting: boolean;
|
|
302
|
-
currentStep: string | null;
|
|
303
|
-
intentFingerprintHex: string | null;
|
|
304
|
-
};
|
|
305
|
-
transactions: {
|
|
306
|
-
tx1: {
|
|
307
|
-
txid: string | null;
|
|
308
|
-
wtxid: string | null;
|
|
309
|
-
};
|
|
310
|
-
tx2: {
|
|
311
|
-
txid: string | null;
|
|
312
|
-
wtxid: string | null;
|
|
313
|
-
};
|
|
314
|
-
};
|
|
315
|
-
intent: Record<string, unknown>;
|
|
316
|
-
} | {
|
|
317
|
-
resolved: {
|
|
318
|
-
sender: {
|
|
319
|
-
selector: string;
|
|
320
|
-
localIndex: number;
|
|
321
|
-
scriptPubKeyHex: string;
|
|
322
|
-
address: string;
|
|
323
|
-
};
|
|
324
|
-
path: import("../wallet/tx/field.js").FieldResolvedPath;
|
|
325
|
-
value: {
|
|
326
|
-
format: number;
|
|
327
|
-
byteLength: number;
|
|
328
|
-
} | null;
|
|
329
|
-
effect: {
|
|
330
|
-
kind: "create-and-initialize-field";
|
|
331
|
-
tx1BurnCogtoshi: "100";
|
|
332
|
-
tx2AdditionalBurnCogtoshi: "1";
|
|
333
|
-
burnCogtoshi?: undefined;
|
|
334
|
-
} | {
|
|
335
|
-
kind: "create-empty-field" | "write-field-value" | "clear-field-value";
|
|
336
|
-
burnCogtoshi: "0" | "1" | "100";
|
|
337
|
-
tx1BurnCogtoshi?: undefined;
|
|
338
|
-
tx2AdditionalBurnCogtoshi?: undefined;
|
|
339
245
|
};
|
|
340
246
|
} | null;
|
|
341
247
|
resultType: "single-tx-mutation";
|
|
@@ -350,6 +256,7 @@ export declare function buildFieldPreviewData(result: FieldMutationResult): {
|
|
|
350
256
|
txid: string | null;
|
|
351
257
|
wtxid: string | null;
|
|
352
258
|
};
|
|
259
|
+
fees: WalletMutationFeeSummary;
|
|
353
260
|
intent: Record<string, unknown>;
|
|
354
261
|
};
|
|
355
262
|
export declare function buildReputationPreviewData(result: ReputationMutationResult): {
|
|
@@ -382,19 +289,9 @@ export declare function buildReputationPreviewData(result: ReputationMutationRes
|
|
|
382
289
|
txid: string | null;
|
|
383
290
|
wtxid: string | null;
|
|
384
291
|
};
|
|
292
|
+
fees: WalletMutationFeeSummary;
|
|
385
293
|
intent: Record<string, unknown>;
|
|
386
294
|
};
|
|
387
|
-
export declare function buildWalletLockPreviewData(result: {
|
|
388
|
-
walletRootId: string | null;
|
|
389
|
-
}): {
|
|
390
|
-
resultType: "state-change";
|
|
391
|
-
stateChange: {
|
|
392
|
-
kind: string;
|
|
393
|
-
before: Record<string, unknown> | null;
|
|
394
|
-
after: Record<string, unknown> | null;
|
|
395
|
-
};
|
|
396
|
-
state: Record<string, unknown>;
|
|
397
|
-
};
|
|
398
295
|
export declare function buildResetPreviewData(result: WalletResetPreview): {
|
|
399
296
|
resultType: "operation";
|
|
400
297
|
operation: {
|
|
@@ -411,7 +308,7 @@ export declare function buildRepairPreviewData(result: WalletRepairResult): {
|
|
|
411
308
|
};
|
|
412
309
|
state: Record<string, unknown>;
|
|
413
310
|
};
|
|
414
|
-
export declare function
|
|
311
|
+
export declare function buildMineSetupPreviewData(view: MiningControlPlaneView): {
|
|
415
312
|
resultType: "state-change";
|
|
416
313
|
stateChange: {
|
|
417
314
|
kind: string;
|
package/dist/cli/preview-json.js
CHANGED
|
@@ -16,23 +16,7 @@ export function buildSingleTxMutationPreviewData(options) {
|
|
|
16
16
|
intentFingerprintHex: options.intentFingerprintHex ?? null,
|
|
17
17
|
},
|
|
18
18
|
transaction: normalizeTxSummary(options.txid, options.wtxid),
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export function buildFamilyMutationPreviewData(options) {
|
|
23
|
-
return {
|
|
24
|
-
resultType: "family-mutation",
|
|
25
|
-
family: {
|
|
26
|
-
kind: options.familyKind,
|
|
27
|
-
localStatus: options.familyStatus,
|
|
28
|
-
reusedExisting: options.reusedExisting,
|
|
29
|
-
currentStep: options.currentStep ?? null,
|
|
30
|
-
intentFingerprintHex: options.intentFingerprintHex ?? null,
|
|
31
|
-
},
|
|
32
|
-
transactions: {
|
|
33
|
-
tx1: normalizeTxSummary(options.tx1Txid, options.tx1Wtxid),
|
|
34
|
-
tx2: normalizeTxSummary(options.tx2Txid, options.tx2Wtxid),
|
|
35
|
-
},
|
|
19
|
+
fees: options.fees,
|
|
36
20
|
intent: options.intent,
|
|
37
21
|
};
|
|
38
22
|
}
|
|
@@ -64,11 +48,11 @@ export function buildRegisterPreviewData(result, options) {
|
|
|
64
48
|
localStatus: result.status,
|
|
65
49
|
txid: result.txid,
|
|
66
50
|
reusedExisting: result.reusedExisting,
|
|
51
|
+
fees: result.fees,
|
|
67
52
|
intent: {
|
|
68
53
|
domainName: result.domainName,
|
|
69
54
|
registerKind: result.registerKind,
|
|
70
55
|
forceRace: options.forceRace,
|
|
71
|
-
fromIdentitySelector: options.fromIdentity,
|
|
72
56
|
},
|
|
73
57
|
}),
|
|
74
58
|
resolved: buildRegisterResolvedJson(result),
|
|
@@ -80,14 +64,12 @@ export function buildDomainMarketPreviewData(result, options) {
|
|
|
80
64
|
listedPriceCogtoshi: decimalOrNull(result.listedPriceCogtoshi),
|
|
81
65
|
recipientScriptPubKeyHex: result.recipientScriptPubKeyHex ?? null,
|
|
82
66
|
};
|
|
83
|
-
if (options.commandKind === "buy") {
|
|
84
|
-
intent.fromIdentitySelector = options.fromIdentity ?? null;
|
|
85
|
-
}
|
|
86
67
|
const data = buildSingleTxMutationPreviewData({
|
|
87
68
|
kind: options.commandKind,
|
|
88
69
|
localStatus: result.status,
|
|
89
70
|
txid: result.txid,
|
|
90
71
|
reusedExisting: result.reusedExisting,
|
|
72
|
+
fees: result.fees,
|
|
91
73
|
intent,
|
|
92
74
|
journalKind: result.kind,
|
|
93
75
|
});
|
|
@@ -108,12 +90,12 @@ export function buildCogPreviewData(result, options) {
|
|
|
108
90
|
localStatus: result.status,
|
|
109
91
|
txid: result.txid,
|
|
110
92
|
reusedExisting: result.reusedExisting,
|
|
93
|
+
fees: result.fees,
|
|
111
94
|
intent: {
|
|
112
95
|
amountCogtoshi: decimalOrNull(result.amountCogtoshi),
|
|
113
96
|
recipientScriptPubKeyHex: result.recipientScriptPubKeyHex ?? null,
|
|
114
97
|
recipientDomainName: result.recipientDomainName ?? null,
|
|
115
98
|
lockId: result.lockId ?? null,
|
|
116
|
-
fromIdentitySelector: options.fromIdentity,
|
|
117
99
|
timeoutBlocksOrDuration: options.timeoutBlocksOrDuration ?? null,
|
|
118
100
|
timeoutHeight: options.timeoutHeight ?? null,
|
|
119
101
|
conditionHex: options.conditionHex ?? null,
|
|
@@ -126,56 +108,25 @@ export function buildCogPreviewData(result, options) {
|
|
|
126
108
|
};
|
|
127
109
|
}
|
|
128
110
|
export function buildAnchorPreviewData(result, options) {
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
|
|
111
|
+
return buildSingleTxMutationPreviewData({
|
|
112
|
+
kind: "anchor",
|
|
113
|
+
localStatus: result.status,
|
|
114
|
+
txid: result.txid,
|
|
132
115
|
reusedExisting: result.reusedExisting,
|
|
133
|
-
|
|
134
|
-
tx1Txid: result.tx1Txid,
|
|
135
|
-
tx2Txid: result.tx2Txid,
|
|
116
|
+
fees: result.fees,
|
|
136
117
|
intent: {
|
|
137
118
|
domainName: result.domainName,
|
|
138
|
-
dedicatedIndex: result.dedicatedIndex,
|
|
139
119
|
foundingMessageIncluded: options.foundingMessageText !== null,
|
|
140
120
|
},
|
|
141
121
|
});
|
|
142
122
|
}
|
|
143
|
-
export function buildAnchorClearPreviewData(result) {
|
|
144
|
-
const before = result.cleared
|
|
145
|
-
? {
|
|
146
|
-
localAnchorIntent: "reserved",
|
|
147
|
-
dedicatedIndex: result.releasedDedicatedIndex,
|
|
148
|
-
familyStatus: result.previousFamilyStatus,
|
|
149
|
-
familyStep: result.previousFamilyStep,
|
|
150
|
-
}
|
|
151
|
-
: null;
|
|
152
|
-
const after = result.cleared
|
|
153
|
-
? {
|
|
154
|
-
localAnchorIntent: "none",
|
|
155
|
-
dedicatedIndex: null,
|
|
156
|
-
familyStatus: "canceled",
|
|
157
|
-
familyStep: result.previousFamilyStep,
|
|
158
|
-
}
|
|
159
|
-
: null;
|
|
160
|
-
return buildStateChangePreviewData({
|
|
161
|
-
kind: "anchor-clear",
|
|
162
|
-
state: {
|
|
163
|
-
domainName: result.domainName,
|
|
164
|
-
cleared: result.cleared,
|
|
165
|
-
previousFamilyStatus: result.previousFamilyStatus,
|
|
166
|
-
previousFamilyStep: result.previousFamilyStep,
|
|
167
|
-
releasedDedicatedIndex: result.releasedDedicatedIndex,
|
|
168
|
-
},
|
|
169
|
-
before,
|
|
170
|
-
after,
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
123
|
export function buildDomainAdminPreviewData(result, options) {
|
|
174
124
|
const data = buildSingleTxMutationPreviewData({
|
|
175
125
|
kind: options.commandKind,
|
|
176
126
|
localStatus: result.status,
|
|
177
127
|
txid: result.txid,
|
|
178
128
|
reusedExisting: result.reusedExisting,
|
|
129
|
+
fees: result.fees,
|
|
179
130
|
intent: {
|
|
180
131
|
domainName: result.domainName,
|
|
181
132
|
recipientScriptPubKeyHex: result.recipientScriptPubKeyHex ?? null,
|
|
@@ -192,32 +143,13 @@ export function buildDomainAdminPreviewData(result, options) {
|
|
|
192
143
|
};
|
|
193
144
|
}
|
|
194
145
|
export function buildFieldPreviewData(result) {
|
|
195
|
-
if (result.family) {
|
|
196
|
-
return {
|
|
197
|
-
...buildFamilyMutationPreviewData({
|
|
198
|
-
familyKind: "field",
|
|
199
|
-
familyStatus: result.status,
|
|
200
|
-
reusedExisting: result.reusedExisting,
|
|
201
|
-
currentStep: result.status === "confirmed" ? "confirmed" : "submitted",
|
|
202
|
-
tx1Txid: result.tx1Txid ?? null,
|
|
203
|
-
tx2Txid: result.tx2Txid ?? null,
|
|
204
|
-
intent: {
|
|
205
|
-
domainName: result.domainName,
|
|
206
|
-
fieldName: result.fieldName,
|
|
207
|
-
fieldId: result.fieldId,
|
|
208
|
-
permanent: result.permanent,
|
|
209
|
-
format: result.format,
|
|
210
|
-
},
|
|
211
|
-
}),
|
|
212
|
-
resolved: buildFieldResolvedJson(result),
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
146
|
return {
|
|
216
147
|
...buildSingleTxMutationPreviewData({
|
|
217
148
|
kind: result.kind,
|
|
218
149
|
localStatus: result.status,
|
|
219
150
|
txid: result.txid,
|
|
220
151
|
reusedExisting: result.reusedExisting,
|
|
152
|
+
fees: result.fees,
|
|
221
153
|
intent: {
|
|
222
154
|
domainName: result.domainName,
|
|
223
155
|
fieldName: result.fieldName,
|
|
@@ -235,6 +167,7 @@ export function buildReputationPreviewData(result) {
|
|
|
235
167
|
localStatus: result.status,
|
|
236
168
|
txid: result.txid,
|
|
237
169
|
reusedExisting: result.reusedExisting,
|
|
170
|
+
fees: result.fees,
|
|
238
171
|
intent: {
|
|
239
172
|
sourceDomainName: result.sourceDomainName,
|
|
240
173
|
targetDomainName: result.targetDomainName,
|
|
@@ -247,15 +180,6 @@ export function buildReputationPreviewData(result) {
|
|
|
247
180
|
resolved: buildReputationResolvedJson(result),
|
|
248
181
|
};
|
|
249
182
|
}
|
|
250
|
-
export function buildWalletLockPreviewData(result) {
|
|
251
|
-
return buildStateChangePreviewData({
|
|
252
|
-
kind: "wallet-lock",
|
|
253
|
-
state: {
|
|
254
|
-
walletRootId: result.walletRootId,
|
|
255
|
-
locked: true,
|
|
256
|
-
},
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
183
|
export function buildResetPreviewData(result) {
|
|
260
184
|
return buildOperationPreviewData({
|
|
261
185
|
kind: "reset",
|
|
@@ -315,17 +239,10 @@ function summarizeRuntime(snapshot) {
|
|
|
315
239
|
note: snapshot.note,
|
|
316
240
|
};
|
|
317
241
|
}
|
|
318
|
-
export function
|
|
242
|
+
export function buildMineSetupPreviewData(view) {
|
|
319
243
|
return buildStateChangePreviewData({
|
|
320
|
-
kind,
|
|
244
|
+
kind: "mine-setup",
|
|
321
245
|
state: {
|
|
322
|
-
hook: {
|
|
323
|
-
mode: view.hook.mode,
|
|
324
|
-
validationState: view.hook.validationState,
|
|
325
|
-
operatorValidationState: view.hook.operatorValidationState,
|
|
326
|
-
validationError: view.hook.validationError,
|
|
327
|
-
cooldownActive: view.hook.cooldownActive,
|
|
328
|
-
},
|
|
329
246
|
provider: {
|
|
330
247
|
configured: view.provider.configured,
|
|
331
248
|
provider: view.provider.provider,
|
package/dist/cli/prompt.js
CHANGED
|
@@ -30,24 +30,19 @@ export function createTerminalPrompter(input, output) {
|
|
|
30
30
|
},
|
|
31
31
|
async promptHidden(message) {
|
|
32
32
|
const writableOutput = ensureWritableOutput();
|
|
33
|
-
let promptShown = false;
|
|
34
33
|
const hiddenOutput = Object.create(writableOutput);
|
|
35
|
-
hiddenOutput.write = ((
|
|
36
|
-
if (!promptShown) {
|
|
37
|
-
promptShown = true;
|
|
38
|
-
output.write(chunk);
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
if (chunk === "\n" || chunk === "\r\n") {
|
|
42
|
-
output.write(chunk);
|
|
43
|
-
}
|
|
44
|
-
return true;
|
|
45
|
-
});
|
|
34
|
+
hiddenOutput.write = (() => true);
|
|
46
35
|
hiddenOutput.on ??= (() => hiddenOutput);
|
|
47
36
|
hiddenOutput.once ??= (() => hiddenOutput);
|
|
48
37
|
hiddenOutput.off ??= (() => hiddenOutput);
|
|
49
38
|
hiddenOutput.removeListener ??= (() => hiddenOutput);
|
|
50
|
-
|
|
39
|
+
output.write(message);
|
|
40
|
+
try {
|
|
41
|
+
return await ask("", hiddenOutput);
|
|
42
|
+
}
|
|
43
|
+
finally {
|
|
44
|
+
output.write("\n");
|
|
45
|
+
}
|
|
51
46
|
},
|
|
52
47
|
clearSensitiveDisplay(scope) {
|
|
53
48
|
if (!input.isTTY || !output.isTTY) {
|
package/dist/cli/read-json.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WalletDomainView, WalletFieldView,
|
|
1
|
+
import type { WalletDomainView, WalletFieldView, WalletLockView, WalletReadContext } from "../wallet/read/index.js";
|
|
2
2
|
import type { MiningControlPlaneView, MiningEventRecord } from "../wallet/mining/index.js";
|
|
3
3
|
import type { PendingMutationRecord } from "../wallet/types.js";
|
|
4
4
|
import type { JsonAvailabilityEntry, JsonPage } from "./output.js";
|
|
@@ -9,31 +9,20 @@ export interface ReadJsonResult<T> {
|
|
|
9
9
|
nextSteps: string[];
|
|
10
10
|
}
|
|
11
11
|
export declare function buildAvailability(context: WalletReadContext): Record<string, JsonAvailabilityEntry>;
|
|
12
|
-
declare function
|
|
13
|
-
index: number;
|
|
14
|
-
scriptPubKeyHex: string;
|
|
12
|
+
declare function mapWalletAddress(context: WalletReadContext): {
|
|
15
13
|
address: string | null;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
ownedDomainNames: string[];
|
|
19
|
-
anchoredOwnedDomainNames: string[];
|
|
20
|
-
localStatus: "funding" | "dedicated" | "read-only";
|
|
21
|
-
effectiveStatus: "funding" | "dedicated" | "read-only";
|
|
22
|
-
canonicalDomainId: number | null;
|
|
23
|
-
canonicalDomainName: string | null;
|
|
14
|
+
scriptPubKeyHex: string | null;
|
|
15
|
+
localDomains: string[];
|
|
24
16
|
observedCogBalance: string | null;
|
|
25
|
-
readOnly: boolean;
|
|
26
17
|
};
|
|
27
18
|
declare function mapDomain(domain: WalletDomainView): {
|
|
28
19
|
name: string;
|
|
29
20
|
domainId: number | null;
|
|
30
21
|
anchored: boolean | null;
|
|
31
22
|
ownerScriptPubKeyHex: string | null;
|
|
32
|
-
ownerLocalIndex: number | null;
|
|
33
23
|
ownerAddress: string | null;
|
|
34
|
-
localRelationship: "unknown" | "
|
|
24
|
+
localRelationship: "unknown" | "local" | "external";
|
|
35
25
|
chainStatus: "unknown" | "registered-unanchored" | "anchored";
|
|
36
|
-
localAnchorIntent: "none" | "repair-required" | "reserved" | "tx1-live" | "tx2-live" | null;
|
|
37
26
|
foundingMessageText: string | null;
|
|
38
27
|
endpointText: string | null;
|
|
39
28
|
delegateScriptPubKeyHex: string | null;
|
|
@@ -72,7 +61,7 @@ declare function mapLock(lock: WalletLockView): {
|
|
|
72
61
|
reclaimableNow: boolean;
|
|
73
62
|
};
|
|
74
63
|
declare function mapPendingMutation(mutation: PendingMutationRecord): {
|
|
75
|
-
kind: "register" | "transfer" | "sell" | "buy" | "rep-give" | "rep-revoke" | "send" | "lock" | "claim" | "field-create" | "field-set" | "field-clear" | "endpoint" | "delegate" | "miner" | "canonical";
|
|
64
|
+
kind: "anchor" | "register" | "transfer" | "sell" | "buy" | "rep-give" | "rep-revoke" | "send" | "lock" | "claim" | "field-create" | "field-set" | "field-clear" | "endpoint" | "delegate" | "miner" | "canonical";
|
|
76
65
|
domainName: string;
|
|
77
66
|
recipientDomainName: string | null;
|
|
78
67
|
fieldName: string | null;
|
|
@@ -92,7 +81,6 @@ export declare function buildStatusJson(context: WalletReadContext): ReadJsonRes
|
|
|
92
81
|
cog: Record<string, unknown>;
|
|
93
82
|
domains: Record<string, unknown>;
|
|
94
83
|
mining: Record<string, unknown> | null;
|
|
95
|
-
hooks: Record<string, unknown> | null;
|
|
96
84
|
availability: Record<string, JsonAvailabilityEntry>;
|
|
97
85
|
}>;
|
|
98
86
|
export declare function buildAddressJson(context: WalletReadContext): ReadJsonResult<{
|
|
@@ -101,27 +89,16 @@ export declare function buildAddressJson(context: WalletReadContext): ReadJsonRe
|
|
|
101
89
|
network: string | null;
|
|
102
90
|
availability: Record<string, JsonAvailabilityEntry>;
|
|
103
91
|
}>;
|
|
104
|
-
export declare function buildIdsJson(context: WalletReadContext, page: JsonPage
|
|
105
|
-
|
|
92
|
+
export declare function buildIdsJson(context: WalletReadContext, page: JsonPage): ReadJsonResult<{
|
|
93
|
+
addresses: ReturnType<typeof mapWalletAddress>[] | null;
|
|
106
94
|
page: JsonPage;
|
|
107
95
|
availability: Record<string, JsonAvailabilityEntry>;
|
|
108
96
|
}>;
|
|
109
97
|
export declare function buildWalletStatusJson(context: WalletReadContext): ReadJsonResult<{
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
availability: Record<string, JsonAvailabilityEntry>;
|
|
115
|
-
}>;
|
|
116
|
-
export declare function buildHooksStatusJson(mining: MiningControlPlaneView): ReadJsonResult<{
|
|
117
|
-
mode: string;
|
|
118
|
-
validationState: string;
|
|
119
|
-
operatorValidationState: string;
|
|
120
|
-
launchFingerprintState: string;
|
|
121
|
-
fullFingerprintState: string;
|
|
122
|
-
lastValidationAtUnixMs: number | null;
|
|
123
|
-
lastValidationError: string | null;
|
|
124
|
-
trustChecks: Record<string, unknown>;
|
|
98
|
+
availability: string;
|
|
99
|
+
walletAddress: string | null;
|
|
100
|
+
walletScriptPubKeyHex: string | null;
|
|
101
|
+
services: Record<string, JsonAvailabilityEntry>;
|
|
125
102
|
}>;
|
|
126
103
|
export declare function buildMineStatusJson(mining: MiningControlPlaneView): ReadJsonResult<{
|
|
127
104
|
runMode: string;
|
|
@@ -132,7 +109,7 @@ export declare function buildMineStatusJson(mining: MiningControlPlaneView): Rea
|
|
|
132
109
|
domainId: number | null;
|
|
133
110
|
name: string | null;
|
|
134
111
|
} | null;
|
|
135
|
-
|
|
112
|
+
livePublishInMempool: boolean | null;
|
|
136
113
|
publishDecision: string | null;
|
|
137
114
|
phase: string;
|
|
138
115
|
lastSuspendDetectedAtUnixMs: number | null;
|
|
@@ -150,7 +127,8 @@ export declare function buildMineLogJson(events: MiningEventRecord[], page: Json
|
|
|
150
127
|
export declare function buildBalanceJson(context: WalletReadContext): ReadJsonResult<{
|
|
151
128
|
assetLabel: string;
|
|
152
129
|
totalCogtoshi: string | null;
|
|
153
|
-
|
|
130
|
+
walletAddress: string | null;
|
|
131
|
+
walletScriptPubKeyHex: string | null;
|
|
154
132
|
pending: ReturnType<typeof mapPendingMutation>[];
|
|
155
133
|
availability: Record<string, JsonAvailabilityEntry>;
|
|
156
134
|
}>;
|