@kynesyslabs/demosdk 2.12.2 → 4.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 (81) hide show
  1. package/build/bridge/nativeBridge.js +1 -0
  2. package/build/bridge/nativeBridge.js.map +1 -1
  3. package/build/bridge/nativeBridgeTypes.d.ts +4 -3
  4. package/build/bridge/nativeBridgeTypes.js.map +1 -1
  5. package/build/d402/client/types.d.ts +6 -3
  6. package/build/d402/server/D402Server.d.ts +25 -0
  7. package/build/d402/server/D402Server.js +63 -2
  8. package/build/d402/server/D402Server.js.map +1 -1
  9. package/build/d402/server/middleware.d.ts +7 -4
  10. package/build/d402/server/middleware.js.map +1 -1
  11. package/build/d402/server/types.d.ts +15 -7
  12. package/build/denomination/conversion.test.js +1 -1
  13. package/build/denomination/conversion.test.js.map +1 -1
  14. package/build/denomination/index.d.ts +3 -0
  15. package/build/denomination/index.js +6 -0
  16. package/build/denomination/index.js.map +1 -1
  17. package/build/denomination/networkInfo.d.ts +69 -0
  18. package/build/denomination/networkInfo.js +38 -0
  19. package/build/denomination/networkInfo.js.map +1 -0
  20. package/build/denomination/networkInfo.test.d.ts +1 -0
  21. package/build/denomination/networkInfo.test.js +28 -0
  22. package/build/denomination/networkInfo.test.js.map +1 -0
  23. package/build/denomination/roundTripHash.test.d.ts +1 -0
  24. package/build/denomination/roundTripHash.test.js +231 -0
  25. package/build/denomination/roundTripHash.test.js.map +1 -0
  26. package/build/denomination/serializerGate.d.ts +46 -0
  27. package/build/denomination/serializerGate.js +283 -0
  28. package/build/denomination/serializerGate.js.map +1 -0
  29. package/build/denomination/serializerGate.test.d.ts +1 -0
  30. package/build/denomination/serializerGate.test.js +255 -0
  31. package/build/denomination/serializerGate.test.js.map +1 -0
  32. package/build/escrow/EscrowTransaction.d.ts +36 -5
  33. package/build/escrow/EscrowTransaction.js +91 -10
  34. package/build/escrow/EscrowTransaction.js.map +1 -1
  35. package/build/ipfs/IPFSOperations.d.ts +37 -10
  36. package/build/ipfs/IPFSOperations.js +38 -8
  37. package/build/ipfs/IPFSOperations.js.map +1 -1
  38. package/build/storage/StorageProgram.d.ts +16 -8
  39. package/build/storage/StorageProgram.js +16 -8
  40. package/build/storage/StorageProgram.js.map +1 -1
  41. package/build/tlsnotary/TLSNotaryService.d.ts +19 -8
  42. package/build/tlsnotary/TLSNotaryService.js +22 -7
  43. package/build/tlsnotary/TLSNotaryService.js.map +1 -1
  44. package/build/tlsnotary/helpers.d.ts +11 -5
  45. package/build/tlsnotary/helpers.js +17 -5
  46. package/build/tlsnotary/helpers.js.map +1 -1
  47. package/build/types/blockchain/CustomCharges.d.ts +28 -16
  48. package/build/types/blockchain/CustomCharges.js +15 -5
  49. package/build/types/blockchain/CustomCharges.js.map +1 -1
  50. package/build/types/blockchain/GCREdit.d.ts +26 -2
  51. package/build/types/blockchain/NetworkParameters.d.ts +33 -0
  52. package/build/types/blockchain/Transaction.d.ts +14 -1
  53. package/build/types/blockchain/Transaction.js.map +1 -1
  54. package/build/types/blockchain/TransactionSubtypes/D402PaymentTransaction.d.ts +8 -3
  55. package/build/types/blockchain/TransactionSubtypes/StorageProgramTransaction.d.ts +6 -5
  56. package/build/types/blockchain/TransactionSubtypes/StorageProgramTransaction.js +15 -3
  57. package/build/types/blockchain/TransactionSubtypes/StorageProgramTransaction.js.map +1 -1
  58. package/build/types/blockchain/TxFee.d.ts +33 -3
  59. package/build/types/blockchain/address.d.ts +23 -0
  60. package/build/types/blockchain/rawTransaction.d.ts +20 -4
  61. package/build/types/blockchain/statusNative.d.ts +9 -1
  62. package/build/types/bridge/bridgeTradePayload.d.ts +1 -1
  63. package/build/types/gls/StateChange.d.ts +29 -3
  64. package/build/types/native/INativePayload.d.ts +6 -1
  65. package/build/wallet/Wallet.d.ts +27 -1
  66. package/build/wallet/Wallet.js +30 -17
  67. package/build/wallet/Wallet.js.map +1 -1
  68. package/build/websdk/DemosTokens.js +2 -0
  69. package/build/websdk/DemosTokens.js.map +1 -1
  70. package/build/websdk/DemosTransactions.d.ts +30 -4
  71. package/build/websdk/DemosTransactions.js +88 -9
  72. package/build/websdk/DemosTransactions.js.map +1 -1
  73. package/build/websdk/GCRGeneration.d.ts +10 -2
  74. package/build/websdk/GCRGeneration.js +30 -14
  75. package/build/websdk/GCRGeneration.js.map +1 -1
  76. package/build/websdk/demosclass.d.ts +152 -23
  77. package/build/websdk/demosclass.js +308 -38
  78. package/build/websdk/demosclass.js.map +1 -1
  79. package/build/websdk/utils/skeletons.js +1 -0
  80. package/build/websdk/utils/skeletons.js.map +1 -1
  81. package/package.json +1 -1
@@ -0,0 +1,231 @@
1
+ import { describe, test, expect } from "@jest/globals";
2
+ import { serializeTransactionContent } from "./serializerGate.js";
3
+ import { demToOs, parseOsString, toOsString } from "./conversion.js";
4
+ // REVIEW: P4 commit 4 — load-bearing round-trip hash equality. The
5
+ // test inlines the node's `serializeTransactionContent` algorithm
6
+ // (verbatim port of `node/src/forks/serializerGate.ts`) so the SDK's
7
+ // implementation is asserted against the canonical node bytes
8
+ // without a cross-repo runtime dependency.
9
+ //
10
+ // If this test breaks, the SDK has produced bytes the node will
11
+ // reject with an InvalidSignature — STOP and triage before shipping.
12
+ /**
13
+ * Verbatim port of the node's `toOsBigint` from
14
+ * `node/src/forks/serializerGate.ts:41`. Kept inline so this test
15
+ * fails the day the node's coercion semantics drift, instead of
16
+ * silently passing against a stale fixture.
17
+ */
18
+ function nodeToOsBigint(value) {
19
+ if (typeof value === "bigint") {
20
+ return value;
21
+ }
22
+ if (typeof value === "string") {
23
+ return parseOsString(value);
24
+ }
25
+ return demToOs(value);
26
+ }
27
+ /**
28
+ * Verbatim port of the node's `transformToOsTransactionContent` from
29
+ * `node/src/forks/serializerGate.ts:73`. Note the deliberate scope:
30
+ * the node only transforms top-level `amount` and `transaction_fee.*`.
31
+ * It does **not** walk `gcr_edits[]`. The SDK's serializer is the
32
+ * source of truth for that array — fixtures here therefore arrive
33
+ * with gcr_edits already in OS-string shape.
34
+ */
35
+ function nodeTransformToOsTransactionContent(content) {
36
+ const transformed = { ...content };
37
+ if (typeof content.amount !== "undefined" && content.amount !== null) {
38
+ const osAmount = nodeToOsBigint(content.amount);
39
+ transformed.amount = toOsString(osAmount);
40
+ }
41
+ if (content.transaction_fee) {
42
+ const fee = content.transaction_fee;
43
+ transformed.transaction_fee = {
44
+ network_fee: toOsString(nodeToOsBigint(fee.network_fee)),
45
+ rpc_fee: toOsString(nodeToOsBigint(fee.rpc_fee)),
46
+ additional_fee: toOsString(nodeToOsBigint(fee.additional_fee)),
47
+ rpc_address: fee.rpc_address ?? null,
48
+ };
49
+ }
50
+ return transformed;
51
+ }
52
+ /**
53
+ * Verbatim port of the node's `serializeTransactionContent` from
54
+ * `node/src/forks/serializerGate.ts:124`. The block-height /
55
+ * `isForkActive` check is collapsed into a boolean parameter for the
56
+ * test — the SDK doesn't see blocks, the node does, but at the
57
+ * post-fork branch both produce the same bytes.
58
+ */
59
+ function nodeSerializeTransactionContent(content, isPostFork) {
60
+ if (isPostFork) {
61
+ return JSON.stringify(nodeTransformToOsTransactionContent(content));
62
+ }
63
+ return JSON.stringify(content);
64
+ }
65
+ /**
66
+ * Build a transaction-content fixture in canonical key order with
67
+ * gcr_edits already populated as the SDK would emit them post-fork
68
+ * (`amount` is OS string for `balance` and `escrow.data.amount`; the
69
+ * `nonce` edit's `amount` stays a counter number). This matches what
70
+ * `GCRGeneration.generate` produces against a post-fork node.
71
+ */
72
+ function buildPostForkShapedFixture() {
73
+ const gcr_edits = [
74
+ {
75
+ type: "balance",
76
+ isRollback: false,
77
+ operation: "remove",
78
+ account: "0xsender",
79
+ amount: "100000000001", // sub-DEM-precision OS string
80
+ txhash: "",
81
+ },
82
+ {
83
+ type: "nonce",
84
+ isRollback: false,
85
+ operation: "add",
86
+ account: "0xsender",
87
+ amount: 1,
88
+ txhash: "",
89
+ },
90
+ {
91
+ type: "balance",
92
+ isRollback: false,
93
+ operation: "add",
94
+ account: "0xreceiver",
95
+ amount: "100000000001",
96
+ txhash: "",
97
+ },
98
+ {
99
+ type: "escrow",
100
+ operation: "deposit",
101
+ account: "0xescrow",
102
+ data: {
103
+ sender: "0xsender",
104
+ platform: "twitter",
105
+ username: "@bob",
106
+ amount: "100000000001",
107
+ expiryDays: 30,
108
+ },
109
+ txhash: "",
110
+ isRollback: false,
111
+ },
112
+ ];
113
+ return {
114
+ type: "native",
115
+ from: "0xsender",
116
+ to: "0xreceiver",
117
+ amount: "100000000001", // sub-DEM-precision OS string
118
+ data: [
119
+ "native",
120
+ {
121
+ nativeOperation: "send",
122
+ args: ["0xreceiver", "100000000001"],
123
+ },
124
+ ],
125
+ nonce: 1,
126
+ timestamp: 1700000000000,
127
+ transaction_fee: {
128
+ network_fee: "1000000000",
129
+ rpc_fee: "0",
130
+ additional_fee: "0",
131
+ rpc_address: null,
132
+ },
133
+ from_ed25519_address: "0xsender",
134
+ gcr_edits,
135
+ };
136
+ }
137
+ describe("round-trip hash equality — SDK post-fork == node post-fork", () => {
138
+ test("OS-string fixture: SDK and node produce identical bytes", () => {
139
+ const content = buildPostForkShapedFixture();
140
+ const sdkBytes = serializeTransactionContent(content, true);
141
+ const nodeBytes = nodeSerializeTransactionContent(content, true);
142
+ expect(sdkBytes).toBe(nodeBytes);
143
+ });
144
+ test("legacy DEM-number fixture: post-fork SDK matches node post-fork output", () => {
145
+ // Build a fixture where the user has populated content with
146
+ // legacy DEM numbers (the v2 callers' pattern). Both SDK and
147
+ // node will normalise the top-level `amount` and
148
+ // `transaction_fee.*` to OS strings; the SDK additionally
149
+ // walks gcr_edits — but the node serializer leaves gcr_edits
150
+ // alone, so to get byte equality the fixture must already
151
+ // carry the post-fork-shaped edits. (This is exactly the SDK
152
+ // contract: gcr_edits are the SDK's responsibility.)
153
+ const content = buildPostForkShapedFixture();
154
+ // Override the wire-sensitive fields with legacy DEM numbers.
155
+ content.amount = 100;
156
+ content.transaction_fee = {
157
+ network_fee: 1,
158
+ rpc_fee: 0,
159
+ additional_fee: 0,
160
+ rpc_address: null,
161
+ };
162
+ const sdkBytes = serializeTransactionContent(content, true);
163
+ const nodeBytes = nodeSerializeTransactionContent(content, true);
164
+ expect(sdkBytes).toBe(nodeBytes);
165
+ });
166
+ test("bigint amount: SDK normalises before stringify; node sees the SDK output", () => {
167
+ // The node never sees a raw bigint on the wire (JSON has no
168
+ // bigint). But the SDK's internal carrier is bigint, and the
169
+ // serializer must coerce to OS string before JSON.stringify.
170
+ // Verify both produce the same canonical output for an
171
+ // OS-string fixture that started from a bigint input.
172
+ const sourceBigintOs = 100000000001n;
173
+ const content = buildPostForkShapedFixture();
174
+ content.amount = toOsString(sourceBigintOs);
175
+ const sdkBytes = serializeTransactionContent(content, true);
176
+ const nodeBytes = nodeSerializeTransactionContent(content, true);
177
+ expect(sdkBytes).toBe(nodeBytes);
178
+ const parsed = JSON.parse(sdkBytes);
179
+ expect(parsed.amount).toBe("100000000001");
180
+ });
181
+ test("non-canonical OS-string normalises identically on both sides", () => {
182
+ const content = buildPostForkShapedFixture();
183
+ content.amount = "00100";
184
+ const sdkBytes = serializeTransactionContent(content, true);
185
+ const nodeBytes = nodeSerializeTransactionContent(content, true);
186
+ expect(sdkBytes).toBe(nodeBytes);
187
+ const parsed = JSON.parse(sdkBytes);
188
+ expect(parsed.amount).toBe("100");
189
+ });
190
+ test("pre-fork branch: SDK and node both stringify content as-is", () => {
191
+ // For pre-fork content with no internal bigints / OS strings,
192
+ // both branches produce `JSON.stringify(content)` verbatim.
193
+ const content = {
194
+ type: "native",
195
+ from: "0xsender",
196
+ to: "0xreceiver",
197
+ amount: 100,
198
+ data: [
199
+ "native",
200
+ {
201
+ nativeOperation: "send",
202
+ args: ["0xreceiver", 100],
203
+ },
204
+ ],
205
+ nonce: 1,
206
+ timestamp: 1700000000000,
207
+ transaction_fee: {
208
+ network_fee: 1,
209
+ rpc_fee: 0,
210
+ additional_fee: 0,
211
+ rpc_address: null,
212
+ },
213
+ from_ed25519_address: "0xsender",
214
+ gcr_edits: [
215
+ {
216
+ type: "balance",
217
+ isRollback: false,
218
+ operation: "remove",
219
+ account: "0xsender",
220
+ amount: 100,
221
+ txhash: "",
222
+ },
223
+ ],
224
+ };
225
+ const sdkBytes = serializeTransactionContent(content, false);
226
+ const nodeBytes = nodeSerializeTransactionContent(content, false);
227
+ expect(sdkBytes).toBe(nodeBytes);
228
+ expect(sdkBytes).toBe(JSON.stringify(content));
229
+ });
230
+ });
231
+ //# sourceMappingURL=roundTripHash.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roundTripHash.test.js","sourceRoot":"","sources":["../../../src/denomination/roundTripHash.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAEtD,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAIjE,mEAAmE;AACnE,kEAAkE;AAClE,qEAAqE;AACrE,8DAA8D;AAC9D,2CAA2C;AAC3C,EAAE;AACF,gEAAgE;AAChE,qEAAqE;AAErE;;;;;GAKG;AACH,SAAS,cAAc,CAAC,KAA+B;IACnD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAA;IAChB,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,aAAa,CAAC,KAAK,CAAC,CAAA;IAC/B,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAA;AACzB,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,mCAAmC,CACxC,OAA2B;IAE3B,MAAM,WAAW,GAAG,EAAE,GAAG,OAAO,EAAwB,CAAA;IAExD,IAAI,OAAO,OAAO,CAAC,MAAM,KAAK,WAAW,IAAI,OAAO,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;QACnE,MAAM,QAA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AAM,EAAE,GAAG;oBACX,MAAM,EAAE,EAAE;iBACb;aACJ;SACJ,CAAA;QACD,MAAM,QAAQ,GAAG,2BAA2B,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QAC5D,MAAM,SAAS,GAAG,+BAA+B,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACjE,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAChC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IAClD,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Dual-format transaction-content serializer.
3
+ *
4
+ * This is the SDK-side mirror of the node's `forks/serializerGate.ts`. It
5
+ * stringifies a `TransactionContent` for hashing/signing and chooses
6
+ * between two wire shapes based on the connected node's fork status:
7
+ *
8
+ * - **Pre-fork**: legacy DEM-`number` JSON. Any internal `bigint` OS
9
+ * amounts are coerced back to JS `number` in DEM via integer division
10
+ * by `OS_PER_DEM`, and the rest of the content is passed through
11
+ * `JSON.stringify` verbatim.
12
+ * - **Post-fork**: OS-decimal-string JSON. The top-level `amount`,
13
+ * every `transaction_fee.*` field, and the per-entry `amount` field
14
+ * on every `gcr_edits[]` entry that carries one (`balance` and
15
+ * `escrow.data.amount`) are converted to canonical OS strings. All
16
+ * other fields are passed through verbatim.
17
+ *
18
+ * Property order is consensus-critical: the node hashes the result of
19
+ * `JSON.stringify`, which serializes keys in insertion order. The
20
+ * implementation uses object spread (`{ ...content, amount, ... }`) which
21
+ * preserves the source's insertion order and overwrites the
22
+ * wire-sensitive fields in place without reordering them.
23
+ *
24
+ * The branching is by node fork status (a boolean), not by block height
25
+ * — the SDK doesn't see blocks. Detection of that boolean lives in
26
+ * `Demos.getNetworkInfo()` (see P4 commit 3) and is cached per-instance.
27
+ *
28
+ * @module denomination/serializerGate
29
+ */
30
+ import type { TransactionContent } from "../types/blockchain/Transaction";
31
+ /**
32
+ * Serialize transaction content for hashing/signing.
33
+ *
34
+ * This is the load-bearing wire boundary: the bytes returned here are
35
+ * fed into `sha256` and the resulting hash is what the keypair signs.
36
+ * The receiving node hashes its in-memory `TransactionContent` through
37
+ * its own `serializerGate.serializeTransactionContent`; if our bytes
38
+ * differ from the node's bytes the signature will not validate.
39
+ *
40
+ * @param content - The transaction content to serialize.
41
+ * @param isPostFork - `true` when the connected node has activated the
42
+ * `osDenomination` fork. When `false` (pre-fork or unknown), the
43
+ * legacy DEM-number wire shape is emitted.
44
+ * @returns Canonical JSON string for hashing.
45
+ */
46
+ export declare function serializeTransactionContent(content: TransactionContent, isPostFork: boolean): string;
@@ -0,0 +1,283 @@
1
+ /**
2
+ * Dual-format transaction-content serializer.
3
+ *
4
+ * This is the SDK-side mirror of the node's `forks/serializerGate.ts`. It
5
+ * stringifies a `TransactionContent` for hashing/signing and chooses
6
+ * between two wire shapes based on the connected node's fork status:
7
+ *
8
+ * - **Pre-fork**: legacy DEM-`number` JSON. Any internal `bigint` OS
9
+ * amounts are coerced back to JS `number` in DEM via integer division
10
+ * by `OS_PER_DEM`, and the rest of the content is passed through
11
+ * `JSON.stringify` verbatim.
12
+ * - **Post-fork**: OS-decimal-string JSON. The top-level `amount`,
13
+ * every `transaction_fee.*` field, and the per-entry `amount` field
14
+ * on every `gcr_edits[]` entry that carries one (`balance` and
15
+ * `escrow.data.amount`) are converted to canonical OS strings. All
16
+ * other fields are passed through verbatim.
17
+ *
18
+ * Property order is consensus-critical: the node hashes the result of
19
+ * `JSON.stringify`, which serializes keys in insertion order. The
20
+ * implementation uses object spread (`{ ...content, amount, ... }`) which
21
+ * preserves the source's insertion order and overwrites the
22
+ * wire-sensitive fields in place without reordering them.
23
+ *
24
+ * The branching is by node fork status (a boolean), not by block height
25
+ * — the SDK doesn't see blocks. Detection of that boolean lives in
26
+ * `Demos.getNetworkInfo()` (see P4 commit 3) and is cached per-instance.
27
+ *
28
+ * @module denomination/serializerGate
29
+ */
30
+ import { OS_PER_DEM } from "./constants.js";
31
+ import { demToOs, parseOsString, toOsString } from "./conversion.js";
32
+ // REVIEW: P4 commit 2 — load-bearing wire boundary. Mirrors the node's
33
+ // `serializeTransactionContent` (forks/serializerGate.ts) byte for byte
34
+ // for post-fork output; pre-fork output is identical to the legacy
35
+ // `JSON.stringify(content)` path the SDK has used since v1.
36
+ /**
37
+ * Coerce a wire-format amount/fee value to an OS `bigint`.
38
+ *
39
+ * Accepts:
40
+ * - `bigint`: returned as-is.
41
+ * - `string`: parsed as a canonical OS decimal integer string (post-fork
42
+ * wire shape).
43
+ * - `number`: treated as DEM (pre-fork wire shape) and converted to OS.
44
+ *
45
+ * Throws on un-coercible inputs (non-numeric strings, fractional numbers
46
+ * smaller than 1 OS, negative results — all surfaced by the underlying
47
+ * `denomination` helpers).
48
+ *
49
+ * @internal
50
+ */
51
+ function toOsBigint(value) {
52
+ if (typeof value === "bigint") {
53
+ return value;
54
+ }
55
+ if (typeof value === "string") {
56
+ return parseOsString(value);
57
+ }
58
+ return demToOs(value);
59
+ }
60
+ /**
61
+ * Coerce an OS-bigint back to a DEM JS `number` for legacy wire shape.
62
+ *
63
+ * Used by the pre-fork branch when an internal bigint amount needs to go
64
+ * onto the wire as the legacy DEM-number. Performs an integer division
65
+ * by `OS_PER_DEM`; the caller is responsible for ensuring the input has
66
+ * no sub-DEM precision (the public-API guard in P4 commit 3 enforces
67
+ * this before we get here).
68
+ *
69
+ * @internal
70
+ */
71
+ function osToDemNumber(os) {
72
+ return Number(os / OS_PER_DEM);
73
+ }
74
+ /**
75
+ * Normalise an `amount`/fee field for the **pre-fork** wire shape.
76
+ *
77
+ * - `bigint` (internal OS) → `number` (DEM, legacy wire).
78
+ * - `string` (post-fork OS) → `number` (DEM). This path is entered when
79
+ * a v3 caller has already produced post-fork-shaped content but the
80
+ * connected node turned out to be pre-fork. The serializer is the
81
+ * last chance to coerce.
82
+ * - `number` (legacy DEM) → returned unchanged.
83
+ *
84
+ * @internal
85
+ */
86
+ function toPreForkWireNumber(value) {
87
+ if (typeof value === "number")
88
+ return value;
89
+ return osToDemNumber(toOsBigint(value));
90
+ }
91
+ /**
92
+ * Normalise an `amount`/fee field for the **post-fork** wire shape.
93
+ *
94
+ * - `bigint` (internal OS) → canonical OS decimal string.
95
+ * - `number` (legacy DEM) → DEM-to-OS conversion → canonical OS string.
96
+ * - `string` → re-parsed and re-emitted as a canonical OS string. This
97
+ * normalises non-canonical shapes (`"00100"`, `" 100 "`) to `"100"`
98
+ * so the hash matches the node's `transformToOsTransactionContent`
99
+ * output.
100
+ *
101
+ * @internal
102
+ */
103
+ function toPostForkWireString(value) {
104
+ return toOsString(toOsBigint(value));
105
+ }
106
+ /**
107
+ * Walk a single `GCREdit` entry and rewrite its embedded amount fields
108
+ * for the post-fork wire shape. The two carriers we touch (per SPEC_P4
109
+ * §2.2) are:
110
+ *
111
+ * - `GCREditBalance.amount` — top-level numeric balance edit.
112
+ * - `GCREditEscrow.data.amount` — nested escrow deposit amount.
113
+ *
114
+ * Other variants (`nonce`, `assign`, `identity`, `smartContract`,
115
+ * `storageProgram`, `tlsnotary`, `validatorStake`,
116
+ * `networkUpgrade`, `networkUpgradeVote`) are passed through unchanged.
117
+ * `validatorStake.amount` is already a bigint-as-string by construction
118
+ * (see GCREdit.ts:258); we still re-parse and re-emit through
119
+ * `toPostForkWireString` so non-canonical inputs are normalised.
120
+ *
121
+ * Object spread preserves key order; the targeted overwrites do not
122
+ * change the position of any existing key.
123
+ *
124
+ * @internal
125
+ */
126
+ function transformEditPostFork(edit) {
127
+ if (edit.type === "balance") {
128
+ return {
129
+ ...edit,
130
+ amount: toPostForkWireString(edit.amount),
131
+ };
132
+ }
133
+ if (edit.type === "escrow") {
134
+ const data = edit.data ?? {};
135
+ if (typeof data.amount === "undefined" || data.amount === null) {
136
+ return edit;
137
+ }
138
+ return {
139
+ ...edit,
140
+ data: {
141
+ ...data,
142
+ amount: toPostForkWireString(data.amount),
143
+ },
144
+ };
145
+ }
146
+ if (edit.type === "validatorStake") {
147
+ // Already string-typed in the static type, but normalise anyway.
148
+ return {
149
+ ...edit,
150
+ amount: toPostForkWireString(edit.amount),
151
+ };
152
+ }
153
+ return edit;
154
+ }
155
+ /**
156
+ * Rewrite a single `GCREdit` for the **pre-fork** wire shape.
157
+ *
158
+ * Symmetric to {@link transformEditPostFork} but emits legacy DEM
159
+ * numbers. Used when SDK v3 callers have already populated edits with
160
+ * OS-strings/bigints (commit 1's widened types) but the connected node
161
+ * is pre-fork.
162
+ *
163
+ * @internal
164
+ */
165
+ function transformEditPreFork(edit) {
166
+ if (edit.type === "balance") {
167
+ return {
168
+ ...edit,
169
+ amount: toPreForkWireNumber(edit.amount),
170
+ };
171
+ }
172
+ if (edit.type === "escrow") {
173
+ const data = edit.data ?? {};
174
+ if (typeof data.amount === "undefined" || data.amount === null) {
175
+ return edit;
176
+ }
177
+ return {
178
+ ...edit,
179
+ data: {
180
+ ...data,
181
+ // Pre-fork escrow.data.amount was a JS number historically.
182
+ amount: toPreForkWireNumber(data.amount),
183
+ },
184
+ };
185
+ }
186
+ return edit;
187
+ }
188
+ /**
189
+ * Re-emit a `TransactionContent` with `amount`, `transaction_fee.*`, and
190
+ * each `gcr_edits[]` entry's amount fields encoded as canonical OS
191
+ * decimal strings.
192
+ *
193
+ * Property order is preserved by spreading the source content first and
194
+ * then overwriting the wire-sensitive fields in place. This is the
195
+ * post-fork branch's analogue to the node's
196
+ * `transformToOsTransactionContent`. The SDK additionally walks
197
+ * `gcr_edits[]` here because, unlike the node's serializer, the SDK is
198
+ * the source of truth for those entries — the node's serializer
199
+ * intentionally does not transform them.
200
+ *
201
+ * @internal
202
+ */
203
+ function transformToPostFork(content) {
204
+ const transformed = { ...content };
205
+ if (typeof content.amount !== "undefined" && content.amount !== null) {
206
+ transformed.amount = toPostForkWireString(content.amount);
207
+ }
208
+ if (content.transaction_fee) {
209
+ const fee = content.transaction_fee;
210
+ // PR-86 myc#19: spread the source fee object first so source
211
+ // insertion order is preserved (consensus-critical) and any
212
+ // extra fields the SDK doesn't know about pass through. Then
213
+ // overwrite the three known carriers in place — `{...fee, ...}`
214
+ // does not change the position of pre-existing keys.
215
+ transformed.transaction_fee = {
216
+ ...fee,
217
+ network_fee: toPostForkWireString(fee.network_fee),
218
+ rpc_fee: toPostForkWireString(fee.rpc_fee),
219
+ additional_fee: toPostForkWireString(fee.additional_fee),
220
+ };
221
+ }
222
+ if (Array.isArray(content.gcr_edits)) {
223
+ transformed.gcr_edits = content.gcr_edits.map(transformEditPostFork);
224
+ }
225
+ return transformed;
226
+ }
227
+ /**
228
+ * Re-emit a `TransactionContent` for the **pre-fork** wire shape.
229
+ *
230
+ * Coerces any `bigint` (internal) or `string` (post-fork-shaped)
231
+ * amount/fee fields back to JS `number` in DEM, walks `gcr_edits[]` to
232
+ * do the same, and otherwise passes the content through verbatim.
233
+ *
234
+ * Why this exists: SDK v3's internal arithmetic uses `bigint` OS even
235
+ * when talking to a pre-fork node. Without this normaliser the legacy
236
+ * wire would carry stringified bigints and break hash equality on the
237
+ * receiving side.
238
+ *
239
+ * @internal
240
+ */
241
+ function transformToPreFork(content) {
242
+ const transformed = { ...content };
243
+ if (typeof content.amount !== "undefined" && content.amount !== null) {
244
+ transformed.amount = toPreForkWireNumber(content.amount);
245
+ }
246
+ if (content.transaction_fee) {
247
+ const fee = content.transaction_fee;
248
+ // PR-86 myc#19: spread to preserve source key order; see the
249
+ // matching block in `transformToPostFork` for the rationale.
250
+ transformed.transaction_fee = {
251
+ ...fee,
252
+ network_fee: toPreForkWireNumber(fee.network_fee),
253
+ rpc_fee: toPreForkWireNumber(fee.rpc_fee),
254
+ additional_fee: toPreForkWireNumber(fee.additional_fee),
255
+ };
256
+ }
257
+ if (Array.isArray(content.gcr_edits)) {
258
+ transformed.gcr_edits = content.gcr_edits.map(transformEditPreFork);
259
+ }
260
+ return transformed;
261
+ }
262
+ /**
263
+ * Serialize transaction content for hashing/signing.
264
+ *
265
+ * This is the load-bearing wire boundary: the bytes returned here are
266
+ * fed into `sha256` and the resulting hash is what the keypair signs.
267
+ * The receiving node hashes its in-memory `TransactionContent` through
268
+ * its own `serializerGate.serializeTransactionContent`; if our bytes
269
+ * differ from the node's bytes the signature will not validate.
270
+ *
271
+ * @param content - The transaction content to serialize.
272
+ * @param isPostFork - `true` when the connected node has activated the
273
+ * `osDenomination` fork. When `false` (pre-fork or unknown), the
274
+ * legacy DEM-number wire shape is emitted.
275
+ * @returns Canonical JSON string for hashing.
276
+ */
277
+ export function serializeTransactionContent(content, isPostFork) {
278
+ if (isPostFork) {
279
+ return JSON.stringify(transformToPostFork(content));
280
+ }
281
+ return JSON.stringify(transformToPreFork(content));
282
+ }
283
+ //# sourceMappingURL=serializerGate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializerGate.js","sourceRoot":"","sources":["../../../src/denomination/serializerGate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAQH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEjE,uEAAuE;AACvE,wEAAwE;AACxE,mEAAmE;AACnE,4DAA4D;AAE5D;;;;;;;;;;;;;;GAcG;AACH,SAAS,UAAU,CAAC,KAA+B;IAC/C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAA;IAChB,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,aAAa,CAAC,KAAK,CAAC,CAAA;IAC/B,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAA;AACzB,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAS,aAAa,CAAC,EAAU;IAC7B,OAAO,MAAM,CAAC,EAAE,GAAG,UAAU,CAAC,CAAA;AAClC,C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