@cogcoin/client 1.1.8 → 1.1.9
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 +1 -1
- package/dist/cli/commands/mining-read.js +1 -1
- package/dist/cli/commands/wallet-mutation/anchor.d.ts +2 -0
- package/dist/cli/commands/wallet-mutation/anchor.js +33 -0
- package/dist/cli/commands/wallet-mutation/bitcoin-transfer.d.ts +2 -0
- package/dist/cli/commands/wallet-mutation/bitcoin-transfer.js +32 -0
- package/dist/cli/commands/wallet-mutation/cog.d.ts +2 -0
- package/dist/cli/commands/wallet-mutation/cog.js +131 -0
- package/dist/cli/commands/wallet-mutation/context.d.ts +3 -0
- package/dist/cli/commands/wallet-mutation/context.js +18 -0
- package/dist/cli/commands/wallet-mutation/domain-admin.d.ts +2 -0
- package/dist/cli/commands/wallet-mutation/domain-admin.js +173 -0
- package/dist/cli/commands/wallet-mutation/domain-market.d.ts +2 -0
- package/dist/cli/commands/wallet-mutation/domain-market.js +107 -0
- package/dist/cli/commands/wallet-mutation/field.d.ts +2 -0
- package/dist/cli/commands/wallet-mutation/field.js +125 -0
- package/dist/cli/commands/wallet-mutation/register.d.ts +2 -0
- package/dist/cli/commands/wallet-mutation/register.js +38 -0
- package/dist/cli/commands/wallet-mutation/registry.d.ts +3 -0
- package/dist/cli/commands/wallet-mutation/registry.js +39 -0
- package/dist/cli/commands/wallet-mutation/reputation.d.ts +2 -0
- package/dist/cli/commands/wallet-mutation/reputation.js +57 -0
- package/dist/cli/commands/wallet-mutation/types.d.ts +32 -0
- package/dist/cli/commands/wallet-mutation/types.js +1 -0
- package/dist/cli/commands/wallet-mutation.js +13 -765
- package/dist/cli/commands/wallet-read.js +4 -4
- package/dist/cli/mutation-success.d.ts +0 -2
- package/dist/cli/output/classify.d.ts +7 -0
- package/dist/cli/output/classify.js +94 -0
- package/dist/cli/output/render.d.ts +2 -0
- package/dist/cli/output/render.js +13 -0
- package/dist/cli/output/rules/cli-surface.d.ts +2 -0
- package/dist/cli/output/rules/cli-surface.js +110 -0
- package/dist/cli/output/rules/generic.d.ts +2 -0
- package/dist/cli/output/rules/generic.js +13 -0
- package/dist/cli/output/rules/index.d.ts +2 -0
- package/dist/cli/output/rules/index.js +24 -0
- package/dist/cli/output/rules/mining-update.d.ts +2 -0
- package/dist/cli/output/rules/mining-update.js +68 -0
- package/dist/cli/output/rules/services.d.ts +2 -0
- package/dist/cli/output/rules/services.js +110 -0
- package/dist/cli/output/rules/wallet-admin.d.ts +2 -0
- package/dist/cli/output/rules/wallet-admin.js +224 -0
- package/dist/cli/output/rules/wallet-mutations.d.ts +2 -0
- package/dist/cli/output/rules/wallet-mutations.js +274 -0
- package/dist/cli/output/types.d.ts +16 -0
- package/dist/cli/output/types.js +1 -0
- package/dist/cli/output.d.ts +2 -168
- package/dist/cli/output.js +6 -989
- package/dist/cli/pagination.d.ts +15 -0
- package/dist/cli/pagination.js +16 -0
- package/dist/cli/recommendations.d.ts +4 -0
- package/dist/cli/recommendations.js +108 -0
- package/dist/cli/wallet-format/availability.d.ts +5 -0
- package/dist/cli/wallet-format/availability.js +96 -0
- package/dist/cli/wallet-format/balance.d.ts +2 -0
- package/dist/cli/wallet-format/balance.js +162 -0
- package/dist/cli/wallet-format/domains.d.ts +8 -0
- package/dist/cli/wallet-format/domains.js +84 -0
- package/dist/cli/wallet-format/fields.d.ts +6 -0
- package/dist/cli/wallet-format/fields.js +61 -0
- package/dist/cli/wallet-format/identity.d.ts +5 -0
- package/dist/cli/wallet-format/identity.js +19 -0
- package/dist/cli/wallet-format/locks.d.ts +7 -0
- package/dist/cli/wallet-format/locks.js +52 -0
- package/dist/cli/wallet-format/overview.d.ts +2 -0
- package/dist/cli/wallet-format/overview.js +122 -0
- package/dist/cli/wallet-format/pending.d.ts +13 -0
- package/dist/cli/wallet-format/pending.js +101 -0
- package/dist/cli/wallet-format/shared.d.ts +7 -0
- package/dist/cli/wallet-format/shared.js +31 -0
- package/dist/cli/wallet-format/status.d.ts +3 -0
- package/dist/cli/wallet-format/status.js +27 -0
- package/dist/cli/wallet-format.d.ts +8 -30
- package/dist/cli/wallet-format.js +8 -830
- package/dist/cli/wallet-read-helpers.d.ts +6 -0
- package/dist/cli/wallet-read-helpers.js +17 -0
- package/dist/wallet/mining/candidate.d.ts +1 -1
- package/dist/wallet/mining/candidate.js +3 -3
- package/dist/wallet/mining/constants.d.ts +2 -2
- package/dist/wallet/mining/constants.js +2 -2
- package/dist/wallet/mining/sentence-protocol.d.ts +2 -2
- package/dist/wallet/mining/sentences.js +8 -8
- package/dist/wallet/tx/anchor/confirm.d.ts +15 -0
- package/dist/wallet/tx/anchor/confirm.js +60 -0
- package/dist/wallet/tx/anchor/draft.d.ts +39 -0
- package/dist/wallet/tx/anchor/draft.js +167 -0
- package/dist/wallet/tx/anchor/index.d.ts +5 -0
- package/dist/wallet/tx/anchor/index.js +148 -0
- package/dist/wallet/tx/anchor/intent.d.ts +61 -0
- package/dist/wallet/tx/anchor/intent.js +101 -0
- package/dist/wallet/tx/anchor/plan.d.ts +3 -0
- package/dist/wallet/tx/anchor/plan.js +18 -0
- package/dist/wallet/tx/anchor/result.d.ts +25 -0
- package/dist/wallet/tx/anchor/result.js +20 -0
- package/dist/wallet/tx/anchor.d.ts +1 -39
- package/dist/wallet/tx/anchor.js +1 -494
- package/dist/wallet/tx/bitcoin-transfer/confirm.d.ts +7 -0
- package/dist/wallet/tx/bitcoin-transfer/confirm.js +11 -0
- package/dist/wallet/tx/bitcoin-transfer/index.d.ts +5 -0
- package/dist/wallet/tx/bitcoin-transfer/index.js +112 -0
- package/dist/wallet/tx/bitcoin-transfer/intent.d.ts +52 -0
- package/dist/wallet/tx/bitcoin-transfer/intent.js +74 -0
- package/dist/wallet/tx/bitcoin-transfer/plan.d.ts +5 -0
- package/dist/wallet/tx/bitcoin-transfer/plan.js +21 -0
- package/dist/wallet/tx/bitcoin-transfer/result.d.ts +19 -0
- package/dist/wallet/tx/bitcoin-transfer/result.js +16 -0
- package/dist/wallet/tx/bitcoin-transfer.d.ts +1 -35
- package/dist/wallet/tx/bitcoin-transfer.js +1 -200
- package/dist/wallet/tx/cog/confirm.d.ts +13 -0
- package/dist/wallet/tx/cog/confirm.js +59 -0
- package/dist/wallet/tx/cog/draft.d.ts +20 -0
- package/dist/wallet/tx/cog/draft.js +114 -0
- package/dist/wallet/tx/cog/index.d.ts +6 -0
- package/dist/wallet/tx/cog/index.js +117 -0
- package/dist/wallet/tx/cog/intent.d.ts +30 -0
- package/dist/wallet/tx/cog/intent.js +169 -0
- package/dist/wallet/tx/cog/plan.d.ts +19 -0
- package/dist/wallet/tx/cog/plan.js +65 -0
- package/dist/wallet/tx/cog/result.d.ts +27 -0
- package/dist/wallet/tx/cog/result.js +28 -0
- package/dist/wallet/tx/cog/types.d.ts +186 -0
- package/dist/wallet/tx/cog/types.js +2 -0
- package/dist/wallet/tx/cog/variants/claim.d.ts +3 -0
- package/dist/wallet/tx/cog/variants/claim.js +92 -0
- package/dist/wallet/tx/cog/variants/lock.d.ts +2 -0
- package/dist/wallet/tx/cog/variants/lock.js +102 -0
- package/dist/wallet/tx/cog/variants/send.d.ts +2 -0
- package/dist/wallet/tx/cog/variants/send.js +77 -0
- package/dist/wallet/tx/cog.d.ts +1 -96
- package/dist/wallet/tx/cog.js +1 -824
- package/dist/wallet/tx/common.d.ts +14 -199
- package/dist/wallet/tx/common.js +10 -493
- package/dist/wallet/tx/domain-admin/confirm.d.ts +17 -0
- package/dist/wallet/tx/domain-admin/confirm.js +58 -0
- package/dist/wallet/tx/domain-admin/draft.d.ts +20 -0
- package/dist/wallet/tx/domain-admin/draft.js +161 -0
- package/dist/wallet/tx/domain-admin/index.d.ts +9 -0
- package/dist/wallet/tx/domain-admin/index.js +150 -0
- package/dist/wallet/tx/domain-admin/intent.d.ts +12 -0
- package/dist/wallet/tx/domain-admin/intent.js +61 -0
- package/dist/wallet/tx/domain-admin/plan.d.ts +19 -0
- package/dist/wallet/tx/domain-admin/plan.js +64 -0
- package/dist/wallet/tx/domain-admin/result.d.ts +19 -0
- package/dist/wallet/tx/domain-admin/result.js +33 -0
- package/dist/wallet/tx/domain-admin/types.d.ts +162 -0
- package/dist/wallet/tx/domain-admin/types.js +1 -0
- package/dist/wallet/tx/domain-admin/variants/canonical.d.ts +2 -0
- package/dist/wallet/tx/domain-admin/variants/canonical.js +22 -0
- package/dist/wallet/tx/domain-admin/variants/delegate.d.ts +3 -0
- package/dist/wallet/tx/domain-admin/variants/delegate.js +60 -0
- package/dist/wallet/tx/domain-admin/variants/endpoint.d.ts +3 -0
- package/dist/wallet/tx/domain-admin/variants/endpoint.js +102 -0
- package/dist/wallet/tx/domain-admin/variants/miner.d.ts +3 -0
- package/dist/wallet/tx/domain-admin/variants/miner.js +59 -0
- package/dist/wallet/tx/domain-admin.d.ts +1 -107
- package/dist/wallet/tx/domain-admin.js +1 -729
- package/dist/wallet/tx/domain-market/confirm.d.ts +6 -0
- package/dist/wallet/tx/domain-market/confirm.js +52 -0
- package/dist/wallet/tx/domain-market/draft.d.ts +43 -0
- package/dist/wallet/tx/domain-market/draft.js +286 -0
- package/dist/wallet/tx/domain-market/index.d.ts +6 -0
- package/dist/wallet/tx/domain-market/index.js +145 -0
- package/dist/wallet/tx/domain-market/intent.d.ts +15 -0
- package/dist/wallet/tx/domain-market/intent.js +131 -0
- package/dist/wallet/tx/domain-market/plan.d.ts +31 -0
- package/dist/wallet/tx/domain-market/plan.js +98 -0
- package/dist/wallet/tx/domain-market/result.d.ts +45 -0
- package/dist/wallet/tx/domain-market/result.js +88 -0
- package/dist/wallet/tx/domain-market/types.d.ts +221 -0
- package/dist/wallet/tx/domain-market/types.js +1 -0
- package/dist/wallet/tx/domain-market/variants/buy.d.ts +2 -0
- package/dist/wallet/tx/domain-market/variants/buy.js +103 -0
- package/dist/wallet/tx/domain-market/variants/sell.d.ts +2 -0
- package/dist/wallet/tx/domain-market/variants/sell.js +91 -0
- package/dist/wallet/tx/domain-market/variants/transfer.d.ts +2 -0
- package/dist/wallet/tx/domain-market/variants/transfer.js +105 -0
- package/dist/wallet/tx/domain-market.d.ts +1 -116
- package/dist/wallet/tx/domain-market.js +1 -1078
- package/dist/wallet/tx/draft-build.d.ts +60 -0
- package/dist/wallet/tx/draft-build.js +127 -0
- package/dist/wallet/tx/executor.d.ts +6 -40
- package/dist/wallet/tx/executor.js +6 -100
- package/dist/wallet/tx/fee.d.ts +30 -0
- package/dist/wallet/tx/fee.js +98 -0
- package/dist/wallet/tx/field/confirm.d.ts +11 -0
- package/dist/wallet/tx/field/confirm.js +19 -0
- package/dist/wallet/tx/field/draft.d.ts +23 -0
- package/dist/wallet/tx/field/draft.js +202 -0
- package/dist/wallet/tx/field/index.d.ts +5 -0
- package/dist/wallet/tx/field/index.js +140 -0
- package/dist/wallet/tx/field/intent.d.ts +5 -0
- package/dist/wallet/tx/field/intent.js +50 -0
- package/dist/wallet/tx/field/plan.d.ts +20 -0
- package/dist/wallet/tx/field/plan.js +65 -0
- package/dist/wallet/tx/field/result.d.ts +29 -0
- package/dist/wallet/tx/field/result.js +103 -0
- package/dist/wallet/tx/field/types.d.ts +163 -0
- package/dist/wallet/tx/field/types.js +1 -0
- package/dist/wallet/tx/field/variants/clear.d.ts +2 -0
- package/dist/wallet/tx/field/variants/clear.js +60 -0
- package/dist/wallet/tx/field/variants/create.d.ts +2 -0
- package/dist/wallet/tx/field/variants/create.js +67 -0
- package/dist/wallet/tx/field/variants/set.d.ts +2 -0
- package/dist/wallet/tx/field/variants/set.js +195 -0
- package/dist/wallet/tx/field.d.ts +1 -95
- package/dist/wallet/tx/field.js +1 -920
- package/dist/wallet/tx/mining-preemption.d.ts +6 -0
- package/dist/wallet/tx/mining-preemption.js +7 -0
- package/dist/wallet/tx/primitives.d.ts +13 -0
- package/dist/wallet/tx/primitives.js +42 -0
- package/dist/wallet/tx/psbt-assert.d.ts +14 -0
- package/dist/wallet/tx/psbt-assert.js +39 -0
- package/dist/wallet/tx/publish.d.ts +37 -0
- package/dist/wallet/tx/publish.js +88 -0
- package/dist/wallet/tx/readiness.d.ts +7 -0
- package/dist/wallet/tx/readiness.js +61 -0
- package/dist/wallet/tx/reconcile.d.ts +24 -0
- package/dist/wallet/tx/reconcile.js +72 -0
- package/dist/wallet/tx/register/confirm.d.ts +6 -0
- package/dist/wallet/tx/register/confirm.js +66 -0
- package/dist/wallet/tx/register/draft.d.ts +42 -0
- package/dist/wallet/tx/register/draft.js +181 -0
- package/dist/wallet/tx/register/index.d.ts +6 -0
- package/dist/wallet/tx/register/index.js +158 -0
- package/dist/wallet/tx/register/intent.d.ts +74 -0
- package/dist/wallet/tx/register/intent.js +119 -0
- package/dist/wallet/tx/register/plan.d.ts +43 -0
- package/dist/wallet/tx/register/plan.js +168 -0
- package/dist/wallet/tx/register/result.d.ts +78 -0
- package/dist/wallet/tx/register/result.js +41 -0
- package/dist/wallet/tx/register.d.ts +1 -70
- package/dist/wallet/tx/register.js +1 -681
- package/dist/wallet/tx/reputation/confirm.d.ts +11 -0
- package/dist/wallet/tx/reputation/confirm.js +51 -0
- package/dist/wallet/tx/reputation/draft.d.ts +20 -0
- package/dist/wallet/tx/reputation/draft.js +130 -0
- package/dist/wallet/tx/reputation/index.d.ts +4 -0
- package/dist/wallet/tx/reputation/index.js +162 -0
- package/dist/wallet/tx/reputation/intent.d.ts +36 -0
- package/dist/wallet/tx/reputation/intent.js +157 -0
- package/dist/wallet/tx/reputation/plan.d.ts +19 -0
- package/dist/wallet/tx/reputation/plan.js +64 -0
- package/dist/wallet/tx/reputation/result.d.ts +21 -0
- package/dist/wallet/tx/reputation/result.js +31 -0
- package/dist/wallet/tx/reputation/types.d.ts +130 -0
- package/dist/wallet/tx/reputation/types.js +1 -0
- package/dist/wallet/tx/reputation.d.ts +1 -74
- package/dist/wallet/tx/reputation.js +1 -556
- package/dist/wallet/tx/signing.d.ts +18 -0
- package/dist/wallet/tx/signing.js +31 -0
- package/dist/wallet/tx/state-persist.d.ts +27 -0
- package/dist/wallet/tx/state-persist.js +54 -0
- package/dist/wallet/tx/types.d.ts +44 -0
- package/dist/wallet/tx/types.js +1 -0
- package/package.json +1 -1
- package/dist/cli/mining-json.d.ts +0 -20
- package/dist/cli/mining-json.js +0 -46
- package/dist/cli/mutation-json.d.ts +0 -325
- package/dist/cli/mutation-json.js +0 -269
- package/dist/cli/mutation-resolved-json.d.ts +0 -117
- package/dist/cli/mutation-resolved-json.js +0 -123
- package/dist/cli/preview-json.d.ts +0 -319
- package/dist/cli/preview-json.js +0 -254
- package/dist/cli/read-json.d.ts +0 -190
- package/dist/cli/read-json.js +0 -627
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
import { buildCogResolvedJson, buildDomainAdminResolvedJson, buildDomainMarketResolvedJson, buildFieldResolvedJson, buildRegisterResolvedJson, buildReputationResolvedJson, decimalOrNull, } from "./mutation-resolved-json.js";
|
|
2
|
-
function normalizeTxSummary(txid, wtxid) {
|
|
3
|
-
return {
|
|
4
|
-
txid: txid ?? null,
|
|
5
|
-
wtxid: wtxid ?? null,
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
export function buildSingleTxMutationData(options) {
|
|
9
|
-
return {
|
|
10
|
-
resultType: "single-tx-mutation",
|
|
11
|
-
mutation: {
|
|
12
|
-
kind: options.kind,
|
|
13
|
-
journalKind: options.journalKind ?? options.kind,
|
|
14
|
-
localStatus: options.localStatus,
|
|
15
|
-
reusedExisting: options.reusedExisting,
|
|
16
|
-
intentFingerprintHex: options.intentFingerprintHex ?? null,
|
|
17
|
-
},
|
|
18
|
-
transaction: normalizeTxSummary(options.txid, options.wtxid),
|
|
19
|
-
fees: options.fees,
|
|
20
|
-
intent: options.intent,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export function buildStateChangeData(options) {
|
|
24
|
-
return {
|
|
25
|
-
resultType: "state-change",
|
|
26
|
-
stateChange: {
|
|
27
|
-
kind: options.kind,
|
|
28
|
-
before: options.before ?? null,
|
|
29
|
-
after: options.after ?? null,
|
|
30
|
-
},
|
|
31
|
-
state: options.state,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export function buildOperationData(options) {
|
|
35
|
-
return {
|
|
36
|
-
resultType: "operation",
|
|
37
|
-
operation: {
|
|
38
|
-
kind: options.kind,
|
|
39
|
-
...options.operation,
|
|
40
|
-
},
|
|
41
|
-
state: options.state ?? null,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
export function buildBitcoinTransferData(result) {
|
|
45
|
-
return buildOperationData({
|
|
46
|
-
kind: "bitcoin-transfer",
|
|
47
|
-
state: null,
|
|
48
|
-
operation: {
|
|
49
|
-
amountSats: result.amountSats.toString(),
|
|
50
|
-
feeSats: result.feeSats.toString(),
|
|
51
|
-
senderAddress: result.senderAddress,
|
|
52
|
-
recipientAddress: result.recipientAddress,
|
|
53
|
-
recipientScriptPubKeyHex: result.recipientScriptPubKeyHex,
|
|
54
|
-
changeAddress: result.changeAddress,
|
|
55
|
-
txid: result.txid,
|
|
56
|
-
wtxid: result.wtxid,
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
export function buildRegisterMutationData(result, options) {
|
|
61
|
-
return {
|
|
62
|
-
...buildSingleTxMutationData({
|
|
63
|
-
kind: "register",
|
|
64
|
-
localStatus: result.status,
|
|
65
|
-
txid: result.txid,
|
|
66
|
-
reusedExisting: result.reusedExisting,
|
|
67
|
-
fees: result.fees,
|
|
68
|
-
intent: {
|
|
69
|
-
domainName: result.domainName,
|
|
70
|
-
registerKind: result.registerKind,
|
|
71
|
-
forceRace: options.forceRace,
|
|
72
|
-
},
|
|
73
|
-
}),
|
|
74
|
-
resolved: buildRegisterResolvedJson(result),
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
export function buildDomainMarketMutationData(result, options) {
|
|
78
|
-
const intent = {
|
|
79
|
-
domainName: result.domainName,
|
|
80
|
-
listedPriceCogtoshi: decimalOrNull(result.listedPriceCogtoshi),
|
|
81
|
-
recipientScriptPubKeyHex: result.recipientScriptPubKeyHex ?? null,
|
|
82
|
-
};
|
|
83
|
-
const data = buildSingleTxMutationData({
|
|
84
|
-
kind: options.commandKind,
|
|
85
|
-
localStatus: result.status,
|
|
86
|
-
txid: result.txid,
|
|
87
|
-
reusedExisting: result.reusedExisting,
|
|
88
|
-
fees: result.fees,
|
|
89
|
-
intent,
|
|
90
|
-
journalKind: result.kind,
|
|
91
|
-
});
|
|
92
|
-
if (options.commandKind !== "buy") {
|
|
93
|
-
return {
|
|
94
|
-
...data,
|
|
95
|
-
resolved: buildDomainMarketResolvedJson(result, options.commandKind),
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
return {
|
|
99
|
-
...data,
|
|
100
|
-
resolved: buildDomainMarketResolvedJson(result, options.commandKind),
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
export function buildCogMutationData(result, options) {
|
|
104
|
-
const data = buildSingleTxMutationData({
|
|
105
|
-
kind: options.commandKind,
|
|
106
|
-
localStatus: result.status,
|
|
107
|
-
txid: result.txid,
|
|
108
|
-
reusedExisting: result.reusedExisting,
|
|
109
|
-
fees: result.fees,
|
|
110
|
-
intent: {
|
|
111
|
-
amountCogtoshi: decimalOrNull(result.amountCogtoshi),
|
|
112
|
-
recipientScriptPubKeyHex: result.recipientScriptPubKeyHex ?? null,
|
|
113
|
-
recipientDomainName: result.recipientDomainName ?? null,
|
|
114
|
-
lockId: result.lockId ?? null,
|
|
115
|
-
timeoutBlocksOrDuration: options.timeoutBlocksOrDuration ?? null,
|
|
116
|
-
timeoutHeight: options.timeoutHeight ?? null,
|
|
117
|
-
conditionHex: options.conditionHex ?? null,
|
|
118
|
-
},
|
|
119
|
-
journalKind: result.kind,
|
|
120
|
-
});
|
|
121
|
-
return {
|
|
122
|
-
...data,
|
|
123
|
-
resolved: buildCogResolvedJson(result, options.commandKind),
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
export function buildAnchorMutationData(result, options) {
|
|
127
|
-
return buildSingleTxMutationData({
|
|
128
|
-
kind: "anchor",
|
|
129
|
-
localStatus: result.status,
|
|
130
|
-
txid: result.txid,
|
|
131
|
-
reusedExisting: result.reusedExisting,
|
|
132
|
-
fees: result.fees,
|
|
133
|
-
intent: {
|
|
134
|
-
domainName: result.domainName,
|
|
135
|
-
foundingMessageIncluded: options.foundingMessageText !== null,
|
|
136
|
-
},
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
export function buildResetMutationData(result) {
|
|
140
|
-
return buildOperationData({
|
|
141
|
-
kind: "reset",
|
|
142
|
-
state: {
|
|
143
|
-
dataRoot: result.dataRoot,
|
|
144
|
-
factoryResetReady: result.factoryResetReady,
|
|
145
|
-
walletAction: result.walletAction,
|
|
146
|
-
walletOldRootId: result.walletOldRootId,
|
|
147
|
-
walletNewRootId: result.walletNewRootId,
|
|
148
|
-
bootstrapSnapshot: result.bootstrapSnapshot,
|
|
149
|
-
bitcoinDataDir: result.bitcoinDataDir,
|
|
150
|
-
stoppedProcesses: result.stoppedProcesses,
|
|
151
|
-
secretCleanupStatus: result.secretCleanupStatus,
|
|
152
|
-
},
|
|
153
|
-
operation: {
|
|
154
|
-
dataRoot: result.dataRoot,
|
|
155
|
-
factoryResetReady: result.factoryResetReady,
|
|
156
|
-
stoppedProcesses: result.stoppedProcesses,
|
|
157
|
-
secretCleanupStatus: result.secretCleanupStatus,
|
|
158
|
-
deletedSecretRefs: result.deletedSecretRefs,
|
|
159
|
-
failedSecretRefs: result.failedSecretRefs,
|
|
160
|
-
preservedSecretRefs: result.preservedSecretRefs,
|
|
161
|
-
walletAction: result.walletAction,
|
|
162
|
-
walletOldRootId: result.walletOldRootId,
|
|
163
|
-
walletNewRootId: result.walletNewRootId,
|
|
164
|
-
bootstrapSnapshot: result.bootstrapSnapshot,
|
|
165
|
-
bitcoinDataDir: result.bitcoinDataDir,
|
|
166
|
-
removedPaths: result.removedPaths,
|
|
167
|
-
},
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
export function buildDomainAdminMutationData(result, options) {
|
|
171
|
-
const data = buildSingleTxMutationData({
|
|
172
|
-
kind: options.commandKind,
|
|
173
|
-
localStatus: result.status,
|
|
174
|
-
txid: result.txid,
|
|
175
|
-
reusedExisting: result.reusedExisting,
|
|
176
|
-
fees: result.fees,
|
|
177
|
-
intent: {
|
|
178
|
-
domainName: result.domainName,
|
|
179
|
-
recipientScriptPubKeyHex: result.recipientScriptPubKeyHex ?? null,
|
|
180
|
-
endpointValueHex: result.endpointValueHex ?? null,
|
|
181
|
-
endpointByteLength: result.endpointValueHex === null || result.endpointValueHex === undefined
|
|
182
|
-
? null
|
|
183
|
-
: result.endpointValueHex.length / 2,
|
|
184
|
-
},
|
|
185
|
-
journalKind: result.kind,
|
|
186
|
-
});
|
|
187
|
-
return {
|
|
188
|
-
...data,
|
|
189
|
-
resolved: buildDomainAdminResolvedJson(result),
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
export function buildFieldMutationData(result) {
|
|
193
|
-
return {
|
|
194
|
-
...buildSingleTxMutationData({
|
|
195
|
-
kind: result.kind,
|
|
196
|
-
localStatus: result.status,
|
|
197
|
-
txid: result.txid,
|
|
198
|
-
reusedExisting: result.reusedExisting,
|
|
199
|
-
fees: result.fees,
|
|
200
|
-
intent: {
|
|
201
|
-
domainName: result.domainName,
|
|
202
|
-
fieldName: result.fieldName,
|
|
203
|
-
fieldId: result.fieldId,
|
|
204
|
-
permanent: result.permanent,
|
|
205
|
-
format: result.format,
|
|
206
|
-
},
|
|
207
|
-
}),
|
|
208
|
-
resolved: buildFieldResolvedJson(result),
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
export function buildReputationMutationData(result) {
|
|
212
|
-
const data = buildSingleTxMutationData({
|
|
213
|
-
kind: result.kind === "give" ? "rep-give" : "rep-revoke",
|
|
214
|
-
localStatus: result.status,
|
|
215
|
-
txid: result.txid,
|
|
216
|
-
reusedExisting: result.reusedExisting,
|
|
217
|
-
fees: result.fees,
|
|
218
|
-
intent: {
|
|
219
|
-
sourceDomainName: result.sourceDomainName,
|
|
220
|
-
targetDomainName: result.targetDomainName,
|
|
221
|
-
amountCogtoshi: result.amountCogtoshi.toString(),
|
|
222
|
-
reviewIncluded: result.reviewIncluded,
|
|
223
|
-
},
|
|
224
|
-
});
|
|
225
|
-
return {
|
|
226
|
-
...data,
|
|
227
|
-
resolved: buildReputationResolvedJson(result),
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
export function buildInitMutationData(result) {
|
|
231
|
-
const after = {
|
|
232
|
-
setupMode: result.setupMode,
|
|
233
|
-
passwordAction: result.passwordAction,
|
|
234
|
-
walletAction: result.walletAction,
|
|
235
|
-
walletRootId: result.walletRootId,
|
|
236
|
-
fundingAddress: result.fundingAddress,
|
|
237
|
-
};
|
|
238
|
-
return buildStateChangeData({
|
|
239
|
-
kind: "init",
|
|
240
|
-
state: after,
|
|
241
|
-
before: null,
|
|
242
|
-
after,
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
export function buildRepairMutationData(result) {
|
|
246
|
-
const after = {
|
|
247
|
-
walletRootId: result.walletRootId,
|
|
248
|
-
recoveredFromBackup: result.recoveredFromBackup,
|
|
249
|
-
recreatedManagedCoreWallet: result.recreatedManagedCoreWallet,
|
|
250
|
-
bitcoindServiceAction: result.bitcoindServiceAction,
|
|
251
|
-
bitcoindCompatibilityIssue: result.bitcoindCompatibilityIssue,
|
|
252
|
-
managedCoreReplicaAction: result.managedCoreReplicaAction,
|
|
253
|
-
bitcoindPostRepairHealth: result.bitcoindPostRepairHealth,
|
|
254
|
-
resetIndexerDatabase: result.resetIndexerDatabase,
|
|
255
|
-
indexerDaemonAction: result.indexerDaemonAction,
|
|
256
|
-
indexerCompatibilityIssue: result.indexerCompatibilityIssue,
|
|
257
|
-
indexerPostRepairHealth: result.indexerPostRepairHealth,
|
|
258
|
-
miningPreRepairRunMode: result.miningPreRepairRunMode,
|
|
259
|
-
miningResumeAction: result.miningResumeAction,
|
|
260
|
-
miningPostRepairRunMode: result.miningPostRepairRunMode,
|
|
261
|
-
miningResumeError: result.miningResumeError,
|
|
262
|
-
note: result.note,
|
|
263
|
-
};
|
|
264
|
-
return buildStateChangeData({
|
|
265
|
-
kind: "repair",
|
|
266
|
-
state: after,
|
|
267
|
-
after,
|
|
268
|
-
});
|
|
269
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import type { CogMutationResult, DomainAdminMutationResult, DomainMarketMutationResult, FieldMutationResult, RegisterDomainResult, ReputationMutationResult } from "../wallet/tx/index.js";
|
|
2
|
-
export declare function decimalOrNull(value: bigint | null | undefined): string | null;
|
|
3
|
-
export declare function buildRegisterResolvedJson(result: RegisterDomainResult): {
|
|
4
|
-
path: "root" | "subdomain";
|
|
5
|
-
parentDomainName: string | null;
|
|
6
|
-
sender: {
|
|
7
|
-
selector: string;
|
|
8
|
-
localIndex: number;
|
|
9
|
-
scriptPubKeyHex: string;
|
|
10
|
-
address: string;
|
|
11
|
-
};
|
|
12
|
-
economicEffect: {
|
|
13
|
-
kind: "treasury-payment" | "cog-burn";
|
|
14
|
-
amount: string | null;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export declare function buildDomainMarketResolvedJson(result: DomainMarketMutationResult, commandKind: "transfer" | "sell" | "unsell" | "buy"): {
|
|
18
|
-
buyer: {
|
|
19
|
-
selector: string;
|
|
20
|
-
localIndex: number;
|
|
21
|
-
scriptPubKeyHex: string;
|
|
22
|
-
address: string;
|
|
23
|
-
} | null;
|
|
24
|
-
seller: {
|
|
25
|
-
scriptPubKeyHex: string;
|
|
26
|
-
address: string | null;
|
|
27
|
-
} | null;
|
|
28
|
-
sender?: undefined;
|
|
29
|
-
recipient?: undefined;
|
|
30
|
-
economicEffect?: undefined;
|
|
31
|
-
} | {
|
|
32
|
-
sender: {
|
|
33
|
-
selector: string;
|
|
34
|
-
localIndex: number;
|
|
35
|
-
scriptPubKeyHex: string;
|
|
36
|
-
address: string;
|
|
37
|
-
};
|
|
38
|
-
recipient: {
|
|
39
|
-
scriptPubKeyHex: string;
|
|
40
|
-
address: string | null;
|
|
41
|
-
opaque: boolean;
|
|
42
|
-
} | null;
|
|
43
|
-
economicEffect: {
|
|
44
|
-
kind: "ownership-transfer";
|
|
45
|
-
clearsListing: boolean;
|
|
46
|
-
listedPriceCogtoshi?: undefined;
|
|
47
|
-
} | {
|
|
48
|
-
kind: "listing-set" | "listing-clear";
|
|
49
|
-
listedPriceCogtoshi: string;
|
|
50
|
-
clearsListing?: undefined;
|
|
51
|
-
};
|
|
52
|
-
buyer?: undefined;
|
|
53
|
-
seller?: undefined;
|
|
54
|
-
} | null;
|
|
55
|
-
export declare function buildCogResolvedJson(result: CogMutationResult, commandKind: "send" | "claim" | "reclaim" | "cog-lock"): {
|
|
56
|
-
claimPath?: import("../wallet/tx/cog.js").CogResolvedClaimPath | null | undefined;
|
|
57
|
-
sender: {
|
|
58
|
-
selector: string;
|
|
59
|
-
localIndex: number;
|
|
60
|
-
scriptPubKeyHex: string;
|
|
61
|
-
address: string;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
export declare function buildDomainAdminResolvedJson(result: DomainAdminMutationResult): {
|
|
65
|
-
sender: {
|
|
66
|
-
selector: string;
|
|
67
|
-
localIndex: number;
|
|
68
|
-
scriptPubKeyHex: string;
|
|
69
|
-
address: string;
|
|
70
|
-
};
|
|
71
|
-
target: {
|
|
72
|
-
scriptPubKeyHex: string;
|
|
73
|
-
address: string | null;
|
|
74
|
-
opaque: boolean;
|
|
75
|
-
} | null;
|
|
76
|
-
effect: {
|
|
77
|
-
kind: "endpoint-set";
|
|
78
|
-
byteLength: number;
|
|
79
|
-
} | {
|
|
80
|
-
kind: "endpoint-clear" | "delegate-set" | "delegate-clear" | "miner-set" | "miner-clear" | "canonicalize-owner";
|
|
81
|
-
byteLength?: undefined;
|
|
82
|
-
};
|
|
83
|
-
} | null;
|
|
84
|
-
export declare function buildFieldResolvedJson(result: FieldMutationResult): {
|
|
85
|
-
sender: {
|
|
86
|
-
selector: string;
|
|
87
|
-
localIndex: number;
|
|
88
|
-
scriptPubKeyHex: string;
|
|
89
|
-
address: string;
|
|
90
|
-
};
|
|
91
|
-
path: import("../wallet/tx/field.js").FieldResolvedPath;
|
|
92
|
-
value: {
|
|
93
|
-
format: number;
|
|
94
|
-
byteLength: number;
|
|
95
|
-
} | null;
|
|
96
|
-
effect: {
|
|
97
|
-
kind: "create-empty-field" | "write-field-value" | "clear-field-value";
|
|
98
|
-
burnCogtoshi: "0" | "1" | "100";
|
|
99
|
-
};
|
|
100
|
-
} | null;
|
|
101
|
-
export declare function buildReputationResolvedJson(result: ReputationMutationResult): {
|
|
102
|
-
sender: {
|
|
103
|
-
selector: string;
|
|
104
|
-
localIndex: number;
|
|
105
|
-
scriptPubKeyHex: string;
|
|
106
|
-
address: string;
|
|
107
|
-
};
|
|
108
|
-
effect: {
|
|
109
|
-
kind: "give-support" | "revoke-support";
|
|
110
|
-
burnCogtoshi: string;
|
|
111
|
-
};
|
|
112
|
-
review: {
|
|
113
|
-
included: boolean;
|
|
114
|
-
byteLength: number | null;
|
|
115
|
-
};
|
|
116
|
-
selfStake: boolean;
|
|
117
|
-
} | null;
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
export function decimalOrNull(value) {
|
|
2
|
-
return value === null || value === undefined ? null : value.toString();
|
|
3
|
-
}
|
|
4
|
-
function buildResolvedSenderJson(sender) {
|
|
5
|
-
return {
|
|
6
|
-
selector: sender.selector,
|
|
7
|
-
localIndex: sender.localIndex,
|
|
8
|
-
scriptPubKeyHex: sender.scriptPubKeyHex,
|
|
9
|
-
address: sender.address,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
function buildScriptTargetJson(target) {
|
|
13
|
-
return target === null || target === undefined
|
|
14
|
-
? null
|
|
15
|
-
: {
|
|
16
|
-
scriptPubKeyHex: target.scriptPubKeyHex,
|
|
17
|
-
address: target.address,
|
|
18
|
-
opaque: target.opaque,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export function buildRegisterResolvedJson(result) {
|
|
22
|
-
return {
|
|
23
|
-
path: result.resolved.path,
|
|
24
|
-
parentDomainName: result.resolved.parentDomainName,
|
|
25
|
-
sender: buildResolvedSenderJson(result.resolved.sender),
|
|
26
|
-
economicEffect: {
|
|
27
|
-
kind: result.resolved.economicEffect.kind,
|
|
28
|
-
amount: decimalOrNull(result.resolved.economicEffect.amount),
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export function buildDomainMarketResolvedJson(result, commandKind) {
|
|
33
|
-
if (commandKind === "buy") {
|
|
34
|
-
return {
|
|
35
|
-
buyer: result.resolvedBuyer === null || result.resolvedBuyer === undefined
|
|
36
|
-
? null
|
|
37
|
-
: buildResolvedSenderJson(result.resolvedBuyer),
|
|
38
|
-
seller: result.resolvedSeller === null || result.resolvedSeller === undefined
|
|
39
|
-
? null
|
|
40
|
-
: {
|
|
41
|
-
scriptPubKeyHex: result.resolvedSeller.scriptPubKeyHex,
|
|
42
|
-
address: result.resolvedSeller.address,
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
if (result.resolved === null || result.resolved === undefined) {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
sender: buildResolvedSenderJson(result.resolved.sender),
|
|
51
|
-
recipient: buildScriptTargetJson(result.resolved.recipient),
|
|
52
|
-
economicEffect: result.resolved.economicEffect.kind === "ownership-transfer"
|
|
53
|
-
? {
|
|
54
|
-
kind: result.resolved.economicEffect.kind,
|
|
55
|
-
clearsListing: result.resolved.economicEffect.clearsListing,
|
|
56
|
-
}
|
|
57
|
-
: {
|
|
58
|
-
kind: result.resolved.economicEffect.kind,
|
|
59
|
-
listedPriceCogtoshi: result.resolved.economicEffect.listedPriceCogtoshi,
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
export function buildCogResolvedJson(result, commandKind) {
|
|
64
|
-
return {
|
|
65
|
-
sender: buildResolvedSenderJson(result.resolved.sender),
|
|
66
|
-
...(commandKind === "claim" || commandKind === "reclaim"
|
|
67
|
-
? { claimPath: result.resolved.claimPath }
|
|
68
|
-
: {}),
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
export function buildDomainAdminResolvedJson(result) {
|
|
72
|
-
if (result.resolved === null || result.resolved === undefined) {
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
return {
|
|
76
|
-
sender: buildResolvedSenderJson(result.resolved.sender),
|
|
77
|
-
target: buildScriptTargetJson(result.resolved.target),
|
|
78
|
-
effect: result.resolved.effect.kind === "endpoint-set"
|
|
79
|
-
? {
|
|
80
|
-
kind: result.resolved.effect.kind,
|
|
81
|
-
byteLength: result.resolved.effect.byteLength,
|
|
82
|
-
}
|
|
83
|
-
: {
|
|
84
|
-
kind: result.resolved.effect.kind,
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
export function buildFieldResolvedJson(result) {
|
|
89
|
-
if (result.resolved === null || result.resolved === undefined) {
|
|
90
|
-
return null;
|
|
91
|
-
}
|
|
92
|
-
return {
|
|
93
|
-
sender: buildResolvedSenderJson(result.resolved.sender),
|
|
94
|
-
path: result.resolved.path,
|
|
95
|
-
value: result.resolved.value === null
|
|
96
|
-
? null
|
|
97
|
-
: {
|
|
98
|
-
format: result.resolved.value.format,
|
|
99
|
-
byteLength: result.resolved.value.byteLength,
|
|
100
|
-
},
|
|
101
|
-
effect: {
|
|
102
|
-
kind: result.resolved.effect.kind,
|
|
103
|
-
burnCogtoshi: result.resolved.effect.burnCogtoshi,
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
export function buildReputationResolvedJson(result) {
|
|
108
|
-
if (result.resolved === null || result.resolved === undefined) {
|
|
109
|
-
return null;
|
|
110
|
-
}
|
|
111
|
-
return {
|
|
112
|
-
sender: buildResolvedSenderJson(result.resolved.sender),
|
|
113
|
-
effect: {
|
|
114
|
-
kind: result.resolved.effect.kind,
|
|
115
|
-
burnCogtoshi: result.resolved.effect.burnCogtoshi,
|
|
116
|
-
},
|
|
117
|
-
review: {
|
|
118
|
-
included: result.resolved.review.included,
|
|
119
|
-
byteLength: result.resolved.review.byteLength,
|
|
120
|
-
},
|
|
121
|
-
selfStake: result.resolved.selfStake,
|
|
122
|
-
};
|
|
123
|
-
}
|