@umbra-privacy/sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +122 -0
  3. package/dist/addresses-Brzgurv_.d.ts +145 -0
  4. package/dist/addresses-D_0YAS6B.d.cts +145 -0
  5. package/dist/chunk-2Q75CQQJ.js +12 -0
  6. package/dist/chunk-2Q75CQQJ.js.map +1 -0
  7. package/dist/chunk-7QVYU63E.js +6 -0
  8. package/dist/chunk-7QVYU63E.js.map +1 -0
  9. package/dist/chunk-BM7N6N7E.js +1883 -0
  10. package/dist/chunk-BM7N6N7E.js.map +1 -0
  11. package/dist/chunk-GXKSUB2U.cjs +4416 -0
  12. package/dist/chunk-GXKSUB2U.cjs.map +1 -0
  13. package/dist/chunk-HOEXDXRC.cjs +792 -0
  14. package/dist/chunk-HOEXDXRC.cjs.map +1 -0
  15. package/dist/chunk-MDFSBU5W.cjs +2033 -0
  16. package/dist/chunk-MDFSBU5W.cjs.map +1 -0
  17. package/dist/chunk-MQY7HDIA.js +600 -0
  18. package/dist/chunk-MQY7HDIA.js.map +1 -0
  19. package/dist/chunk-MVKTV3FT.cjs +20 -0
  20. package/dist/chunk-MVKTV3FT.cjs.map +1 -0
  21. package/dist/chunk-PG2J6V6Y.js +4094 -0
  22. package/dist/chunk-PG2J6V6Y.js.map +1 -0
  23. package/dist/chunk-PK6SKIKE.cjs +8 -0
  24. package/dist/chunk-PK6SKIKE.cjs.map +1 -0
  25. package/dist/chunk-VEGLTTYQ.cjs +621 -0
  26. package/dist/chunk-VEGLTTYQ.cjs.map +1 -0
  27. package/dist/chunk-WVHQ46DD.js +758 -0
  28. package/dist/chunk-WVHQ46DD.js.map +1 -0
  29. package/dist/constants/index.cjs +316 -0
  30. package/dist/constants/index.cjs.map +1 -0
  31. package/dist/constants/index.d.cts +739 -0
  32. package/dist/constants/index.d.ts +739 -0
  33. package/dist/constants/index.js +193 -0
  34. package/dist/constants/index.js.map +1 -0
  35. package/dist/cryptography-BTGC72u-.d.cts +4809 -0
  36. package/dist/cryptography-BTGC72u-.d.ts +4809 -0
  37. package/dist/errors/index.cjs +141 -0
  38. package/dist/errors/index.cjs.map +1 -0
  39. package/dist/errors/index.d.cts +1415 -0
  40. package/dist/errors/index.d.ts +1415 -0
  41. package/dist/errors/index.js +4 -0
  42. package/dist/errors/index.js.map +1 -0
  43. package/dist/index-B9pDY73x.d.ts +12933 -0
  44. package/dist/index-CLj_zWSD.d.ts +235 -0
  45. package/dist/index-CX6_pIRS.d.cts +235 -0
  46. package/dist/index-D33yo0qB.d.cts +12933 -0
  47. package/dist/index.cjs +22464 -0
  48. package/dist/index.cjs.map +1 -0
  49. package/dist/index.d.cts +11694 -0
  50. package/dist/index.d.ts +11694 -0
  51. package/dist/index.js +22314 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/interfaces/index.cjs +4 -0
  54. package/dist/interfaces/index.cjs.map +1 -0
  55. package/dist/interfaces/index.d.cts +8 -0
  56. package/dist/interfaces/index.d.ts +8 -0
  57. package/dist/interfaces/index.js +3 -0
  58. package/dist/interfaces/index.js.map +1 -0
  59. package/dist/networks-C-orpSFW.d.ts +65 -0
  60. package/dist/networks-FxYERGD1.d.cts +65 -0
  61. package/dist/types/index.cjs +605 -0
  62. package/dist/types/index.cjs.map +1 -0
  63. package/dist/types/index.d.cts +1853 -0
  64. package/dist/types/index.d.ts +1853 -0
  65. package/dist/types/index.js +4 -0
  66. package/dist/types/index.js.map +1 -0
  67. package/dist/types-BBuELtY8.d.cts +495 -0
  68. package/dist/types-n-sHFcgr.d.ts +495 -0
  69. package/dist/utils/index.cjs +1295 -0
  70. package/dist/utils/index.cjs.map +1 -0
  71. package/dist/utils/index.d.cts +9559 -0
  72. package/dist/utils/index.d.ts +9559 -0
  73. package/dist/utils/index.js +6 -0
  74. package/dist/utils/index.js.map +1 -0
  75. package/dist/versions-D9PqsEvj.d.cts +173 -0
  76. package/dist/versions-D9PqsEvj.d.ts +173 -0
  77. package/package.json +151 -0
@@ -0,0 +1,4416 @@
1
+ 'use strict';
2
+
3
+ var chunkMVKTV3FT_cjs = require('./chunk-MVKTV3FT.cjs');
4
+ var chunkMDFSBU5W_cjs = require('./chunk-MDFSBU5W.cjs');
5
+ var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
6
+ var kit = require('@solana/kit');
7
+ var codama = require('@umbra-privacy/codama');
8
+ var sha2_js = require('@noble/hashes/sha2.js');
9
+
10
+ // src/common/converters/branded.ts
11
+ var ConversionError = class _ConversionError extends Error {
12
+ static {
13
+ chunkPK6SKIKE_cjs.__name(this, "ConversionError");
14
+ }
15
+ /**
16
+ * The original value that failed conversion.
17
+ * @public
18
+ */
19
+ sourceValue;
20
+ /**
21
+ * The type name of the source value (e.g., "number", "string", "Uint8Array").
22
+ * @public
23
+ */
24
+ sourceType;
25
+ /**
26
+ * The target branded type name (e.g., "U8", "U256LeBytes", "Bn254FieldElement").
27
+ * @public
28
+ */
29
+ targetType;
30
+ /**
31
+ * Human-readable explanation of why the conversion failed.
32
+ * @public
33
+ */
34
+ reason;
35
+ /**
36
+ * Creates a new ConversionError with structured metadata.
37
+ *
38
+ * @param message - A human-readable error message summarising the failure
39
+ * @param options - Structured details about the failed conversion
40
+ * @param options.sourceValue - The original value that could not be converted
41
+ * @param options.sourceType - The type name of the source value
42
+ * @param options.targetType - The branded type name that was the conversion target
43
+ * @param options.reason - A concise description of why the conversion was rejected
44
+ * @public
45
+ */
46
+ constructor(message, options) {
47
+ super(message);
48
+ this.name = "ConversionError";
49
+ this.sourceValue = options.sourceValue;
50
+ this.sourceType = options.sourceType;
51
+ this.targetType = options.targetType;
52
+ this.reason = options.reason;
53
+ Error.captureStackTrace(this, _ConversionError);
54
+ Object.setPrototypeOf(this, _ConversionError.prototype);
55
+ }
56
+ };
57
+ function getTypeName(value) {
58
+ if (value === null) {
59
+ return "null";
60
+ }
61
+ if (value === void 0) {
62
+ return "undefined";
63
+ }
64
+ if (value instanceof Uint8Array) {
65
+ return "Uint8Array";
66
+ }
67
+ if (value instanceof ArrayBuffer) {
68
+ return "ArrayBuffer";
69
+ }
70
+ if (value instanceof DataView) {
71
+ return "DataView";
72
+ }
73
+ if (Array.isArray(value)) {
74
+ return "Array";
75
+ }
76
+ return typeof value;
77
+ }
78
+ chunkPK6SKIKE_cjs.__name(getTypeName, "getTypeName");
79
+ function parseStringToBigInt(value, targetType) {
80
+ const trimmed = value.trim();
81
+ if (trimmed === "") {
82
+ throw new ConversionError(`Cannot convert empty string to ${targetType}`, {
83
+ sourceValue: value,
84
+ sourceType: "string",
85
+ targetType,
86
+ reason: "Empty string is not a valid number"
87
+ });
88
+ }
89
+ try {
90
+ if (trimmed.toLowerCase().startsWith("0x")) {
91
+ return BigInt(trimmed);
92
+ }
93
+ if (trimmed.toLowerCase().startsWith("0b")) {
94
+ return BigInt(trimmed);
95
+ }
96
+ if (trimmed.toLowerCase().startsWith("0o")) {
97
+ return BigInt(trimmed);
98
+ }
99
+ if (/^[0-9a-fA-F]+$/.test(trimmed) && /[a-fA-F]/.test(trimmed)) {
100
+ return BigInt(`0x${trimmed}`);
101
+ }
102
+ return BigInt(trimmed);
103
+ } catch {
104
+ throw new ConversionError(`Cannot parse string "${value}" to ${targetType}`, {
105
+ sourceValue: value,
106
+ sourceType: "string",
107
+ targetType,
108
+ reason: "Invalid number format"
109
+ });
110
+ }
111
+ }
112
+ chunkPK6SKIKE_cjs.__name(parseStringToBigInt, "parseStringToBigInt");
113
+ function toBigIntValue(value, targetType) {
114
+ if (typeof value === "bigint") {
115
+ return value;
116
+ }
117
+ if (typeof value === "number") {
118
+ if (!Number.isFinite(value)) {
119
+ throw new ConversionError(`Cannot convert ${String(value)} to ${targetType}`, {
120
+ sourceValue: value,
121
+ sourceType: "number",
122
+ targetType,
123
+ reason: "Value must be a finite number"
124
+ });
125
+ }
126
+ if (!Number.isInteger(value)) {
127
+ throw new ConversionError(`Cannot convert ${String(value)} to ${targetType}`, {
128
+ sourceValue: value,
129
+ sourceType: "number",
130
+ targetType,
131
+ reason: "Value must be an integer"
132
+ });
133
+ }
134
+ return BigInt(value);
135
+ }
136
+ if (typeof value === "string") {
137
+ return parseStringToBigInt(value, targetType);
138
+ }
139
+ if (value instanceof Uint8Array) {
140
+ return bytesToBigInt(value);
141
+ }
142
+ if (value instanceof ArrayBuffer) {
143
+ return bytesToBigInt(new Uint8Array(value));
144
+ }
145
+ if (value instanceof DataView) {
146
+ return bytesToBigInt(new Uint8Array(value.buffer, value.byteOffset, value.byteLength));
147
+ }
148
+ throw new ConversionError(`Cannot convert ${getTypeName(value)} to ${targetType}`, {
149
+ sourceValue: value,
150
+ sourceType: getTypeName(value),
151
+ targetType,
152
+ reason: "Unsupported input type"
153
+ });
154
+ }
155
+ chunkPK6SKIKE_cjs.__name(toBigIntValue, "toBigIntValue");
156
+ function bytesToBigInt(bytes) {
157
+ let result = 0n;
158
+ for (const byte of bytes) {
159
+ result = result << 8n | BigInt(byte);
160
+ }
161
+ return result;
162
+ }
163
+ chunkPK6SKIKE_cjs.__name(bytesToBigInt, "bytesToBigInt");
164
+ function toByteArrayValue(value, targetLength, targetType) {
165
+ let bytes;
166
+ if (value instanceof Uint8Array) {
167
+ bytes = value;
168
+ } else if (value instanceof ArrayBuffer) {
169
+ bytes = new Uint8Array(value);
170
+ } else if (value instanceof DataView) {
171
+ bytes = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
172
+ } else if (typeof value === "string") {
173
+ bytes = hexStringToBytes(value, targetType);
174
+ } else if (Array.isArray(value)) {
175
+ for (let index = 0; index < value.length; index++) {
176
+ const element = value[index];
177
+ if (typeof element !== "number" || element < 0 || element > 255 || !Number.isInteger(element)) {
178
+ throw new ConversionError(`Invalid byte value at index ${String(index)}`, {
179
+ sourceValue: value,
180
+ sourceType: "Array",
181
+ targetType,
182
+ reason: `Array element at index ${String(index)} must be an integer between 0 and 255`
183
+ });
184
+ }
185
+ }
186
+ bytes = new Uint8Array(value);
187
+ } else if (typeof value === "bigint") {
188
+ bytes = bigIntToBytes(value, targetLength ?? 0, targetType);
189
+ } else {
190
+ throw new ConversionError(`Cannot convert ${getTypeName(value)} to ${targetType}`, {
191
+ sourceValue: value,
192
+ sourceType: getTypeName(value),
193
+ targetType,
194
+ reason: "Unsupported input type"
195
+ });
196
+ }
197
+ if (targetLength !== null) {
198
+ if (bytes.length > targetLength) {
199
+ throw new ConversionError(
200
+ `Byte array too large for ${targetType}: ${String(bytes.length)} > ${String(targetLength)}`,
201
+ {
202
+ sourceValue: value,
203
+ sourceType: getTypeName(value),
204
+ targetType,
205
+ reason: `Maximum length is ${String(targetLength)} bytes`
206
+ }
207
+ );
208
+ }
209
+ if (bytes.length < targetLength) {
210
+ const padded = new Uint8Array(targetLength);
211
+ padded.set(bytes, 0);
212
+ bytes = padded;
213
+ }
214
+ }
215
+ return bytes;
216
+ }
217
+ chunkPK6SKIKE_cjs.__name(toByteArrayValue, "toByteArrayValue");
218
+ function hexStringToBytes(value, targetType) {
219
+ let hex = value.trim();
220
+ if (hex.toLowerCase().startsWith("0x")) {
221
+ hex = hex.slice(2);
222
+ }
223
+ if (!/^[0-9a-fA-F]*$/.test(hex)) {
224
+ throw new ConversionError(`Invalid hex string: "${value}"`, {
225
+ sourceValue: value,
226
+ sourceType: "string",
227
+ targetType,
228
+ reason: "String contains non-hexadecimal characters"
229
+ });
230
+ }
231
+ if (hex === "") {
232
+ return new Uint8Array(0);
233
+ }
234
+ if (hex.length % 2 !== 0) {
235
+ hex = `0${hex}`;
236
+ }
237
+ const bytes = new Uint8Array(hex.length / 2);
238
+ for (let index = 0; index < bytes.length; index++) {
239
+ bytes[index] = Number.parseInt(hex.slice(index * 2, index * 2 + 2), 16);
240
+ }
241
+ return bytes;
242
+ }
243
+ chunkPK6SKIKE_cjs.__name(hexStringToBytes, "hexStringToBytes");
244
+ function bigIntToBytes(value, minLength, targetType) {
245
+ if (value < 0n) {
246
+ throw new ConversionError(`Cannot convert negative bigint to ${targetType}`, {
247
+ sourceValue: value,
248
+ sourceType: "bigint",
249
+ targetType,
250
+ reason: "Byte arrays cannot represent negative values directly"
251
+ });
252
+ }
253
+ if (value === 0n) {
254
+ return new Uint8Array(minLength);
255
+ }
256
+ const hex = value.toString(16);
257
+ const byteLength = Math.ceil(hex.length / 2);
258
+ const bytes = new Uint8Array(Math.max(byteLength, minLength));
259
+ let temporary = value;
260
+ for (let index = bytes.length - 1; index >= 0 && temporary > 0n; index--) {
261
+ bytes[index] = Number(temporary & 0xffn);
262
+ temporary >>= 8n;
263
+ }
264
+ return bytes;
265
+ }
266
+ chunkPK6SKIKE_cjs.__name(bigIntToBytes, "bigIntToBytes");
267
+ function createLeBytes(value) {
268
+ const bytes = toByteArrayValue(value, null, "LeBytes");
269
+ return bytes;
270
+ }
271
+ chunkPK6SKIKE_cjs.__name(createLeBytes, "createLeBytes");
272
+ function createBeBytes(value) {
273
+ const bytes = toByteArrayValue(value, null, "BeBytes");
274
+ return bytes;
275
+ }
276
+ chunkPK6SKIKE_cjs.__name(createBeBytes, "createBeBytes");
277
+ function createU8LeBytes(value) {
278
+ const bytes = toByteArrayValue(value, chunkMDFSBU5W_cjs.U8_BYTE_LENGTH, "U8LeBytes");
279
+ return bytes;
280
+ }
281
+ chunkPK6SKIKE_cjs.__name(createU8LeBytes, "createU8LeBytes");
282
+ function createU16LeBytes(value) {
283
+ const bytes = toByteArrayValue(value, chunkMDFSBU5W_cjs.U16_BYTE_LENGTH, "U16LeBytes");
284
+ return bytes;
285
+ }
286
+ chunkPK6SKIKE_cjs.__name(createU16LeBytes, "createU16LeBytes");
287
+ function createU32LeBytes(value) {
288
+ const bytes = toByteArrayValue(value, chunkMDFSBU5W_cjs.U32_BYTE_LENGTH, "U32LeBytes");
289
+ return bytes;
290
+ }
291
+ chunkPK6SKIKE_cjs.__name(createU32LeBytes, "createU32LeBytes");
292
+ function createU64LeBytes(value) {
293
+ const bytes = toByteArrayValue(value, chunkMDFSBU5W_cjs.U64_BYTE_LENGTH, "U64LeBytes");
294
+ return bytes;
295
+ }
296
+ chunkPK6SKIKE_cjs.__name(createU64LeBytes, "createU64LeBytes");
297
+ function createU128LeBytes(value) {
298
+ const bytes = toByteArrayValue(value, chunkMDFSBU5W_cjs.U128_BYTE_LENGTH, "U128LeBytes");
299
+ return bytes;
300
+ }
301
+ chunkPK6SKIKE_cjs.__name(createU128LeBytes, "createU128LeBytes");
302
+ function createU256LeBytes(value) {
303
+ const bytes = toByteArrayValue(value, chunkMDFSBU5W_cjs.U256_BYTE_LENGTH, "U256LeBytes");
304
+ return bytes;
305
+ }
306
+ chunkPK6SKIKE_cjs.__name(createU256LeBytes, "createU256LeBytes");
307
+ function createU512LeBytes(value) {
308
+ const bytes = toByteArrayValue(value, chunkMDFSBU5W_cjs.U512_BYTE_LENGTH, "U512LeBytes");
309
+ return bytes;
310
+ }
311
+ chunkPK6SKIKE_cjs.__name(createU512LeBytes, "createU512LeBytes");
312
+ function createU1024LeBytes(value) {
313
+ const bytes = toByteArrayValue(value, chunkMDFSBU5W_cjs.U1024_BYTE_LENGTH, "U1024LeBytes");
314
+ return bytes;
315
+ }
316
+ chunkPK6SKIKE_cjs.__name(createU1024LeBytes, "createU1024LeBytes");
317
+ function createU8BeBytes(value) {
318
+ const bytes = toByteArrayValue(value, chunkMDFSBU5W_cjs.U8_BYTE_LENGTH, "U8BeBytes");
319
+ return bytes;
320
+ }
321
+ chunkPK6SKIKE_cjs.__name(createU8BeBytes, "createU8BeBytes");
322
+ function createU16BeBytes(value) {
323
+ const bytes = toByteArrayValue(value, chunkMDFSBU5W_cjs.U16_BYTE_LENGTH, "U16BeBytes");
324
+ return bytes;
325
+ }
326
+ chunkPK6SKIKE_cjs.__name(createU16BeBytes, "createU16BeBytes");
327
+ function createU32BeBytes(value) {
328
+ const bytes = toByteArrayValue(value, chunkMDFSBU5W_cjs.U32_BYTE_LENGTH, "U32BeBytes");
329
+ return bytes;
330
+ }
331
+ chunkPK6SKIKE_cjs.__name(createU32BeBytes, "createU32BeBytes");
332
+ function createU64BeBytes(value) {
333
+ const bytes = toByteArrayValue(value, chunkMDFSBU5W_cjs.U64_BYTE_LENGTH, "U64BeBytes");
334
+ return bytes;
335
+ }
336
+ chunkPK6SKIKE_cjs.__name(createU64BeBytes, "createU64BeBytes");
337
+ function createU128BeBytes(value) {
338
+ const bytes = toByteArrayValue(value, chunkMDFSBU5W_cjs.U128_BYTE_LENGTH, "U128BeBytes");
339
+ return bytes;
340
+ }
341
+ chunkPK6SKIKE_cjs.__name(createU128BeBytes, "createU128BeBytes");
342
+ function createU256BeBytes(value) {
343
+ const bytes = toByteArrayValue(value, chunkMDFSBU5W_cjs.U256_BYTE_LENGTH, "U256BeBytes");
344
+ return bytes;
345
+ }
346
+ chunkPK6SKIKE_cjs.__name(createU256BeBytes, "createU256BeBytes");
347
+ function createU512BeBytes(value) {
348
+ const bytes = toByteArrayValue(value, chunkMDFSBU5W_cjs.U512_BYTE_LENGTH, "U512BeBytes");
349
+ return bytes;
350
+ }
351
+ chunkPK6SKIKE_cjs.__name(createU512BeBytes, "createU512BeBytes");
352
+ function createU1024BeBytes(value) {
353
+ const bytes = toByteArrayValue(value, chunkMDFSBU5W_cjs.U1024_BYTE_LENGTH, "U1024BeBytes");
354
+ return bytes;
355
+ }
356
+ chunkPK6SKIKE_cjs.__name(createU1024BeBytes, "createU1024BeBytes");
357
+ function createUnsignedInteger(value) {
358
+ const bigIntValue = toBigIntValue(value, "UnsignedInteger");
359
+ if (bigIntValue < 0n) {
360
+ throw new ConversionError(`Cannot convert negative value to UnsignedInteger`, {
361
+ sourceValue: value,
362
+ sourceType: getTypeName(value),
363
+ targetType: "UnsignedInteger",
364
+ reason: "Unsigned integers must be non-negative"
365
+ });
366
+ }
367
+ return bigIntValue;
368
+ }
369
+ chunkPK6SKIKE_cjs.__name(createUnsignedInteger, "createUnsignedInteger");
370
+ function createSignedInteger(value) {
371
+ const bigIntValue = toBigIntValue(value, "SignedInteger");
372
+ return bigIntValue;
373
+ }
374
+ chunkPK6SKIKE_cjs.__name(createSignedInteger, "createSignedInteger");
375
+ function createU8(value) {
376
+ const bigIntValue = toBigIntValue(value, "U8");
377
+ if (bigIntValue < 0n) {
378
+ throw new ConversionError(`Value ${String(bigIntValue)} is negative`, {
379
+ sourceValue: value,
380
+ sourceType: getTypeName(value),
381
+ targetType: "U8",
382
+ reason: "U8 must be non-negative"
383
+ });
384
+ }
385
+ if (bigIntValue > chunkMDFSBU5W_cjs.U8_MAX) {
386
+ throw new ConversionError(
387
+ `Value ${String(bigIntValue)} exceeds U8 maximum (${String(chunkMDFSBU5W_cjs.U8_MAX)})`,
388
+ {
389
+ sourceValue: value,
390
+ sourceType: getTypeName(value),
391
+ targetType: "U8",
392
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U8_MAX)}`
393
+ }
394
+ );
395
+ }
396
+ return bigIntValue;
397
+ }
398
+ chunkPK6SKIKE_cjs.__name(createU8, "createU8");
399
+ function createU16(value) {
400
+ const bigIntValue = toBigIntValue(value, "U16");
401
+ if (bigIntValue < 0n) {
402
+ throw new ConversionError(`Value ${String(bigIntValue)} is negative`, {
403
+ sourceValue: value,
404
+ sourceType: getTypeName(value),
405
+ targetType: "U16",
406
+ reason: "U16 must be non-negative"
407
+ });
408
+ }
409
+ if (bigIntValue > chunkMDFSBU5W_cjs.U16_MAX) {
410
+ throw new ConversionError(
411
+ `Value ${String(bigIntValue)} exceeds U16 maximum (${String(chunkMDFSBU5W_cjs.U16_MAX)})`,
412
+ {
413
+ sourceValue: value,
414
+ sourceType: getTypeName(value),
415
+ targetType: "U16",
416
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U16_MAX)}`
417
+ }
418
+ );
419
+ }
420
+ return bigIntValue;
421
+ }
422
+ chunkPK6SKIKE_cjs.__name(createU16, "createU16");
423
+ function createU32(value) {
424
+ const bigIntValue = toBigIntValue(value, "U32");
425
+ if (bigIntValue < 0n) {
426
+ throw new ConversionError(`Value ${String(bigIntValue)} is negative`, {
427
+ sourceValue: value,
428
+ sourceType: getTypeName(value),
429
+ targetType: "U32",
430
+ reason: "U32 must be non-negative"
431
+ });
432
+ }
433
+ if (bigIntValue > chunkMDFSBU5W_cjs.U32_MAX) {
434
+ throw new ConversionError(
435
+ `Value ${String(bigIntValue)} exceeds U32 maximum (${String(chunkMDFSBU5W_cjs.U32_MAX)})`,
436
+ {
437
+ sourceValue: value,
438
+ sourceType: getTypeName(value),
439
+ targetType: "U32",
440
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U32_MAX)}`
441
+ }
442
+ );
443
+ }
444
+ return bigIntValue;
445
+ }
446
+ chunkPK6SKIKE_cjs.__name(createU32, "createU32");
447
+ function createU64(value) {
448
+ const bigIntValue = toBigIntValue(value, "U64");
449
+ if (bigIntValue < 0n) {
450
+ throw new ConversionError(`Value ${String(bigIntValue)} is negative`, {
451
+ sourceValue: value,
452
+ sourceType: getTypeName(value),
453
+ targetType: "U64",
454
+ reason: "U64 must be non-negative"
455
+ });
456
+ }
457
+ if (bigIntValue > chunkMDFSBU5W_cjs.U64_MAX) {
458
+ throw new ConversionError(`Value exceeds U64 maximum`, {
459
+ sourceValue: value,
460
+ sourceType: getTypeName(value),
461
+ targetType: "U64",
462
+ reason: "Value must be <= 2^64 - 1"
463
+ });
464
+ }
465
+ return bigIntValue;
466
+ }
467
+ chunkPK6SKIKE_cjs.__name(createU64, "createU64");
468
+ function createU128(value) {
469
+ const bigIntValue = toBigIntValue(value, "U128");
470
+ if (bigIntValue < 0n) {
471
+ throw new ConversionError(`Value is negative`, {
472
+ sourceValue: value,
473
+ sourceType: getTypeName(value),
474
+ targetType: "U128",
475
+ reason: "U128 must be non-negative"
476
+ });
477
+ }
478
+ if (bigIntValue > chunkMDFSBU5W_cjs.U128_MAX) {
479
+ throw new ConversionError(`Value exceeds U128 maximum`, {
480
+ sourceValue: value,
481
+ sourceType: getTypeName(value),
482
+ targetType: "U128",
483
+ reason: "Value must be <= 2^128 - 1"
484
+ });
485
+ }
486
+ return bigIntValue;
487
+ }
488
+ chunkPK6SKIKE_cjs.__name(createU128, "createU128");
489
+ function createU256(value) {
490
+ const bigIntValue = toBigIntValue(value, "U256");
491
+ if (bigIntValue < 0n) {
492
+ throw new ConversionError(`Value is negative`, {
493
+ sourceValue: value,
494
+ sourceType: getTypeName(value),
495
+ targetType: "U256",
496
+ reason: "U256 must be non-negative"
497
+ });
498
+ }
499
+ if (bigIntValue > chunkMDFSBU5W_cjs.U256_MAX) {
500
+ throw new ConversionError(`Value exceeds U256 maximum`, {
501
+ sourceValue: value,
502
+ sourceType: getTypeName(value),
503
+ targetType: "U256",
504
+ reason: "Value must be <= 2^256 - 1"
505
+ });
506
+ }
507
+ return bigIntValue;
508
+ }
509
+ chunkPK6SKIKE_cjs.__name(createU256, "createU256");
510
+ function createU512(value) {
511
+ const bigIntValue = toBigIntValue(value, "U512");
512
+ if (bigIntValue < 0n) {
513
+ throw new ConversionError(`Value is negative`, {
514
+ sourceValue: value,
515
+ sourceType: getTypeName(value),
516
+ targetType: "U512",
517
+ reason: "U512 must be non-negative"
518
+ });
519
+ }
520
+ if (bigIntValue > chunkMDFSBU5W_cjs.U512_MAX) {
521
+ throw new ConversionError(`Value exceeds U512 maximum`, {
522
+ sourceValue: value,
523
+ sourceType: getTypeName(value),
524
+ targetType: "U512",
525
+ reason: "Value must be <= 2^512 - 1"
526
+ });
527
+ }
528
+ return bigIntValue;
529
+ }
530
+ chunkPK6SKIKE_cjs.__name(createU512, "createU512");
531
+ function createU1024(value) {
532
+ const bigIntValue = toBigIntValue(value, "U1024");
533
+ if (bigIntValue < 0n) {
534
+ throw new ConversionError(`Value is negative`, {
535
+ sourceValue: value,
536
+ sourceType: getTypeName(value),
537
+ targetType: "U1024",
538
+ reason: "U1024 must be non-negative"
539
+ });
540
+ }
541
+ if (bigIntValue > chunkMDFSBU5W_cjs.U1024_MAX) {
542
+ throw new ConversionError(`Value exceeds U1024 maximum`, {
543
+ sourceValue: value,
544
+ sourceType: getTypeName(value),
545
+ targetType: "U1024",
546
+ reason: "Value must be <= 2^1024 - 1"
547
+ });
548
+ }
549
+ return bigIntValue;
550
+ }
551
+ chunkPK6SKIKE_cjs.__name(createU1024, "createU1024");
552
+ function createI8(value) {
553
+ const bigIntValue = toBigIntValue(value, "I8");
554
+ if (bigIntValue < chunkMDFSBU5W_cjs.I8_MIN || bigIntValue > chunkMDFSBU5W_cjs.I8_MAX) {
555
+ throw new ConversionError(`Value ${String(bigIntValue)} is out of range for I8`, {
556
+ sourceValue: value,
557
+ sourceType: getTypeName(value),
558
+ targetType: "I8",
559
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I8_MIN)}, ${String(chunkMDFSBU5W_cjs.I8_MAX)}]`
560
+ });
561
+ }
562
+ return bigIntValue;
563
+ }
564
+ chunkPK6SKIKE_cjs.__name(createI8, "createI8");
565
+ function createI16(value) {
566
+ const bigIntValue = toBigIntValue(value, "I16");
567
+ if (bigIntValue < chunkMDFSBU5W_cjs.I16_MIN || bigIntValue > chunkMDFSBU5W_cjs.I16_MAX) {
568
+ throw new ConversionError(`Value ${String(bigIntValue)} is out of range for I16`, {
569
+ sourceValue: value,
570
+ sourceType: getTypeName(value),
571
+ targetType: "I16",
572
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I16_MIN)}, ${String(chunkMDFSBU5W_cjs.I16_MAX)}]`
573
+ });
574
+ }
575
+ return bigIntValue;
576
+ }
577
+ chunkPK6SKIKE_cjs.__name(createI16, "createI16");
578
+ function createI32(value) {
579
+ const bigIntValue = toBigIntValue(value, "I32");
580
+ if (bigIntValue < chunkMDFSBU5W_cjs.I32_MIN || bigIntValue > chunkMDFSBU5W_cjs.I32_MAX) {
581
+ throw new ConversionError(`Value ${String(bigIntValue)} is out of range for I32`, {
582
+ sourceValue: value,
583
+ sourceType: getTypeName(value),
584
+ targetType: "I32",
585
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I32_MIN)}, ${String(chunkMDFSBU5W_cjs.I32_MAX)}]`
586
+ });
587
+ }
588
+ return bigIntValue;
589
+ }
590
+ chunkPK6SKIKE_cjs.__name(createI32, "createI32");
591
+ function createI64(value) {
592
+ const bigIntValue = toBigIntValue(value, "I64");
593
+ if (bigIntValue < chunkMDFSBU5W_cjs.I64_MIN || bigIntValue > chunkMDFSBU5W_cjs.I64_MAX) {
594
+ throw new ConversionError(`Value is out of range for I64`, {
595
+ sourceValue: value,
596
+ sourceType: getTypeName(value),
597
+ targetType: "I64",
598
+ reason: "Value must be in range [-2^63, 2^63 - 1]"
599
+ });
600
+ }
601
+ return bigIntValue;
602
+ }
603
+ chunkPK6SKIKE_cjs.__name(createI64, "createI64");
604
+ function createI128(value) {
605
+ const bigIntValue = toBigIntValue(value, "I128");
606
+ if (bigIntValue < chunkMDFSBU5W_cjs.I128_MIN || bigIntValue > chunkMDFSBU5W_cjs.I128_MAX) {
607
+ throw new ConversionError(`Value is out of range for I128`, {
608
+ sourceValue: value,
609
+ sourceType: getTypeName(value),
610
+ targetType: "I128",
611
+ reason: "Value must be in range [-2^127, 2^127 - 1]"
612
+ });
613
+ }
614
+ return bigIntValue;
615
+ }
616
+ chunkPK6SKIKE_cjs.__name(createI128, "createI128");
617
+ function createI256(value) {
618
+ const bigIntValue = toBigIntValue(value, "I256");
619
+ if (bigIntValue < chunkMDFSBU5W_cjs.I256_MIN || bigIntValue > chunkMDFSBU5W_cjs.I256_MAX) {
620
+ throw new ConversionError(`Value is out of range for I256`, {
621
+ sourceValue: value,
622
+ sourceType: getTypeName(value),
623
+ targetType: "I256",
624
+ reason: "Value must be in range [-2^255, 2^255 - 1]"
625
+ });
626
+ }
627
+ return bigIntValue;
628
+ }
629
+ chunkPK6SKIKE_cjs.__name(createI256, "createI256");
630
+ function createI512(value) {
631
+ const bigIntValue = toBigIntValue(value, "I512");
632
+ if (bigIntValue < chunkMDFSBU5W_cjs.I512_MIN || bigIntValue > chunkMDFSBU5W_cjs.I512_MAX) {
633
+ throw new ConversionError(`Value is out of range for I512`, {
634
+ sourceValue: value,
635
+ sourceType: getTypeName(value),
636
+ targetType: "I512",
637
+ reason: "Value must be in range [-2^511, 2^511 - 1]"
638
+ });
639
+ }
640
+ return bigIntValue;
641
+ }
642
+ chunkPK6SKIKE_cjs.__name(createI512, "createI512");
643
+ function createI1024(value) {
644
+ const bigIntValue = toBigIntValue(value, "I1024");
645
+ if (bigIntValue < chunkMDFSBU5W_cjs.I1024_MIN || bigIntValue > chunkMDFSBU5W_cjs.I1024_MAX) {
646
+ throw new ConversionError(`Value is out of range for I1024`, {
647
+ sourceValue: value,
648
+ sourceType: getTypeName(value),
649
+ targetType: "I1024",
650
+ reason: "Value must be in range [-2^1023, 2^1023 - 1]"
651
+ });
652
+ }
653
+ return bigIntValue;
654
+ }
655
+ chunkPK6SKIKE_cjs.__name(createI1024, "createI1024");
656
+ function createBn254FieldElement(value) {
657
+ const bigIntValue = toBigIntValue(value, "Bn254FieldElement");
658
+ if (bigIntValue < 0n) {
659
+ throw new ConversionError(`Value is negative`, {
660
+ sourceValue: value,
661
+ sourceType: getTypeName(value),
662
+ targetType: "Bn254FieldElement",
663
+ reason: "Field elements must be non-negative"
664
+ });
665
+ }
666
+ if (bigIntValue >= chunkMDFSBU5W_cjs.BN254_FIELD_PRIME) {
667
+ throw new ConversionError(`Value exceeds BN254 field prime`, {
668
+ sourceValue: value,
669
+ sourceType: getTypeName(value),
670
+ targetType: "Bn254FieldElement",
671
+ reason: `Value must be < ${String(chunkMDFSBU5W_cjs.BN254_FIELD_PRIME)}`
672
+ });
673
+ }
674
+ return bigIntValue;
675
+ }
676
+ chunkPK6SKIKE_cjs.__name(createBn254FieldElement, "createBn254FieldElement");
677
+ function createCurve25519FieldElement(value) {
678
+ const bigIntValue = toBigIntValue(value, "Curve25519FieldElement");
679
+ if (bigIntValue < 0n) {
680
+ throw new ConversionError(`Value is negative`, {
681
+ sourceValue: value,
682
+ sourceType: getTypeName(value),
683
+ targetType: "Curve25519FieldElement",
684
+ reason: "Field elements must be non-negative"
685
+ });
686
+ }
687
+ if (bigIntValue >= chunkMDFSBU5W_cjs.CURVE25519_FIELD_PRIME) {
688
+ throw new ConversionError(`Value exceeds Curve25519 field prime`, {
689
+ sourceValue: value,
690
+ sourceType: getTypeName(value),
691
+ targetType: "Curve25519FieldElement",
692
+ reason: `Value must be < 2^255 - 19`
693
+ });
694
+ }
695
+ return bigIntValue;
696
+ }
697
+ chunkPK6SKIKE_cjs.__name(createCurve25519FieldElement, "createCurve25519FieldElement");
698
+ function createPoseidonPlaintext(value) {
699
+ const bigIntValue = toBigIntValue(value, "PoseidonPlaintext");
700
+ if (bigIntValue < 0n) {
701
+ throw new ConversionError(`Value is negative`, {
702
+ sourceValue: value,
703
+ sourceType: getTypeName(value),
704
+ targetType: "PoseidonPlaintext",
705
+ reason: "Poseidon plaintexts must be non-negative"
706
+ });
707
+ }
708
+ if (bigIntValue >= chunkMDFSBU5W_cjs.BN254_FIELD_PRIME) {
709
+ throw new ConversionError(`Value exceeds BN254 field prime`, {
710
+ sourceValue: value,
711
+ sourceType: getTypeName(value),
712
+ targetType: "PoseidonPlaintext",
713
+ reason: `Poseidon plaintexts must be < ${String(chunkMDFSBU5W_cjs.BN254_FIELD_PRIME)}`
714
+ });
715
+ }
716
+ return bigIntValue;
717
+ }
718
+ chunkPK6SKIKE_cjs.__name(createPoseidonPlaintext, "createPoseidonPlaintext");
719
+ function createPoseidonHash(value) {
720
+ const bigIntValue = toBigIntValue(value, "PoseidonHash");
721
+ if (bigIntValue < 0n) {
722
+ throw new ConversionError(`Value is negative`, {
723
+ sourceValue: value,
724
+ sourceType: getTypeName(value),
725
+ targetType: "PoseidonHash",
726
+ reason: "Poseidon hashes must be non-negative"
727
+ });
728
+ }
729
+ if (bigIntValue >= chunkMDFSBU5W_cjs.BN254_FIELD_PRIME) {
730
+ throw new ConversionError(`Value exceeds BN254 field prime`, {
731
+ sourceValue: value,
732
+ sourceType: getTypeName(value),
733
+ targetType: "PoseidonHash",
734
+ reason: `Poseidon hashes must be < ${String(chunkMDFSBU5W_cjs.BN254_FIELD_PRIME)}`
735
+ });
736
+ }
737
+ return bigIntValue;
738
+ }
739
+ chunkPK6SKIKE_cjs.__name(createPoseidonHash, "createPoseidonHash");
740
+ function createPoseidonKey(value) {
741
+ const bigIntValue = toBigIntValue(value, "PoseidonKey");
742
+ if (bigIntValue < 0n) {
743
+ throw new ConversionError(`Value is negative`, {
744
+ sourceValue: value,
745
+ sourceType: getTypeName(value),
746
+ targetType: "PoseidonKey",
747
+ reason: "Poseidon keys must be non-negative"
748
+ });
749
+ }
750
+ if (bigIntValue >= chunkMDFSBU5W_cjs.BN254_FIELD_PRIME) {
751
+ throw new ConversionError(`Value exceeds BN254 field prime`, {
752
+ sourceValue: value,
753
+ sourceType: getTypeName(value),
754
+ targetType: "PoseidonKey",
755
+ reason: `Poseidon keys must be < ${String(chunkMDFSBU5W_cjs.BN254_FIELD_PRIME)}`
756
+ });
757
+ }
758
+ return bigIntValue;
759
+ }
760
+ chunkPK6SKIKE_cjs.__name(createPoseidonKey, "createPoseidonKey");
761
+ function createPoseidonCiphertext(value) {
762
+ const bigIntValue = toBigIntValue(value, "PoseidonCiphertext");
763
+ if (bigIntValue < 0n) {
764
+ throw new ConversionError(`Value is negative`, {
765
+ sourceValue: value,
766
+ sourceType: getTypeName(value),
767
+ targetType: "PoseidonCiphertext",
768
+ reason: "Poseidon ciphertexts must be non-negative"
769
+ });
770
+ }
771
+ if (bigIntValue >= chunkMDFSBU5W_cjs.BN254_FIELD_PRIME) {
772
+ throw new ConversionError(`Value exceeds BN254 field prime`, {
773
+ sourceValue: value,
774
+ sourceType: getTypeName(value),
775
+ targetType: "PoseidonCiphertext",
776
+ reason: `Poseidon ciphertexts must be < ${String(chunkMDFSBU5W_cjs.BN254_FIELD_PRIME)}`
777
+ });
778
+ }
779
+ return bigIntValue;
780
+ }
781
+ chunkPK6SKIKE_cjs.__name(createPoseidonCiphertext, "createPoseidonCiphertext");
782
+ function createRcCiphertext(value) {
783
+ const bigIntValue = toBigIntValue(value, "RcCiphertext");
784
+ if (bigIntValue < 0n) {
785
+ throw new ConversionError(`Value is negative`, {
786
+ sourceValue: value,
787
+ sourceType: getTypeName(value),
788
+ targetType: "RcCiphertext",
789
+ reason: "Rescue ciphertexts must be non-negative"
790
+ });
791
+ }
792
+ if (bigIntValue >= chunkMDFSBU5W_cjs.CURVE25519_FIELD_PRIME) {
793
+ throw new ConversionError(`Value exceeds Curve25519 field prime`, {
794
+ sourceValue: value,
795
+ sourceType: getTypeName(value),
796
+ targetType: "RcCiphertext",
797
+ reason: "Rescue ciphertexts must be < 2^255 - 19"
798
+ });
799
+ }
800
+ return bigIntValue;
801
+ }
802
+ chunkPK6SKIKE_cjs.__name(createRcCiphertext, "createRcCiphertext");
803
+ function createRcPlaintext(value) {
804
+ const bigIntValue = toBigIntValue(value, "RcPlaintext");
805
+ if (bigIntValue < 0n) {
806
+ throw new ConversionError(`Value is negative`, {
807
+ sourceValue: value,
808
+ sourceType: getTypeName(value),
809
+ targetType: "RcPlaintext",
810
+ reason: "Rescue plaintexts must be non-negative"
811
+ });
812
+ }
813
+ if (bigIntValue >= chunkMDFSBU5W_cjs.CURVE25519_FIELD_PRIME) {
814
+ throw new ConversionError(`Value exceeds Curve25519 field prime`, {
815
+ sourceValue: value,
816
+ sourceType: getTypeName(value),
817
+ targetType: "RcPlaintext",
818
+ reason: "Rescue plaintexts must be < 2^255 - 19"
819
+ });
820
+ }
821
+ return bigIntValue;
822
+ }
823
+ chunkPK6SKIKE_cjs.__name(createRcPlaintext, "createRcPlaintext");
824
+ function createRcKey(value) {
825
+ const bigIntValue = toBigIntValue(value, "RcKey");
826
+ if (bigIntValue < 0n) {
827
+ throw new ConversionError(`Value is negative`, {
828
+ sourceValue: value,
829
+ sourceType: getTypeName(value),
830
+ targetType: "RcKey",
831
+ reason: "Rescue keys must be non-negative"
832
+ });
833
+ }
834
+ if (bigIntValue >= chunkMDFSBU5W_cjs.CURVE25519_FIELD_PRIME) {
835
+ throw new ConversionError(`Value exceeds Curve25519 field prime`, {
836
+ sourceValue: value,
837
+ sourceType: getTypeName(value),
838
+ targetType: "RcKey",
839
+ reason: "Rescue keys must be < 2^255 - 19"
840
+ });
841
+ }
842
+ return bigIntValue;
843
+ }
844
+ chunkPK6SKIKE_cjs.__name(createRcKey, "createRcKey");
845
+ function createRcCounter(value) {
846
+ const bigIntValue = toBigIntValue(value, "RcCounter");
847
+ if (bigIntValue < 0n) {
848
+ throw new ConversionError(`Value is negative`, {
849
+ sourceValue: value,
850
+ sourceType: getTypeName(value),
851
+ targetType: "RcCounter",
852
+ reason: "Rescue counters must be non-negative"
853
+ });
854
+ }
855
+ if (bigIntValue >= chunkMDFSBU5W_cjs.CURVE25519_FIELD_PRIME) {
856
+ throw new ConversionError(`Value exceeds Curve25519 field prime`, {
857
+ sourceValue: value,
858
+ sourceType: getTypeName(value),
859
+ targetType: "RcCounter",
860
+ reason: "Rescue counters must be < 2^255 - 19"
861
+ });
862
+ }
863
+ return bigIntValue;
864
+ }
865
+ chunkPK6SKIKE_cjs.__name(createRcCounter, "createRcCounter");
866
+ function createRcEncryptionNonce(value) {
867
+ const bigIntValue = toBigIntValue(value, "RcEncryptionNonce");
868
+ if (bigIntValue < 0n) {
869
+ throw new ConversionError(`Value is negative`, {
870
+ sourceValue: value,
871
+ sourceType: getTypeName(value),
872
+ targetType: "RcEncryptionNonce",
873
+ reason: "Rescue encryption nonces must be non-negative"
874
+ });
875
+ }
876
+ if (bigIntValue > chunkMDFSBU5W_cjs.U128_MAX) {
877
+ throw new ConversionError(`Value exceeds U128 maximum`, {
878
+ sourceValue: value,
879
+ sourceType: getTypeName(value),
880
+ targetType: "RcEncryptionNonce",
881
+ reason: "Rescue encryption nonces must be <= 2^128 - 1"
882
+ });
883
+ }
884
+ return bigIntValue;
885
+ }
886
+ chunkPK6SKIKE_cjs.__name(createRcEncryptionNonce, "createRcEncryptionNonce");
887
+ function createBytes(value) {
888
+ if (value instanceof Uint8Array) {
889
+ return value;
890
+ }
891
+ if (value instanceof ArrayBuffer) {
892
+ return new Uint8Array(value);
893
+ }
894
+ if (value instanceof DataView) {
895
+ return new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
896
+ }
897
+ if (Array.isArray(value)) {
898
+ for (let index = 0; index < value.length; index++) {
899
+ const byte = value[index];
900
+ if (typeof byte !== "number" || !Number.isInteger(byte) || byte < 0 || byte > 255) {
901
+ throw new ConversionError(`Invalid byte value at index ${String(index)}: ${String(byte)}`, {
902
+ sourceValue: value,
903
+ sourceType: "number[]",
904
+ targetType: "Bytes",
905
+ reason: "All values must be integers in range [0, 255]"
906
+ });
907
+ }
908
+ }
909
+ return new Uint8Array(value);
910
+ }
911
+ throw new ConversionError(`Cannot convert to Bytes`, {
912
+ sourceValue: value,
913
+ sourceType: typeof value,
914
+ targetType: "Bytes",
915
+ reason: "Expected Uint8Array, ArrayBuffer, DataView, or number[]"
916
+ });
917
+ }
918
+ chunkPK6SKIKE_cjs.__name(createBytes, "createBytes");
919
+ function createX25519Bytes(value) {
920
+ let bytes;
921
+ if (value instanceof Uint8Array) {
922
+ bytes = value;
923
+ } else if (value instanceof ArrayBuffer) {
924
+ bytes = new Uint8Array(value);
925
+ } else if (value instanceof DataView) {
926
+ bytes = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
927
+ } else if (Array.isArray(value)) {
928
+ for (let index = 0; index < value.length; index++) {
929
+ const byte = value[index];
930
+ if (typeof byte !== "number" || !Number.isInteger(byte) || byte < 0 || byte > 255) {
931
+ throw new ConversionError(`Invalid byte value at index ${String(index)}: ${String(byte)}`, {
932
+ sourceValue: value,
933
+ sourceType: "number[]",
934
+ targetType: "X25519Bytes",
935
+ reason: "All values must be integers in range [0, 255]"
936
+ });
937
+ }
938
+ }
939
+ bytes = new Uint8Array(value);
940
+ } else {
941
+ throw new ConversionError(`Cannot convert to X25519Bytes`, {
942
+ sourceValue: value,
943
+ sourceType: typeof value,
944
+ targetType: "X25519Bytes",
945
+ reason: "Expected Uint8Array, ArrayBuffer, DataView, or number[]"
946
+ });
947
+ }
948
+ if (bytes.length > chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH) {
949
+ throw new ConversionError(
950
+ `Value exceeds X25519 byte length (${String(bytes.length)} > ${String(chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH)})`,
951
+ {
952
+ sourceValue: value,
953
+ sourceType: getTypeName(value),
954
+ targetType: "X25519Bytes",
955
+ reason: `X25519 values must be at most ${String(chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH)} bytes`
956
+ }
957
+ );
958
+ }
959
+ if (bytes.length < chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH) {
960
+ const padded = new Uint8Array(chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH);
961
+ padded.set(bytes, 0);
962
+ return padded;
963
+ }
964
+ return bytes;
965
+ }
966
+ chunkPK6SKIKE_cjs.__name(createX25519Bytes, "createX25519Bytes");
967
+ function createX25519PrivateKey(value) {
968
+ let bytes;
969
+ if (value instanceof Uint8Array) {
970
+ bytes = value;
971
+ } else if (value instanceof ArrayBuffer) {
972
+ bytes = new Uint8Array(value);
973
+ } else if (value instanceof DataView) {
974
+ bytes = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
975
+ } else if (Array.isArray(value)) {
976
+ for (let index = 0; index < value.length; index++) {
977
+ const byte = value[index];
978
+ if (typeof byte !== "number" || !Number.isInteger(byte) || byte < 0 || byte > 255) {
979
+ throw new ConversionError(`Invalid byte value at index ${String(index)}: ${String(byte)}`, {
980
+ sourceValue: value,
981
+ sourceType: "number[]",
982
+ targetType: "X25519PrivateKey",
983
+ reason: "All values must be integers in range [0, 255]"
984
+ });
985
+ }
986
+ }
987
+ bytes = new Uint8Array(value);
988
+ } else {
989
+ throw new ConversionError(`Cannot convert to X25519PrivateKey`, {
990
+ sourceValue: value,
991
+ sourceType: typeof value,
992
+ targetType: "X25519PrivateKey",
993
+ reason: "Expected Uint8Array, ArrayBuffer, DataView, or number[]"
994
+ });
995
+ }
996
+ if (bytes.length > chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH) {
997
+ throw new ConversionError(
998
+ `Value exceeds X25519 byte length (${String(bytes.length)} > ${String(chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH)})`,
999
+ {
1000
+ sourceValue: value,
1001
+ sourceType: getTypeName(value),
1002
+ targetType: "X25519PrivateKey",
1003
+ reason: `X25519 private keys must be at most ${String(chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH)} bytes`
1004
+ }
1005
+ );
1006
+ }
1007
+ if (bytes.length < chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH) {
1008
+ const padded = new Uint8Array(chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH);
1009
+ padded.set(bytes, 0);
1010
+ return padded;
1011
+ }
1012
+ return bytes;
1013
+ }
1014
+ chunkPK6SKIKE_cjs.__name(createX25519PrivateKey, "createX25519PrivateKey");
1015
+ function createX25519PublicKey(value) {
1016
+ let bytes;
1017
+ if (value instanceof Uint8Array) {
1018
+ bytes = value;
1019
+ } else if (value instanceof ArrayBuffer) {
1020
+ bytes = new Uint8Array(value);
1021
+ } else if (value instanceof DataView) {
1022
+ bytes = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
1023
+ } else if (Array.isArray(value)) {
1024
+ for (let index = 0; index < value.length; index++) {
1025
+ const byte = value[index];
1026
+ if (typeof byte !== "number" || !Number.isInteger(byte) || byte < 0 || byte > 255) {
1027
+ throw new ConversionError(`Invalid byte value at index ${String(index)}: ${String(byte)}`, {
1028
+ sourceValue: value,
1029
+ sourceType: "number[]",
1030
+ targetType: "X25519PublicKey",
1031
+ reason: "All values must be integers in range [0, 255]"
1032
+ });
1033
+ }
1034
+ }
1035
+ bytes = new Uint8Array(value);
1036
+ } else {
1037
+ throw new ConversionError(`Cannot convert to X25519PublicKey`, {
1038
+ sourceValue: value,
1039
+ sourceType: typeof value,
1040
+ targetType: "X25519PublicKey",
1041
+ reason: "Expected Uint8Array, ArrayBuffer, DataView, or number[]"
1042
+ });
1043
+ }
1044
+ if (bytes.length > chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH) {
1045
+ throw new ConversionError(
1046
+ `Value exceeds X25519 byte length (${String(bytes.length)} > ${String(chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH)})`,
1047
+ {
1048
+ sourceValue: value,
1049
+ sourceType: getTypeName(value),
1050
+ targetType: "X25519PublicKey",
1051
+ reason: `X25519 public keys must be at most ${String(chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH)} bytes`
1052
+ }
1053
+ );
1054
+ }
1055
+ if (bytes.length < chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH) {
1056
+ const padded = new Uint8Array(chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH);
1057
+ padded.set(bytes, 0);
1058
+ return padded;
1059
+ }
1060
+ return bytes;
1061
+ }
1062
+ chunkPK6SKIKE_cjs.__name(createX25519PublicKey, "createX25519PublicKey");
1063
+ function createSharedSecret(value) {
1064
+ let bytes;
1065
+ if (value instanceof Uint8Array) {
1066
+ bytes = value;
1067
+ } else if (value instanceof ArrayBuffer) {
1068
+ bytes = new Uint8Array(value);
1069
+ } else if (value instanceof DataView) {
1070
+ bytes = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
1071
+ } else if (Array.isArray(value)) {
1072
+ for (let index = 0; index < value.length; index++) {
1073
+ const byte = value[index];
1074
+ if (typeof byte !== "number" || !Number.isInteger(byte) || byte < 0 || byte > 255) {
1075
+ throw new ConversionError(`Invalid byte value at index ${String(index)}: ${String(byte)}`, {
1076
+ sourceValue: value,
1077
+ sourceType: "number[]",
1078
+ targetType: "SharedSecret",
1079
+ reason: "All values must be integers in range [0, 255]"
1080
+ });
1081
+ }
1082
+ }
1083
+ bytes = new Uint8Array(value);
1084
+ } else {
1085
+ throw new ConversionError(`Cannot convert to SharedSecret`, {
1086
+ sourceValue: value,
1087
+ sourceType: typeof value,
1088
+ targetType: "SharedSecret",
1089
+ reason: "Expected Uint8Array, ArrayBuffer, DataView, or number[]"
1090
+ });
1091
+ }
1092
+ if (bytes.length > chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH) {
1093
+ throw new ConversionError(
1094
+ `Value exceeds SharedSecret byte length (${String(bytes.length)} > ${String(chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH)})`,
1095
+ {
1096
+ sourceValue: value,
1097
+ sourceType: getTypeName(value),
1098
+ targetType: "SharedSecret",
1099
+ reason: `Shared secrets must be at most ${String(chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH)} bytes`
1100
+ }
1101
+ );
1102
+ }
1103
+ if (bytes.length < chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH) {
1104
+ const padded = new Uint8Array(chunkMDFSBU5W_cjs.X25519_BYTE_LENGTH);
1105
+ padded.set(bytes, 0);
1106
+ return padded;
1107
+ }
1108
+ return bytes;
1109
+ }
1110
+ chunkPK6SKIKE_cjs.__name(createSharedSecret, "createSharedSecret");
1111
+
1112
+ // src/common/converters/mathematics.ts
1113
+ function convertU8ToU16(value) {
1114
+ chunkMDFSBU5W_cjs.assertU8(value);
1115
+ chunkMDFSBU5W_cjs.assertU16(value);
1116
+ return value;
1117
+ }
1118
+ chunkPK6SKIKE_cjs.__name(convertU8ToU16, "convertU8ToU16");
1119
+ function convertU8ToU32(value) {
1120
+ chunkMDFSBU5W_cjs.assertU8(value);
1121
+ chunkMDFSBU5W_cjs.assertU32(value);
1122
+ return value;
1123
+ }
1124
+ chunkPK6SKIKE_cjs.__name(convertU8ToU32, "convertU8ToU32");
1125
+ function convertU8ToU64(value) {
1126
+ chunkMDFSBU5W_cjs.assertU8(value);
1127
+ chunkMDFSBU5W_cjs.assertU64(value);
1128
+ return value;
1129
+ }
1130
+ chunkPK6SKIKE_cjs.__name(convertU8ToU64, "convertU8ToU64");
1131
+ function convertU8ToU128(value) {
1132
+ chunkMDFSBU5W_cjs.assertU8(value);
1133
+ chunkMDFSBU5W_cjs.assertU128(value);
1134
+ return value;
1135
+ }
1136
+ chunkPK6SKIKE_cjs.__name(convertU8ToU128, "convertU8ToU128");
1137
+ function convertU8ToU256(value) {
1138
+ chunkMDFSBU5W_cjs.assertU8(value);
1139
+ chunkMDFSBU5W_cjs.assertU256(value);
1140
+ return value;
1141
+ }
1142
+ chunkPK6SKIKE_cjs.__name(convertU8ToU256, "convertU8ToU256");
1143
+ function convertU8ToU512(value) {
1144
+ chunkMDFSBU5W_cjs.assertU8(value);
1145
+ chunkMDFSBU5W_cjs.assertU512(value);
1146
+ return value;
1147
+ }
1148
+ chunkPK6SKIKE_cjs.__name(convertU8ToU512, "convertU8ToU512");
1149
+ function convertU8ToU1024(value) {
1150
+ chunkMDFSBU5W_cjs.assertU8(value);
1151
+ chunkMDFSBU5W_cjs.assertU1024(value);
1152
+ return value;
1153
+ }
1154
+ chunkPK6SKIKE_cjs.__name(convertU8ToU1024, "convertU8ToU1024");
1155
+ function convertU16ToU32(value) {
1156
+ chunkMDFSBU5W_cjs.assertU16(value);
1157
+ chunkMDFSBU5W_cjs.assertU32(value);
1158
+ return value;
1159
+ }
1160
+ chunkPK6SKIKE_cjs.__name(convertU16ToU32, "convertU16ToU32");
1161
+ function convertU16ToU64(value) {
1162
+ chunkMDFSBU5W_cjs.assertU16(value);
1163
+ chunkMDFSBU5W_cjs.assertU64(value);
1164
+ return value;
1165
+ }
1166
+ chunkPK6SKIKE_cjs.__name(convertU16ToU64, "convertU16ToU64");
1167
+ function convertU16ToU128(value) {
1168
+ chunkMDFSBU5W_cjs.assertU16(value);
1169
+ chunkMDFSBU5W_cjs.assertU128(value);
1170
+ return value;
1171
+ }
1172
+ chunkPK6SKIKE_cjs.__name(convertU16ToU128, "convertU16ToU128");
1173
+ function convertU16ToU256(value) {
1174
+ chunkMDFSBU5W_cjs.assertU16(value);
1175
+ chunkMDFSBU5W_cjs.assertU256(value);
1176
+ return value;
1177
+ }
1178
+ chunkPK6SKIKE_cjs.__name(convertU16ToU256, "convertU16ToU256");
1179
+ function convertU16ToU512(value) {
1180
+ chunkMDFSBU5W_cjs.assertU16(value);
1181
+ chunkMDFSBU5W_cjs.assertU512(value);
1182
+ return value;
1183
+ }
1184
+ chunkPK6SKIKE_cjs.__name(convertU16ToU512, "convertU16ToU512");
1185
+ function convertU16ToU1024(value) {
1186
+ chunkMDFSBU5W_cjs.assertU16(value);
1187
+ chunkMDFSBU5W_cjs.assertU1024(value);
1188
+ return value;
1189
+ }
1190
+ chunkPK6SKIKE_cjs.__name(convertU16ToU1024, "convertU16ToU1024");
1191
+ function convertU32ToU64(value) {
1192
+ chunkMDFSBU5W_cjs.assertU32(value);
1193
+ chunkMDFSBU5W_cjs.assertU64(value);
1194
+ return value;
1195
+ }
1196
+ chunkPK6SKIKE_cjs.__name(convertU32ToU64, "convertU32ToU64");
1197
+ function convertU32ToU128(value) {
1198
+ chunkMDFSBU5W_cjs.assertU32(value);
1199
+ chunkMDFSBU5W_cjs.assertU128(value);
1200
+ return value;
1201
+ }
1202
+ chunkPK6SKIKE_cjs.__name(convertU32ToU128, "convertU32ToU128");
1203
+ function convertU32ToU256(value) {
1204
+ chunkMDFSBU5W_cjs.assertU32(value);
1205
+ chunkMDFSBU5W_cjs.assertU256(value);
1206
+ return value;
1207
+ }
1208
+ chunkPK6SKIKE_cjs.__name(convertU32ToU256, "convertU32ToU256");
1209
+ function convertU32ToU512(value) {
1210
+ chunkMDFSBU5W_cjs.assertU32(value);
1211
+ chunkMDFSBU5W_cjs.assertU512(value);
1212
+ return value;
1213
+ }
1214
+ chunkPK6SKIKE_cjs.__name(convertU32ToU512, "convertU32ToU512");
1215
+ function convertU32ToU1024(value) {
1216
+ chunkMDFSBU5W_cjs.assertU32(value);
1217
+ chunkMDFSBU5W_cjs.assertU1024(value);
1218
+ return value;
1219
+ }
1220
+ chunkPK6SKIKE_cjs.__name(convertU32ToU1024, "convertU32ToU1024");
1221
+ function convertU64ToU128(value) {
1222
+ chunkMDFSBU5W_cjs.assertU64(value);
1223
+ chunkMDFSBU5W_cjs.assertU128(value);
1224
+ return value;
1225
+ }
1226
+ chunkPK6SKIKE_cjs.__name(convertU64ToU128, "convertU64ToU128");
1227
+ function convertU64ToU256(value) {
1228
+ chunkMDFSBU5W_cjs.assertU64(value);
1229
+ chunkMDFSBU5W_cjs.assertU256(value);
1230
+ return value;
1231
+ }
1232
+ chunkPK6SKIKE_cjs.__name(convertU64ToU256, "convertU64ToU256");
1233
+ function convertU64ToU512(value) {
1234
+ chunkMDFSBU5W_cjs.assertU64(value);
1235
+ chunkMDFSBU5W_cjs.assertU512(value);
1236
+ return value;
1237
+ }
1238
+ chunkPK6SKIKE_cjs.__name(convertU64ToU512, "convertU64ToU512");
1239
+ function convertU64ToU1024(value) {
1240
+ chunkMDFSBU5W_cjs.assertU64(value);
1241
+ chunkMDFSBU5W_cjs.assertU1024(value);
1242
+ return value;
1243
+ }
1244
+ chunkPK6SKIKE_cjs.__name(convertU64ToU1024, "convertU64ToU1024");
1245
+ function convertU128ToU256(value) {
1246
+ chunkMDFSBU5W_cjs.assertU128(value);
1247
+ chunkMDFSBU5W_cjs.assertU256(value);
1248
+ return value;
1249
+ }
1250
+ chunkPK6SKIKE_cjs.__name(convertU128ToU256, "convertU128ToU256");
1251
+ function convertU128ToU512(value) {
1252
+ chunkMDFSBU5W_cjs.assertU128(value);
1253
+ chunkMDFSBU5W_cjs.assertU512(value);
1254
+ return value;
1255
+ }
1256
+ chunkPK6SKIKE_cjs.__name(convertU128ToU512, "convertU128ToU512");
1257
+ function convertU128ToU1024(value) {
1258
+ chunkMDFSBU5W_cjs.assertU128(value);
1259
+ chunkMDFSBU5W_cjs.assertU1024(value);
1260
+ return value;
1261
+ }
1262
+ chunkPK6SKIKE_cjs.__name(convertU128ToU1024, "convertU128ToU1024");
1263
+ function convertU256ToU512(value) {
1264
+ chunkMDFSBU5W_cjs.assertU256(value);
1265
+ chunkMDFSBU5W_cjs.assertU512(value);
1266
+ return value;
1267
+ }
1268
+ chunkPK6SKIKE_cjs.__name(convertU256ToU512, "convertU256ToU512");
1269
+ function convertU256ToU1024(value) {
1270
+ chunkMDFSBU5W_cjs.assertU256(value);
1271
+ chunkMDFSBU5W_cjs.assertU1024(value);
1272
+ return value;
1273
+ }
1274
+ chunkPK6SKIKE_cjs.__name(convertU256ToU1024, "convertU256ToU1024");
1275
+ function convertU512ToU1024(value) {
1276
+ chunkMDFSBU5W_cjs.assertU512(value);
1277
+ chunkMDFSBU5W_cjs.assertU1024(value);
1278
+ return value;
1279
+ }
1280
+ chunkPK6SKIKE_cjs.__name(convertU512ToU1024, "convertU512ToU1024");
1281
+ function convertU16ToU8(value) {
1282
+ chunkMDFSBU5W_cjs.assertU16(value);
1283
+ if (value > chunkMDFSBU5W_cjs.U8_MAX) {
1284
+ throw new ConversionError(`Value ${String(value)} exceeds U8 maximum of ${String(chunkMDFSBU5W_cjs.U8_MAX)}`, {
1285
+ sourceValue: value,
1286
+ sourceType: "U16",
1287
+ targetType: "U8",
1288
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U8_MAX)}`
1289
+ });
1290
+ }
1291
+ chunkMDFSBU5W_cjs.assertU8(value);
1292
+ return value;
1293
+ }
1294
+ chunkPK6SKIKE_cjs.__name(convertU16ToU8, "convertU16ToU8");
1295
+ function convertU32ToU8(value) {
1296
+ chunkMDFSBU5W_cjs.assertU32(value);
1297
+ if (value > chunkMDFSBU5W_cjs.U8_MAX) {
1298
+ throw new ConversionError(`Value ${String(value)} exceeds U8 maximum of ${String(chunkMDFSBU5W_cjs.U8_MAX)}`, {
1299
+ sourceValue: value,
1300
+ sourceType: "U32",
1301
+ targetType: "U8",
1302
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U8_MAX)}`
1303
+ });
1304
+ }
1305
+ chunkMDFSBU5W_cjs.assertU8(value);
1306
+ return value;
1307
+ }
1308
+ chunkPK6SKIKE_cjs.__name(convertU32ToU8, "convertU32ToU8");
1309
+ function convertU32ToU16(value) {
1310
+ chunkMDFSBU5W_cjs.assertU32(value);
1311
+ if (value > chunkMDFSBU5W_cjs.U16_MAX) {
1312
+ throw new ConversionError(`Value ${String(value)} exceeds U16 maximum of ${String(chunkMDFSBU5W_cjs.U16_MAX)}`, {
1313
+ sourceValue: value,
1314
+ sourceType: "U32",
1315
+ targetType: "U16",
1316
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U16_MAX)}`
1317
+ });
1318
+ }
1319
+ chunkMDFSBU5W_cjs.assertU16(value);
1320
+ return value;
1321
+ }
1322
+ chunkPK6SKIKE_cjs.__name(convertU32ToU16, "convertU32ToU16");
1323
+ function convertU64ToU8(value) {
1324
+ chunkMDFSBU5W_cjs.assertU64(value);
1325
+ if (value > chunkMDFSBU5W_cjs.U8_MAX) {
1326
+ throw new ConversionError(`Value ${String(value)} exceeds U8 maximum of ${String(chunkMDFSBU5W_cjs.U8_MAX)}`, {
1327
+ sourceValue: value,
1328
+ sourceType: "U64",
1329
+ targetType: "U8",
1330
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U8_MAX)}`
1331
+ });
1332
+ }
1333
+ chunkMDFSBU5W_cjs.assertU8(value);
1334
+ return value;
1335
+ }
1336
+ chunkPK6SKIKE_cjs.__name(convertU64ToU8, "convertU64ToU8");
1337
+ function convertU64ToU16(value) {
1338
+ chunkMDFSBU5W_cjs.assertU64(value);
1339
+ if (value > chunkMDFSBU5W_cjs.U16_MAX) {
1340
+ throw new ConversionError(`Value ${String(value)} exceeds U16 maximum of ${String(chunkMDFSBU5W_cjs.U16_MAX)}`, {
1341
+ sourceValue: value,
1342
+ sourceType: "U64",
1343
+ targetType: "U16",
1344
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U16_MAX)}`
1345
+ });
1346
+ }
1347
+ chunkMDFSBU5W_cjs.assertU16(value);
1348
+ return value;
1349
+ }
1350
+ chunkPK6SKIKE_cjs.__name(convertU64ToU16, "convertU64ToU16");
1351
+ function convertU64ToU32(value) {
1352
+ chunkMDFSBU5W_cjs.assertU64(value);
1353
+ if (value > chunkMDFSBU5W_cjs.U32_MAX) {
1354
+ throw new ConversionError(`Value ${String(value)} exceeds U32 maximum of ${String(chunkMDFSBU5W_cjs.U32_MAX)}`, {
1355
+ sourceValue: value,
1356
+ sourceType: "U64",
1357
+ targetType: "U32",
1358
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U32_MAX)}`
1359
+ });
1360
+ }
1361
+ chunkMDFSBU5W_cjs.assertU32(value);
1362
+ return value;
1363
+ }
1364
+ chunkPK6SKIKE_cjs.__name(convertU64ToU32, "convertU64ToU32");
1365
+ function convertU128ToU8(value) {
1366
+ chunkMDFSBU5W_cjs.assertU128(value);
1367
+ if (value > chunkMDFSBU5W_cjs.U8_MAX) {
1368
+ throw new ConversionError(`Value exceeds U8 maximum of ${String(chunkMDFSBU5W_cjs.U8_MAX)}`, {
1369
+ sourceValue: value,
1370
+ sourceType: "U128",
1371
+ targetType: "U8",
1372
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U8_MAX)}`
1373
+ });
1374
+ }
1375
+ chunkMDFSBU5W_cjs.assertU8(value);
1376
+ return value;
1377
+ }
1378
+ chunkPK6SKIKE_cjs.__name(convertU128ToU8, "convertU128ToU8");
1379
+ function convertU128ToU16(value) {
1380
+ chunkMDFSBU5W_cjs.assertU128(value);
1381
+ if (value > chunkMDFSBU5W_cjs.U16_MAX) {
1382
+ throw new ConversionError(`Value exceeds U16 maximum of ${String(chunkMDFSBU5W_cjs.U16_MAX)}`, {
1383
+ sourceValue: value,
1384
+ sourceType: "U128",
1385
+ targetType: "U16",
1386
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U16_MAX)}`
1387
+ });
1388
+ }
1389
+ chunkMDFSBU5W_cjs.assertU16(value);
1390
+ return value;
1391
+ }
1392
+ chunkPK6SKIKE_cjs.__name(convertU128ToU16, "convertU128ToU16");
1393
+ function convertU128ToU32(value) {
1394
+ chunkMDFSBU5W_cjs.assertU128(value);
1395
+ if (value > chunkMDFSBU5W_cjs.U32_MAX) {
1396
+ throw new ConversionError(`Value exceeds U32 maximum of ${String(chunkMDFSBU5W_cjs.U32_MAX)}`, {
1397
+ sourceValue: value,
1398
+ sourceType: "U128",
1399
+ targetType: "U32",
1400
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U32_MAX)}`
1401
+ });
1402
+ }
1403
+ chunkMDFSBU5W_cjs.assertU32(value);
1404
+ return value;
1405
+ }
1406
+ chunkPK6SKIKE_cjs.__name(convertU128ToU32, "convertU128ToU32");
1407
+ function convertU128ToU64(value) {
1408
+ chunkMDFSBU5W_cjs.assertU128(value);
1409
+ if (value > chunkMDFSBU5W_cjs.U64_MAX) {
1410
+ throw new ConversionError(`Value exceeds U64 maximum`, {
1411
+ sourceValue: value,
1412
+ sourceType: "U128",
1413
+ targetType: "U64",
1414
+ reason: `Value must be <= 2^64 - 1`
1415
+ });
1416
+ }
1417
+ chunkMDFSBU5W_cjs.assertU64(value);
1418
+ return value;
1419
+ }
1420
+ chunkPK6SKIKE_cjs.__name(convertU128ToU64, "convertU128ToU64");
1421
+ function convertU256ToU8(value) {
1422
+ chunkMDFSBU5W_cjs.assertU256(value);
1423
+ if (value > chunkMDFSBU5W_cjs.U8_MAX) {
1424
+ throw new ConversionError(`Value exceeds U8 maximum of ${String(chunkMDFSBU5W_cjs.U8_MAX)}`, {
1425
+ sourceValue: value,
1426
+ sourceType: "U256",
1427
+ targetType: "U8",
1428
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U8_MAX)}`
1429
+ });
1430
+ }
1431
+ chunkMDFSBU5W_cjs.assertU8(value);
1432
+ return value;
1433
+ }
1434
+ chunkPK6SKIKE_cjs.__name(convertU256ToU8, "convertU256ToU8");
1435
+ function convertU256ToU16(value) {
1436
+ chunkMDFSBU5W_cjs.assertU256(value);
1437
+ if (value > chunkMDFSBU5W_cjs.U16_MAX) {
1438
+ throw new ConversionError(`Value exceeds U16 maximum of ${String(chunkMDFSBU5W_cjs.U16_MAX)}`, {
1439
+ sourceValue: value,
1440
+ sourceType: "U256",
1441
+ targetType: "U16",
1442
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U16_MAX)}`
1443
+ });
1444
+ }
1445
+ chunkMDFSBU5W_cjs.assertU16(value);
1446
+ return value;
1447
+ }
1448
+ chunkPK6SKIKE_cjs.__name(convertU256ToU16, "convertU256ToU16");
1449
+ function convertU256ToU32(value) {
1450
+ chunkMDFSBU5W_cjs.assertU256(value);
1451
+ if (value > chunkMDFSBU5W_cjs.U32_MAX) {
1452
+ throw new ConversionError(`Value exceeds U32 maximum of ${String(chunkMDFSBU5W_cjs.U32_MAX)}`, {
1453
+ sourceValue: value,
1454
+ sourceType: "U256",
1455
+ targetType: "U32",
1456
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U32_MAX)}`
1457
+ });
1458
+ }
1459
+ chunkMDFSBU5W_cjs.assertU32(value);
1460
+ return value;
1461
+ }
1462
+ chunkPK6SKIKE_cjs.__name(convertU256ToU32, "convertU256ToU32");
1463
+ function convertU256ToU64(value) {
1464
+ chunkMDFSBU5W_cjs.assertU256(value);
1465
+ if (value > chunkMDFSBU5W_cjs.U64_MAX) {
1466
+ throw new ConversionError(`Value exceeds U64 maximum`, {
1467
+ sourceValue: value,
1468
+ sourceType: "U256",
1469
+ targetType: "U64",
1470
+ reason: `Value must be <= 2^64 - 1`
1471
+ });
1472
+ }
1473
+ chunkMDFSBU5W_cjs.assertU64(value);
1474
+ return value;
1475
+ }
1476
+ chunkPK6SKIKE_cjs.__name(convertU256ToU64, "convertU256ToU64");
1477
+ function convertU256ToU128(value) {
1478
+ chunkMDFSBU5W_cjs.assertU256(value);
1479
+ if (value > chunkMDFSBU5W_cjs.U128_MAX) {
1480
+ throw new ConversionError(`Value exceeds U128 maximum`, {
1481
+ sourceValue: value,
1482
+ sourceType: "U256",
1483
+ targetType: "U128",
1484
+ reason: `Value must be <= 2^128 - 1`
1485
+ });
1486
+ }
1487
+ chunkMDFSBU5W_cjs.assertU128(value);
1488
+ return value;
1489
+ }
1490
+ chunkPK6SKIKE_cjs.__name(convertU256ToU128, "convertU256ToU128");
1491
+ function convertU512ToU8(value) {
1492
+ chunkMDFSBU5W_cjs.assertU512(value);
1493
+ if (value > chunkMDFSBU5W_cjs.U8_MAX) {
1494
+ throw new ConversionError(`Value exceeds U8 maximum of ${String(chunkMDFSBU5W_cjs.U8_MAX)}`, {
1495
+ sourceValue: value,
1496
+ sourceType: "U512",
1497
+ targetType: "U8",
1498
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U8_MAX)}`
1499
+ });
1500
+ }
1501
+ chunkMDFSBU5W_cjs.assertU8(value);
1502
+ return value;
1503
+ }
1504
+ chunkPK6SKIKE_cjs.__name(convertU512ToU8, "convertU512ToU8");
1505
+ function convertU512ToU16(value) {
1506
+ chunkMDFSBU5W_cjs.assertU512(value);
1507
+ if (value > chunkMDFSBU5W_cjs.U16_MAX) {
1508
+ throw new ConversionError(`Value exceeds U16 maximum of ${String(chunkMDFSBU5W_cjs.U16_MAX)}`, {
1509
+ sourceValue: value,
1510
+ sourceType: "U512",
1511
+ targetType: "U16",
1512
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U16_MAX)}`
1513
+ });
1514
+ }
1515
+ chunkMDFSBU5W_cjs.assertU16(value);
1516
+ return value;
1517
+ }
1518
+ chunkPK6SKIKE_cjs.__name(convertU512ToU16, "convertU512ToU16");
1519
+ function convertU512ToU32(value) {
1520
+ chunkMDFSBU5W_cjs.assertU512(value);
1521
+ if (value > chunkMDFSBU5W_cjs.U32_MAX) {
1522
+ throw new ConversionError(`Value exceeds U32 maximum of ${String(chunkMDFSBU5W_cjs.U32_MAX)}`, {
1523
+ sourceValue: value,
1524
+ sourceType: "U512",
1525
+ targetType: "U32",
1526
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U32_MAX)}`
1527
+ });
1528
+ }
1529
+ chunkMDFSBU5W_cjs.assertU32(value);
1530
+ return value;
1531
+ }
1532
+ chunkPK6SKIKE_cjs.__name(convertU512ToU32, "convertU512ToU32");
1533
+ function convertU512ToU64(value) {
1534
+ chunkMDFSBU5W_cjs.assertU512(value);
1535
+ if (value > chunkMDFSBU5W_cjs.U64_MAX) {
1536
+ throw new ConversionError(`Value exceeds U64 maximum`, {
1537
+ sourceValue: value,
1538
+ sourceType: "U512",
1539
+ targetType: "U64",
1540
+ reason: `Value must be <= 2^64 - 1`
1541
+ });
1542
+ }
1543
+ chunkMDFSBU5W_cjs.assertU64(value);
1544
+ return value;
1545
+ }
1546
+ chunkPK6SKIKE_cjs.__name(convertU512ToU64, "convertU512ToU64");
1547
+ function convertU512ToU128(value) {
1548
+ chunkMDFSBU5W_cjs.assertU512(value);
1549
+ if (value > chunkMDFSBU5W_cjs.U128_MAX) {
1550
+ throw new ConversionError(`Value exceeds U128 maximum`, {
1551
+ sourceValue: value,
1552
+ sourceType: "U512",
1553
+ targetType: "U128",
1554
+ reason: `Value must be <= 2^128 - 1`
1555
+ });
1556
+ }
1557
+ chunkMDFSBU5W_cjs.assertU128(value);
1558
+ return value;
1559
+ }
1560
+ chunkPK6SKIKE_cjs.__name(convertU512ToU128, "convertU512ToU128");
1561
+ function convertU512ToU256(value) {
1562
+ chunkMDFSBU5W_cjs.assertU512(value);
1563
+ if (value > chunkMDFSBU5W_cjs.U256_MAX) {
1564
+ throw new ConversionError(`Value exceeds U256 maximum`, {
1565
+ sourceValue: value,
1566
+ sourceType: "U512",
1567
+ targetType: "U256",
1568
+ reason: `Value must be <= 2^256 - 1`
1569
+ });
1570
+ }
1571
+ chunkMDFSBU5W_cjs.assertU256(value);
1572
+ return value;
1573
+ }
1574
+ chunkPK6SKIKE_cjs.__name(convertU512ToU256, "convertU512ToU256");
1575
+ function convertU1024ToU8(value) {
1576
+ chunkMDFSBU5W_cjs.assertU1024(value);
1577
+ if (value > chunkMDFSBU5W_cjs.U8_MAX) {
1578
+ throw new ConversionError(`Value exceeds U8 maximum of ${String(chunkMDFSBU5W_cjs.U8_MAX)}`, {
1579
+ sourceValue: value,
1580
+ sourceType: "U1024",
1581
+ targetType: "U8",
1582
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U8_MAX)}`
1583
+ });
1584
+ }
1585
+ chunkMDFSBU5W_cjs.assertU8(value);
1586
+ return value;
1587
+ }
1588
+ chunkPK6SKIKE_cjs.__name(convertU1024ToU8, "convertU1024ToU8");
1589
+ function convertU1024ToU16(value) {
1590
+ chunkMDFSBU5W_cjs.assertU1024(value);
1591
+ if (value > chunkMDFSBU5W_cjs.U16_MAX) {
1592
+ throw new ConversionError(`Value exceeds U16 maximum of ${String(chunkMDFSBU5W_cjs.U16_MAX)}`, {
1593
+ sourceValue: value,
1594
+ sourceType: "U1024",
1595
+ targetType: "U16",
1596
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U16_MAX)}`
1597
+ });
1598
+ }
1599
+ chunkMDFSBU5W_cjs.assertU16(value);
1600
+ return value;
1601
+ }
1602
+ chunkPK6SKIKE_cjs.__name(convertU1024ToU16, "convertU1024ToU16");
1603
+ function convertU1024ToU32(value) {
1604
+ chunkMDFSBU5W_cjs.assertU1024(value);
1605
+ if (value > chunkMDFSBU5W_cjs.U32_MAX) {
1606
+ throw new ConversionError(`Value exceeds U32 maximum of ${String(chunkMDFSBU5W_cjs.U32_MAX)}`, {
1607
+ sourceValue: value,
1608
+ sourceType: "U1024",
1609
+ targetType: "U32",
1610
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.U32_MAX)}`
1611
+ });
1612
+ }
1613
+ chunkMDFSBU5W_cjs.assertU32(value);
1614
+ return value;
1615
+ }
1616
+ chunkPK6SKIKE_cjs.__name(convertU1024ToU32, "convertU1024ToU32");
1617
+ function convertU1024ToU64(value) {
1618
+ chunkMDFSBU5W_cjs.assertU1024(value);
1619
+ if (value > chunkMDFSBU5W_cjs.U64_MAX) {
1620
+ throw new ConversionError(`Value exceeds U64 maximum`, {
1621
+ sourceValue: value,
1622
+ sourceType: "U1024",
1623
+ targetType: "U64",
1624
+ reason: `Value must be <= 2^64 - 1`
1625
+ });
1626
+ }
1627
+ chunkMDFSBU5W_cjs.assertU64(value);
1628
+ return value;
1629
+ }
1630
+ chunkPK6SKIKE_cjs.__name(convertU1024ToU64, "convertU1024ToU64");
1631
+ function convertU1024ToU128(value) {
1632
+ chunkMDFSBU5W_cjs.assertU1024(value);
1633
+ if (value > chunkMDFSBU5W_cjs.U128_MAX) {
1634
+ throw new ConversionError(`Value exceeds U128 maximum`, {
1635
+ sourceValue: value,
1636
+ sourceType: "U1024",
1637
+ targetType: "U128",
1638
+ reason: `Value must be <= 2^128 - 1`
1639
+ });
1640
+ }
1641
+ chunkMDFSBU5W_cjs.assertU128(value);
1642
+ return value;
1643
+ }
1644
+ chunkPK6SKIKE_cjs.__name(convertU1024ToU128, "convertU1024ToU128");
1645
+ function convertU1024ToU256(value) {
1646
+ chunkMDFSBU5W_cjs.assertU1024(value);
1647
+ if (value > chunkMDFSBU5W_cjs.U256_MAX) {
1648
+ throw new ConversionError(`Value exceeds U256 maximum`, {
1649
+ sourceValue: value,
1650
+ sourceType: "U1024",
1651
+ targetType: "U256",
1652
+ reason: `Value must be <= 2^256 - 1`
1653
+ });
1654
+ }
1655
+ chunkMDFSBU5W_cjs.assertU256(value);
1656
+ return value;
1657
+ }
1658
+ chunkPK6SKIKE_cjs.__name(convertU1024ToU256, "convertU1024ToU256");
1659
+ function convertU1024ToU512(value) {
1660
+ chunkMDFSBU5W_cjs.assertU1024(value);
1661
+ if (value > chunkMDFSBU5W_cjs.U512_MAX) {
1662
+ throw new ConversionError(`Value exceeds U512 maximum`, {
1663
+ sourceValue: value,
1664
+ sourceType: "U1024",
1665
+ targetType: "U512",
1666
+ reason: `Value must be <= 2^512 - 1`
1667
+ });
1668
+ }
1669
+ chunkMDFSBU5W_cjs.assertU512(value);
1670
+ return value;
1671
+ }
1672
+ chunkPK6SKIKE_cjs.__name(convertU1024ToU512, "convertU1024ToU512");
1673
+ function convertI8ToI16(value) {
1674
+ chunkMDFSBU5W_cjs.assertI8(value);
1675
+ chunkMDFSBU5W_cjs.assertI16(value);
1676
+ return value;
1677
+ }
1678
+ chunkPK6SKIKE_cjs.__name(convertI8ToI16, "convertI8ToI16");
1679
+ function convertI8ToI32(value) {
1680
+ chunkMDFSBU5W_cjs.assertI8(value);
1681
+ chunkMDFSBU5W_cjs.assertI32(value);
1682
+ return value;
1683
+ }
1684
+ chunkPK6SKIKE_cjs.__name(convertI8ToI32, "convertI8ToI32");
1685
+ function convertI8ToI64(value) {
1686
+ chunkMDFSBU5W_cjs.assertI8(value);
1687
+ chunkMDFSBU5W_cjs.assertI64(value);
1688
+ return value;
1689
+ }
1690
+ chunkPK6SKIKE_cjs.__name(convertI8ToI64, "convertI8ToI64");
1691
+ function convertI8ToI128(value) {
1692
+ chunkMDFSBU5W_cjs.assertI8(value);
1693
+ chunkMDFSBU5W_cjs.assertI128(value);
1694
+ return value;
1695
+ }
1696
+ chunkPK6SKIKE_cjs.__name(convertI8ToI128, "convertI8ToI128");
1697
+ function convertI8ToI256(value) {
1698
+ chunkMDFSBU5W_cjs.assertI8(value);
1699
+ chunkMDFSBU5W_cjs.assertI256(value);
1700
+ return value;
1701
+ }
1702
+ chunkPK6SKIKE_cjs.__name(convertI8ToI256, "convertI8ToI256");
1703
+ function convertI8ToI512(value) {
1704
+ chunkMDFSBU5W_cjs.assertI8(value);
1705
+ chunkMDFSBU5W_cjs.assertI512(value);
1706
+ return value;
1707
+ }
1708
+ chunkPK6SKIKE_cjs.__name(convertI8ToI512, "convertI8ToI512");
1709
+ function convertI8ToI1024(value) {
1710
+ chunkMDFSBU5W_cjs.assertI8(value);
1711
+ chunkMDFSBU5W_cjs.assertI1024(value);
1712
+ return value;
1713
+ }
1714
+ chunkPK6SKIKE_cjs.__name(convertI8ToI1024, "convertI8ToI1024");
1715
+ function convertI16ToI32(value) {
1716
+ chunkMDFSBU5W_cjs.assertI16(value);
1717
+ chunkMDFSBU5W_cjs.assertI32(value);
1718
+ return value;
1719
+ }
1720
+ chunkPK6SKIKE_cjs.__name(convertI16ToI32, "convertI16ToI32");
1721
+ function convertI16ToI64(value) {
1722
+ chunkMDFSBU5W_cjs.assertI16(value);
1723
+ chunkMDFSBU5W_cjs.assertI64(value);
1724
+ return value;
1725
+ }
1726
+ chunkPK6SKIKE_cjs.__name(convertI16ToI64, "convertI16ToI64");
1727
+ function convertI16ToI128(value) {
1728
+ chunkMDFSBU5W_cjs.assertI16(value);
1729
+ chunkMDFSBU5W_cjs.assertI128(value);
1730
+ return value;
1731
+ }
1732
+ chunkPK6SKIKE_cjs.__name(convertI16ToI128, "convertI16ToI128");
1733
+ function convertI16ToI256(value) {
1734
+ chunkMDFSBU5W_cjs.assertI16(value);
1735
+ chunkMDFSBU5W_cjs.assertI256(value);
1736
+ return value;
1737
+ }
1738
+ chunkPK6SKIKE_cjs.__name(convertI16ToI256, "convertI16ToI256");
1739
+ function convertI16ToI512(value) {
1740
+ chunkMDFSBU5W_cjs.assertI16(value);
1741
+ chunkMDFSBU5W_cjs.assertI512(value);
1742
+ return value;
1743
+ }
1744
+ chunkPK6SKIKE_cjs.__name(convertI16ToI512, "convertI16ToI512");
1745
+ function convertI16ToI1024(value) {
1746
+ chunkMDFSBU5W_cjs.assertI16(value);
1747
+ chunkMDFSBU5W_cjs.assertI1024(value);
1748
+ return value;
1749
+ }
1750
+ chunkPK6SKIKE_cjs.__name(convertI16ToI1024, "convertI16ToI1024");
1751
+ function convertI32ToI64(value) {
1752
+ chunkMDFSBU5W_cjs.assertI32(value);
1753
+ chunkMDFSBU5W_cjs.assertI64(value);
1754
+ return value;
1755
+ }
1756
+ chunkPK6SKIKE_cjs.__name(convertI32ToI64, "convertI32ToI64");
1757
+ function convertI32ToI128(value) {
1758
+ chunkMDFSBU5W_cjs.assertI32(value);
1759
+ chunkMDFSBU5W_cjs.assertI128(value);
1760
+ return value;
1761
+ }
1762
+ chunkPK6SKIKE_cjs.__name(convertI32ToI128, "convertI32ToI128");
1763
+ function convertI32ToI256(value) {
1764
+ chunkMDFSBU5W_cjs.assertI32(value);
1765
+ chunkMDFSBU5W_cjs.assertI256(value);
1766
+ return value;
1767
+ }
1768
+ chunkPK6SKIKE_cjs.__name(convertI32ToI256, "convertI32ToI256");
1769
+ function convertI32ToI512(value) {
1770
+ chunkMDFSBU5W_cjs.assertI32(value);
1771
+ chunkMDFSBU5W_cjs.assertI512(value);
1772
+ return value;
1773
+ }
1774
+ chunkPK6SKIKE_cjs.__name(convertI32ToI512, "convertI32ToI512");
1775
+ function convertI32ToI1024(value) {
1776
+ chunkMDFSBU5W_cjs.assertI32(value);
1777
+ chunkMDFSBU5W_cjs.assertI1024(value);
1778
+ return value;
1779
+ }
1780
+ chunkPK6SKIKE_cjs.__name(convertI32ToI1024, "convertI32ToI1024");
1781
+ function convertI64ToI128(value) {
1782
+ chunkMDFSBU5W_cjs.assertI64(value);
1783
+ chunkMDFSBU5W_cjs.assertI128(value);
1784
+ return value;
1785
+ }
1786
+ chunkPK6SKIKE_cjs.__name(convertI64ToI128, "convertI64ToI128");
1787
+ function convertI64ToI256(value) {
1788
+ chunkMDFSBU5W_cjs.assertI64(value);
1789
+ chunkMDFSBU5W_cjs.assertI256(value);
1790
+ return value;
1791
+ }
1792
+ chunkPK6SKIKE_cjs.__name(convertI64ToI256, "convertI64ToI256");
1793
+ function convertI64ToI512(value) {
1794
+ chunkMDFSBU5W_cjs.assertI64(value);
1795
+ chunkMDFSBU5W_cjs.assertI512(value);
1796
+ return value;
1797
+ }
1798
+ chunkPK6SKIKE_cjs.__name(convertI64ToI512, "convertI64ToI512");
1799
+ function convertI64ToI1024(value) {
1800
+ chunkMDFSBU5W_cjs.assertI64(value);
1801
+ chunkMDFSBU5W_cjs.assertI1024(value);
1802
+ return value;
1803
+ }
1804
+ chunkPK6SKIKE_cjs.__name(convertI64ToI1024, "convertI64ToI1024");
1805
+ function convertI128ToI256(value) {
1806
+ chunkMDFSBU5W_cjs.assertI128(value);
1807
+ chunkMDFSBU5W_cjs.assertI256(value);
1808
+ return value;
1809
+ }
1810
+ chunkPK6SKIKE_cjs.__name(convertI128ToI256, "convertI128ToI256");
1811
+ function convertI128ToI512(value) {
1812
+ chunkMDFSBU5W_cjs.assertI128(value);
1813
+ chunkMDFSBU5W_cjs.assertI512(value);
1814
+ return value;
1815
+ }
1816
+ chunkPK6SKIKE_cjs.__name(convertI128ToI512, "convertI128ToI512");
1817
+ function convertI128ToI1024(value) {
1818
+ chunkMDFSBU5W_cjs.assertI128(value);
1819
+ chunkMDFSBU5W_cjs.assertI1024(value);
1820
+ return value;
1821
+ }
1822
+ chunkPK6SKIKE_cjs.__name(convertI128ToI1024, "convertI128ToI1024");
1823
+ function convertI256ToI512(value) {
1824
+ chunkMDFSBU5W_cjs.assertI256(value);
1825
+ chunkMDFSBU5W_cjs.assertI512(value);
1826
+ return value;
1827
+ }
1828
+ chunkPK6SKIKE_cjs.__name(convertI256ToI512, "convertI256ToI512");
1829
+ function convertI256ToI1024(value) {
1830
+ chunkMDFSBU5W_cjs.assertI256(value);
1831
+ chunkMDFSBU5W_cjs.assertI1024(value);
1832
+ return value;
1833
+ }
1834
+ chunkPK6SKIKE_cjs.__name(convertI256ToI1024, "convertI256ToI1024");
1835
+ function convertI512ToI1024(value) {
1836
+ chunkMDFSBU5W_cjs.assertI512(value);
1837
+ chunkMDFSBU5W_cjs.assertI1024(value);
1838
+ return value;
1839
+ }
1840
+ chunkPK6SKIKE_cjs.__name(convertI512ToI1024, "convertI512ToI1024");
1841
+ function convertI16ToI8(value) {
1842
+ chunkMDFSBU5W_cjs.assertI16(value);
1843
+ if (value < chunkMDFSBU5W_cjs.I8_MIN || value > chunkMDFSBU5W_cjs.I8_MAX) {
1844
+ throw new ConversionError(
1845
+ `Value ${String(value)} is out of range for I8 [${String(chunkMDFSBU5W_cjs.I8_MIN)}, ${String(chunkMDFSBU5W_cjs.I8_MAX)}]`,
1846
+ {
1847
+ sourceValue: value,
1848
+ sourceType: "I16",
1849
+ targetType: "I8",
1850
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I8_MIN)}, ${String(chunkMDFSBU5W_cjs.I8_MAX)}]`
1851
+ }
1852
+ );
1853
+ }
1854
+ chunkMDFSBU5W_cjs.assertI8(value);
1855
+ return value;
1856
+ }
1857
+ chunkPK6SKIKE_cjs.__name(convertI16ToI8, "convertI16ToI8");
1858
+ function convertI32ToI8(value) {
1859
+ chunkMDFSBU5W_cjs.assertI32(value);
1860
+ if (value < chunkMDFSBU5W_cjs.I8_MIN || value > chunkMDFSBU5W_cjs.I8_MAX) {
1861
+ throw new ConversionError(
1862
+ `Value ${String(value)} is out of range for I8 [${String(chunkMDFSBU5W_cjs.I8_MIN)}, ${String(chunkMDFSBU5W_cjs.I8_MAX)}]`,
1863
+ {
1864
+ sourceValue: value,
1865
+ sourceType: "I32",
1866
+ targetType: "I8",
1867
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I8_MIN)}, ${String(chunkMDFSBU5W_cjs.I8_MAX)}]`
1868
+ }
1869
+ );
1870
+ }
1871
+ chunkMDFSBU5W_cjs.assertI8(value);
1872
+ return value;
1873
+ }
1874
+ chunkPK6SKIKE_cjs.__name(convertI32ToI8, "convertI32ToI8");
1875
+ function convertI32ToI16(value) {
1876
+ chunkMDFSBU5W_cjs.assertI32(value);
1877
+ if (value < chunkMDFSBU5W_cjs.I16_MIN || value > chunkMDFSBU5W_cjs.I16_MAX) {
1878
+ throw new ConversionError(
1879
+ `Value ${String(value)} is out of range for I16 [${String(chunkMDFSBU5W_cjs.I16_MIN)}, ${String(chunkMDFSBU5W_cjs.I16_MAX)}]`,
1880
+ {
1881
+ sourceValue: value,
1882
+ sourceType: "I32",
1883
+ targetType: "I16",
1884
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I16_MIN)}, ${String(chunkMDFSBU5W_cjs.I16_MAX)}]`
1885
+ }
1886
+ );
1887
+ }
1888
+ chunkMDFSBU5W_cjs.assertI16(value);
1889
+ return value;
1890
+ }
1891
+ chunkPK6SKIKE_cjs.__name(convertI32ToI16, "convertI32ToI16");
1892
+ function convertI64ToI8(value) {
1893
+ chunkMDFSBU5W_cjs.assertI64(value);
1894
+ if (value < chunkMDFSBU5W_cjs.I8_MIN || value > chunkMDFSBU5W_cjs.I8_MAX) {
1895
+ throw new ConversionError(
1896
+ `Value ${String(value)} is out of range for I8 [${String(chunkMDFSBU5W_cjs.I8_MIN)}, ${String(chunkMDFSBU5W_cjs.I8_MAX)}]`,
1897
+ {
1898
+ sourceValue: value,
1899
+ sourceType: "I64",
1900
+ targetType: "I8",
1901
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I8_MIN)}, ${String(chunkMDFSBU5W_cjs.I8_MAX)}]`
1902
+ }
1903
+ );
1904
+ }
1905
+ chunkMDFSBU5W_cjs.assertI8(value);
1906
+ return value;
1907
+ }
1908
+ chunkPK6SKIKE_cjs.__name(convertI64ToI8, "convertI64ToI8");
1909
+ function convertI64ToI16(value) {
1910
+ chunkMDFSBU5W_cjs.assertI64(value);
1911
+ if (value < chunkMDFSBU5W_cjs.I16_MIN || value > chunkMDFSBU5W_cjs.I16_MAX) {
1912
+ throw new ConversionError(
1913
+ `Value ${String(value)} is out of range for I16 [${String(chunkMDFSBU5W_cjs.I16_MIN)}, ${String(chunkMDFSBU5W_cjs.I16_MAX)}]`,
1914
+ {
1915
+ sourceValue: value,
1916
+ sourceType: "I64",
1917
+ targetType: "I16",
1918
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I16_MIN)}, ${String(chunkMDFSBU5W_cjs.I16_MAX)}]`
1919
+ }
1920
+ );
1921
+ }
1922
+ chunkMDFSBU5W_cjs.assertI16(value);
1923
+ return value;
1924
+ }
1925
+ chunkPK6SKIKE_cjs.__name(convertI64ToI16, "convertI64ToI16");
1926
+ function convertI64ToI32(value) {
1927
+ chunkMDFSBU5W_cjs.assertI64(value);
1928
+ if (value < chunkMDFSBU5W_cjs.I32_MIN || value > chunkMDFSBU5W_cjs.I32_MAX) {
1929
+ throw new ConversionError(
1930
+ `Value ${String(value)} is out of range for I32 [${String(chunkMDFSBU5W_cjs.I32_MIN)}, ${String(chunkMDFSBU5W_cjs.I32_MAX)}]`,
1931
+ {
1932
+ sourceValue: value,
1933
+ sourceType: "I64",
1934
+ targetType: "I32",
1935
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I32_MIN)}, ${String(chunkMDFSBU5W_cjs.I32_MAX)}]`
1936
+ }
1937
+ );
1938
+ }
1939
+ chunkMDFSBU5W_cjs.assertI32(value);
1940
+ return value;
1941
+ }
1942
+ chunkPK6SKIKE_cjs.__name(convertI64ToI32, "convertI64ToI32");
1943
+ function convertI128ToI8(value) {
1944
+ chunkMDFSBU5W_cjs.assertI128(value);
1945
+ if (value < chunkMDFSBU5W_cjs.I8_MIN || value > chunkMDFSBU5W_cjs.I8_MAX) {
1946
+ throw new ConversionError(
1947
+ `Value is out of range for I8 [${String(chunkMDFSBU5W_cjs.I8_MIN)}, ${String(chunkMDFSBU5W_cjs.I8_MAX)}]`,
1948
+ {
1949
+ sourceValue: value,
1950
+ sourceType: "I128",
1951
+ targetType: "I8",
1952
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I8_MIN)}, ${String(chunkMDFSBU5W_cjs.I8_MAX)}]`
1953
+ }
1954
+ );
1955
+ }
1956
+ chunkMDFSBU5W_cjs.assertI8(value);
1957
+ return value;
1958
+ }
1959
+ chunkPK6SKIKE_cjs.__name(convertI128ToI8, "convertI128ToI8");
1960
+ function convertI128ToI16(value) {
1961
+ chunkMDFSBU5W_cjs.assertI128(value);
1962
+ if (value < chunkMDFSBU5W_cjs.I16_MIN || value > chunkMDFSBU5W_cjs.I16_MAX) {
1963
+ throw new ConversionError(
1964
+ `Value is out of range for I16 [${String(chunkMDFSBU5W_cjs.I16_MIN)}, ${String(chunkMDFSBU5W_cjs.I16_MAX)}]`,
1965
+ {
1966
+ sourceValue: value,
1967
+ sourceType: "I128",
1968
+ targetType: "I16",
1969
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I16_MIN)}, ${String(chunkMDFSBU5W_cjs.I16_MAX)}]`
1970
+ }
1971
+ );
1972
+ }
1973
+ chunkMDFSBU5W_cjs.assertI16(value);
1974
+ return value;
1975
+ }
1976
+ chunkPK6SKIKE_cjs.__name(convertI128ToI16, "convertI128ToI16");
1977
+ function convertI128ToI32(value) {
1978
+ chunkMDFSBU5W_cjs.assertI128(value);
1979
+ if (value < chunkMDFSBU5W_cjs.I32_MIN || value > chunkMDFSBU5W_cjs.I32_MAX) {
1980
+ throw new ConversionError(
1981
+ `Value is out of range for I32 [${String(chunkMDFSBU5W_cjs.I32_MIN)}, ${String(chunkMDFSBU5W_cjs.I32_MAX)}]`,
1982
+ {
1983
+ sourceValue: value,
1984
+ sourceType: "I128",
1985
+ targetType: "I32",
1986
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I32_MIN)}, ${String(chunkMDFSBU5W_cjs.I32_MAX)}]`
1987
+ }
1988
+ );
1989
+ }
1990
+ chunkMDFSBU5W_cjs.assertI32(value);
1991
+ return value;
1992
+ }
1993
+ chunkPK6SKIKE_cjs.__name(convertI128ToI32, "convertI128ToI32");
1994
+ function convertI128ToI64(value) {
1995
+ chunkMDFSBU5W_cjs.assertI128(value);
1996
+ if (value < chunkMDFSBU5W_cjs.I64_MIN || value > chunkMDFSBU5W_cjs.I64_MAX) {
1997
+ throw new ConversionError(`Value is out of range for I64`, {
1998
+ sourceValue: value,
1999
+ sourceType: "I128",
2000
+ targetType: "I64",
2001
+ reason: `Value must be in range [-2^63, 2^63 - 1]`
2002
+ });
2003
+ }
2004
+ chunkMDFSBU5W_cjs.assertI64(value);
2005
+ return value;
2006
+ }
2007
+ chunkPK6SKIKE_cjs.__name(convertI128ToI64, "convertI128ToI64");
2008
+ function convertI256ToI8(value) {
2009
+ chunkMDFSBU5W_cjs.assertI256(value);
2010
+ if (value < chunkMDFSBU5W_cjs.I8_MIN || value > chunkMDFSBU5W_cjs.I8_MAX) {
2011
+ throw new ConversionError(
2012
+ `Value is out of range for I8 [${String(chunkMDFSBU5W_cjs.I8_MIN)}, ${String(chunkMDFSBU5W_cjs.I8_MAX)}]`,
2013
+ {
2014
+ sourceValue: value,
2015
+ sourceType: "I256",
2016
+ targetType: "I8",
2017
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I8_MIN)}, ${String(chunkMDFSBU5W_cjs.I8_MAX)}]`
2018
+ }
2019
+ );
2020
+ }
2021
+ chunkMDFSBU5W_cjs.assertI8(value);
2022
+ return value;
2023
+ }
2024
+ chunkPK6SKIKE_cjs.__name(convertI256ToI8, "convertI256ToI8");
2025
+ function convertI256ToI16(value) {
2026
+ chunkMDFSBU5W_cjs.assertI256(value);
2027
+ if (value < chunkMDFSBU5W_cjs.I16_MIN || value > chunkMDFSBU5W_cjs.I16_MAX) {
2028
+ throw new ConversionError(
2029
+ `Value is out of range for I16 [${String(chunkMDFSBU5W_cjs.I16_MIN)}, ${String(chunkMDFSBU5W_cjs.I16_MAX)}]`,
2030
+ {
2031
+ sourceValue: value,
2032
+ sourceType: "I256",
2033
+ targetType: "I16",
2034
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I16_MIN)}, ${String(chunkMDFSBU5W_cjs.I16_MAX)}]`
2035
+ }
2036
+ );
2037
+ }
2038
+ chunkMDFSBU5W_cjs.assertI16(value);
2039
+ return value;
2040
+ }
2041
+ chunkPK6SKIKE_cjs.__name(convertI256ToI16, "convertI256ToI16");
2042
+ function convertI256ToI32(value) {
2043
+ chunkMDFSBU5W_cjs.assertI256(value);
2044
+ if (value < chunkMDFSBU5W_cjs.I32_MIN || value > chunkMDFSBU5W_cjs.I32_MAX) {
2045
+ throw new ConversionError(
2046
+ `Value is out of range for I32 [${String(chunkMDFSBU5W_cjs.I32_MIN)}, ${String(chunkMDFSBU5W_cjs.I32_MAX)}]`,
2047
+ {
2048
+ sourceValue: value,
2049
+ sourceType: "I256",
2050
+ targetType: "I32",
2051
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I32_MIN)}, ${String(chunkMDFSBU5W_cjs.I32_MAX)}]`
2052
+ }
2053
+ );
2054
+ }
2055
+ chunkMDFSBU5W_cjs.assertI32(value);
2056
+ return value;
2057
+ }
2058
+ chunkPK6SKIKE_cjs.__name(convertI256ToI32, "convertI256ToI32");
2059
+ function convertI256ToI64(value) {
2060
+ chunkMDFSBU5W_cjs.assertI256(value);
2061
+ if (value < chunkMDFSBU5W_cjs.I64_MIN || value > chunkMDFSBU5W_cjs.I64_MAX) {
2062
+ throw new ConversionError(`Value is out of range for I64`, {
2063
+ sourceValue: value,
2064
+ sourceType: "I256",
2065
+ targetType: "I64",
2066
+ reason: `Value must be in range [-2^63, 2^63 - 1]`
2067
+ });
2068
+ }
2069
+ chunkMDFSBU5W_cjs.assertI64(value);
2070
+ return value;
2071
+ }
2072
+ chunkPK6SKIKE_cjs.__name(convertI256ToI64, "convertI256ToI64");
2073
+ function convertI256ToI128(value) {
2074
+ chunkMDFSBU5W_cjs.assertI256(value);
2075
+ if (value < chunkMDFSBU5W_cjs.I128_MIN || value > chunkMDFSBU5W_cjs.I128_MAX) {
2076
+ throw new ConversionError(`Value is out of range for I128`, {
2077
+ sourceValue: value,
2078
+ sourceType: "I256",
2079
+ targetType: "I128",
2080
+ reason: `Value must be in range [-2^127, 2^127 - 1]`
2081
+ });
2082
+ }
2083
+ chunkMDFSBU5W_cjs.assertI128(value);
2084
+ return value;
2085
+ }
2086
+ chunkPK6SKIKE_cjs.__name(convertI256ToI128, "convertI256ToI128");
2087
+ function convertI512ToI8(value) {
2088
+ chunkMDFSBU5W_cjs.assertI512(value);
2089
+ if (value < chunkMDFSBU5W_cjs.I8_MIN || value > chunkMDFSBU5W_cjs.I8_MAX) {
2090
+ throw new ConversionError(
2091
+ `Value is out of range for I8 [${String(chunkMDFSBU5W_cjs.I8_MIN)}, ${String(chunkMDFSBU5W_cjs.I8_MAX)}]`,
2092
+ {
2093
+ sourceValue: value,
2094
+ sourceType: "I512",
2095
+ targetType: "I8",
2096
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I8_MIN)}, ${String(chunkMDFSBU5W_cjs.I8_MAX)}]`
2097
+ }
2098
+ );
2099
+ }
2100
+ chunkMDFSBU5W_cjs.assertI8(value);
2101
+ return value;
2102
+ }
2103
+ chunkPK6SKIKE_cjs.__name(convertI512ToI8, "convertI512ToI8");
2104
+ function convertI512ToI16(value) {
2105
+ chunkMDFSBU5W_cjs.assertI512(value);
2106
+ if (value < chunkMDFSBU5W_cjs.I16_MIN || value > chunkMDFSBU5W_cjs.I16_MAX) {
2107
+ throw new ConversionError(
2108
+ `Value is out of range for I16 [${String(chunkMDFSBU5W_cjs.I16_MIN)}, ${String(chunkMDFSBU5W_cjs.I16_MAX)}]`,
2109
+ {
2110
+ sourceValue: value,
2111
+ sourceType: "I512",
2112
+ targetType: "I16",
2113
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I16_MIN)}, ${String(chunkMDFSBU5W_cjs.I16_MAX)}]`
2114
+ }
2115
+ );
2116
+ }
2117
+ chunkMDFSBU5W_cjs.assertI16(value);
2118
+ return value;
2119
+ }
2120
+ chunkPK6SKIKE_cjs.__name(convertI512ToI16, "convertI512ToI16");
2121
+ function convertI512ToI32(value) {
2122
+ chunkMDFSBU5W_cjs.assertI512(value);
2123
+ if (value < chunkMDFSBU5W_cjs.I32_MIN || value > chunkMDFSBU5W_cjs.I32_MAX) {
2124
+ throw new ConversionError(
2125
+ `Value is out of range for I32 [${String(chunkMDFSBU5W_cjs.I32_MIN)}, ${String(chunkMDFSBU5W_cjs.I32_MAX)}]`,
2126
+ {
2127
+ sourceValue: value,
2128
+ sourceType: "I512",
2129
+ targetType: "I32",
2130
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I32_MIN)}, ${String(chunkMDFSBU5W_cjs.I32_MAX)}]`
2131
+ }
2132
+ );
2133
+ }
2134
+ chunkMDFSBU5W_cjs.assertI32(value);
2135
+ return value;
2136
+ }
2137
+ chunkPK6SKIKE_cjs.__name(convertI512ToI32, "convertI512ToI32");
2138
+ function convertI512ToI64(value) {
2139
+ chunkMDFSBU5W_cjs.assertI512(value);
2140
+ if (value < chunkMDFSBU5W_cjs.I64_MIN || value > chunkMDFSBU5W_cjs.I64_MAX) {
2141
+ throw new ConversionError(`Value is out of range for I64`, {
2142
+ sourceValue: value,
2143
+ sourceType: "I512",
2144
+ targetType: "I64",
2145
+ reason: `Value must be in range [-2^63, 2^63 - 1]`
2146
+ });
2147
+ }
2148
+ chunkMDFSBU5W_cjs.assertI64(value);
2149
+ return value;
2150
+ }
2151
+ chunkPK6SKIKE_cjs.__name(convertI512ToI64, "convertI512ToI64");
2152
+ function convertI512ToI128(value) {
2153
+ chunkMDFSBU5W_cjs.assertI512(value);
2154
+ if (value < chunkMDFSBU5W_cjs.I128_MIN || value > chunkMDFSBU5W_cjs.I128_MAX) {
2155
+ throw new ConversionError(`Value is out of range for I128`, {
2156
+ sourceValue: value,
2157
+ sourceType: "I512",
2158
+ targetType: "I128",
2159
+ reason: `Value must be in range [-2^127, 2^127 - 1]`
2160
+ });
2161
+ }
2162
+ chunkMDFSBU5W_cjs.assertI128(value);
2163
+ return value;
2164
+ }
2165
+ chunkPK6SKIKE_cjs.__name(convertI512ToI128, "convertI512ToI128");
2166
+ function convertI512ToI256(value) {
2167
+ chunkMDFSBU5W_cjs.assertI512(value);
2168
+ if (value < chunkMDFSBU5W_cjs.I256_MIN || value > chunkMDFSBU5W_cjs.I256_MAX) {
2169
+ throw new ConversionError(`Value is out of range for I256`, {
2170
+ sourceValue: value,
2171
+ sourceType: "I512",
2172
+ targetType: "I256",
2173
+ reason: `Value must be in range [-2^255, 2^255 - 1]`
2174
+ });
2175
+ }
2176
+ chunkMDFSBU5W_cjs.assertI256(value);
2177
+ return value;
2178
+ }
2179
+ chunkPK6SKIKE_cjs.__name(convertI512ToI256, "convertI512ToI256");
2180
+ function convertI1024ToI8(value) {
2181
+ chunkMDFSBU5W_cjs.assertI1024(value);
2182
+ if (value < chunkMDFSBU5W_cjs.I8_MIN || value > chunkMDFSBU5W_cjs.I8_MAX) {
2183
+ throw new ConversionError(
2184
+ `Value is out of range for I8 [${String(chunkMDFSBU5W_cjs.I8_MIN)}, ${String(chunkMDFSBU5W_cjs.I8_MAX)}]`,
2185
+ {
2186
+ sourceValue: value,
2187
+ sourceType: "I1024",
2188
+ targetType: "I8",
2189
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I8_MIN)}, ${String(chunkMDFSBU5W_cjs.I8_MAX)}]`
2190
+ }
2191
+ );
2192
+ }
2193
+ chunkMDFSBU5W_cjs.assertI8(value);
2194
+ return value;
2195
+ }
2196
+ chunkPK6SKIKE_cjs.__name(convertI1024ToI8, "convertI1024ToI8");
2197
+ function convertI1024ToI16(value) {
2198
+ chunkMDFSBU5W_cjs.assertI1024(value);
2199
+ if (value < chunkMDFSBU5W_cjs.I16_MIN || value > chunkMDFSBU5W_cjs.I16_MAX) {
2200
+ throw new ConversionError(
2201
+ `Value is out of range for I16 [${String(chunkMDFSBU5W_cjs.I16_MIN)}, ${String(chunkMDFSBU5W_cjs.I16_MAX)}]`,
2202
+ {
2203
+ sourceValue: value,
2204
+ sourceType: "I1024",
2205
+ targetType: "I16",
2206
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I16_MIN)}, ${String(chunkMDFSBU5W_cjs.I16_MAX)}]`
2207
+ }
2208
+ );
2209
+ }
2210
+ chunkMDFSBU5W_cjs.assertI16(value);
2211
+ return value;
2212
+ }
2213
+ chunkPK6SKIKE_cjs.__name(convertI1024ToI16, "convertI1024ToI16");
2214
+ function convertI1024ToI32(value) {
2215
+ chunkMDFSBU5W_cjs.assertI1024(value);
2216
+ if (value < chunkMDFSBU5W_cjs.I32_MIN || value > chunkMDFSBU5W_cjs.I32_MAX) {
2217
+ throw new ConversionError(
2218
+ `Value is out of range for I32 [${String(chunkMDFSBU5W_cjs.I32_MIN)}, ${String(chunkMDFSBU5W_cjs.I32_MAX)}]`,
2219
+ {
2220
+ sourceValue: value,
2221
+ sourceType: "I1024",
2222
+ targetType: "I32",
2223
+ reason: `Value must be in range [${String(chunkMDFSBU5W_cjs.I32_MIN)}, ${String(chunkMDFSBU5W_cjs.I32_MAX)}]`
2224
+ }
2225
+ );
2226
+ }
2227
+ chunkMDFSBU5W_cjs.assertI32(value);
2228
+ return value;
2229
+ }
2230
+ chunkPK6SKIKE_cjs.__name(convertI1024ToI32, "convertI1024ToI32");
2231
+ function convertI1024ToI64(value) {
2232
+ chunkMDFSBU5W_cjs.assertI1024(value);
2233
+ if (value < chunkMDFSBU5W_cjs.I64_MIN || value > chunkMDFSBU5W_cjs.I64_MAX) {
2234
+ throw new ConversionError(`Value is out of range for I64`, {
2235
+ sourceValue: value,
2236
+ sourceType: "I1024",
2237
+ targetType: "I64",
2238
+ reason: `Value must be in range [-2^63, 2^63 - 1]`
2239
+ });
2240
+ }
2241
+ chunkMDFSBU5W_cjs.assertI64(value);
2242
+ return value;
2243
+ }
2244
+ chunkPK6SKIKE_cjs.__name(convertI1024ToI64, "convertI1024ToI64");
2245
+ function convertI1024ToI128(value) {
2246
+ chunkMDFSBU5W_cjs.assertI1024(value);
2247
+ if (value < chunkMDFSBU5W_cjs.I128_MIN || value > chunkMDFSBU5W_cjs.I128_MAX) {
2248
+ throw new ConversionError(`Value is out of range for I128`, {
2249
+ sourceValue: value,
2250
+ sourceType: "I1024",
2251
+ targetType: "I128",
2252
+ reason: `Value must be in range [-2^127, 2^127 - 1]`
2253
+ });
2254
+ }
2255
+ chunkMDFSBU5W_cjs.assertI128(value);
2256
+ return value;
2257
+ }
2258
+ chunkPK6SKIKE_cjs.__name(convertI1024ToI128, "convertI1024ToI128");
2259
+ function convertI1024ToI256(value) {
2260
+ chunkMDFSBU5W_cjs.assertI1024(value);
2261
+ if (value < chunkMDFSBU5W_cjs.I256_MIN || value > chunkMDFSBU5W_cjs.I256_MAX) {
2262
+ throw new ConversionError(`Value is out of range for I256`, {
2263
+ sourceValue: value,
2264
+ sourceType: "I1024",
2265
+ targetType: "I256",
2266
+ reason: `Value must be in range [-2^255, 2^255 - 1]`
2267
+ });
2268
+ }
2269
+ chunkMDFSBU5W_cjs.assertI256(value);
2270
+ return value;
2271
+ }
2272
+ chunkPK6SKIKE_cjs.__name(convertI1024ToI256, "convertI1024ToI256");
2273
+ function convertI1024ToI512(value) {
2274
+ chunkMDFSBU5W_cjs.assertI1024(value);
2275
+ if (value < chunkMDFSBU5W_cjs.I512_MIN || value > chunkMDFSBU5W_cjs.I512_MAX) {
2276
+ throw new ConversionError(`Value is out of range for I512`, {
2277
+ sourceValue: value,
2278
+ sourceType: "I1024",
2279
+ targetType: "I512",
2280
+ reason: `Value must be in range [-2^511, 2^511 - 1]`
2281
+ });
2282
+ }
2283
+ chunkMDFSBU5W_cjs.assertI512(value);
2284
+ return value;
2285
+ }
2286
+ chunkPK6SKIKE_cjs.__name(convertI1024ToI512, "convertI1024ToI512");
2287
+ function convertI8ToU8(value) {
2288
+ chunkMDFSBU5W_cjs.assertI8(value);
2289
+ if (value < 0n) {
2290
+ throw new ConversionError(`Cannot convert negative value ${String(value)} to unsigned type`, {
2291
+ sourceValue: value,
2292
+ sourceType: "I8",
2293
+ targetType: "U8",
2294
+ reason: "Value must be non-negative"
2295
+ });
2296
+ }
2297
+ chunkMDFSBU5W_cjs.assertU8(value);
2298
+ return value;
2299
+ }
2300
+ chunkPK6SKIKE_cjs.__name(convertI8ToU8, "convertI8ToU8");
2301
+ function convertI16ToU16(value) {
2302
+ chunkMDFSBU5W_cjs.assertI16(value);
2303
+ if (value < 0n) {
2304
+ throw new ConversionError(`Cannot convert negative value ${String(value)} to unsigned type`, {
2305
+ sourceValue: value,
2306
+ sourceType: "I16",
2307
+ targetType: "U16",
2308
+ reason: "Value must be non-negative"
2309
+ });
2310
+ }
2311
+ chunkMDFSBU5W_cjs.assertU16(value);
2312
+ return value;
2313
+ }
2314
+ chunkPK6SKIKE_cjs.__name(convertI16ToU16, "convertI16ToU16");
2315
+ function convertI32ToU32(value) {
2316
+ chunkMDFSBU5W_cjs.assertI32(value);
2317
+ if (value < 0n) {
2318
+ throw new ConversionError(`Cannot convert negative value ${String(value)} to unsigned type`, {
2319
+ sourceValue: value,
2320
+ sourceType: "I32",
2321
+ targetType: "U32",
2322
+ reason: "Value must be non-negative"
2323
+ });
2324
+ }
2325
+ chunkMDFSBU5W_cjs.assertU32(value);
2326
+ return value;
2327
+ }
2328
+ chunkPK6SKIKE_cjs.__name(convertI32ToU32, "convertI32ToU32");
2329
+ function convertI64ToU64(value) {
2330
+ chunkMDFSBU5W_cjs.assertI64(value);
2331
+ if (value < 0n) {
2332
+ throw new ConversionError(`Cannot convert negative value to unsigned type`, {
2333
+ sourceValue: value,
2334
+ sourceType: "I64",
2335
+ targetType: "U64",
2336
+ reason: "Value must be non-negative"
2337
+ });
2338
+ }
2339
+ chunkMDFSBU5W_cjs.assertU64(value);
2340
+ return value;
2341
+ }
2342
+ chunkPK6SKIKE_cjs.__name(convertI64ToU64, "convertI64ToU64");
2343
+ function convertI128ToU128(value) {
2344
+ chunkMDFSBU5W_cjs.assertI128(value);
2345
+ if (value < 0n) {
2346
+ throw new ConversionError(`Cannot convert negative value to unsigned type`, {
2347
+ sourceValue: value,
2348
+ sourceType: "I128",
2349
+ targetType: "U128",
2350
+ reason: "Value must be non-negative"
2351
+ });
2352
+ }
2353
+ chunkMDFSBU5W_cjs.assertU128(value);
2354
+ return value;
2355
+ }
2356
+ chunkPK6SKIKE_cjs.__name(convertI128ToU128, "convertI128ToU128");
2357
+ function convertI256ToU256(value) {
2358
+ chunkMDFSBU5W_cjs.assertI256(value);
2359
+ if (value < 0n) {
2360
+ throw new ConversionError(`Cannot convert negative value to unsigned type`, {
2361
+ sourceValue: value,
2362
+ sourceType: "I256",
2363
+ targetType: "U256",
2364
+ reason: "Value must be non-negative"
2365
+ });
2366
+ }
2367
+ chunkMDFSBU5W_cjs.assertU256(value);
2368
+ return value;
2369
+ }
2370
+ chunkPK6SKIKE_cjs.__name(convertI256ToU256, "convertI256ToU256");
2371
+ function convertI512ToU512(value) {
2372
+ chunkMDFSBU5W_cjs.assertI512(value);
2373
+ if (value < 0n) {
2374
+ throw new ConversionError(`Cannot convert negative value to unsigned type`, {
2375
+ sourceValue: value,
2376
+ sourceType: "I512",
2377
+ targetType: "U512",
2378
+ reason: "Value must be non-negative"
2379
+ });
2380
+ }
2381
+ chunkMDFSBU5W_cjs.assertU512(value);
2382
+ return value;
2383
+ }
2384
+ chunkPK6SKIKE_cjs.__name(convertI512ToU512, "convertI512ToU512");
2385
+ function convertI1024ToU1024(value) {
2386
+ chunkMDFSBU5W_cjs.assertI1024(value);
2387
+ if (value < 0n) {
2388
+ throw new ConversionError(`Cannot convert negative value to unsigned type`, {
2389
+ sourceValue: value,
2390
+ sourceType: "I1024",
2391
+ targetType: "U1024",
2392
+ reason: "Value must be non-negative"
2393
+ });
2394
+ }
2395
+ chunkMDFSBU5W_cjs.assertU1024(value);
2396
+ return value;
2397
+ }
2398
+ chunkPK6SKIKE_cjs.__name(convertI1024ToU1024, "convertI1024ToU1024");
2399
+ function convertU8ToI8(value) {
2400
+ chunkMDFSBU5W_cjs.assertU8(value);
2401
+ if (value > chunkMDFSBU5W_cjs.I8_MAX) {
2402
+ throw new ConversionError(`Value ${String(value)} exceeds I8 maximum of ${String(chunkMDFSBU5W_cjs.I8_MAX)}`, {
2403
+ sourceValue: value,
2404
+ sourceType: "U8",
2405
+ targetType: "I8",
2406
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.I8_MAX)}`
2407
+ });
2408
+ }
2409
+ chunkMDFSBU5W_cjs.assertI8(value);
2410
+ return value;
2411
+ }
2412
+ chunkPK6SKIKE_cjs.__name(convertU8ToI8, "convertU8ToI8");
2413
+ function convertU16ToI16(value) {
2414
+ chunkMDFSBU5W_cjs.assertU16(value);
2415
+ if (value > chunkMDFSBU5W_cjs.I16_MAX) {
2416
+ throw new ConversionError(`Value ${String(value)} exceeds I16 maximum of ${String(chunkMDFSBU5W_cjs.I16_MAX)}`, {
2417
+ sourceValue: value,
2418
+ sourceType: "U16",
2419
+ targetType: "I16",
2420
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.I16_MAX)}`
2421
+ });
2422
+ }
2423
+ chunkMDFSBU5W_cjs.assertI16(value);
2424
+ return value;
2425
+ }
2426
+ chunkPK6SKIKE_cjs.__name(convertU16ToI16, "convertU16ToI16");
2427
+ function convertU32ToI32(value) {
2428
+ chunkMDFSBU5W_cjs.assertU32(value);
2429
+ if (value > chunkMDFSBU5W_cjs.I32_MAX) {
2430
+ throw new ConversionError(`Value ${String(value)} exceeds I32 maximum of ${String(chunkMDFSBU5W_cjs.I32_MAX)}`, {
2431
+ sourceValue: value,
2432
+ sourceType: "U32",
2433
+ targetType: "I32",
2434
+ reason: `Value must be <= ${String(chunkMDFSBU5W_cjs.I32_MAX)}`
2435
+ });
2436
+ }
2437
+ chunkMDFSBU5W_cjs.assertI32(value);
2438
+ return value;
2439
+ }
2440
+ chunkPK6SKIKE_cjs.__name(convertU32ToI32, "convertU32ToI32");
2441
+ function convertU64ToI64(value) {
2442
+ chunkMDFSBU5W_cjs.assertU64(value);
2443
+ if (value > chunkMDFSBU5W_cjs.I64_MAX) {
2444
+ throw new ConversionError(`Value exceeds I64 maximum`, {
2445
+ sourceValue: value,
2446
+ sourceType: "U64",
2447
+ targetType: "I64",
2448
+ reason: `Value must be <= 2^63 - 1`
2449
+ });
2450
+ }
2451
+ chunkMDFSBU5W_cjs.assertI64(value);
2452
+ return value;
2453
+ }
2454
+ chunkPK6SKIKE_cjs.__name(convertU64ToI64, "convertU64ToI64");
2455
+ function convertU128ToI128(value) {
2456
+ chunkMDFSBU5W_cjs.assertU128(value);
2457
+ if (value > chunkMDFSBU5W_cjs.I128_MAX) {
2458
+ throw new ConversionError(`Value exceeds I128 maximum`, {
2459
+ sourceValue: value,
2460
+ sourceType: "U128",
2461
+ targetType: "I128",
2462
+ reason: `Value must be <= 2^127 - 1`
2463
+ });
2464
+ }
2465
+ chunkMDFSBU5W_cjs.assertI128(value);
2466
+ return value;
2467
+ }
2468
+ chunkPK6SKIKE_cjs.__name(convertU128ToI128, "convertU128ToI128");
2469
+ function convertU256ToI256(value) {
2470
+ chunkMDFSBU5W_cjs.assertU256(value);
2471
+ if (value > chunkMDFSBU5W_cjs.I256_MAX) {
2472
+ throw new ConversionError(`Value exceeds I256 maximum`, {
2473
+ sourceValue: value,
2474
+ sourceType: "U256",
2475
+ targetType: "I256",
2476
+ reason: `Value must be <= 2^255 - 1`
2477
+ });
2478
+ }
2479
+ chunkMDFSBU5W_cjs.assertI256(value);
2480
+ return value;
2481
+ }
2482
+ chunkPK6SKIKE_cjs.__name(convertU256ToI256, "convertU256ToI256");
2483
+ function convertU512ToI512(value) {
2484
+ chunkMDFSBU5W_cjs.assertU512(value);
2485
+ if (value > chunkMDFSBU5W_cjs.I512_MAX) {
2486
+ throw new ConversionError(`Value exceeds I512 maximum`, {
2487
+ sourceValue: value,
2488
+ sourceType: "U512",
2489
+ targetType: "I512",
2490
+ reason: `Value must be <= 2^511 - 1`
2491
+ });
2492
+ }
2493
+ chunkMDFSBU5W_cjs.assertI512(value);
2494
+ return value;
2495
+ }
2496
+ chunkPK6SKIKE_cjs.__name(convertU512ToI512, "convertU512ToI512");
2497
+ function convertU1024ToI1024(value) {
2498
+ chunkMDFSBU5W_cjs.assertU1024(value);
2499
+ if (value > chunkMDFSBU5W_cjs.I1024_MAX) {
2500
+ throw new ConversionError(`Value exceeds I1024 maximum`, {
2501
+ sourceValue: value,
2502
+ sourceType: "U1024",
2503
+ targetType: "I1024",
2504
+ reason: `Value must be <= 2^1023 - 1`
2505
+ });
2506
+ }
2507
+ chunkMDFSBU5W_cjs.assertI1024(value);
2508
+ return value;
2509
+ }
2510
+ chunkPK6SKIKE_cjs.__name(convertU1024ToI1024, "convertU1024ToI1024");
2511
+ function convertU8LeBytesToU8BeBytes(value) {
2512
+ chunkMDFSBU5W_cjs.assertU8LeBytes(value);
2513
+ const result = new Uint8Array(value);
2514
+ chunkMDFSBU5W_cjs.assertU8BeBytes(result);
2515
+ return result;
2516
+ }
2517
+ chunkPK6SKIKE_cjs.__name(convertU8LeBytesToU8BeBytes, "convertU8LeBytesToU8BeBytes");
2518
+ function convertU8BeBytesToU8LeBytes(value) {
2519
+ chunkMDFSBU5W_cjs.assertU8BeBytes(value);
2520
+ const result = new Uint8Array(value);
2521
+ chunkMDFSBU5W_cjs.assertU8LeBytes(result);
2522
+ return result;
2523
+ }
2524
+ chunkPK6SKIKE_cjs.__name(convertU8BeBytesToU8LeBytes, "convertU8BeBytesToU8LeBytes");
2525
+ function convertU16LeBytesToU16BeBytes(value) {
2526
+ chunkMDFSBU5W_cjs.assertU16LeBytes(value);
2527
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U16_BYTE_LENGTH);
2528
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U16_BYTE_LENGTH; index++) {
2529
+ result[index] = value[chunkMDFSBU5W_cjs.U16_BYTE_LENGTH - 1 - index];
2530
+ }
2531
+ chunkMDFSBU5W_cjs.assertU16BeBytes(result);
2532
+ return result;
2533
+ }
2534
+ chunkPK6SKIKE_cjs.__name(convertU16LeBytesToU16BeBytes, "convertU16LeBytesToU16BeBytes");
2535
+ function convertU16BeBytesToU16LeBytes(value) {
2536
+ chunkMDFSBU5W_cjs.assertU16BeBytes(value);
2537
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U16_BYTE_LENGTH);
2538
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U16_BYTE_LENGTH; index++) {
2539
+ result[index] = value[chunkMDFSBU5W_cjs.U16_BYTE_LENGTH - 1 - index];
2540
+ }
2541
+ chunkMDFSBU5W_cjs.assertU16LeBytes(result);
2542
+ return result;
2543
+ }
2544
+ chunkPK6SKIKE_cjs.__name(convertU16BeBytesToU16LeBytes, "convertU16BeBytesToU16LeBytes");
2545
+ function convertU32LeBytesToU32BeBytes(value) {
2546
+ chunkMDFSBU5W_cjs.assertU32LeBytes(value);
2547
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U32_BYTE_LENGTH);
2548
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U32_BYTE_LENGTH; index++) {
2549
+ result[index] = value[chunkMDFSBU5W_cjs.U32_BYTE_LENGTH - 1 - index];
2550
+ }
2551
+ chunkMDFSBU5W_cjs.assertU32BeBytes(result);
2552
+ return result;
2553
+ }
2554
+ chunkPK6SKIKE_cjs.__name(convertU32LeBytesToU32BeBytes, "convertU32LeBytesToU32BeBytes");
2555
+ function convertU32BeBytesToU32LeBytes(value) {
2556
+ chunkMDFSBU5W_cjs.assertU32BeBytes(value);
2557
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U32_BYTE_LENGTH);
2558
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U32_BYTE_LENGTH; index++) {
2559
+ result[index] = value[chunkMDFSBU5W_cjs.U32_BYTE_LENGTH - 1 - index];
2560
+ }
2561
+ chunkMDFSBU5W_cjs.assertU32LeBytes(result);
2562
+ return result;
2563
+ }
2564
+ chunkPK6SKIKE_cjs.__name(convertU32BeBytesToU32LeBytes, "convertU32BeBytesToU32LeBytes");
2565
+ function convertU64LeBytesToU64BeBytes(value) {
2566
+ chunkMDFSBU5W_cjs.assertU64LeBytes(value);
2567
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U64_BYTE_LENGTH);
2568
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U64_BYTE_LENGTH; index++) {
2569
+ result[index] = value[chunkMDFSBU5W_cjs.U64_BYTE_LENGTH - 1 - index];
2570
+ }
2571
+ chunkMDFSBU5W_cjs.assertU64BeBytes(result);
2572
+ return result;
2573
+ }
2574
+ chunkPK6SKIKE_cjs.__name(convertU64LeBytesToU64BeBytes, "convertU64LeBytesToU64BeBytes");
2575
+ function convertU64BeBytesToU64LeBytes(value) {
2576
+ chunkMDFSBU5W_cjs.assertU64BeBytes(value);
2577
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U64_BYTE_LENGTH);
2578
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U64_BYTE_LENGTH; index++) {
2579
+ result[index] = value[chunkMDFSBU5W_cjs.U64_BYTE_LENGTH - 1 - index];
2580
+ }
2581
+ chunkMDFSBU5W_cjs.assertU64LeBytes(result);
2582
+ return result;
2583
+ }
2584
+ chunkPK6SKIKE_cjs.__name(convertU64BeBytesToU64LeBytes, "convertU64BeBytesToU64LeBytes");
2585
+ function convertU128LeBytesToU128BeBytes(value) {
2586
+ chunkMDFSBU5W_cjs.assertU128LeBytes(value);
2587
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U128_BYTE_LENGTH);
2588
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U128_BYTE_LENGTH; index++) {
2589
+ result[index] = value[chunkMDFSBU5W_cjs.U128_BYTE_LENGTH - 1 - index];
2590
+ }
2591
+ chunkMDFSBU5W_cjs.assertU128BeBytes(result);
2592
+ return result;
2593
+ }
2594
+ chunkPK6SKIKE_cjs.__name(convertU128LeBytesToU128BeBytes, "convertU128LeBytesToU128BeBytes");
2595
+ function convertU128BeBytesToU128LeBytes(value) {
2596
+ chunkMDFSBU5W_cjs.assertU128BeBytes(value);
2597
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U128_BYTE_LENGTH);
2598
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U128_BYTE_LENGTH; index++) {
2599
+ result[index] = value[chunkMDFSBU5W_cjs.U128_BYTE_LENGTH - 1 - index];
2600
+ }
2601
+ chunkMDFSBU5W_cjs.assertU128LeBytes(result);
2602
+ return result;
2603
+ }
2604
+ chunkPK6SKIKE_cjs.__name(convertU128BeBytesToU128LeBytes, "convertU128BeBytesToU128LeBytes");
2605
+ function convertU256LeBytesToU256BeBytes(value) {
2606
+ chunkMDFSBU5W_cjs.assertU256LeBytes(value);
2607
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U256_BYTE_LENGTH);
2608
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U256_BYTE_LENGTH; index++) {
2609
+ result[index] = value[chunkMDFSBU5W_cjs.U256_BYTE_LENGTH - 1 - index];
2610
+ }
2611
+ chunkMDFSBU5W_cjs.assertU256BeBytes(result);
2612
+ return result;
2613
+ }
2614
+ chunkPK6SKIKE_cjs.__name(convertU256LeBytesToU256BeBytes, "convertU256LeBytesToU256BeBytes");
2615
+ function convertU256BeBytesToU256LeBytes(value) {
2616
+ chunkMDFSBU5W_cjs.assertU256BeBytes(value);
2617
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U256_BYTE_LENGTH);
2618
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U256_BYTE_LENGTH; index++) {
2619
+ result[index] = value[chunkMDFSBU5W_cjs.U256_BYTE_LENGTH - 1 - index];
2620
+ }
2621
+ chunkMDFSBU5W_cjs.assertU256LeBytes(result);
2622
+ return result;
2623
+ }
2624
+ chunkPK6SKIKE_cjs.__name(convertU256BeBytesToU256LeBytes, "convertU256BeBytesToU256LeBytes");
2625
+ function convertU512LeBytesToU512BeBytes(value) {
2626
+ chunkMDFSBU5W_cjs.assertU512LeBytes(value);
2627
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U512_BYTE_LENGTH);
2628
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U512_BYTE_LENGTH; index++) {
2629
+ result[index] = value[chunkMDFSBU5W_cjs.U512_BYTE_LENGTH - 1 - index];
2630
+ }
2631
+ chunkMDFSBU5W_cjs.assertU512BeBytes(result);
2632
+ return result;
2633
+ }
2634
+ chunkPK6SKIKE_cjs.__name(convertU512LeBytesToU512BeBytes, "convertU512LeBytesToU512BeBytes");
2635
+ function convertU512BeBytesToU512LeBytes(value) {
2636
+ chunkMDFSBU5W_cjs.assertU512BeBytes(value);
2637
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U512_BYTE_LENGTH);
2638
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U512_BYTE_LENGTH; index++) {
2639
+ result[index] = value[chunkMDFSBU5W_cjs.U512_BYTE_LENGTH - 1 - index];
2640
+ }
2641
+ chunkMDFSBU5W_cjs.assertU512LeBytes(result);
2642
+ return result;
2643
+ }
2644
+ chunkPK6SKIKE_cjs.__name(convertU512BeBytesToU512LeBytes, "convertU512BeBytesToU512LeBytes");
2645
+ function convertU1024LeBytesToU1024BeBytes(value) {
2646
+ chunkMDFSBU5W_cjs.assertU1024LeBytes(value);
2647
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U1024_BYTE_LENGTH);
2648
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U1024_BYTE_LENGTH; index++) {
2649
+ result[index] = value[chunkMDFSBU5W_cjs.U1024_BYTE_LENGTH - 1 - index];
2650
+ }
2651
+ chunkMDFSBU5W_cjs.assertU1024BeBytes(result);
2652
+ return result;
2653
+ }
2654
+ chunkPK6SKIKE_cjs.__name(convertU1024LeBytesToU1024BeBytes, "convertU1024LeBytesToU1024BeBytes");
2655
+ function convertU1024BeBytesToU1024LeBytes(value) {
2656
+ chunkMDFSBU5W_cjs.assertU1024BeBytes(value);
2657
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U1024_BYTE_LENGTH);
2658
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U1024_BYTE_LENGTH; index++) {
2659
+ result[index] = value[chunkMDFSBU5W_cjs.U1024_BYTE_LENGTH - 1 - index];
2660
+ }
2661
+ chunkMDFSBU5W_cjs.assertU1024LeBytes(result);
2662
+ return result;
2663
+ }
2664
+ chunkPK6SKIKE_cjs.__name(convertU1024BeBytesToU1024LeBytes, "convertU1024BeBytesToU1024LeBytes");
2665
+ function encodeU8ToU8LeBytes(value) {
2666
+ chunkMDFSBU5W_cjs.assertU8(value);
2667
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U8_BYTE_LENGTH);
2668
+ result[0] = Number(value);
2669
+ chunkMDFSBU5W_cjs.assertU8LeBytes(result);
2670
+ return result;
2671
+ }
2672
+ chunkPK6SKIKE_cjs.__name(encodeU8ToU8LeBytes, "encodeU8ToU8LeBytes");
2673
+ function encodeU8ToU8BeBytes(value) {
2674
+ chunkMDFSBU5W_cjs.assertU8(value);
2675
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U8_BYTE_LENGTH);
2676
+ result[0] = Number(value);
2677
+ chunkMDFSBU5W_cjs.assertU8BeBytes(result);
2678
+ return result;
2679
+ }
2680
+ chunkPK6SKIKE_cjs.__name(encodeU8ToU8BeBytes, "encodeU8ToU8BeBytes");
2681
+ function encodeU16ToU16LeBytes(value) {
2682
+ chunkMDFSBU5W_cjs.assertU16(value);
2683
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U16_BYTE_LENGTH);
2684
+ let temporary = value;
2685
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U16_BYTE_LENGTH; index++) {
2686
+ result[index] = Number(temporary & 0xffn);
2687
+ temporary >>= 8n;
2688
+ }
2689
+ chunkMDFSBU5W_cjs.assertU16LeBytes(result);
2690
+ return result;
2691
+ }
2692
+ chunkPK6SKIKE_cjs.__name(encodeU16ToU16LeBytes, "encodeU16ToU16LeBytes");
2693
+ function encodeU16ToU16BeBytes(value) {
2694
+ chunkMDFSBU5W_cjs.assertU16(value);
2695
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U16_BYTE_LENGTH);
2696
+ let temporary = value;
2697
+ for (let index = chunkMDFSBU5W_cjs.U16_BYTE_LENGTH - 1; index >= 0; index--) {
2698
+ result[index] = Number(temporary & 0xffn);
2699
+ temporary >>= 8n;
2700
+ }
2701
+ chunkMDFSBU5W_cjs.assertU16BeBytes(result);
2702
+ return result;
2703
+ }
2704
+ chunkPK6SKIKE_cjs.__name(encodeU16ToU16BeBytes, "encodeU16ToU16BeBytes");
2705
+ function encodeU32ToU32LeBytes(value) {
2706
+ chunkMDFSBU5W_cjs.assertU32(value);
2707
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U32_BYTE_LENGTH);
2708
+ let temporary = value;
2709
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U32_BYTE_LENGTH; index++) {
2710
+ result[index] = Number(temporary & 0xffn);
2711
+ temporary >>= 8n;
2712
+ }
2713
+ chunkMDFSBU5W_cjs.assertU32LeBytes(result);
2714
+ return result;
2715
+ }
2716
+ chunkPK6SKIKE_cjs.__name(encodeU32ToU32LeBytes, "encodeU32ToU32LeBytes");
2717
+ function encodeU32ToU32BeBytes(value) {
2718
+ chunkMDFSBU5W_cjs.assertU32(value);
2719
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U32_BYTE_LENGTH);
2720
+ let temporary = value;
2721
+ for (let index = chunkMDFSBU5W_cjs.U32_BYTE_LENGTH - 1; index >= 0; index--) {
2722
+ result[index] = Number(temporary & 0xffn);
2723
+ temporary >>= 8n;
2724
+ }
2725
+ chunkMDFSBU5W_cjs.assertU32BeBytes(result);
2726
+ return result;
2727
+ }
2728
+ chunkPK6SKIKE_cjs.__name(encodeU32ToU32BeBytes, "encodeU32ToU32BeBytes");
2729
+ function encodeU64ToU64LeBytes(value) {
2730
+ chunkMDFSBU5W_cjs.assertU64(value);
2731
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U64_BYTE_LENGTH);
2732
+ let temporary = value;
2733
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U64_BYTE_LENGTH; index++) {
2734
+ result[index] = Number(temporary & 0xffn);
2735
+ temporary >>= 8n;
2736
+ }
2737
+ chunkMDFSBU5W_cjs.assertU64LeBytes(result);
2738
+ return result;
2739
+ }
2740
+ chunkPK6SKIKE_cjs.__name(encodeU64ToU64LeBytes, "encodeU64ToU64LeBytes");
2741
+ function encodeU64ToU64BeBytes(value) {
2742
+ chunkMDFSBU5W_cjs.assertU64(value);
2743
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U64_BYTE_LENGTH);
2744
+ let temporary = value;
2745
+ for (let index = chunkMDFSBU5W_cjs.U64_BYTE_LENGTH - 1; index >= 0; index--) {
2746
+ result[index] = Number(temporary & 0xffn);
2747
+ temporary >>= 8n;
2748
+ }
2749
+ chunkMDFSBU5W_cjs.assertU64BeBytes(result);
2750
+ return result;
2751
+ }
2752
+ chunkPK6SKIKE_cjs.__name(encodeU64ToU64BeBytes, "encodeU64ToU64BeBytes");
2753
+ function encodeU128ToU128LeBytes(value) {
2754
+ chunkMDFSBU5W_cjs.assertU128(value);
2755
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U128_BYTE_LENGTH);
2756
+ let temporary = value;
2757
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U128_BYTE_LENGTH; index++) {
2758
+ result[index] = Number(temporary & 0xffn);
2759
+ temporary >>= 8n;
2760
+ }
2761
+ chunkMDFSBU5W_cjs.assertU128LeBytes(result);
2762
+ return result;
2763
+ }
2764
+ chunkPK6SKIKE_cjs.__name(encodeU128ToU128LeBytes, "encodeU128ToU128LeBytes");
2765
+ function encodeU128ToU128BeBytes(value) {
2766
+ chunkMDFSBU5W_cjs.assertU128(value);
2767
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U128_BYTE_LENGTH);
2768
+ let temporary = value;
2769
+ for (let index = chunkMDFSBU5W_cjs.U128_BYTE_LENGTH - 1; index >= 0; index--) {
2770
+ result[index] = Number(temporary & 0xffn);
2771
+ temporary >>= 8n;
2772
+ }
2773
+ chunkMDFSBU5W_cjs.assertU128BeBytes(result);
2774
+ return result;
2775
+ }
2776
+ chunkPK6SKIKE_cjs.__name(encodeU128ToU128BeBytes, "encodeU128ToU128BeBytes");
2777
+ function encodeU256ToU256LeBytes(value) {
2778
+ chunkMDFSBU5W_cjs.assertU256(value);
2779
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U256_BYTE_LENGTH);
2780
+ let temporary = value;
2781
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U256_BYTE_LENGTH; index++) {
2782
+ result[index] = Number(temporary & 0xffn);
2783
+ temporary >>= 8n;
2784
+ }
2785
+ chunkMDFSBU5W_cjs.assertU256LeBytes(result);
2786
+ return result;
2787
+ }
2788
+ chunkPK6SKIKE_cjs.__name(encodeU256ToU256LeBytes, "encodeU256ToU256LeBytes");
2789
+ function encodeU256ToU256BeBytes(value) {
2790
+ chunkMDFSBU5W_cjs.assertU256(value);
2791
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U256_BYTE_LENGTH);
2792
+ let temporary = value;
2793
+ for (let index = chunkMDFSBU5W_cjs.U256_BYTE_LENGTH - 1; index >= 0; index--) {
2794
+ result[index] = Number(temporary & 0xffn);
2795
+ temporary >>= 8n;
2796
+ }
2797
+ chunkMDFSBU5W_cjs.assertU256BeBytes(result);
2798
+ return result;
2799
+ }
2800
+ chunkPK6SKIKE_cjs.__name(encodeU256ToU256BeBytes, "encodeU256ToU256BeBytes");
2801
+ function encodeU512ToU512LeBytes(value) {
2802
+ chunkMDFSBU5W_cjs.assertU512(value);
2803
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U512_BYTE_LENGTH);
2804
+ let temporary = value;
2805
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U512_BYTE_LENGTH; index++) {
2806
+ result[index] = Number(temporary & 0xffn);
2807
+ temporary >>= 8n;
2808
+ }
2809
+ chunkMDFSBU5W_cjs.assertU512LeBytes(result);
2810
+ return result;
2811
+ }
2812
+ chunkPK6SKIKE_cjs.__name(encodeU512ToU512LeBytes, "encodeU512ToU512LeBytes");
2813
+ function encodeU512ToU512BeBytes(value) {
2814
+ chunkMDFSBU5W_cjs.assertU512(value);
2815
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U512_BYTE_LENGTH);
2816
+ let temporary = value;
2817
+ for (let index = chunkMDFSBU5W_cjs.U512_BYTE_LENGTH - 1; index >= 0; index--) {
2818
+ result[index] = Number(temporary & 0xffn);
2819
+ temporary >>= 8n;
2820
+ }
2821
+ chunkMDFSBU5W_cjs.assertU512BeBytes(result);
2822
+ return result;
2823
+ }
2824
+ chunkPK6SKIKE_cjs.__name(encodeU512ToU512BeBytes, "encodeU512ToU512BeBytes");
2825
+ function encodeU1024ToU1024LeBytes(value) {
2826
+ chunkMDFSBU5W_cjs.assertU1024(value);
2827
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U1024_BYTE_LENGTH);
2828
+ let temporary = value;
2829
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U1024_BYTE_LENGTH; index++) {
2830
+ result[index] = Number(temporary & 0xffn);
2831
+ temporary >>= 8n;
2832
+ }
2833
+ chunkMDFSBU5W_cjs.assertU1024LeBytes(result);
2834
+ return result;
2835
+ }
2836
+ chunkPK6SKIKE_cjs.__name(encodeU1024ToU1024LeBytes, "encodeU1024ToU1024LeBytes");
2837
+ function encodeU1024ToU1024BeBytes(value) {
2838
+ chunkMDFSBU5W_cjs.assertU1024(value);
2839
+ const result = new Uint8Array(chunkMDFSBU5W_cjs.U1024_BYTE_LENGTH);
2840
+ let temporary = value;
2841
+ for (let index = chunkMDFSBU5W_cjs.U1024_BYTE_LENGTH - 1; index >= 0; index--) {
2842
+ result[index] = Number(temporary & 0xffn);
2843
+ temporary >>= 8n;
2844
+ }
2845
+ chunkMDFSBU5W_cjs.assertU1024BeBytes(result);
2846
+ return result;
2847
+ }
2848
+ chunkPK6SKIKE_cjs.__name(encodeU1024ToU1024BeBytes, "encodeU1024ToU1024BeBytes");
2849
+ function decodeU8LeBytesToU8(value) {
2850
+ chunkMDFSBU5W_cjs.assertU8LeBytes(value);
2851
+ const result = BigInt(value[0]);
2852
+ chunkMDFSBU5W_cjs.assertU8(result);
2853
+ return result;
2854
+ }
2855
+ chunkPK6SKIKE_cjs.__name(decodeU8LeBytesToU8, "decodeU8LeBytesToU8");
2856
+ function decodeU8BeBytesToU8(value) {
2857
+ chunkMDFSBU5W_cjs.assertU8BeBytes(value);
2858
+ const result = BigInt(value[0]);
2859
+ chunkMDFSBU5W_cjs.assertU8(result);
2860
+ return result;
2861
+ }
2862
+ chunkPK6SKIKE_cjs.__name(decodeU8BeBytesToU8, "decodeU8BeBytesToU8");
2863
+ function decodeU16LeBytesToU16(value) {
2864
+ chunkMDFSBU5W_cjs.assertU16LeBytes(value);
2865
+ let result = 0n;
2866
+ for (let index = chunkMDFSBU5W_cjs.U16_BYTE_LENGTH - 1; index >= 0; index--) {
2867
+ result = result << 8n | BigInt(value[index]);
2868
+ }
2869
+ chunkMDFSBU5W_cjs.assertU16(result);
2870
+ return result;
2871
+ }
2872
+ chunkPK6SKIKE_cjs.__name(decodeU16LeBytesToU16, "decodeU16LeBytesToU16");
2873
+ function decodeU16BeBytesToU16(value) {
2874
+ chunkMDFSBU5W_cjs.assertU16BeBytes(value);
2875
+ let result = 0n;
2876
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U16_BYTE_LENGTH; index++) {
2877
+ result = result << 8n | BigInt(value[index]);
2878
+ }
2879
+ chunkMDFSBU5W_cjs.assertU16(result);
2880
+ return result;
2881
+ }
2882
+ chunkPK6SKIKE_cjs.__name(decodeU16BeBytesToU16, "decodeU16BeBytesToU16");
2883
+ function decodeU32LeBytesToU32(value) {
2884
+ chunkMDFSBU5W_cjs.assertU32LeBytes(value);
2885
+ let result = 0n;
2886
+ for (let index = chunkMDFSBU5W_cjs.U32_BYTE_LENGTH - 1; index >= 0; index--) {
2887
+ result = result << 8n | BigInt(value[index]);
2888
+ }
2889
+ chunkMDFSBU5W_cjs.assertU32(result);
2890
+ return result;
2891
+ }
2892
+ chunkPK6SKIKE_cjs.__name(decodeU32LeBytesToU32, "decodeU32LeBytesToU32");
2893
+ function decodeU32BeBytesToU32(value) {
2894
+ chunkMDFSBU5W_cjs.assertU32BeBytes(value);
2895
+ let result = 0n;
2896
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U32_BYTE_LENGTH; index++) {
2897
+ result = result << 8n | BigInt(value[index]);
2898
+ }
2899
+ chunkMDFSBU5W_cjs.assertU32(result);
2900
+ return result;
2901
+ }
2902
+ chunkPK6SKIKE_cjs.__name(decodeU32BeBytesToU32, "decodeU32BeBytesToU32");
2903
+ function decodeU64LeBytesToU64(value) {
2904
+ chunkMDFSBU5W_cjs.assertU64LeBytes(value);
2905
+ let result = 0n;
2906
+ for (let index = chunkMDFSBU5W_cjs.U64_BYTE_LENGTH - 1; index >= 0; index--) {
2907
+ result = result << 8n | BigInt(value[index]);
2908
+ }
2909
+ chunkMDFSBU5W_cjs.assertU64(result);
2910
+ return result;
2911
+ }
2912
+ chunkPK6SKIKE_cjs.__name(decodeU64LeBytesToU64, "decodeU64LeBytesToU64");
2913
+ function decodeU64BeBytesToU64(value) {
2914
+ chunkMDFSBU5W_cjs.assertU64BeBytes(value);
2915
+ let result = 0n;
2916
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U64_BYTE_LENGTH; index++) {
2917
+ result = result << 8n | BigInt(value[index]);
2918
+ }
2919
+ chunkMDFSBU5W_cjs.assertU64(result);
2920
+ return result;
2921
+ }
2922
+ chunkPK6SKIKE_cjs.__name(decodeU64BeBytesToU64, "decodeU64BeBytesToU64");
2923
+ function decodeU128LeBytesToU128(value) {
2924
+ chunkMDFSBU5W_cjs.assertU128LeBytes(value);
2925
+ let result = 0n;
2926
+ for (let index = chunkMDFSBU5W_cjs.U128_BYTE_LENGTH - 1; index >= 0; index--) {
2927
+ result = result << 8n | BigInt(value[index]);
2928
+ }
2929
+ chunkMDFSBU5W_cjs.assertU128(result);
2930
+ return result;
2931
+ }
2932
+ chunkPK6SKIKE_cjs.__name(decodeU128LeBytesToU128, "decodeU128LeBytesToU128");
2933
+ function decodeU128BeBytesToU128(value) {
2934
+ chunkMDFSBU5W_cjs.assertU128BeBytes(value);
2935
+ let result = 0n;
2936
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U128_BYTE_LENGTH; index++) {
2937
+ result = result << 8n | BigInt(value[index]);
2938
+ }
2939
+ chunkMDFSBU5W_cjs.assertU128(result);
2940
+ return result;
2941
+ }
2942
+ chunkPK6SKIKE_cjs.__name(decodeU128BeBytesToU128, "decodeU128BeBytesToU128");
2943
+ function decodeU256LeBytesToU256(value) {
2944
+ chunkMDFSBU5W_cjs.assertU256LeBytes(value);
2945
+ let result = 0n;
2946
+ for (let index = chunkMDFSBU5W_cjs.U256_BYTE_LENGTH - 1; index >= 0; index--) {
2947
+ result = result << 8n | BigInt(value[index]);
2948
+ }
2949
+ chunkMDFSBU5W_cjs.assertU256(result);
2950
+ return result;
2951
+ }
2952
+ chunkPK6SKIKE_cjs.__name(decodeU256LeBytesToU256, "decodeU256LeBytesToU256");
2953
+ function decodeU256BeBytesToU256(value) {
2954
+ chunkMDFSBU5W_cjs.assertU256BeBytes(value);
2955
+ let result = 0n;
2956
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U256_BYTE_LENGTH; index++) {
2957
+ result = result << 8n | BigInt(value[index]);
2958
+ }
2959
+ chunkMDFSBU5W_cjs.assertU256(result);
2960
+ return result;
2961
+ }
2962
+ chunkPK6SKIKE_cjs.__name(decodeU256BeBytesToU256, "decodeU256BeBytesToU256");
2963
+ function decodeU512LeBytesToU512(value) {
2964
+ chunkMDFSBU5W_cjs.assertU512LeBytes(value);
2965
+ let result = 0n;
2966
+ for (let index = chunkMDFSBU5W_cjs.U512_BYTE_LENGTH - 1; index >= 0; index--) {
2967
+ result = result << 8n | BigInt(value[index]);
2968
+ }
2969
+ chunkMDFSBU5W_cjs.assertU512(result);
2970
+ return result;
2971
+ }
2972
+ chunkPK6SKIKE_cjs.__name(decodeU512LeBytesToU512, "decodeU512LeBytesToU512");
2973
+ function decodeU512BeBytesToU512(value) {
2974
+ chunkMDFSBU5W_cjs.assertU512BeBytes(value);
2975
+ let result = 0n;
2976
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U512_BYTE_LENGTH; index++) {
2977
+ result = result << 8n | BigInt(value[index]);
2978
+ }
2979
+ chunkMDFSBU5W_cjs.assertU512(result);
2980
+ return result;
2981
+ }
2982
+ chunkPK6SKIKE_cjs.__name(decodeU512BeBytesToU512, "decodeU512BeBytesToU512");
2983
+ function decodeU1024LeBytesToU1024(value) {
2984
+ chunkMDFSBU5W_cjs.assertU1024LeBytes(value);
2985
+ let result = 0n;
2986
+ for (let index = chunkMDFSBU5W_cjs.U1024_BYTE_LENGTH - 1; index >= 0; index--) {
2987
+ result = result << 8n | BigInt(value[index]);
2988
+ }
2989
+ chunkMDFSBU5W_cjs.assertU1024(result);
2990
+ return result;
2991
+ }
2992
+ chunkPK6SKIKE_cjs.__name(decodeU1024LeBytesToU1024, "decodeU1024LeBytesToU1024");
2993
+ function decodeU1024BeBytesToU1024(value) {
2994
+ chunkMDFSBU5W_cjs.assertU1024BeBytes(value);
2995
+ let result = 0n;
2996
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U1024_BYTE_LENGTH; index++) {
2997
+ result = result << 8n | BigInt(value[index]);
2998
+ }
2999
+ chunkMDFSBU5W_cjs.assertU1024(result);
3000
+ return result;
3001
+ }
3002
+ chunkPK6SKIKE_cjs.__name(decodeU1024BeBytesToU1024, "decodeU1024BeBytesToU1024");
3003
+
3004
+ // src/common/converters/cryptography.ts
3005
+ function convertU256ToBn254FieldElement(value) {
3006
+ chunkMDFSBU5W_cjs.assertU256(value);
3007
+ if (value >= chunkMDFSBU5W_cjs.BN254_FIELD_PRIME) {
3008
+ throw new ConversionError(`Value exceeds BN254 field prime`, {
3009
+ sourceValue: value,
3010
+ sourceType: "U256",
3011
+ targetType: "Bn254FieldElement",
3012
+ reason: `Value must be < ${String(chunkMDFSBU5W_cjs.BN254_FIELD_PRIME)}`
3013
+ });
3014
+ }
3015
+ chunkMDFSBU5W_cjs.assertBn254FieldElement(value);
3016
+ return value;
3017
+ }
3018
+ chunkPK6SKIKE_cjs.__name(convertU256ToBn254FieldElement, "convertU256ToBn254FieldElement");
3019
+ function convertBn254FieldElementToU256(value) {
3020
+ chunkMDFSBU5W_cjs.assertBn254FieldElement(value);
3021
+ chunkMDFSBU5W_cjs.assertU256(value);
3022
+ return value;
3023
+ }
3024
+ chunkPK6SKIKE_cjs.__name(convertBn254FieldElementToU256, "convertBn254FieldElementToU256");
3025
+ function convertU256ToCurve25519FieldElement(value) {
3026
+ chunkMDFSBU5W_cjs.assertU256(value);
3027
+ if (value >= chunkMDFSBU5W_cjs.CURVE25519_FIELD_PRIME) {
3028
+ throw new ConversionError(`Value exceeds Curve25519 field prime`, {
3029
+ sourceValue: value,
3030
+ sourceType: "U256",
3031
+ targetType: "Curve25519FieldElement",
3032
+ reason: "Value must be < 2^255 - 19"
3033
+ });
3034
+ }
3035
+ chunkMDFSBU5W_cjs.assertCurve25519FieldElement(value);
3036
+ return value;
3037
+ }
3038
+ chunkPK6SKIKE_cjs.__name(convertU256ToCurve25519FieldElement, "convertU256ToCurve25519FieldElement");
3039
+ function convertCurve25519FieldElementToU256(value) {
3040
+ chunkMDFSBU5W_cjs.assertCurve25519FieldElement(value);
3041
+ chunkMDFSBU5W_cjs.assertU256(value);
3042
+ return value;
3043
+ }
3044
+ chunkPK6SKIKE_cjs.__name(convertCurve25519FieldElementToU256, "convertCurve25519FieldElementToU256");
3045
+ function convertBn254FieldElementToCurve25519FieldElement(value) {
3046
+ chunkMDFSBU5W_cjs.assertBn254FieldElement(value);
3047
+ if (value >= chunkMDFSBU5W_cjs.CURVE25519_FIELD_PRIME) {
3048
+ throw new ConversionError(`BN254 field element exceeds Curve25519 field prime`, {
3049
+ sourceValue: value,
3050
+ sourceType: "Bn254FieldElement",
3051
+ targetType: "Curve25519FieldElement",
3052
+ reason: "Value must be < 2^255 - 19"
3053
+ });
3054
+ }
3055
+ chunkMDFSBU5W_cjs.assertCurve25519FieldElement(value);
3056
+ return value;
3057
+ }
3058
+ chunkPK6SKIKE_cjs.__name(convertBn254FieldElementToCurve25519FieldElement, "convertBn254FieldElementToCurve25519FieldElement");
3059
+ function convertCurve25519FieldElementToBn254FieldElement(value) {
3060
+ chunkMDFSBU5W_cjs.assertCurve25519FieldElement(value);
3061
+ chunkMDFSBU5W_cjs.assertBn254FieldElement(value);
3062
+ return value;
3063
+ }
3064
+ chunkPK6SKIKE_cjs.__name(convertCurve25519FieldElementToBn254FieldElement, "convertCurve25519FieldElementToBn254FieldElement");
3065
+ function convertBn254FieldElementToPoseidonPlaintext(value) {
3066
+ chunkMDFSBU5W_cjs.assertBn254FieldElement(value);
3067
+ chunkMDFSBU5W_cjs.assertPoseidonPlaintext(value);
3068
+ return value;
3069
+ }
3070
+ chunkPK6SKIKE_cjs.__name(convertBn254FieldElementToPoseidonPlaintext, "convertBn254FieldElementToPoseidonPlaintext");
3071
+ function convertBn254FieldElementToPoseidonHash(value) {
3072
+ chunkMDFSBU5W_cjs.assertBn254FieldElement(value);
3073
+ chunkMDFSBU5W_cjs.assertPoseidonHash(value);
3074
+ return value;
3075
+ }
3076
+ chunkPK6SKIKE_cjs.__name(convertBn254FieldElementToPoseidonHash, "convertBn254FieldElementToPoseidonHash");
3077
+ function convertBn254FieldElementToPoseidonKey(value) {
3078
+ chunkMDFSBU5W_cjs.assertBn254FieldElement(value);
3079
+ chunkMDFSBU5W_cjs.assertPoseidonKey(value);
3080
+ return value;
3081
+ }
3082
+ chunkPK6SKIKE_cjs.__name(convertBn254FieldElementToPoseidonKey, "convertBn254FieldElementToPoseidonKey");
3083
+ function convertBn254FieldElementToPoseidonCiphertext(value) {
3084
+ chunkMDFSBU5W_cjs.assertBn254FieldElement(value);
3085
+ chunkMDFSBU5W_cjs.assertPoseidonCiphertext(value);
3086
+ return value;
3087
+ }
3088
+ chunkPK6SKIKE_cjs.__name(convertBn254FieldElementToPoseidonCiphertext, "convertBn254FieldElementToPoseidonCiphertext");
3089
+ function convertPoseidonPlaintextToBn254FieldElement(value) {
3090
+ chunkMDFSBU5W_cjs.assertPoseidonPlaintext(value);
3091
+ chunkMDFSBU5W_cjs.assertBn254FieldElement(value);
3092
+ return value;
3093
+ }
3094
+ chunkPK6SKIKE_cjs.__name(convertPoseidonPlaintextToBn254FieldElement, "convertPoseidonPlaintextToBn254FieldElement");
3095
+ function convertPoseidonHashToBn254FieldElement(value) {
3096
+ chunkMDFSBU5W_cjs.assertPoseidonHash(value);
3097
+ chunkMDFSBU5W_cjs.assertBn254FieldElement(value);
3098
+ return value;
3099
+ }
3100
+ chunkPK6SKIKE_cjs.__name(convertPoseidonHashToBn254FieldElement, "convertPoseidonHashToBn254FieldElement");
3101
+ function convertPoseidonKeyToBn254FieldElement(value) {
3102
+ chunkMDFSBU5W_cjs.assertPoseidonKey(value);
3103
+ chunkMDFSBU5W_cjs.assertBn254FieldElement(value);
3104
+ return value;
3105
+ }
3106
+ chunkPK6SKIKE_cjs.__name(convertPoseidonKeyToBn254FieldElement, "convertPoseidonKeyToBn254FieldElement");
3107
+ function convertPoseidonCiphertextToBn254FieldElement(value) {
3108
+ chunkMDFSBU5W_cjs.assertPoseidonCiphertext(value);
3109
+ chunkMDFSBU5W_cjs.assertBn254FieldElement(value);
3110
+ return value;
3111
+ }
3112
+ chunkPK6SKIKE_cjs.__name(convertPoseidonCiphertextToBn254FieldElement, "convertPoseidonCiphertextToBn254FieldElement");
3113
+ function convertCurve25519FieldElementToRcPlaintext(value) {
3114
+ chunkMDFSBU5W_cjs.assertCurve25519FieldElement(value);
3115
+ chunkMDFSBU5W_cjs.assertRcPlaintext(value);
3116
+ return value;
3117
+ }
3118
+ chunkPK6SKIKE_cjs.__name(convertCurve25519FieldElementToRcPlaintext, "convertCurve25519FieldElementToRcPlaintext");
3119
+ function convertCurve25519FieldElementToRcCiphertext(value) {
3120
+ chunkMDFSBU5W_cjs.assertCurve25519FieldElement(value);
3121
+ chunkMDFSBU5W_cjs.assertRcCiphertext(value);
3122
+ return value;
3123
+ }
3124
+ chunkPK6SKIKE_cjs.__name(convertCurve25519FieldElementToRcCiphertext, "convertCurve25519FieldElementToRcCiphertext");
3125
+ function convertCurve25519FieldElementToRcKey(value) {
3126
+ chunkMDFSBU5W_cjs.assertCurve25519FieldElement(value);
3127
+ chunkMDFSBU5W_cjs.assertRcKey(value);
3128
+ return value;
3129
+ }
3130
+ chunkPK6SKIKE_cjs.__name(convertCurve25519FieldElementToRcKey, "convertCurve25519FieldElementToRcKey");
3131
+ function convertCurve25519FieldElementToRcCounter(value) {
3132
+ chunkMDFSBU5W_cjs.assertCurve25519FieldElement(value);
3133
+ chunkMDFSBU5W_cjs.assertRcCounter(value);
3134
+ return value;
3135
+ }
3136
+ chunkPK6SKIKE_cjs.__name(convertCurve25519FieldElementToRcCounter, "convertCurve25519FieldElementToRcCounter");
3137
+ function convertRcPlaintextToCurve25519FieldElement(value) {
3138
+ chunkMDFSBU5W_cjs.assertRcPlaintext(value);
3139
+ chunkMDFSBU5W_cjs.assertCurve25519FieldElement(value);
3140
+ return value;
3141
+ }
3142
+ chunkPK6SKIKE_cjs.__name(convertRcPlaintextToCurve25519FieldElement, "convertRcPlaintextToCurve25519FieldElement");
3143
+ function convertRcCiphertextToCurve25519FieldElement(value) {
3144
+ chunkMDFSBU5W_cjs.assertRcCiphertext(value);
3145
+ chunkMDFSBU5W_cjs.assertCurve25519FieldElement(value);
3146
+ return value;
3147
+ }
3148
+ chunkPK6SKIKE_cjs.__name(convertRcCiphertextToCurve25519FieldElement, "convertRcCiphertextToCurve25519FieldElement");
3149
+ function convertRcKeyToCurve25519FieldElement(value) {
3150
+ chunkMDFSBU5W_cjs.assertRcKey(value);
3151
+ chunkMDFSBU5W_cjs.assertCurve25519FieldElement(value);
3152
+ return value;
3153
+ }
3154
+ chunkPK6SKIKE_cjs.__name(convertRcKeyToCurve25519FieldElement, "convertRcKeyToCurve25519FieldElement");
3155
+ function convertRcCounterToCurve25519FieldElement(value) {
3156
+ chunkMDFSBU5W_cjs.assertRcCounter(value);
3157
+ chunkMDFSBU5W_cjs.assertCurve25519FieldElement(value);
3158
+ return value;
3159
+ }
3160
+ chunkPK6SKIKE_cjs.__name(convertRcCounterToCurve25519FieldElement, "convertRcCounterToCurve25519FieldElement");
3161
+ function convertU128ToRcEncryptionNonce(value) {
3162
+ chunkMDFSBU5W_cjs.assertU128(value);
3163
+ chunkMDFSBU5W_cjs.assertRcEncryptionNonce(value);
3164
+ return value;
3165
+ }
3166
+ chunkPK6SKIKE_cjs.__name(convertU128ToRcEncryptionNonce, "convertU128ToRcEncryptionNonce");
3167
+ function convertRcEncryptionNonceToU128(value) {
3168
+ chunkMDFSBU5W_cjs.assertRcEncryptionNonce(value);
3169
+ chunkMDFSBU5W_cjs.assertU128(value);
3170
+ return value;
3171
+ }
3172
+ chunkPK6SKIKE_cjs.__name(convertRcEncryptionNonceToU128, "convertRcEncryptionNonceToU128");
3173
+ function convertX25519BytesToX25519PrivateKey(value) {
3174
+ chunkMDFSBU5W_cjs.assertX25519Bytes(value);
3175
+ chunkMDFSBU5W_cjs.assertX25519PrivateKey(value);
3176
+ return value;
3177
+ }
3178
+ chunkPK6SKIKE_cjs.__name(convertX25519BytesToX25519PrivateKey, "convertX25519BytesToX25519PrivateKey");
3179
+ function convertX25519BytesToX25519PublicKey(value) {
3180
+ chunkMDFSBU5W_cjs.assertX25519Bytes(value);
3181
+ chunkMDFSBU5W_cjs.assertX25519PublicKey(value);
3182
+ return value;
3183
+ }
3184
+ chunkPK6SKIKE_cjs.__name(convertX25519BytesToX25519PublicKey, "convertX25519BytesToX25519PublicKey");
3185
+ function convertX25519BytesToSharedSecret(value) {
3186
+ chunkMDFSBU5W_cjs.assertX25519Bytes(value);
3187
+ chunkMDFSBU5W_cjs.assertSharedSecret(value);
3188
+ return value;
3189
+ }
3190
+ chunkPK6SKIKE_cjs.__name(convertX25519BytesToSharedSecret, "convertX25519BytesToSharedSecret");
3191
+ function convertX25519PrivateKeyToX25519Bytes(value) {
3192
+ chunkMDFSBU5W_cjs.assertX25519PrivateKey(value);
3193
+ chunkMDFSBU5W_cjs.assertX25519Bytes(value);
3194
+ return value;
3195
+ }
3196
+ chunkPK6SKIKE_cjs.__name(convertX25519PrivateKeyToX25519Bytes, "convertX25519PrivateKeyToX25519Bytes");
3197
+ function convertX25519PublicKeyToX25519Bytes(value) {
3198
+ chunkMDFSBU5W_cjs.assertX25519PublicKey(value);
3199
+ chunkMDFSBU5W_cjs.assertX25519Bytes(value);
3200
+ return value;
3201
+ }
3202
+ chunkPK6SKIKE_cjs.__name(convertX25519PublicKeyToX25519Bytes, "convertX25519PublicKeyToX25519Bytes");
3203
+ function convertSharedSecretToX25519Bytes(value) {
3204
+ chunkMDFSBU5W_cjs.assertSharedSecret(value);
3205
+ chunkMDFSBU5W_cjs.assertX25519Bytes(value);
3206
+ return value;
3207
+ }
3208
+ chunkPK6SKIKE_cjs.__name(convertSharedSecretToX25519Bytes, "convertSharedSecretToX25519Bytes");
3209
+ function splitU256IntoTwoU128s(value) {
3210
+ chunkMDFSBU5W_cjs.assertU256(value);
3211
+ const U128_MAX2 = (1n << 128n) - 1n;
3212
+ const lowValue = value & U128_MAX2;
3213
+ chunkMDFSBU5W_cjs.assertU128(lowValue);
3214
+ const highValue = value >> 128n;
3215
+ chunkMDFSBU5W_cjs.assertU128(highValue);
3216
+ return { low: lowValue, high: highValue };
3217
+ }
3218
+ chunkPK6SKIKE_cjs.__name(splitU256IntoTwoU128s, "splitU256IntoTwoU128s");
3219
+ function splitX25519PublicKeyIntoTwoU128s(key) {
3220
+ chunkMDFSBU5W_cjs.assertX25519PublicKey(key);
3221
+ let low = 0n;
3222
+ for (let index = chunkMDFSBU5W_cjs.U128_BYTE_LENGTH - 1; index >= 0; index--) {
3223
+ low = low << 8n | BigInt(key[index]);
3224
+ }
3225
+ let high = 0n;
3226
+ for (let index = chunkMDFSBU5W_cjs.U256_BYTE_LENGTH - 1; index >= chunkMDFSBU5W_cjs.U128_BYTE_LENGTH; index--) {
3227
+ high = high << 8n | BigInt(key[index]);
3228
+ }
3229
+ chunkMDFSBU5W_cjs.assertU128(low);
3230
+ chunkMDFSBU5W_cjs.assertU128(high);
3231
+ return { low, high };
3232
+ }
3233
+ chunkPK6SKIKE_cjs.__name(splitX25519PublicKeyIntoTwoU128s, "splitX25519PublicKeyIntoTwoU128s");
3234
+ function convertU256ToBase85Limbs(value) {
3235
+ chunkMDFSBU5W_cjs.assertU256(value);
3236
+ const BASE85_MASK = (1n << 85n) - 1n;
3237
+ const lowValue = value & BASE85_MASK;
3238
+ chunkMDFSBU5W_cjs.assertBase85Limb(lowValue);
3239
+ const middleValue = value >> 85n & BASE85_MASK;
3240
+ chunkMDFSBU5W_cjs.assertBase85Limb(middleValue);
3241
+ const highValue = value >> 170n;
3242
+ chunkMDFSBU5W_cjs.assertBase85Limb(highValue);
3243
+ return {
3244
+ low: lowValue,
3245
+ middle: middleValue,
3246
+ high: highValue
3247
+ };
3248
+ }
3249
+ chunkPK6SKIKE_cjs.__name(convertU256ToBase85Limbs, "convertU256ToBase85Limbs");
3250
+
3251
+ // src/common/math-utils.ts
3252
+ function generateRandomU128() {
3253
+ const bytes = new Uint8Array(chunkMDFSBU5W_cjs.U128_BYTE_LENGTH);
3254
+ crypto.getRandomValues(bytes);
3255
+ let result = 0n;
3256
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U128_BYTE_LENGTH; index++) {
3257
+ result |= BigInt(bytes[index]) << BigInt(index * 8);
3258
+ }
3259
+ return result;
3260
+ }
3261
+ chunkPK6SKIKE_cjs.__name(generateRandomU128, "generateRandomU128");
3262
+ function generateRandomU64() {
3263
+ const bytes = new Uint8Array(chunkMDFSBU5W_cjs.U64_BYTE_LENGTH);
3264
+ crypto.getRandomValues(bytes);
3265
+ let result = 0n;
3266
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U64_BYTE_LENGTH; index++) {
3267
+ result |= BigInt(bytes[index]) << BigInt(index * 8);
3268
+ }
3269
+ return result;
3270
+ }
3271
+ chunkPK6SKIKE_cjs.__name(generateRandomU64, "generateRandomU64");
3272
+ function generateRandomU256() {
3273
+ const bytes = new Uint8Array(chunkMDFSBU5W_cjs.U256_BYTE_LENGTH);
3274
+ crypto.getRandomValues(bytes);
3275
+ let result = 0n;
3276
+ for (let index = 0; index < chunkMDFSBU5W_cjs.U256_BYTE_LENGTH; index++) {
3277
+ result |= BigInt(bytes[index]) << BigInt(index * 8);
3278
+ }
3279
+ return result;
3280
+ }
3281
+ chunkPK6SKIKE_cjs.__name(generateRandomU256, "generateRandomU256");
3282
+ function bigintToBinaryArrayLSB(value, length) {
3283
+ const result = [];
3284
+ let remaining = value;
3285
+ for (let index = 0; index < length; index++) {
3286
+ result.push(Number(remaining & 1n));
3287
+ remaining >>= 1n;
3288
+ }
3289
+ return result;
3290
+ }
3291
+ chunkPK6SKIKE_cjs.__name(bigintToBinaryArrayLSB, "bigintToBinaryArrayLSB");
3292
+
3293
+ // src/common/arcium.ts
3294
+ function generateRandomNonce() {
3295
+ const nonce = generateRandomU128();
3296
+ chunkMDFSBU5W_cjs.assertRcEncryptionNonce(nonce);
3297
+ return nonce;
3298
+ }
3299
+ chunkPK6SKIKE_cjs.__name(generateRandomNonce, "generateRandomNonce");
3300
+ function getRandomComputationOffset() {
3301
+ return generateRandomU64();
3302
+ }
3303
+ chunkPK6SKIKE_cjs.__name(getRandomComputationOffset, "getRandomComputationOffset");
3304
+ var cachedAddressEncoder = null;
3305
+ function getEncoder() {
3306
+ cachedAddressEncoder ??= kit.getAddressEncoder();
3307
+ return cachedAddressEncoder;
3308
+ }
3309
+ chunkPK6SKIKE_cjs.__name(getEncoder, "getEncoder");
3310
+ function splitAddressToLowHigh(address2) {
3311
+ const encoder = getEncoder();
3312
+ const addressBytes = encoder.encode(address2);
3313
+ const lowBytes = createU128LeBytes(addressBytes.slice(0, 16));
3314
+ const low = decodeU128LeBytesToU128(lowBytes);
3315
+ const highBytes = createU128LeBytes(addressBytes.slice(16, 32));
3316
+ const high = decodeU128LeBytesToU128(highBytes);
3317
+ return { low, high };
3318
+ }
3319
+ chunkPK6SKIKE_cjs.__name(splitAddressToLowHigh, "splitAddressToLowHigh");
3320
+ function structSeed(name) {
3321
+ return sha2_js.sha256(new TextEncoder().encode(name));
3322
+ }
3323
+ chunkPK6SKIKE_cjs.__name(structSeed, "structSeed");
3324
+ var MIXER_TREE_SEED = structSeed("MixerTree");
3325
+ var CONF_UTXO_BURNER_SEED = structSeed("ConfidentialUtxoBurner");
3326
+ var PUB_UTXO_BURNER_SEED = structSeed("PublicUtxoBurner");
3327
+ var TREAP_SEED = structSeed("Treap");
3328
+ async function getMixerTreeAddress(index, umbraProgram) {
3329
+ const [pda] = await kit.getProgramDerivedAddress({
3330
+ programAddress: umbraProgram,
3331
+ seeds: [MIXER_TREE_SEED, encodeU128ToU128LeBytes(index)]
3332
+ });
3333
+ return pda;
3334
+ }
3335
+ chunkPK6SKIKE_cjs.__name(getMixerTreeAddress, "getMixerTreeAddress");
3336
+ async function getActiveMixerTreeAddress(umbraProgram) {
3337
+ return getMixerTreeAddress(0n, umbraProgram);
3338
+ }
3339
+ chunkPK6SKIKE_cjs.__name(getActiveMixerTreeAddress, "getActiveMixerTreeAddress");
3340
+ async function getConfUtxoBurnerPda(relayerAddress, ephemeralAddress, burnerAccountOffset, umbraProgram) {
3341
+ const addressEncoder = kit.getAddressEncoder();
3342
+ const [pda] = await kit.getProgramDerivedAddress({
3343
+ programAddress: umbraProgram,
3344
+ seeds: [
3345
+ CONF_UTXO_BURNER_SEED,
3346
+ addressEncoder.encode(relayerAddress),
3347
+ addressEncoder.encode(ephemeralAddress),
3348
+ codama.getAccountOffsetEncoder().encode({
3349
+ first: BigInt(burnerAccountOffset)
3350
+ })
3351
+ ]
3352
+ });
3353
+ return pda;
3354
+ }
3355
+ chunkPK6SKIKE_cjs.__name(getConfUtxoBurnerPda, "getConfUtxoBurnerPda");
3356
+ async function getPubUtxoBurnerPda(relayerAddress, ephemeralAddress, burnerAccountOffset, umbraProgram) {
3357
+ const addressEncoder = kit.getAddressEncoder();
3358
+ const [pda] = await kit.getProgramDerivedAddress({
3359
+ programAddress: umbraProgram,
3360
+ seeds: [
3361
+ PUB_UTXO_BURNER_SEED,
3362
+ addressEncoder.encode(relayerAddress),
3363
+ addressEncoder.encode(ephemeralAddress),
3364
+ codama.getAccountOffsetEncoder().encode({
3365
+ first: BigInt(burnerAccountOffset)
3366
+ })
3367
+ ]
3368
+ });
3369
+ return pda;
3370
+ }
3371
+ chunkPK6SKIKE_cjs.__name(getPubUtxoBurnerPda, "getPubUtxoBurnerPda");
3372
+ async function getTreapPdas(mixerTreeIndex, umbraProgram) {
3373
+ const treapSeedBytes = TREAP_SEED;
3374
+ const indexBytes = encodeU128ToU128LeBytes(mixerTreeIndex);
3375
+ const derivePda = /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async (variant) => {
3376
+ const [pda] = await kit.getProgramDerivedAddress({
3377
+ programAddress: umbraProgram,
3378
+ seeds: [treapSeedBytes, indexBytes, new Uint8Array([variant])]
3379
+ });
3380
+ return pda;
3381
+ }, "derivePda");
3382
+ const [treap0, treap1, treap2, treap3, treap4] = await Promise.all([
3383
+ derivePda(0),
3384
+ derivePda(1),
3385
+ derivePda(2),
3386
+ derivePda(3),
3387
+ derivePda(4)
3388
+ ]);
3389
+ return { treap0, treap1, treap2, treap3, treap4 };
3390
+ }
3391
+ chunkPK6SKIKE_cjs.__name(getTreapPdas, "getTreapPdas");
3392
+
3393
+ // src/common/pda/user.ts
3394
+ var ARCIUM_ENCRYPTED_USER_ACCOUNT_SEED = structSeed("ArciumEncryptedUserAccount");
3395
+ var ARCIUM_ENCRYPTED_TOKEN_ACCOUNT_SEED = structSeed("ArciumEncryptedTokenAccount");
3396
+ async function getArciumEncryptedUserAccountPda(userPubkey, umbraProgram) {
3397
+ const addressEncoder = kit.getAddressEncoder();
3398
+ const [pda] = await kit.getProgramDerivedAddress({
3399
+ programAddress: umbraProgram,
3400
+ seeds: [ARCIUM_ENCRYPTED_USER_ACCOUNT_SEED, addressEncoder.encode(userPubkey)]
3401
+ });
3402
+ return pda;
3403
+ }
3404
+ chunkPK6SKIKE_cjs.__name(getArciumEncryptedUserAccountPda, "getArciumEncryptedUserAccountPda");
3405
+ async function getArciumEncryptedTokenAccountPda(userPubkey, mintPubkey, umbraProgram) {
3406
+ const addressEncoder = kit.getAddressEncoder();
3407
+ const [pda] = await kit.getProgramDerivedAddress({
3408
+ programAddress: umbraProgram,
3409
+ seeds: [
3410
+ ARCIUM_ENCRYPTED_TOKEN_ACCOUNT_SEED,
3411
+ addressEncoder.encode(userPubkey),
3412
+ addressEncoder.encode(mintPubkey)
3413
+ ]
3414
+ });
3415
+ return pda;
3416
+ }
3417
+ chunkPK6SKIKE_cjs.__name(getArciumEncryptedTokenAccountPda, "getArciumEncryptedTokenAccountPda");
3418
+ function getCompDefOffset(instructionName) {
3419
+ const hash = sha2_js.sha256(new TextEncoder().encode(instructionName));
3420
+ const byte0 = hash[0];
3421
+ const byte1 = hash[1];
3422
+ const byte2 = hash[2];
3423
+ const byte3 = hash[3];
3424
+ const offset = byte0 | byte1 << 8 | byte2 << 16 | byte3 << 24;
3425
+ return offset >>> 0;
3426
+ }
3427
+ chunkPK6SKIKE_cjs.__name(getCompDefOffset, "getCompDefOffset");
3428
+ async function getMxeAccountAddress(umbraProgram, arciumProgram) {
3429
+ const [address2] = await kit.getProgramDerivedAddress({
3430
+ programAddress: arciumProgram,
3431
+ seeds: [
3432
+ new TextEncoder().encode(chunkMVKTV3FT_cjs.ARCIUM_MXE_ACCOUNT_SEED),
3433
+ kit.getAddressEncoder().encode(umbraProgram)
3434
+ ]
3435
+ });
3436
+ return address2;
3437
+ }
3438
+ chunkPK6SKIKE_cjs.__name(getMxeAccountAddress, "getMxeAccountAddress");
3439
+ async function getMempoolAccountAddress(arciumProgram, clusterOffset) {
3440
+ chunkMDFSBU5W_cjs.assertU32(BigInt(clusterOffset));
3441
+ const [address2] = await kit.getProgramDerivedAddress({
3442
+ programAddress: arciumProgram,
3443
+ seeds: [
3444
+ new TextEncoder().encode(chunkMVKTV3FT_cjs.ARCIUM_MEMPOOL_SEED),
3445
+ encodeU32ToU32LeBytes(BigInt(clusterOffset))
3446
+ ]
3447
+ });
3448
+ return address2;
3449
+ }
3450
+ chunkPK6SKIKE_cjs.__name(getMempoolAccountAddress, "getMempoolAccountAddress");
3451
+ async function getExecutingPoolAccountAddress(arciumProgram, clusterOffset) {
3452
+ chunkMDFSBU5W_cjs.assertU32(BigInt(clusterOffset));
3453
+ const [address2] = await kit.getProgramDerivedAddress({
3454
+ programAddress: arciumProgram,
3455
+ seeds: [
3456
+ new TextEncoder().encode(chunkMVKTV3FT_cjs.ARCIUM_EXEC_POOL_SEED),
3457
+ encodeU32ToU32LeBytes(BigInt(clusterOffset))
3458
+ ]
3459
+ });
3460
+ return address2;
3461
+ }
3462
+ chunkPK6SKIKE_cjs.__name(getExecutingPoolAccountAddress, "getExecutingPoolAccountAddress");
3463
+ async function getComputationAccountAddress(arciumProgram, clusterOffset, computationOffset) {
3464
+ chunkMDFSBU5W_cjs.assertU32(BigInt(clusterOffset));
3465
+ chunkMDFSBU5W_cjs.assertU64(computationOffset);
3466
+ const [address2] = await kit.getProgramDerivedAddress({
3467
+ programAddress: arciumProgram,
3468
+ seeds: [
3469
+ new TextEncoder().encode(chunkMVKTV3FT_cjs.ARCIUM_COMPUTATION_SEED),
3470
+ encodeU32ToU32LeBytes(BigInt(clusterOffset)),
3471
+ encodeU64ToU64LeBytes(computationOffset)
3472
+ ]
3473
+ });
3474
+ return address2;
3475
+ }
3476
+ chunkPK6SKIKE_cjs.__name(getComputationAccountAddress, "getComputationAccountAddress");
3477
+ async function getCompDefAccountAddress(umbraProgram, arciumProgram, compDefOffset) {
3478
+ chunkMDFSBU5W_cjs.assertU32(BigInt(compDefOffset));
3479
+ const [address2] = await kit.getProgramDerivedAddress({
3480
+ programAddress: arciumProgram,
3481
+ seeds: [
3482
+ new TextEncoder().encode(chunkMVKTV3FT_cjs.ARCIUM_COMP_DEF_SEED),
3483
+ kit.getAddressEncoder().encode(umbraProgram),
3484
+ encodeU32ToU32LeBytes(BigInt(compDefOffset))
3485
+ ]
3486
+ });
3487
+ return address2;
3488
+ }
3489
+ chunkPK6SKIKE_cjs.__name(getCompDefAccountAddress, "getCompDefAccountAddress");
3490
+ async function getClusterAccountAddress(arciumProgram, clusterOffset) {
3491
+ chunkMDFSBU5W_cjs.assertU32(BigInt(clusterOffset));
3492
+ const [address2] = await kit.getProgramDerivedAddress({
3493
+ programAddress: arciumProgram,
3494
+ seeds: [
3495
+ new TextEncoder().encode(chunkMVKTV3FT_cjs.ARCIUM_CLUSTER_SEED),
3496
+ encodeU32ToU32LeBytes(BigInt(clusterOffset))
3497
+ ]
3498
+ });
3499
+ return address2;
3500
+ }
3501
+ chunkPK6SKIKE_cjs.__name(getClusterAccountAddress, "getClusterAccountAddress");
3502
+ async function getArciumAccountAddresses(umbraProgram, arciumProgram, clusterOffset, computationOffset, instructionName) {
3503
+ const compDefOffset = getCompDefOffset(instructionName);
3504
+ const [
3505
+ mxeAccount,
3506
+ mempoolAccount,
3507
+ executingPoolAccount,
3508
+ computationAccount,
3509
+ compDefAccount,
3510
+ // eslint-disable-line unicorn/prevent-abbreviations
3511
+ clusterAccount
3512
+ ] = await Promise.all([
3513
+ getMxeAccountAddress(umbraProgram, arciumProgram),
3514
+ getMempoolAccountAddress(arciumProgram, clusterOffset),
3515
+ getExecutingPoolAccountAddress(arciumProgram, clusterOffset),
3516
+ getComputationAccountAddress(arciumProgram, clusterOffset, computationOffset),
3517
+ getCompDefAccountAddress(umbraProgram, arciumProgram, compDefOffset),
3518
+ getClusterAccountAddress(arciumProgram, clusterOffset)
3519
+ ]);
3520
+ return {
3521
+ mxeAccount,
3522
+ mempoolAccount,
3523
+ executingPoolAccount,
3524
+ computationAccount,
3525
+ compDefAccount,
3526
+ clusterAccount
3527
+ };
3528
+ }
3529
+ chunkPK6SKIKE_cjs.__name(getArciumAccountAddresses, "getArciumAccountAddresses");
3530
+ var ARCIUM_COMPLIANCE_GRANT_SEED = new Uint8Array([
3531
+ 112,
3532
+ 51,
3533
+ 91,
3534
+ 80,
3535
+ 182,
3536
+ 130,
3537
+ 183,
3538
+ 114,
3539
+ 130,
3540
+ 126,
3541
+ 192,
3542
+ 174,
3543
+ 103,
3544
+ 176,
3545
+ 96,
3546
+ 111,
3547
+ 39,
3548
+ 197,
3549
+ 11,
3550
+ 178,
3551
+ 95,
3552
+ 176,
3553
+ 244,
3554
+ 219,
3555
+ 178,
3556
+ 162,
3557
+ 167,
3558
+ 166,
3559
+ 191,
3560
+ 89,
3561
+ 196,
3562
+ 197
3563
+ ]);
3564
+ var USER_GRANT_VARIANT_SEED = new Uint8Array([
3565
+ 184,
3566
+ 137,
3567
+ 63,
3568
+ 24,
3569
+ 18,
3570
+ 54,
3571
+ 138,
3572
+ 200,
3573
+ 151,
3574
+ 217,
3575
+ 219,
3576
+ 241,
3577
+ 119,
3578
+ 150,
3579
+ 66,
3580
+ 8,
3581
+ 27,
3582
+ 105,
3583
+ 131,
3584
+ 187,
3585
+ 58,
3586
+ 182,
3587
+ 24,
3588
+ 203,
3589
+ 146,
3590
+ 119,
3591
+ 188,
3592
+ 210,
3593
+ 197,
3594
+ 104,
3595
+ 238,
3596
+ 33
3597
+ ]);
3598
+ var NETWORK_MXE_GRANT_VARIANT_SEED = new Uint8Array([
3599
+ 142,
3600
+ 219,
3601
+ 209,
3602
+ 143,
3603
+ 158,
3604
+ 68,
3605
+ 71,
3606
+ 58,
3607
+ 193,
3608
+ 244,
3609
+ 116,
3610
+ 159,
3611
+ 48,
3612
+ 68,
3613
+ 160,
3614
+ 95,
3615
+ 175,
3616
+ 131,
3617
+ 151,
3618
+ 209,
3619
+ 81,
3620
+ 213,
3621
+ 51,
3622
+ 159,
3623
+ 98,
3624
+ 98,
3625
+ 138,
3626
+ 109,
3627
+ 254,
3628
+ 69,
3629
+ 221,
3630
+ 95
3631
+ ]);
3632
+ var NETWORK_SHARED_GRANT_VARIANT_SEED = new Uint8Array([
3633
+ 172,
3634
+ 245,
3635
+ 86,
3636
+ 61,
3637
+ 89,
3638
+ 235,
3639
+ 170,
3640
+ 92,
3641
+ 253,
3642
+ 117,
3643
+ 241,
3644
+ 14,
3645
+ 2,
3646
+ 33,
3647
+ 164,
3648
+ 107,
3649
+ 22,
3650
+ 131,
3651
+ 100,
3652
+ 113,
3653
+ 39,
3654
+ 173,
3655
+ 185,
3656
+ 55,
3657
+ 254,
3658
+ 100,
3659
+ 108,
3660
+ 218,
3661
+ 180,
3662
+ 105,
3663
+ 75,
3664
+ 184
3665
+ ]);
3666
+ async function getUserGrantedComplianceGrantPda(granterX25519, nonce, receiverX25519, umbraProgram) {
3667
+ const [pda] = await kit.getProgramDerivedAddress({
3668
+ programAddress: umbraProgram,
3669
+ seeds: [
3670
+ ARCIUM_COMPLIANCE_GRANT_SEED,
3671
+ USER_GRANT_VARIANT_SEED,
3672
+ codama.getArciumX25519PublicKeyEncoder().encode({ first: granterX25519 }),
3673
+ codama.getArciumX25519NonceEncoder().encode({ first: nonce }),
3674
+ codama.getArciumX25519PublicKeyEncoder().encode({ first: receiverX25519 })
3675
+ ]
3676
+ });
3677
+ return pda;
3678
+ }
3679
+ chunkPK6SKIKE_cjs.__name(getUserGrantedComplianceGrantPda, "getUserGrantedComplianceGrantPda");
3680
+ async function getNetworkMxeComplianceGrantPda(nonce, receiverX25519, umbraProgram) {
3681
+ const [pda] = await kit.getProgramDerivedAddress({
3682
+ programAddress: umbraProgram,
3683
+ seeds: [
3684
+ ARCIUM_COMPLIANCE_GRANT_SEED,
3685
+ NETWORK_MXE_GRANT_VARIANT_SEED,
3686
+ codama.getArciumX25519NonceEncoder().encode({ first: nonce }),
3687
+ codama.getArciumX25519PublicKeyEncoder().encode({ first: receiverX25519 })
3688
+ ]
3689
+ });
3690
+ return pda;
3691
+ }
3692
+ chunkPK6SKIKE_cjs.__name(getNetworkMxeComplianceGrantPda, "getNetworkMxeComplianceGrantPda");
3693
+ async function getNetworkSharedComplianceGrantPda(granterX25519, nonce, receiverX25519, umbraProgram) {
3694
+ const [pda] = await kit.getProgramDerivedAddress({
3695
+ programAddress: umbraProgram,
3696
+ seeds: [
3697
+ ARCIUM_COMPLIANCE_GRANT_SEED,
3698
+ NETWORK_SHARED_GRANT_VARIANT_SEED,
3699
+ codama.getArciumX25519PublicKeyEncoder().encode({ first: granterX25519 }),
3700
+ codama.getArciumX25519NonceEncoder().encode({ first: nonce }),
3701
+ codama.getArciumX25519PublicKeyEncoder().encode({ first: receiverX25519 })
3702
+ ]
3703
+ });
3704
+ return pda;
3705
+ }
3706
+ chunkPK6SKIKE_cjs.__name(getNetworkSharedComplianceGrantPda, "getNetworkSharedComplianceGrantPda");
3707
+ var PROGRAM_INFORMATION_SEED = structSeed("ProgramInformation");
3708
+ async function getProgramInformationPda(umbraProgram) {
3709
+ const [pda] = await kit.getProgramDerivedAddress({
3710
+ programAddress: umbraProgram,
3711
+ seeds: [PROGRAM_INFORMATION_SEED]
3712
+ });
3713
+ return pda;
3714
+ }
3715
+ chunkPK6SKIKE_cjs.__name(getProgramInformationPda, "getProgramInformationPda");
3716
+ var POOL_SEED = structSeed("Pool");
3717
+ async function getPoolPda(mintAddress, umbraProgram) {
3718
+ const [pda] = await kit.getProgramDerivedAddress({
3719
+ programAddress: umbraProgram,
3720
+ seeds: [POOL_SEED, kit.getAddressEncoder().encode(mintAddress)]
3721
+ });
3722
+ return pda;
3723
+ }
3724
+ chunkPK6SKIKE_cjs.__name(getPoolPda, "getPoolPda");
3725
+ var RELAYER_ACCOUNT_SEED = structSeed("RelayerAccount");
3726
+ async function getRelayerAccountPda(relayerAddress, mintAddress, umbraProgram) {
3727
+ const addressEncoder = kit.getAddressEncoder();
3728
+ const [pda] = await kit.getProgramDerivedAddress({
3729
+ programAddress: umbraProgram,
3730
+ seeds: [
3731
+ RELAYER_ACCOUNT_SEED,
3732
+ addressEncoder.encode(relayerAddress),
3733
+ addressEncoder.encode(mintAddress)
3734
+ ]
3735
+ });
3736
+ return pda;
3737
+ }
3738
+ chunkPK6SKIKE_cjs.__name(getRelayerAccountPda, "getRelayerAccountPda");
3739
+ var UNIFIED_FEES_POOL_SEED = structSeed("UnifiedFeesPool");
3740
+ var DOMAIN_PROTOCOL_FEES = structSeed("ProtocolFees");
3741
+ var DOMAIN_PROTOCOL_RELAYER_FEES = structSeed("ProtocolRelayerFees");
3742
+ var PROTOCOL_FEES_CONFIGURATION_SEED = structSeed("ProtocolFeesConfiguration");
3743
+ async function getProtocolOnlyUnifiedFeesPoolPda(instructionSeed, mintAddress, offset, umbraProgram) {
3744
+ const addressEncoder = kit.getAddressEncoder();
3745
+ return kit.getProgramDerivedAddress({
3746
+ programAddress: umbraProgram,
3747
+ seeds: [
3748
+ UNIFIED_FEES_POOL_SEED,
3749
+ DOMAIN_PROTOCOL_FEES,
3750
+ encodeU128ToU128LeBytes(instructionSeed),
3751
+ addressEncoder.encode(mintAddress),
3752
+ codama.getAccountOffsetEncoder().encode({ first: BigInt(offset) })
3753
+ ]
3754
+ });
3755
+ }
3756
+ chunkPK6SKIKE_cjs.__name(getProtocolOnlyUnifiedFeesPoolPda, "getProtocolOnlyUnifiedFeesPoolPda");
3757
+ async function getRelayerUnifiedFeesPoolPda(instructionSeed, relayerAddress, mintAddress, offset, umbraProgram) {
3758
+ const addressEncoder = kit.getAddressEncoder();
3759
+ return kit.getProgramDerivedAddress({
3760
+ programAddress: umbraProgram,
3761
+ seeds: [
3762
+ UNIFIED_FEES_POOL_SEED,
3763
+ DOMAIN_PROTOCOL_RELAYER_FEES,
3764
+ encodeU128ToU128LeBytes(instructionSeed),
3765
+ addressEncoder.encode(relayerAddress),
3766
+ addressEncoder.encode(mintAddress),
3767
+ codama.getAccountOffsetEncoder().encode({ first: BigInt(offset) })
3768
+ ]
3769
+ });
3770
+ }
3771
+ chunkPK6SKIKE_cjs.__name(getRelayerUnifiedFeesPoolPda, "getRelayerUnifiedFeesPoolPda");
3772
+ async function getProtocolFeesConfigurationPda(instructionSeed, mintAddress, offset, umbraProgram) {
3773
+ const addressEncoder = kit.getAddressEncoder();
3774
+ return kit.getProgramDerivedAddress({
3775
+ programAddress: umbraProgram,
3776
+ seeds: [
3777
+ PROTOCOL_FEES_CONFIGURATION_SEED,
3778
+ encodeU128ToU128LeBytes(instructionSeed),
3779
+ addressEncoder.encode(mintAddress),
3780
+ codama.getAccountOffsetEncoder().encode({ first: BigInt(offset) })
3781
+ ]
3782
+ });
3783
+ }
3784
+ chunkPK6SKIKE_cjs.__name(getProtocolFeesConfigurationPda, "getProtocolFeesConfigurationPda");
3785
+ var ZK_VERIFYING_KEY_SEED = structSeed("ZkVerifyingKey");
3786
+ var CONFIDENTIAL_CLAIM_PROOF_ACCOUNT_SEED = structSeed("ConfidentialClaimProofAccount");
3787
+ var CONFIDENTIAL_UTXO_PROOF_ACCOUNT_SEED = structSeed("ConfidentialUtxoProofAccount");
3788
+ var PUBLIC_CLAIM_PROOF_ACCOUNT_SEED = structSeed("PublicClaimProofAccount");
3789
+ var PUBLIC_CLAIM_MXE_MPC_CALLBACK_DATA_SEED = structSeed("PublicClaimMxeMpcCallbackData");
3790
+ async function getZkVerifyingKeyPda(instructionSeed, umbraProgram) {
3791
+ const [pda] = await kit.getProgramDerivedAddress({
3792
+ programAddress: umbraProgram,
3793
+ seeds: [ZK_VERIFYING_KEY_SEED, encodeU128ToU128LeBytes(instructionSeed)]
3794
+ });
3795
+ return pda;
3796
+ }
3797
+ chunkPK6SKIKE_cjs.__name(getZkVerifyingKeyPda, "getZkVerifyingKeyPda");
3798
+ async function getConfidentialClaimProofAccountPda(payerAddress, offset, umbraProgram) {
3799
+ const [pda] = await kit.getProgramDerivedAddress({
3800
+ programAddress: umbraProgram,
3801
+ seeds: [
3802
+ CONFIDENTIAL_CLAIM_PROOF_ACCOUNT_SEED,
3803
+ kit.getAddressEncoder().encode(payerAddress),
3804
+ codama.getAccountOffsetEncoder().encode({ first: BigInt(offset) })
3805
+ ]
3806
+ });
3807
+ return pda;
3808
+ }
3809
+ chunkPK6SKIKE_cjs.__name(getConfidentialClaimProofAccountPda, "getConfidentialClaimProofAccountPda");
3810
+ async function getConfidentialUtxoProofAccountPda(depositorAddress, offset, umbraProgram) {
3811
+ const [pda] = await kit.getProgramDerivedAddress({
3812
+ programAddress: umbraProgram,
3813
+ seeds: [
3814
+ CONFIDENTIAL_UTXO_PROOF_ACCOUNT_SEED,
3815
+ kit.getAddressEncoder().encode(depositorAddress),
3816
+ codama.getAccountOffsetEncoder().encode({ first: BigInt(offset) })
3817
+ ]
3818
+ });
3819
+ return pda;
3820
+ }
3821
+ chunkPK6SKIKE_cjs.__name(getConfidentialUtxoProofAccountPda, "getConfidentialUtxoProofAccountPda");
3822
+ async function getPublicClaimProofAccountPda(relayerAddress, offset, umbraProgram) {
3823
+ const [pda] = await kit.getProgramDerivedAddress({
3824
+ programAddress: umbraProgram,
3825
+ seeds: [
3826
+ PUBLIC_CLAIM_PROOF_ACCOUNT_SEED,
3827
+ kit.getAddressEncoder().encode(relayerAddress),
3828
+ codama.getAccountOffsetEncoder().encode({ first: BigInt(offset) })
3829
+ ]
3830
+ });
3831
+ return pda;
3832
+ }
3833
+ chunkPK6SKIKE_cjs.__name(getPublicClaimProofAccountPda, "getPublicClaimProofAccountPda");
3834
+ async function getPublicClaimMxeMpcCallbackDataPda(relayerAddress, offset, umbraProgram) {
3835
+ return kit.getProgramDerivedAddress({
3836
+ programAddress: umbraProgram,
3837
+ seeds: [
3838
+ PUBLIC_CLAIM_MXE_MPC_CALLBACK_DATA_SEED,
3839
+ kit.getAddressEncoder().encode(relayerAddress),
3840
+ codama.getAccountOffsetEncoder().encode({ first: BigInt(offset) })
3841
+ ]
3842
+ });
3843
+ }
3844
+ chunkPK6SKIKE_cjs.__name(getPublicClaimMxeMpcCallbackDataPda, "getPublicClaimMxeMpcCallbackDataPda");
3845
+
3846
+ // src/common/temporal/index.ts
3847
+ function extractUtcComponents(date) {
3848
+ const yearValue = BigInt(date.getUTCFullYear());
3849
+ const monthValue = BigInt(date.getUTCMonth() + 1);
3850
+ const dayValue = BigInt(date.getUTCDate());
3851
+ const hourValue = BigInt(date.getUTCHours());
3852
+ const minuteValue = BigInt(date.getUTCMinutes());
3853
+ const secondValue = BigInt(date.getUTCSeconds());
3854
+ chunkMDFSBU5W_cjs.assertYear(yearValue);
3855
+ chunkMDFSBU5W_cjs.assertMonth(monthValue);
3856
+ chunkMDFSBU5W_cjs.assertDay(dayValue);
3857
+ chunkMDFSBU5W_cjs.assertHour(hourValue);
3858
+ chunkMDFSBU5W_cjs.assertMinute(minuteValue);
3859
+ chunkMDFSBU5W_cjs.assertSecond(secondValue);
3860
+ return {
3861
+ year: yearValue,
3862
+ month: monthValue,
3863
+ day: dayValue,
3864
+ hour: hourValue,
3865
+ minute: minuteValue,
3866
+ second: secondValue
3867
+ };
3868
+ }
3869
+ chunkPK6SKIKE_cjs.__name(extractUtcComponents, "extractUtcComponents");
3870
+ function getUtcNow() {
3871
+ return extractUtcComponents(/* @__PURE__ */ new Date());
3872
+ }
3873
+ chunkPK6SKIKE_cjs.__name(getUtcNow, "getUtcNow");
3874
+ function getUtcNowFunction(deps) {
3875
+ const dateProvider = deps?.dateProvider ?? (() => /* @__PURE__ */ new Date());
3876
+ return () => extractUtcComponents(dateProvider());
3877
+ }
3878
+ chunkPK6SKIKE_cjs.__name(getUtcNowFunction, "getUtcNowFunction");
3879
+ function getExtractUtcComponentsFunction(deps) {
3880
+ return extractUtcComponents;
3881
+ }
3882
+ chunkPK6SKIKE_cjs.__name(getExtractUtcComponentsFunction, "getExtractUtcComponentsFunction");
3883
+ var defaultGetUtcNow = getUtcNowFunction();
3884
+ var defaultExtractUtcComponents = getExtractUtcComponentsFunction();
3885
+ var EXTENSION_TYPE_TRANSFER_FEE_CONFIG = 1;
3886
+ var MINT_SIZE = 82;
3887
+ var ACCOUNT_TYPE_OFFSET = MINT_SIZE;
3888
+ var EXTENSIONS_OFFSET = ACCOUNT_TYPE_OFFSET + 1;
3889
+ var TRANSFER_FEE_CONFIG_SIZE = 108;
3890
+ function extractTransferFeeConfig(mintData) {
3891
+ if (mintData === void 0 || mintData.length === 0) {
3892
+ return null;
3893
+ }
3894
+ if (mintData.length <= EXTENSIONS_OFFSET) {
3895
+ return null;
3896
+ }
3897
+ const accountType = mintData[ACCOUNT_TYPE_OFFSET];
3898
+ if (accountType !== 1) {
3899
+ return null;
3900
+ }
3901
+ let offset = EXTENSIONS_OFFSET;
3902
+ while (offset + 4 <= mintData.length) {
3903
+ const extensionType = (mintData[offset] ?? 0) | (mintData[offset + 1] ?? 0) << 8;
3904
+ offset += 2;
3905
+ const extensionLength = (mintData[offset] ?? 0) | (mintData[offset + 1] ?? 0) << 8;
3906
+ offset += 2;
3907
+ if (extensionLength === 0 || extensionLength > 1e4) {
3908
+ break;
3909
+ }
3910
+ if (offset + extensionLength > mintData.length) {
3911
+ break;
3912
+ }
3913
+ if (extensionType === EXTENSION_TYPE_TRANSFER_FEE_CONFIG) {
3914
+ return parseTransferFeeConfig(mintData.slice(offset, offset + extensionLength));
3915
+ }
3916
+ offset += extensionLength;
3917
+ }
3918
+ return null;
3919
+ }
3920
+ chunkPK6SKIKE_cjs.__name(extractTransferFeeConfig, "extractTransferFeeConfig");
3921
+ function parseTransferFeeConfig(data) {
3922
+ if (data.length < TRANSFER_FEE_CONFIG_SIZE) {
3923
+ return null;
3924
+ }
3925
+ let offset = 0;
3926
+ const transferFeeConfigAuthority = parseOptionalPubkey(data, offset);
3927
+ offset += 36;
3928
+ const withdrawWithheldAuthority = parseOptionalPubkey(data, offset);
3929
+ offset += 36;
3930
+ const withheldAmount = readU64LE(data, offset);
3931
+ offset += 8;
3932
+ const olderTransferFee = parseTransferFeeSchedule(data, offset);
3933
+ offset += 18;
3934
+ const newerTransferFee = parseTransferFeeSchedule(data, offset);
3935
+ if (olderTransferFee.transferFeeBasisPoints > 1e4 || newerTransferFee.transferFeeBasisPoints > 1e4) {
3936
+ return null;
3937
+ }
3938
+ return {
3939
+ transferFeeConfigAuthority,
3940
+ withdrawWithheldAuthority,
3941
+ withheldAmount,
3942
+ olderTransferFee,
3943
+ newerTransferFee
3944
+ };
3945
+ }
3946
+ chunkPK6SKIKE_cjs.__name(parseTransferFeeConfig, "parseTransferFeeConfig");
3947
+ function parseOptionalPubkey(data, offset) {
3948
+ const discriminator = (data[offset] ?? 0) | (data[offset + 1] ?? 0) << 8 | (data[offset + 2] ?? 0) << 16 | (data[offset + 3] ?? 0) << 24;
3949
+ if (discriminator === 0) {
3950
+ return null;
3951
+ }
3952
+ const pubkeyBytes = data.slice(offset + 4, offset + 36);
3953
+ return pubkeyBytesToAddress(pubkeyBytes);
3954
+ }
3955
+ chunkPK6SKIKE_cjs.__name(parseOptionalPubkey, "parseOptionalPubkey");
3956
+ function pubkeyBytesToAddress(bytes) {
3957
+ const ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
3958
+ let numericValue = 0n;
3959
+ for (const byte of bytes) {
3960
+ numericValue = numericValue * 256n + BigInt(byte);
3961
+ }
3962
+ let encoded = "";
3963
+ while (numericValue > 0n) {
3964
+ const remainder = Number(numericValue % 58n);
3965
+ numericValue = numericValue / 58n;
3966
+ encoded = (ALPHABET[remainder] ?? "") + encoded;
3967
+ }
3968
+ for (const byte of bytes) {
3969
+ if (byte === 0) {
3970
+ encoded = `1${encoded}`;
3971
+ } else {
3972
+ break;
3973
+ }
3974
+ }
3975
+ return kit.address(encoded);
3976
+ }
3977
+ chunkPK6SKIKE_cjs.__name(pubkeyBytesToAddress, "pubkeyBytesToAddress");
3978
+ function parseTransferFeeSchedule(data, offset) {
3979
+ const epoch = readU64LE(data, offset);
3980
+ const maximumFee = readU64LE(data, offset + 8);
3981
+ const transferFeeBasisPoints = (data[offset + 16] ?? 0) | (data[offset + 17] ?? 0) << 8;
3982
+ return {
3983
+ epoch,
3984
+ maximumFee,
3985
+ transferFeeBasisPoints
3986
+ };
3987
+ }
3988
+ chunkPK6SKIKE_cjs.__name(parseTransferFeeSchedule, "parseTransferFeeSchedule");
3989
+ function readU64LE(data, offset) {
3990
+ let result = 0n;
3991
+ for (let index = 7; index >= 0; index--) {
3992
+ result = result << 8n | BigInt(data[offset + index] ?? 0);
3993
+ }
3994
+ return result;
3995
+ }
3996
+ chunkPK6SKIKE_cjs.__name(readU64LE, "readU64LE");
3997
+ function calculateTransferFee(feeConfig, currentEpoch, amount) {
3998
+ if (amount <= 0n) {
3999
+ return 0n;
4000
+ }
4001
+ const schedule = currentEpoch >= feeConfig.newerTransferFee.epoch ? feeConfig.newerTransferFee : feeConfig.olderTransferFee;
4002
+ if (schedule.transferFeeBasisPoints === 0) {
4003
+ return 0n;
4004
+ }
4005
+ const fee = ceilDiv(amount * BigInt(schedule.transferFeeBasisPoints), 10000n);
4006
+ return fee < schedule.maximumFee ? fee : schedule.maximumFee;
4007
+ }
4008
+ chunkPK6SKIKE_cjs.__name(calculateTransferFee, "calculateTransferFee");
4009
+ function ceilDiv(numerator, denominator) {
4010
+ if (denominator === 0n) {
4011
+ throw new Error("Division by zero");
4012
+ }
4013
+ return (numerator + denominator - 1n) / denominator;
4014
+ }
4015
+ chunkPK6SKIKE_cjs.__name(ceilDiv, "ceilDiv");
4016
+ function calculateNetAmountAfterFee(feeConfig, currentEpoch, grossAmount) {
4017
+ const fee = calculateTransferFee(feeConfig, currentEpoch, grossAmount);
4018
+ return grossAmount - fee;
4019
+ }
4020
+ chunkPK6SKIKE_cjs.__name(calculateNetAmountAfterFee, "calculateNetAmountAfterFee");
4021
+
4022
+ // src/common/type-helpers.ts
4023
+ function asU64(value, name) {
4024
+ chunkMDFSBU5W_cjs.assertU64(value, name);
4025
+ return value;
4026
+ }
4027
+ chunkPK6SKIKE_cjs.__name(asU64, "asU64");
4028
+ function asU128(value, name) {
4029
+ chunkMDFSBU5W_cjs.assertU128(value, name);
4030
+ return value;
4031
+ }
4032
+ chunkPK6SKIKE_cjs.__name(asU128, "asU128");
4033
+ function asU256(value, name) {
4034
+ chunkMDFSBU5W_cjs.assertU256(value, name);
4035
+ return value;
4036
+ }
4037
+ chunkPK6SKIKE_cjs.__name(asU256, "asU256");
4038
+ function asBn254FieldElement(value, name) {
4039
+ chunkMDFSBU5W_cjs.assertBn254FieldElement(value, name);
4040
+ return value;
4041
+ }
4042
+ chunkPK6SKIKE_cjs.__name(asBn254FieldElement, "asBn254FieldElement");
4043
+ function asCurve25519FieldElement(value, name) {
4044
+ chunkMDFSBU5W_cjs.assertCurve25519FieldElement(value, name);
4045
+ return value;
4046
+ }
4047
+ chunkPK6SKIKE_cjs.__name(asCurve25519FieldElement, "asCurve25519FieldElement");
4048
+ function asPoseidonKey(value) {
4049
+ chunkMDFSBU5W_cjs.assertPoseidonKey(value);
4050
+ return value;
4051
+ }
4052
+ chunkPK6SKIKE_cjs.__name(asPoseidonKey, "asPoseidonKey");
4053
+ function asRcPlaintext(value, name) {
4054
+ chunkMDFSBU5W_cjs.assertRcPlaintext(value, name);
4055
+ return value;
4056
+ }
4057
+ chunkPK6SKIKE_cjs.__name(asRcPlaintext, "asRcPlaintext");
4058
+ function asRcCiphertext(value, name) {
4059
+ chunkMDFSBU5W_cjs.assertRcCiphertext(value, name);
4060
+ return value;
4061
+ }
4062
+ chunkPK6SKIKE_cjs.__name(asRcCiphertext, "asRcCiphertext");
4063
+ function asRcKey(value, name) {
4064
+ chunkMDFSBU5W_cjs.assertRcKey(value, name);
4065
+ return value;
4066
+ }
4067
+ chunkPK6SKIKE_cjs.__name(asRcKey, "asRcKey");
4068
+ function asRcEncryptionNonce(value, name) {
4069
+ chunkMDFSBU5W_cjs.assertRcEncryptionNonce(value, name);
4070
+ return value;
4071
+ }
4072
+ chunkPK6SKIKE_cjs.__name(asRcEncryptionNonce, "asRcEncryptionNonce");
4073
+ function asBase85Limb(value, name) {
4074
+ chunkMDFSBU5W_cjs.assertBase85Limb(value, name);
4075
+ return value;
4076
+ }
4077
+ chunkPK6SKIKE_cjs.__name(asBase85Limb, "asBase85Limb");
4078
+ function getByteAt(bytes, index, name = "array") {
4079
+ if (index < 0 || index >= bytes.length) {
4080
+ throw new Error(
4081
+ `${name}: Index ${String(index)} out of bounds for Uint8Array of length ${String(bytes.length)}`
4082
+ );
4083
+ }
4084
+ const byte = bytes[index];
4085
+ if (byte === void 0) {
4086
+ throw new Error(
4087
+ `${name}: Byte at index ${String(index)} is undefined (array length: ${String(bytes.length)})`
4088
+ );
4089
+ }
4090
+ return byte;
4091
+ }
4092
+ chunkPK6SKIKE_cjs.__name(getByteAt, "getByteAt");
4093
+
4094
+ exports.ConversionError = ConversionError;
4095
+ exports.POOL_SEED = POOL_SEED;
4096
+ exports.asBase85Limb = asBase85Limb;
4097
+ exports.asBn254FieldElement = asBn254FieldElement;
4098
+ exports.asCurve25519FieldElement = asCurve25519FieldElement;
4099
+ exports.asPoseidonKey = asPoseidonKey;
4100
+ exports.asRcCiphertext = asRcCiphertext;
4101
+ exports.asRcEncryptionNonce = asRcEncryptionNonce;
4102
+ exports.asRcKey = asRcKey;
4103
+ exports.asRcPlaintext = asRcPlaintext;
4104
+ exports.asU128 = asU128;
4105
+ exports.asU256 = asU256;
4106
+ exports.asU64 = asU64;
4107
+ exports.bigintToBinaryArrayLSB = bigintToBinaryArrayLSB;
4108
+ exports.calculateNetAmountAfterFee = calculateNetAmountAfterFee;
4109
+ exports.calculateTransferFee = calculateTransferFee;
4110
+ exports.convertBn254FieldElementToCurve25519FieldElement = convertBn254FieldElementToCurve25519FieldElement;
4111
+ exports.convertBn254FieldElementToPoseidonCiphertext = convertBn254FieldElementToPoseidonCiphertext;
4112
+ exports.convertBn254FieldElementToPoseidonHash = convertBn254FieldElementToPoseidonHash;
4113
+ exports.convertBn254FieldElementToPoseidonKey = convertBn254FieldElementToPoseidonKey;
4114
+ exports.convertBn254FieldElementToPoseidonPlaintext = convertBn254FieldElementToPoseidonPlaintext;
4115
+ exports.convertBn254FieldElementToU256 = convertBn254FieldElementToU256;
4116
+ exports.convertCurve25519FieldElementToBn254FieldElement = convertCurve25519FieldElementToBn254FieldElement;
4117
+ exports.convertCurve25519FieldElementToRcCiphertext = convertCurve25519FieldElementToRcCiphertext;
4118
+ exports.convertCurve25519FieldElementToRcCounter = convertCurve25519FieldElementToRcCounter;
4119
+ exports.convertCurve25519FieldElementToRcKey = convertCurve25519FieldElementToRcKey;
4120
+ exports.convertCurve25519FieldElementToRcPlaintext = convertCurve25519FieldElementToRcPlaintext;
4121
+ exports.convertCurve25519FieldElementToU256 = convertCurve25519FieldElementToU256;
4122
+ exports.convertI1024ToI128 = convertI1024ToI128;
4123
+ exports.convertI1024ToI16 = convertI1024ToI16;
4124
+ exports.convertI1024ToI256 = convertI1024ToI256;
4125
+ exports.convertI1024ToI32 = convertI1024ToI32;
4126
+ exports.convertI1024ToI512 = convertI1024ToI512;
4127
+ exports.convertI1024ToI64 = convertI1024ToI64;
4128
+ exports.convertI1024ToI8 = convertI1024ToI8;
4129
+ exports.convertI1024ToU1024 = convertI1024ToU1024;
4130
+ exports.convertI128ToI1024 = convertI128ToI1024;
4131
+ exports.convertI128ToI16 = convertI128ToI16;
4132
+ exports.convertI128ToI256 = convertI128ToI256;
4133
+ exports.convertI128ToI32 = convertI128ToI32;
4134
+ exports.convertI128ToI512 = convertI128ToI512;
4135
+ exports.convertI128ToI64 = convertI128ToI64;
4136
+ exports.convertI128ToI8 = convertI128ToI8;
4137
+ exports.convertI128ToU128 = convertI128ToU128;
4138
+ exports.convertI16ToI1024 = convertI16ToI1024;
4139
+ exports.convertI16ToI128 = convertI16ToI128;
4140
+ exports.convertI16ToI256 = convertI16ToI256;
4141
+ exports.convertI16ToI32 = convertI16ToI32;
4142
+ exports.convertI16ToI512 = convertI16ToI512;
4143
+ exports.convertI16ToI64 = convertI16ToI64;
4144
+ exports.convertI16ToI8 = convertI16ToI8;
4145
+ exports.convertI16ToU16 = convertI16ToU16;
4146
+ exports.convertI256ToI1024 = convertI256ToI1024;
4147
+ exports.convertI256ToI128 = convertI256ToI128;
4148
+ exports.convertI256ToI16 = convertI256ToI16;
4149
+ exports.convertI256ToI32 = convertI256ToI32;
4150
+ exports.convertI256ToI512 = convertI256ToI512;
4151
+ exports.convertI256ToI64 = convertI256ToI64;
4152
+ exports.convertI256ToI8 = convertI256ToI8;
4153
+ exports.convertI256ToU256 = convertI256ToU256;
4154
+ exports.convertI32ToI1024 = convertI32ToI1024;
4155
+ exports.convertI32ToI128 = convertI32ToI128;
4156
+ exports.convertI32ToI16 = convertI32ToI16;
4157
+ exports.convertI32ToI256 = convertI32ToI256;
4158
+ exports.convertI32ToI512 = convertI32ToI512;
4159
+ exports.convertI32ToI64 = convertI32ToI64;
4160
+ exports.convertI32ToI8 = convertI32ToI8;
4161
+ exports.convertI32ToU32 = convertI32ToU32;
4162
+ exports.convertI512ToI1024 = convertI512ToI1024;
4163
+ exports.convertI512ToI128 = convertI512ToI128;
4164
+ exports.convertI512ToI16 = convertI512ToI16;
4165
+ exports.convertI512ToI256 = convertI512ToI256;
4166
+ exports.convertI512ToI32 = convertI512ToI32;
4167
+ exports.convertI512ToI64 = convertI512ToI64;
4168
+ exports.convertI512ToI8 = convertI512ToI8;
4169
+ exports.convertI512ToU512 = convertI512ToU512;
4170
+ exports.convertI64ToI1024 = convertI64ToI1024;
4171
+ exports.convertI64ToI128 = convertI64ToI128;
4172
+ exports.convertI64ToI16 = convertI64ToI16;
4173
+ exports.convertI64ToI256 = convertI64ToI256;
4174
+ exports.convertI64ToI32 = convertI64ToI32;
4175
+ exports.convertI64ToI512 = convertI64ToI512;
4176
+ exports.convertI64ToI8 = convertI64ToI8;
4177
+ exports.convertI64ToU64 = convertI64ToU64;
4178
+ exports.convertI8ToI1024 = convertI8ToI1024;
4179
+ exports.convertI8ToI128 = convertI8ToI128;
4180
+ exports.convertI8ToI16 = convertI8ToI16;
4181
+ exports.convertI8ToI256 = convertI8ToI256;
4182
+ exports.convertI8ToI32 = convertI8ToI32;
4183
+ exports.convertI8ToI512 = convertI8ToI512;
4184
+ exports.convertI8ToI64 = convertI8ToI64;
4185
+ exports.convertI8ToU8 = convertI8ToU8;
4186
+ exports.convertPoseidonCiphertextToBn254FieldElement = convertPoseidonCiphertextToBn254FieldElement;
4187
+ exports.convertPoseidonHashToBn254FieldElement = convertPoseidonHashToBn254FieldElement;
4188
+ exports.convertPoseidonKeyToBn254FieldElement = convertPoseidonKeyToBn254FieldElement;
4189
+ exports.convertPoseidonPlaintextToBn254FieldElement = convertPoseidonPlaintextToBn254FieldElement;
4190
+ exports.convertRcCiphertextToCurve25519FieldElement = convertRcCiphertextToCurve25519FieldElement;
4191
+ exports.convertRcCounterToCurve25519FieldElement = convertRcCounterToCurve25519FieldElement;
4192
+ exports.convertRcEncryptionNonceToU128 = convertRcEncryptionNonceToU128;
4193
+ exports.convertRcKeyToCurve25519FieldElement = convertRcKeyToCurve25519FieldElement;
4194
+ exports.convertRcPlaintextToCurve25519FieldElement = convertRcPlaintextToCurve25519FieldElement;
4195
+ exports.convertSharedSecretToX25519Bytes = convertSharedSecretToX25519Bytes;
4196
+ exports.convertU1024BeBytesToU1024LeBytes = convertU1024BeBytesToU1024LeBytes;
4197
+ exports.convertU1024LeBytesToU1024BeBytes = convertU1024LeBytesToU1024BeBytes;
4198
+ exports.convertU1024ToI1024 = convertU1024ToI1024;
4199
+ exports.convertU1024ToU128 = convertU1024ToU128;
4200
+ exports.convertU1024ToU16 = convertU1024ToU16;
4201
+ exports.convertU1024ToU256 = convertU1024ToU256;
4202
+ exports.convertU1024ToU32 = convertU1024ToU32;
4203
+ exports.convertU1024ToU512 = convertU1024ToU512;
4204
+ exports.convertU1024ToU64 = convertU1024ToU64;
4205
+ exports.convertU1024ToU8 = convertU1024ToU8;
4206
+ exports.convertU128BeBytesToU128LeBytes = convertU128BeBytesToU128LeBytes;
4207
+ exports.convertU128LeBytesToU128BeBytes = convertU128LeBytesToU128BeBytes;
4208
+ exports.convertU128ToI128 = convertU128ToI128;
4209
+ exports.convertU128ToRcEncryptionNonce = convertU128ToRcEncryptionNonce;
4210
+ exports.convertU128ToU1024 = convertU128ToU1024;
4211
+ exports.convertU128ToU16 = convertU128ToU16;
4212
+ exports.convertU128ToU256 = convertU128ToU256;
4213
+ exports.convertU128ToU32 = convertU128ToU32;
4214
+ exports.convertU128ToU512 = convertU128ToU512;
4215
+ exports.convertU128ToU64 = convertU128ToU64;
4216
+ exports.convertU128ToU8 = convertU128ToU8;
4217
+ exports.convertU16BeBytesToU16LeBytes = convertU16BeBytesToU16LeBytes;
4218
+ exports.convertU16LeBytesToU16BeBytes = convertU16LeBytesToU16BeBytes;
4219
+ exports.convertU16ToI16 = convertU16ToI16;
4220
+ exports.convertU16ToU1024 = convertU16ToU1024;
4221
+ exports.convertU16ToU128 = convertU16ToU128;
4222
+ exports.convertU16ToU256 = convertU16ToU256;
4223
+ exports.convertU16ToU32 = convertU16ToU32;
4224
+ exports.convertU16ToU512 = convertU16ToU512;
4225
+ exports.convertU16ToU64 = convertU16ToU64;
4226
+ exports.convertU16ToU8 = convertU16ToU8;
4227
+ exports.convertU256BeBytesToU256LeBytes = convertU256BeBytesToU256LeBytes;
4228
+ exports.convertU256LeBytesToU256BeBytes = convertU256LeBytesToU256BeBytes;
4229
+ exports.convertU256ToBase85Limbs = convertU256ToBase85Limbs;
4230
+ exports.convertU256ToBn254FieldElement = convertU256ToBn254FieldElement;
4231
+ exports.convertU256ToCurve25519FieldElement = convertU256ToCurve25519FieldElement;
4232
+ exports.convertU256ToI256 = convertU256ToI256;
4233
+ exports.convertU256ToU1024 = convertU256ToU1024;
4234
+ exports.convertU256ToU128 = convertU256ToU128;
4235
+ exports.convertU256ToU16 = convertU256ToU16;
4236
+ exports.convertU256ToU32 = convertU256ToU32;
4237
+ exports.convertU256ToU512 = convertU256ToU512;
4238
+ exports.convertU256ToU64 = convertU256ToU64;
4239
+ exports.convertU256ToU8 = convertU256ToU8;
4240
+ exports.convertU32BeBytesToU32LeBytes = convertU32BeBytesToU32LeBytes;
4241
+ exports.convertU32LeBytesToU32BeBytes = convertU32LeBytesToU32BeBytes;
4242
+ exports.convertU32ToI32 = convertU32ToI32;
4243
+ exports.convertU32ToU1024 = convertU32ToU1024;
4244
+ exports.convertU32ToU128 = convertU32ToU128;
4245
+ exports.convertU32ToU16 = convertU32ToU16;
4246
+ exports.convertU32ToU256 = convertU32ToU256;
4247
+ exports.convertU32ToU512 = convertU32ToU512;
4248
+ exports.convertU32ToU64 = convertU32ToU64;
4249
+ exports.convertU32ToU8 = convertU32ToU8;
4250
+ exports.convertU512BeBytesToU512LeBytes = convertU512BeBytesToU512LeBytes;
4251
+ exports.convertU512LeBytesToU512BeBytes = convertU512LeBytesToU512BeBytes;
4252
+ exports.convertU512ToI512 = convertU512ToI512;
4253
+ exports.convertU512ToU1024 = convertU512ToU1024;
4254
+ exports.convertU512ToU128 = convertU512ToU128;
4255
+ exports.convertU512ToU16 = convertU512ToU16;
4256
+ exports.convertU512ToU256 = convertU512ToU256;
4257
+ exports.convertU512ToU32 = convertU512ToU32;
4258
+ exports.convertU512ToU64 = convertU512ToU64;
4259
+ exports.convertU512ToU8 = convertU512ToU8;
4260
+ exports.convertU64BeBytesToU64LeBytes = convertU64BeBytesToU64LeBytes;
4261
+ exports.convertU64LeBytesToU64BeBytes = convertU64LeBytesToU64BeBytes;
4262
+ exports.convertU64ToI64 = convertU64ToI64;
4263
+ exports.convertU64ToU1024 = convertU64ToU1024;
4264
+ exports.convertU64ToU128 = convertU64ToU128;
4265
+ exports.convertU64ToU16 = convertU64ToU16;
4266
+ exports.convertU64ToU256 = convertU64ToU256;
4267
+ exports.convertU64ToU32 = convertU64ToU32;
4268
+ exports.convertU64ToU512 = convertU64ToU512;
4269
+ exports.convertU64ToU8 = convertU64ToU8;
4270
+ exports.convertU8BeBytesToU8LeBytes = convertU8BeBytesToU8LeBytes;
4271
+ exports.convertU8LeBytesToU8BeBytes = convertU8LeBytesToU8BeBytes;
4272
+ exports.convertU8ToI8 = convertU8ToI8;
4273
+ exports.convertU8ToU1024 = convertU8ToU1024;
4274
+ exports.convertU8ToU128 = convertU8ToU128;
4275
+ exports.convertU8ToU16 = convertU8ToU16;
4276
+ exports.convertU8ToU256 = convertU8ToU256;
4277
+ exports.convertU8ToU32 = convertU8ToU32;
4278
+ exports.convertU8ToU512 = convertU8ToU512;
4279
+ exports.convertU8ToU64 = convertU8ToU64;
4280
+ exports.convertX25519BytesToSharedSecret = convertX25519BytesToSharedSecret;
4281
+ exports.convertX25519BytesToX25519PrivateKey = convertX25519BytesToX25519PrivateKey;
4282
+ exports.convertX25519BytesToX25519PublicKey = convertX25519BytesToX25519PublicKey;
4283
+ exports.convertX25519PrivateKeyToX25519Bytes = convertX25519PrivateKeyToX25519Bytes;
4284
+ exports.convertX25519PublicKeyToX25519Bytes = convertX25519PublicKeyToX25519Bytes;
4285
+ exports.createBeBytes = createBeBytes;
4286
+ exports.createBn254FieldElement = createBn254FieldElement;
4287
+ exports.createBytes = createBytes;
4288
+ exports.createCurve25519FieldElement = createCurve25519FieldElement;
4289
+ exports.createI1024 = createI1024;
4290
+ exports.createI128 = createI128;
4291
+ exports.createI16 = createI16;
4292
+ exports.createI256 = createI256;
4293
+ exports.createI32 = createI32;
4294
+ exports.createI512 = createI512;
4295
+ exports.createI64 = createI64;
4296
+ exports.createI8 = createI8;
4297
+ exports.createLeBytes = createLeBytes;
4298
+ exports.createPoseidonCiphertext = createPoseidonCiphertext;
4299
+ exports.createPoseidonHash = createPoseidonHash;
4300
+ exports.createPoseidonKey = createPoseidonKey;
4301
+ exports.createPoseidonPlaintext = createPoseidonPlaintext;
4302
+ exports.createRcCiphertext = createRcCiphertext;
4303
+ exports.createRcCounter = createRcCounter;
4304
+ exports.createRcEncryptionNonce = createRcEncryptionNonce;
4305
+ exports.createRcKey = createRcKey;
4306
+ exports.createRcPlaintext = createRcPlaintext;
4307
+ exports.createSharedSecret = createSharedSecret;
4308
+ exports.createSignedInteger = createSignedInteger;
4309
+ exports.createU1024 = createU1024;
4310
+ exports.createU1024BeBytes = createU1024BeBytes;
4311
+ exports.createU1024LeBytes = createU1024LeBytes;
4312
+ exports.createU128 = createU128;
4313
+ exports.createU128BeBytes = createU128BeBytes;
4314
+ exports.createU128LeBytes = createU128LeBytes;
4315
+ exports.createU16 = createU16;
4316
+ exports.createU16BeBytes = createU16BeBytes;
4317
+ exports.createU16LeBytes = createU16LeBytes;
4318
+ exports.createU256 = createU256;
4319
+ exports.createU256BeBytes = createU256BeBytes;
4320
+ exports.createU256LeBytes = createU256LeBytes;
4321
+ exports.createU32 = createU32;
4322
+ exports.createU32BeBytes = createU32BeBytes;
4323
+ exports.createU32LeBytes = createU32LeBytes;
4324
+ exports.createU512 = createU512;
4325
+ exports.createU512BeBytes = createU512BeBytes;
4326
+ exports.createU512LeBytes = createU512LeBytes;
4327
+ exports.createU64 = createU64;
4328
+ exports.createU64BeBytes = createU64BeBytes;
4329
+ exports.createU64LeBytes = createU64LeBytes;
4330
+ exports.createU8 = createU8;
4331
+ exports.createU8BeBytes = createU8BeBytes;
4332
+ exports.createU8LeBytes = createU8LeBytes;
4333
+ exports.createUnsignedInteger = createUnsignedInteger;
4334
+ exports.createX25519Bytes = createX25519Bytes;
4335
+ exports.createX25519PrivateKey = createX25519PrivateKey;
4336
+ exports.createX25519PublicKey = createX25519PublicKey;
4337
+ exports.decodeU1024BeBytesToU1024 = decodeU1024BeBytesToU1024;
4338
+ exports.decodeU1024LeBytesToU1024 = decodeU1024LeBytesToU1024;
4339
+ exports.decodeU128BeBytesToU128 = decodeU128BeBytesToU128;
4340
+ exports.decodeU128LeBytesToU128 = decodeU128LeBytesToU128;
4341
+ exports.decodeU16BeBytesToU16 = decodeU16BeBytesToU16;
4342
+ exports.decodeU16LeBytesToU16 = decodeU16LeBytesToU16;
4343
+ exports.decodeU256BeBytesToU256 = decodeU256BeBytesToU256;
4344
+ exports.decodeU256LeBytesToU256 = decodeU256LeBytesToU256;
4345
+ exports.decodeU32BeBytesToU32 = decodeU32BeBytesToU32;
4346
+ exports.decodeU32LeBytesToU32 = decodeU32LeBytesToU32;
4347
+ exports.decodeU512BeBytesToU512 = decodeU512BeBytesToU512;
4348
+ exports.decodeU512LeBytesToU512 = decodeU512LeBytesToU512;
4349
+ exports.decodeU64BeBytesToU64 = decodeU64BeBytesToU64;
4350
+ exports.decodeU64LeBytesToU64 = decodeU64LeBytesToU64;
4351
+ exports.decodeU8BeBytesToU8 = decodeU8BeBytesToU8;
4352
+ exports.decodeU8LeBytesToU8 = decodeU8LeBytesToU8;
4353
+ exports.defaultExtractUtcComponents = defaultExtractUtcComponents;
4354
+ exports.defaultGetUtcNow = defaultGetUtcNow;
4355
+ exports.encodeU1024ToU1024BeBytes = encodeU1024ToU1024BeBytes;
4356
+ exports.encodeU1024ToU1024LeBytes = encodeU1024ToU1024LeBytes;
4357
+ exports.encodeU128ToU128BeBytes = encodeU128ToU128BeBytes;
4358
+ exports.encodeU128ToU128LeBytes = encodeU128ToU128LeBytes;
4359
+ exports.encodeU16ToU16BeBytes = encodeU16ToU16BeBytes;
4360
+ exports.encodeU16ToU16LeBytes = encodeU16ToU16LeBytes;
4361
+ exports.encodeU256ToU256BeBytes = encodeU256ToU256BeBytes;
4362
+ exports.encodeU256ToU256LeBytes = encodeU256ToU256LeBytes;
4363
+ exports.encodeU32ToU32BeBytes = encodeU32ToU32BeBytes;
4364
+ exports.encodeU32ToU32LeBytes = encodeU32ToU32LeBytes;
4365
+ exports.encodeU512ToU512BeBytes = encodeU512ToU512BeBytes;
4366
+ exports.encodeU512ToU512LeBytes = encodeU512ToU512LeBytes;
4367
+ exports.encodeU64ToU64BeBytes = encodeU64ToU64BeBytes;
4368
+ exports.encodeU64ToU64LeBytes = encodeU64ToU64LeBytes;
4369
+ exports.encodeU8ToU8BeBytes = encodeU8ToU8BeBytes;
4370
+ exports.encodeU8ToU8LeBytes = encodeU8ToU8LeBytes;
4371
+ exports.extractTransferFeeConfig = extractTransferFeeConfig;
4372
+ exports.extractUtcComponents = extractUtcComponents;
4373
+ exports.generateRandomNonce = generateRandomNonce;
4374
+ exports.generateRandomU128 = generateRandomU128;
4375
+ exports.generateRandomU256 = generateRandomU256;
4376
+ exports.generateRandomU64 = generateRandomU64;
4377
+ exports.getActiveMixerTreeAddress = getActiveMixerTreeAddress;
4378
+ exports.getArciumAccountAddresses = getArciumAccountAddresses;
4379
+ exports.getArciumEncryptedTokenAccountPda = getArciumEncryptedTokenAccountPda;
4380
+ exports.getArciumEncryptedUserAccountPda = getArciumEncryptedUserAccountPda;
4381
+ exports.getByteAt = getByteAt;
4382
+ exports.getClusterAccountAddress = getClusterAccountAddress;
4383
+ exports.getCompDefAccountAddress = getCompDefAccountAddress;
4384
+ exports.getCompDefOffset = getCompDefOffset;
4385
+ exports.getComputationAccountAddress = getComputationAccountAddress;
4386
+ exports.getConfUtxoBurnerPda = getConfUtxoBurnerPda;
4387
+ exports.getConfidentialClaimProofAccountPda = getConfidentialClaimProofAccountPda;
4388
+ exports.getConfidentialUtxoProofAccountPda = getConfidentialUtxoProofAccountPda;
4389
+ exports.getExecutingPoolAccountAddress = getExecutingPoolAccountAddress;
4390
+ exports.getExtractUtcComponentsFunction = getExtractUtcComponentsFunction;
4391
+ exports.getMempoolAccountAddress = getMempoolAccountAddress;
4392
+ exports.getMixerTreeAddress = getMixerTreeAddress;
4393
+ exports.getMxeAccountAddress = getMxeAccountAddress;
4394
+ exports.getNetworkMxeComplianceGrantPda = getNetworkMxeComplianceGrantPda;
4395
+ exports.getNetworkSharedComplianceGrantPda = getNetworkSharedComplianceGrantPda;
4396
+ exports.getPoolPda = getPoolPda;
4397
+ exports.getProgramInformationPda = getProgramInformationPda;
4398
+ exports.getProtocolFeesConfigurationPda = getProtocolFeesConfigurationPda;
4399
+ exports.getProtocolOnlyUnifiedFeesPoolPda = getProtocolOnlyUnifiedFeesPoolPda;
4400
+ exports.getPubUtxoBurnerPda = getPubUtxoBurnerPda;
4401
+ exports.getPublicClaimMxeMpcCallbackDataPda = getPublicClaimMxeMpcCallbackDataPda;
4402
+ exports.getPublicClaimProofAccountPda = getPublicClaimProofAccountPda;
4403
+ exports.getRandomComputationOffset = getRandomComputationOffset;
4404
+ exports.getRelayerAccountPda = getRelayerAccountPda;
4405
+ exports.getRelayerUnifiedFeesPoolPda = getRelayerUnifiedFeesPoolPda;
4406
+ exports.getTreapPdas = getTreapPdas;
4407
+ exports.getUserGrantedComplianceGrantPda = getUserGrantedComplianceGrantPda;
4408
+ exports.getUtcNow = getUtcNow;
4409
+ exports.getUtcNowFunction = getUtcNowFunction;
4410
+ exports.getZkVerifyingKeyPda = getZkVerifyingKeyPda;
4411
+ exports.splitAddressToLowHigh = splitAddressToLowHigh;
4412
+ exports.splitU256IntoTwoU128s = splitU256IntoTwoU128s;
4413
+ exports.splitX25519PublicKeyIntoTwoU128s = splitX25519PublicKeyIntoTwoU128s;
4414
+ exports.structSeed = structSeed;
4415
+ //# sourceMappingURL=chunk-GXKSUB2U.cjs.map
4416
+ //# sourceMappingURL=chunk-GXKSUB2U.cjs.map