@inco/js 0.1.20 → 0.1.22

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.
@@ -41,797 +41,11 @@ var __export = (target, all) => {
41
41
  };
42
42
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
43
43
 
44
- // ../node_modules/viem/_esm/utils/data/isHex.js
45
- function isHex(value6, { strict: strict2 = true } = {}) {
46
- if (!value6)
47
- return false;
48
- if (typeof value6 !== "string")
49
- return false;
50
- return strict2 ? /^0x[0-9a-fA-F]*$/.test(value6) : value6.startsWith("0x");
51
- }
52
-
53
- // ../node_modules/viem/_esm/utils/data/size.js
54
- function size21(value6) {
55
- if (isHex(value6, { strict: false }))
56
- return Math.ceil((value6.length - 2) / 2);
57
- return value6.length;
58
- }
59
- var init_size = () => {};
60
-
61
- // ../node_modules/viem/_esm/errors/version.js
62
- var version = "2.24.3";
63
-
64
- // ../node_modules/viem/_esm/errors/base.js
65
- function walk(err, fn) {
66
- if (fn?.(err))
67
- return err;
68
- if (err && typeof err === "object" && "cause" in err && err.cause !== undefined)
69
- return walk(err.cause, fn);
70
- return fn ? null : err;
71
- }
72
- var errorConfig, BaseError;
73
- var init_base = __esm(() => {
74
- errorConfig = {
75
- getDocsUrl: ({ docsBaseUrl, docsPath = "", docsSlug }) => docsPath ? `${docsBaseUrl ?? "https://viem.sh"}${docsPath}${docsSlug ? `#${docsSlug}` : ""}` : undefined,
76
- version: `viem@${version}`
77
- };
78
- BaseError = class BaseError extends Error {
79
- constructor(shortMessage, args2 = {}) {
80
- const details = (() => {
81
- if (args2.cause instanceof BaseError)
82
- return args2.cause.details;
83
- if (args2.cause?.message)
84
- return args2.cause.message;
85
- return args2.details;
86
- })();
87
- const docsPath = (() => {
88
- if (args2.cause instanceof BaseError)
89
- return args2.cause.docsPath || args2.docsPath;
90
- return args2.docsPath;
91
- })();
92
- const docsUrl = errorConfig.getDocsUrl?.({ ...args2, docsPath });
93
- const message = [
94
- shortMessage || "An error occurred.",
95
- "",
96
- ...args2.metaMessages ? [...args2.metaMessages, ""] : [],
97
- ...docsUrl ? [`Docs: ${docsUrl}`] : [],
98
- ...details ? [`Details: ${details}`] : [],
99
- ...errorConfig.version ? [`Version: ${errorConfig.version}`] : []
100
- ].join(`
101
- `);
102
- super(message, args2.cause ? { cause: args2.cause } : undefined);
103
- Object.defineProperty(this, "details", {
104
- enumerable: true,
105
- configurable: true,
106
- writable: true,
107
- value: undefined
108
- });
109
- Object.defineProperty(this, "docsPath", {
110
- enumerable: true,
111
- configurable: true,
112
- writable: true,
113
- value: undefined
114
- });
115
- Object.defineProperty(this, "metaMessages", {
116
- enumerable: true,
117
- configurable: true,
118
- writable: true,
119
- value: undefined
120
- });
121
- Object.defineProperty(this, "shortMessage", {
122
- enumerable: true,
123
- configurable: true,
124
- writable: true,
125
- value: undefined
126
- });
127
- Object.defineProperty(this, "version", {
128
- enumerable: true,
129
- configurable: true,
130
- writable: true,
131
- value: undefined
132
- });
133
- Object.defineProperty(this, "name", {
134
- enumerable: true,
135
- configurable: true,
136
- writable: true,
137
- value: "BaseError"
138
- });
139
- this.details = details;
140
- this.docsPath = docsPath;
141
- this.metaMessages = args2.metaMessages;
142
- this.name = args2.name ?? this.name;
143
- this.shortMessage = shortMessage;
144
- this.version = version;
145
- }
146
- walk(fn) {
147
- return walk(this, fn);
148
- }
149
- };
150
- });
151
-
152
- // ../node_modules/viem/_esm/errors/abi.js
153
- var AbiEncodingLengthMismatchError, BytesSizeMismatchError, UnsupportedPackedAbiType;
154
- var init_abi = __esm(() => {
155
- init_base();
156
- AbiEncodingLengthMismatchError = class AbiEncodingLengthMismatchError extends BaseError {
157
- constructor({ expectedLength, givenLength }) {
158
- super([
159
- "ABI encoding params/values length mismatch.",
160
- `Expected length (params): ${expectedLength}`,
161
- `Given length (values): ${givenLength}`
162
- ].join(`
163
- `), { name: "AbiEncodingLengthMismatchError" });
164
- }
165
- };
166
- BytesSizeMismatchError = class BytesSizeMismatchError extends BaseError {
167
- constructor({ expectedSize, givenSize }) {
168
- super(`Expected bytes${expectedSize}, got bytes${givenSize}.`, {
169
- name: "BytesSizeMismatchError"
170
- });
171
- }
172
- };
173
- UnsupportedPackedAbiType = class UnsupportedPackedAbiType extends BaseError {
174
- constructor(type2) {
175
- super(`Type "${type2}" is not supported for packed encoding.`, {
176
- name: "UnsupportedPackedAbiType"
177
- });
178
- }
179
- };
180
- });
181
-
182
- // ../node_modules/viem/_esm/errors/data.js
183
- var SizeExceedsPaddingSizeError;
184
- var init_data = __esm(() => {
185
- init_base();
186
- SizeExceedsPaddingSizeError = class SizeExceedsPaddingSizeError extends BaseError {
187
- constructor({ size: size22, targetSize, type: type2 }) {
188
- super(`${type2.charAt(0).toUpperCase()}${type2.slice(1).toLowerCase()} size (${size22}) exceeds padding size (${targetSize}).`, { name: "SizeExceedsPaddingSizeError" });
189
- }
190
- };
191
- });
192
-
193
- // ../node_modules/viem/_esm/utils/data/pad.js
194
- function pad(hexOrBytes, { dir: dir2, size: size22 = 32 } = {}) {
195
- if (typeof hexOrBytes === "string")
196
- return padHex(hexOrBytes, { dir: dir2, size: size22 });
197
- return padBytes(hexOrBytes, { dir: dir2, size: size22 });
198
- }
199
- function padHex(hex_, { dir: dir2, size: size22 = 32 } = {}) {
200
- if (size22 === null)
201
- return hex_;
202
- const hex = hex_.replace("0x", "");
203
- if (hex.length > size22 * 2)
204
- throw new SizeExceedsPaddingSizeError({
205
- size: Math.ceil(hex.length / 2),
206
- targetSize: size22,
207
- type: "hex"
208
- });
209
- return `0x${hex[dir2 === "right" ? "padEnd" : "padStart"](size22 * 2, "0")}`;
210
- }
211
- function padBytes(bytes, { dir: dir2, size: size22 = 32 } = {}) {
212
- if (size22 === null)
213
- return bytes;
214
- if (bytes.length > size22)
215
- throw new SizeExceedsPaddingSizeError({
216
- size: bytes.length,
217
- targetSize: size22,
218
- type: "bytes"
219
- });
220
- const paddedBytes = new Uint8Array(size22);
221
- for (let i = 0;i < size22; i++) {
222
- const padEnd = dir2 === "right";
223
- paddedBytes[padEnd ? i : size22 - i - 1] = bytes[padEnd ? i : bytes.length - i - 1];
224
- }
225
- return paddedBytes;
226
- }
227
- var init_pad = __esm(() => {
228
- init_data();
229
- });
230
-
231
- // ../node_modules/viem/_esm/errors/encoding.js
232
- var IntegerOutOfRangeError, SizeOverflowError;
233
- var init_encoding = __esm(() => {
234
- init_base();
235
- IntegerOutOfRangeError = class IntegerOutOfRangeError extends BaseError {
236
- constructor({ max: max6, min: min4, signed, size: size22, value: value6 }) {
237
- super(`Number "${value6}" is not in safe ${size22 ? `${size22 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max6 ? `(${min4} to ${max6})` : `(above ${min4})`}`, { name: "IntegerOutOfRangeError" });
238
- }
239
- };
240
- SizeOverflowError = class SizeOverflowError extends BaseError {
241
- constructor({ givenSize, maxSize }) {
242
- super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`, { name: "SizeOverflowError" });
243
- }
244
- };
245
- });
246
-
247
- // ../node_modules/viem/_esm/utils/encoding/fromHex.js
248
- function assertSize(hexOrBytes, { size: size22 }) {
249
- if (size21(hexOrBytes) > size22)
250
- throw new SizeOverflowError({
251
- givenSize: size21(hexOrBytes),
252
- maxSize: size22
253
- });
254
- }
255
- var init_fromHex = __esm(() => {
256
- init_encoding();
257
- init_size();
258
- });
259
-
260
- // ../node_modules/viem/_esm/utils/encoding/toHex.js
261
- function toHex(value6, opts = {}) {
262
- if (typeof value6 === "number" || typeof value6 === "bigint")
263
- return numberToHex(value6, opts);
264
- if (typeof value6 === "string") {
265
- return stringToHex(value6, opts);
266
- }
267
- if (typeof value6 === "boolean")
268
- return boolToHex(value6, opts);
269
- return bytesToHex2(value6, opts);
270
- }
271
- function boolToHex(value6, opts = {}) {
272
- const hex = `0x${Number(value6)}`;
273
- if (typeof opts.size === "number") {
274
- assertSize(hex, { size: opts.size });
275
- return pad(hex, { size: opts.size });
276
- }
277
- return hex;
278
- }
279
- function bytesToHex2(value6, opts = {}) {
280
- let string6 = "";
281
- for (let i = 0;i < value6.length; i++) {
282
- string6 += hexes[value6[i]];
283
- }
284
- const hex = `0x${string6}`;
285
- if (typeof opts.size === "number") {
286
- assertSize(hex, { size: opts.size });
287
- return pad(hex, { dir: "right", size: opts.size });
288
- }
289
- return hex;
290
- }
291
- function numberToHex(value_, opts = {}) {
292
- const { signed, size: size22 } = opts;
293
- const value6 = BigInt(value_);
294
- let maxValue;
295
- if (size22) {
296
- if (signed)
297
- maxValue = (1n << BigInt(size22) * 8n - 1n) - 1n;
298
- else
299
- maxValue = 2n ** (BigInt(size22) * 8n) - 1n;
300
- } else if (typeof value_ === "number") {
301
- maxValue = BigInt(Number.MAX_SAFE_INTEGER);
302
- }
303
- const minValue = typeof maxValue === "bigint" && signed ? -maxValue - 1n : 0;
304
- if (maxValue && value6 > maxValue || value6 < minValue) {
305
- const suffix = typeof value_ === "bigint" ? "n" : "";
306
- throw new IntegerOutOfRangeError({
307
- max: maxValue ? `${maxValue}${suffix}` : undefined,
308
- min: `${minValue}${suffix}`,
309
- signed,
310
- size: size22,
311
- value: `${value_}${suffix}`
312
- });
313
- }
314
- const hex = `0x${(signed && value6 < 0 ? (1n << BigInt(size22 * 8)) + BigInt(value6) : value6).toString(16)}`;
315
- if (size22)
316
- return pad(hex, { size: size22 });
317
- return hex;
318
- }
319
- function stringToHex(value_, opts = {}) {
320
- const value6 = encoder2.encode(value_);
321
- return bytesToHex2(value6, opts);
322
- }
323
- var hexes, encoder2;
324
- var init_toHex = __esm(() => {
325
- init_encoding();
326
- init_pad();
327
- init_fromHex();
328
- hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
329
- encoder2 = /* @__PURE__ */ new TextEncoder;
330
- });
331
-
332
- // ../node_modules/viem/_esm/utils/encoding/toBytes.js
333
- function toBytes(value6, opts = {}) {
334
- if (typeof value6 === "number" || typeof value6 === "bigint")
335
- return numberToBytes(value6, opts);
336
- if (typeof value6 === "boolean")
337
- return boolToBytes(value6, opts);
338
- if (isHex(value6))
339
- return hexToBytes(value6, opts);
340
- return stringToBytes(value6, opts);
341
- }
342
- function boolToBytes(value6, opts = {}) {
343
- const bytes = new Uint8Array(1);
344
- bytes[0] = Number(value6);
345
- if (typeof opts.size === "number") {
346
- assertSize(bytes, { size: opts.size });
347
- return pad(bytes, { size: opts.size });
348
- }
349
- return bytes;
350
- }
351
- function charCodeToBase16(char) {
352
- if (char >= charCodeMap.zero && char <= charCodeMap.nine)
353
- return char - charCodeMap.zero;
354
- if (char >= charCodeMap.A && char <= charCodeMap.F)
355
- return char - (charCodeMap.A - 10);
356
- if (char >= charCodeMap.a && char <= charCodeMap.f)
357
- return char - (charCodeMap.a - 10);
358
- return;
359
- }
360
- function hexToBytes(hex_, opts = {}) {
361
- let hex = hex_;
362
- if (opts.size) {
363
- assertSize(hex, { size: opts.size });
364
- hex = pad(hex, { dir: "right", size: opts.size });
365
- }
366
- let hexString = hex.slice(2);
367
- if (hexString.length % 2)
368
- hexString = `0${hexString}`;
369
- const length4 = hexString.length / 2;
370
- const bytes = new Uint8Array(length4);
371
- for (let index = 0, j = 0;index < length4; index++) {
372
- const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j++));
373
- const nibbleRight = charCodeToBase16(hexString.charCodeAt(j++));
374
- if (nibbleLeft === undefined || nibbleRight === undefined) {
375
- throw new BaseError(`Invalid byte sequence ("${hexString[j - 2]}${hexString[j - 1]}" in "${hexString}").`);
376
- }
377
- bytes[index] = nibbleLeft * 16 + nibbleRight;
378
- }
379
- return bytes;
380
- }
381
- function numberToBytes(value6, opts) {
382
- const hex = numberToHex(value6, opts);
383
- return hexToBytes(hex);
384
- }
385
- function stringToBytes(value6, opts = {}) {
386
- const bytes = encoder3.encode(value6);
387
- if (typeof opts.size === "number") {
388
- assertSize(bytes, { size: opts.size });
389
- return pad(bytes, { dir: "right", size: opts.size });
390
- }
391
- return bytes;
392
- }
393
- var encoder3, charCodeMap;
394
- var init_toBytes = __esm(() => {
395
- init_base();
396
- init_pad();
397
- init_fromHex();
398
- init_toHex();
399
- encoder3 = /* @__PURE__ */ new TextEncoder;
400
- charCodeMap = {
401
- zero: 48,
402
- nine: 57,
403
- A: 65,
404
- F: 70,
405
- a: 97,
406
- f: 102
407
- };
408
- });
409
-
410
- // ../node_modules/@noble/hashes/esm/_assert.js
411
- function anumber(n) {
412
- if (!Number.isSafeInteger(n) || n < 0)
413
- throw new Error("positive integer expected, got " + n);
414
- }
415
- function isBytes(a) {
416
- return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
417
- }
418
- function abytes(b, ...lengths) {
419
- if (!isBytes(b))
420
- throw new Error("Uint8Array expected");
421
- if (lengths.length > 0 && !lengths.includes(b.length))
422
- throw new Error("Uint8Array expected of length " + lengths + ", got length=" + b.length);
423
- }
424
- function aexists(instance, checkFinished = true) {
425
- if (instance.destroyed)
426
- throw new Error("Hash instance has been destroyed");
427
- if (checkFinished && instance.finished)
428
- throw new Error("Hash#digest() has already been called");
429
- }
430
- function aoutput(out, instance) {
431
- abytes(out);
432
- const min4 = instance.outputLen;
433
- if (out.length < min4) {
434
- throw new Error("digestInto() expects output buffer of length at least " + min4);
435
- }
436
- }
437
- var init__assert = () => {};
438
-
439
- // ../node_modules/@noble/hashes/esm/_u64.js
440
- function fromBig(n, le = false) {
441
- if (le)
442
- return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
443
- return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
444
- }
445
- function split3(lst, le = false) {
446
- let Ah = new Uint32Array(lst.length);
447
- let Al = new Uint32Array(lst.length);
448
- for (let i = 0;i < lst.length; i++) {
449
- const { h, l } = fromBig(lst[i], le);
450
- [Ah[i], Al[i]] = [h, l];
451
- }
452
- return [Ah, Al];
453
- }
454
- var U32_MASK64, _32n, rotlSH = (h, l, s) => h << s | l >>> 32 - s, rotlSL = (h, l, s) => l << s | h >>> 32 - s, rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s, rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
455
- var init__u64 = __esm(() => {
456
- U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
457
- _32n = /* @__PURE__ */ BigInt(32);
458
- });
459
-
460
- // ../node_modules/@noble/hashes/esm/utils.js
461
- function u32(arr) {
462
- return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
463
- }
464
- function byteSwap(word) {
465
- return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
466
- }
467
- function byteSwap32(arr) {
468
- for (let i = 0;i < arr.length; i++) {
469
- arr[i] = byteSwap(arr[i]);
470
- }
471
- }
472
- function utf8ToBytes(str) {
473
- if (typeof str !== "string")
474
- throw new Error("utf8ToBytes expected string, got " + typeof str);
475
- return new Uint8Array(new TextEncoder().encode(str));
476
- }
477
- function toBytes2(data) {
478
- if (typeof data === "string")
479
- data = utf8ToBytes(data);
480
- abytes(data);
481
- return data;
482
- }
483
-
484
- class Hash {
485
- clone() {
486
- return this._cloneInto();
487
- }
488
- }
489
- function wrapConstructor(hashCons) {
490
- const hashC = (msg) => hashCons().update(toBytes2(msg)).digest();
491
- const tmp = hashCons();
492
- hashC.outputLen = tmp.outputLen;
493
- hashC.blockLen = tmp.blockLen;
494
- hashC.create = () => hashCons();
495
- return hashC;
496
- }
497
- function wrapXOFConstructorWithOpts(hashCons) {
498
- const hashC = (msg, opts) => hashCons(opts).update(toBytes2(msg)).digest();
499
- const tmp = hashCons({});
500
- hashC.outputLen = tmp.outputLen;
501
- hashC.blockLen = tmp.blockLen;
502
- hashC.create = (opts) => hashCons(opts);
503
- return hashC;
504
- }
505
- var isLE;
506
- var init_utils = __esm(() => {
507
- init__assert();
508
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
509
- isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
510
- });
511
-
512
- // ../node_modules/@noble/hashes/esm/sha3.js
513
- function keccakP(s, rounds = 24) {
514
- const B = new Uint32Array(5 * 2);
515
- for (let round = 24 - rounds;round < 24; round++) {
516
- for (let x = 0;x < 10; x++)
517
- B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];
518
- for (let x = 0;x < 10; x += 2) {
519
- const idx1 = (x + 8) % 10;
520
- const idx0 = (x + 2) % 10;
521
- const B0 = B[idx0];
522
- const B1 = B[idx0 + 1];
523
- const Th = rotlH(B0, B1, 1) ^ B[idx1];
524
- const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];
525
- for (let y = 0;y < 50; y += 10) {
526
- s[x + y] ^= Th;
527
- s[x + y + 1] ^= Tl;
528
- }
529
- }
530
- let curH = s[2];
531
- let curL = s[3];
532
- for (let t = 0;t < 24; t++) {
533
- const shift2 = SHA3_ROTL[t];
534
- const Th = rotlH(curH, curL, shift2);
535
- const Tl = rotlL(curH, curL, shift2);
536
- const PI = SHA3_PI[t];
537
- curH = s[PI];
538
- curL = s[PI + 1];
539
- s[PI] = Th;
540
- s[PI + 1] = Tl;
541
- }
542
- for (let y = 0;y < 50; y += 10) {
543
- for (let x = 0;x < 10; x++)
544
- B[x] = s[y + x];
545
- for (let x = 0;x < 10; x++)
546
- s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];
547
- }
548
- s[0] ^= SHA3_IOTA_H[round];
549
- s[1] ^= SHA3_IOTA_L[round];
550
- }
551
- B.fill(0);
552
- }
553
- var SHA3_PI, SHA3_ROTL, _SHA3_IOTA, _0n, _1n, _2n, _7n, _256n, _0x71n, SHA3_IOTA_H, SHA3_IOTA_L, rotlH = (h, l, s) => s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s), rotlL = (h, l, s) => s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s), Keccak, gen5 = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen)), sha3_224, sha3_256, sha3_384, sha3_512, keccak_224, keccak_256, keccak_384, keccak_512, genShake = (suffix, blockLen, outputLen) => wrapXOFConstructorWithOpts((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true)), shake128, shake256;
554
- var init_sha3 = __esm(() => {
555
- init__assert();
556
- init__u64();
557
- init_utils();
558
- SHA3_PI = [];
559
- SHA3_ROTL = [];
560
- _SHA3_IOTA = [];
561
- _0n = /* @__PURE__ */ BigInt(0);
562
- _1n = /* @__PURE__ */ BigInt(1);
563
- _2n = /* @__PURE__ */ BigInt(2);
564
- _7n = /* @__PURE__ */ BigInt(7);
565
- _256n = /* @__PURE__ */ BigInt(256);
566
- _0x71n = /* @__PURE__ */ BigInt(113);
567
- for (let round = 0, R = _1n, x = 1, y = 0;round < 24; round++) {
568
- [x, y] = [y, (2 * x + 3 * y) % 5];
569
- SHA3_PI.push(2 * (5 * y + x));
570
- SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64);
571
- let t = _0n;
572
- for (let j = 0;j < 7; j++) {
573
- R = (R << _1n ^ (R >> _7n) * _0x71n) % _256n;
574
- if (R & _2n)
575
- t ^= _1n << (_1n << /* @__PURE__ */ BigInt(j)) - _1n;
576
- }
577
- _SHA3_IOTA.push(t);
578
- }
579
- [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split3(_SHA3_IOTA, true);
580
- Keccak = class Keccak extends Hash {
581
- constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
582
- super();
583
- this.blockLen = blockLen;
584
- this.suffix = suffix;
585
- this.outputLen = outputLen;
586
- this.enableXOF = enableXOF;
587
- this.rounds = rounds;
588
- this.pos = 0;
589
- this.posOut = 0;
590
- this.finished = false;
591
- this.destroyed = false;
592
- anumber(outputLen);
593
- if (0 >= this.blockLen || this.blockLen >= 200)
594
- throw new Error("Sha3 supports only keccak-f1600 function");
595
- this.state = new Uint8Array(200);
596
- this.state32 = u32(this.state);
597
- }
598
- keccak() {
599
- if (!isLE)
600
- byteSwap32(this.state32);
601
- keccakP(this.state32, this.rounds);
602
- if (!isLE)
603
- byteSwap32(this.state32);
604
- this.posOut = 0;
605
- this.pos = 0;
606
- }
607
- update(data) {
608
- aexists(this);
609
- const { blockLen, state } = this;
610
- data = toBytes2(data);
611
- const len = data.length;
612
- for (let pos = 0;pos < len; ) {
613
- const take10 = Math.min(blockLen - this.pos, len - pos);
614
- for (let i = 0;i < take10; i++)
615
- state[this.pos++] ^= data[pos++];
616
- if (this.pos === blockLen)
617
- this.keccak();
618
- }
619
- return this;
620
- }
621
- finish() {
622
- if (this.finished)
623
- return;
624
- this.finished = true;
625
- const { state, suffix, pos, blockLen } = this;
626
- state[pos] ^= suffix;
627
- if ((suffix & 128) !== 0 && pos === blockLen - 1)
628
- this.keccak();
629
- state[blockLen - 1] ^= 128;
630
- this.keccak();
631
- }
632
- writeInto(out) {
633
- aexists(this, false);
634
- abytes(out);
635
- this.finish();
636
- const bufferOut = this.state;
637
- const { blockLen } = this;
638
- for (let pos = 0, len = out.length;pos < len; ) {
639
- if (this.posOut >= blockLen)
640
- this.keccak();
641
- const take10 = Math.min(blockLen - this.posOut, len - pos);
642
- out.set(bufferOut.subarray(this.posOut, this.posOut + take10), pos);
643
- this.posOut += take10;
644
- pos += take10;
645
- }
646
- return out;
647
- }
648
- xofInto(out) {
649
- if (!this.enableXOF)
650
- throw new Error("XOF is not possible for this instance");
651
- return this.writeInto(out);
652
- }
653
- xof(bytes) {
654
- anumber(bytes);
655
- return this.xofInto(new Uint8Array(bytes));
656
- }
657
- digestInto(out) {
658
- aoutput(out, this);
659
- if (this.finished)
660
- throw new Error("digest() was already called");
661
- this.writeInto(out);
662
- this.destroy();
663
- return out;
664
- }
665
- digest() {
666
- return this.digestInto(new Uint8Array(this.outputLen));
667
- }
668
- destroy() {
669
- this.destroyed = true;
670
- this.state.fill(0);
671
- }
672
- _cloneInto(to) {
673
- const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
674
- to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));
675
- to.state32.set(this.state32);
676
- to.pos = this.pos;
677
- to.posOut = this.posOut;
678
- to.finished = this.finished;
679
- to.rounds = rounds;
680
- to.suffix = suffix;
681
- to.outputLen = outputLen;
682
- to.enableXOF = enableXOF;
683
- to.destroyed = this.destroyed;
684
- return to;
685
- }
686
- };
687
- sha3_224 = /* @__PURE__ */ gen5(6, 144, 224 / 8);
688
- sha3_256 = /* @__PURE__ */ gen5(6, 136, 256 / 8);
689
- sha3_384 = /* @__PURE__ */ gen5(6, 104, 384 / 8);
690
- sha3_512 = /* @__PURE__ */ gen5(6, 72, 512 / 8);
691
- keccak_224 = /* @__PURE__ */ gen5(1, 144, 224 / 8);
692
- keccak_256 = /* @__PURE__ */ gen5(1, 136, 256 / 8);
693
- keccak_384 = /* @__PURE__ */ gen5(1, 104, 384 / 8);
694
- keccak_512 = /* @__PURE__ */ gen5(1, 72, 512 / 8);
695
- shake128 = /* @__PURE__ */ genShake(31, 168, 128 / 8);
696
- shake256 = /* @__PURE__ */ genShake(31, 136, 256 / 8);
697
- });
698
-
699
- // ../node_modules/viem/_esm/utils/hash/keccak256.js
700
- function keccak256(value6, to_) {
701
- const to = to_ || "hex";
702
- const bytes = keccak_256(isHex(value6, { strict: false }) ? toBytes(value6) : value6);
703
- if (to === "bytes")
704
- return bytes;
705
- return toHex(bytes);
706
- }
707
- var init_keccak256 = __esm(() => {
708
- init_sha3();
709
- init_toBytes();
710
- init_toHex();
711
- });
712
-
713
- // ../node_modules/viem/_esm/errors/address.js
714
- var InvalidAddressError;
715
- var init_address = __esm(() => {
716
- init_base();
717
- InvalidAddressError = class InvalidAddressError extends BaseError {
718
- constructor({ address }) {
719
- super(`Address "${address}" is invalid.`, {
720
- metaMessages: [
721
- "- Address must be a hex value of 20 bytes (40 hex characters).",
722
- "- Address must match its checksum counterpart."
723
- ],
724
- name: "InvalidAddressError"
725
- });
726
- }
727
- };
728
- });
729
-
730
- // ../node_modules/viem/_esm/utils/lru.js
731
- var LruMap;
732
- var init_lru = __esm(() => {
733
- LruMap = class LruMap extends Map {
734
- constructor(size22) {
735
- super();
736
- Object.defineProperty(this, "maxSize", {
737
- enumerable: true,
738
- configurable: true,
739
- writable: true,
740
- value: undefined
741
- });
742
- this.maxSize = size22;
743
- }
744
- get(key) {
745
- const value6 = super.get(key);
746
- if (super.has(key) && value6 !== undefined) {
747
- this.delete(key);
748
- super.set(key, value6);
749
- }
750
- return value6;
751
- }
752
- set(key, value6) {
753
- super.set(key, value6);
754
- if (this.maxSize && this.size > this.maxSize) {
755
- const firstKey = this.keys().next().value;
756
- if (firstKey)
757
- this.delete(firstKey);
758
- }
759
- return this;
760
- }
761
- };
762
- });
763
-
764
- // ../node_modules/viem/_esm/utils/address/getAddress.js
765
- function checksumAddress(address_, chainId) {
766
- if (checksumAddressCache.has(`${address_}.${chainId}`))
767
- return checksumAddressCache.get(`${address_}.${chainId}`);
768
- const hexAddress = chainId ? `${chainId}${address_.toLowerCase()}` : address_.substring(2).toLowerCase();
769
- const hash2 = keccak256(stringToBytes(hexAddress), "bytes");
770
- const address = (chainId ? hexAddress.substring(`${chainId}0x`.length) : hexAddress).split("");
771
- for (let i = 0;i < 40; i += 2) {
772
- if (hash2[i >> 1] >> 4 >= 8 && address[i]) {
773
- address[i] = address[i].toUpperCase();
774
- }
775
- if ((hash2[i >> 1] & 15) >= 8 && address[i + 1]) {
776
- address[i + 1] = address[i + 1].toUpperCase();
777
- }
778
- }
779
- const result = `0x${address.join("")}`;
780
- checksumAddressCache.set(`${address_}.${chainId}`, result);
781
- return result;
782
- }
783
- var checksumAddressCache;
784
- var init_getAddress = __esm(() => {
785
- init_toBytes();
786
- init_keccak256();
787
- init_lru();
788
- checksumAddressCache = /* @__PURE__ */ new LruMap(8192);
789
- });
790
-
791
- // ../node_modules/viem/_esm/utils/address/isAddress.js
792
- function isAddress(address, options) {
793
- const { strict: strict2 = true } = options ?? {};
794
- const cacheKey = `${address}.${strict2}`;
795
- if (isAddressCache.has(cacheKey))
796
- return isAddressCache.get(cacheKey);
797
- const result = (() => {
798
- if (!addressRegex.test(address))
799
- return false;
800
- if (address.toLowerCase() === address)
801
- return true;
802
- if (strict2)
803
- return checksumAddress(address) === address;
804
- return true;
805
- })();
806
- isAddressCache.set(cacheKey, result);
807
- return result;
808
- }
809
- var addressRegex, isAddressCache;
810
- var init_isAddress = __esm(() => {
811
- init_lru();
812
- init_getAddress();
813
- addressRegex = /^0x[a-fA-F0-9]{40}$/;
814
- isAddressCache = /* @__PURE__ */ new LruMap(8192);
815
- });
816
-
817
- // ../node_modules/viem/_esm/utils/data/concat.js
818
- function concatHex(values7) {
819
- return `0x${values7.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
820
- }
821
-
822
- // ../node_modules/viem/_esm/utils/regex.js
823
- var arrayRegex, bytesRegex, integerRegex;
824
- var init_regex = __esm(() => {
825
- arrayRegex = /^(.*)\[([0-9]*)\]$/;
826
- bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;
827
- integerRegex = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
828
- });
829
-
830
44
  // ../node_modules/dotenv/package.json
831
45
  var require_package = __commonJS((exports2, module2) => {
832
46
  module2.exports = {
833
47
  name: "dotenv",
834
- version: "16.4.7",
48
+ version: "16.5.0",
835
49
  description: "Loads environment variables from .env file",
836
50
  main: "lib/main.js",
837
51
  types: "lib/main.d.ts",
@@ -862,6 +76,7 @@ var require_package = __commonJS((exports2, module2) => {
862
76
  type: "git",
863
77
  url: "git://github.com/motdotla/dotenv.git"
864
78
  },
79
+ homepage: "https://github.com/motdotla/dotenv#readme",
865
80
  funding: "https://dotenvx.com",
866
81
  keywords: [
867
82
  "dotenv",
@@ -899,7 +114,7 @@ var require_main = __commonJS((exports2, module2) => {
899
114
  var os = require("os");
900
115
  var crypto = require("crypto");
901
116
  var packageJson = require_package();
902
- var version2 = packageJson.version;
117
+ var version = packageJson.version;
903
118
  var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
904
119
  function parse3(src) {
905
120
  const obj = {};
@@ -947,14 +162,11 @@ var require_main = __commonJS((exports2, module2) => {
947
162
  }
948
163
  return DotenvModule.parse(decrypted);
949
164
  }
950
- function _log(message) {
951
- console.log(`[dotenv@${version2}][INFO] ${message}`);
952
- }
953
165
  function _warn(message) {
954
- console.log(`[dotenv@${version2}][WARN] ${message}`);
166
+ console.log(`[dotenv@${version}][WARN] ${message}`);
955
167
  }
956
168
  function _debug(message) {
957
- console.log(`[dotenv@${version2}][DEBUG] ${message}`);
169
+ console.log(`[dotenv@${version}][DEBUG] ${message}`);
958
170
  }
959
171
  function _dotenvKey(options) {
960
172
  if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
@@ -1022,7 +234,10 @@ var require_main = __commonJS((exports2, module2) => {
1022
234
  return envPath[0] === "~" ? path.join(os.homedir(), envPath.slice(1)) : envPath;
1023
235
  }
1024
236
  function _configVault(options) {
1025
- _log("Loading env from encrypted .env.vault");
237
+ const debug2 = Boolean(options && options.debug);
238
+ if (debug2) {
239
+ _debug("Loading env from encrypted .env.vault");
240
+ }
1026
241
  const parsed = DotenvModule._parseVault(options);
1027
242
  let processEnv = process.env;
1028
243
  if (options && options.processEnv != null) {
@@ -1485,7 +700,8 @@ var tracingFunction = (name) => {
1485
700
  };
1486
701
  };
1487
702
  var internalCall = /* @__PURE__ */ tracingFunction("effect_internal_function");
1488
- var genConstructor = function* () {}.constructor;
703
+ var genConstructor = function* () {
704
+ }.constructor;
1489
705
 
1490
706
  // ../node_modules/effect/dist/esm/Hash.js
1491
707
  var randomHashCache = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/randomHashCache"), () => new WeakMap);
@@ -1832,7 +1048,8 @@ var StructuralCommitPrototype = {
1832
1048
  ...StructuralPrototype
1833
1049
  };
1834
1050
  var Base = /* @__PURE__ */ function() {
1835
- function Base2() {}
1051
+ function Base2() {
1052
+ }
1836
1053
  Base2.prototype = CommitPrototype;
1837
1054
  return Base2;
1838
1055
  }();
@@ -5335,7 +4552,8 @@ var Reference = () => (id, options) => {
5335
4552
  Error.stackTraceLimit = 2;
5336
4553
  const creationError = new Error;
5337
4554
  Error.stackTraceLimit = limit;
5338
- function ReferenceClass() {}
4555
+ function ReferenceClass() {
4556
+ }
5339
4557
  Object.setPrototypeOf(ReferenceClass, ReferenceProto);
5340
4558
  ReferenceClass.key = id;
5341
4559
  ReferenceClass.defaultValue = options.defaultValue;
@@ -8275,7 +7493,8 @@ var prettyErrorMessage = (u) => {
8275
7493
  if (hasProperty(u, "toString") && isFunction2(u["toString"]) && u["toString"] !== Object.prototype.toString && u["toString"] !== globalThis.Array.prototype.toString) {
8276
7494
  return u["toString"]();
8277
7495
  }
8278
- } catch {}
7496
+ } catch {
7497
+ }
8279
7498
  return stringifyCircular(u);
8280
7499
  };
8281
7500
  var locationRegex = /\((.*)\)/g;
@@ -8849,7 +8068,8 @@ var zip2 = /* @__PURE__ */ dual(2, (self, that) => flatMap6(self, (a) => map9(th
8849
8068
  var zipLeft = /* @__PURE__ */ dual(2, (self, that) => flatMap6(self, (a) => as(that, a)));
8850
8069
  var zipRight = /* @__PURE__ */ dual(2, (self, that) => flatMap6(self, () => that));
8851
8070
  var never = /* @__PURE__ */ asyncInterrupt(() => {
8852
- const interval = setInterval(() => {}, 2 ** 31 - 1);
8071
+ const interval = setInterval(() => {
8072
+ }, 2 ** 31 - 1);
8853
8073
  return sync(() => clearInterval(interval));
8854
8074
  });
8855
8075
  var interruptFiber = (self) => flatMap6(fiberId, (fiberId2) => pipe(self, interruptAsFiber(fiberId2)));
@@ -12669,11 +11889,16 @@ class Const {
12669
11889
  get value() {
12670
11890
  return this.effect;
12671
11891
  }
12672
- onStart(_context, _effect, _parent, _fiber) {}
12673
- onEnd(_value, _fiber) {}
12674
- onEffect(_fiber, _effect) {}
12675
- onSuspend(_fiber) {}
12676
- onResume(_fiber) {}
11892
+ onStart(_context, _effect, _parent, _fiber) {
11893
+ }
11894
+ onEnd(_value, _fiber) {
11895
+ }
11896
+ onEffect(_fiber, _effect) {
11897
+ }
11898
+ onSuspend(_fiber) {
11899
+ }
11900
+ onResume(_fiber) {
11901
+ }
12677
11902
  map(f) {
12678
11903
  return new ProxySupervisor(this, pipe(this.value, map9(f)));
12679
11904
  }
@@ -13147,7 +12372,8 @@ class FiberRuntime extends Class {
13147
12372
  return whileLoop({
13148
12373
  while: () => !isDone3,
13149
12374
  body,
13150
- step: () => {}
12375
+ step: () => {
12376
+ }
13151
12377
  });
13152
12378
  }
13153
12379
  return null;
@@ -22677,78 +21903,6 @@ class TrieIterator {
22677
21903
  }
22678
21904
  }
22679
21905
  var isTrie = (u) => hasProperty(u, TrieTypeId);
22680
- // ../node_modules/viem/_esm/utils/abi/encodePacked.js
22681
- init_abi();
22682
- init_address();
22683
- init_isAddress();
22684
- init_pad();
22685
- init_toHex();
22686
- init_regex();
22687
- function encodePacked(types, values7) {
22688
- if (types.length !== values7.length)
22689
- throw new AbiEncodingLengthMismatchError({
22690
- expectedLength: types.length,
22691
- givenLength: values7.length
22692
- });
22693
- const data = [];
22694
- for (let i = 0;i < types.length; i++) {
22695
- const type2 = types[i];
22696
- const value6 = values7[i];
22697
- data.push(encode6(type2, value6));
22698
- }
22699
- return concatHex(data);
22700
- }
22701
- function encode6(type2, value6, isArray2 = false) {
22702
- if (type2 === "address") {
22703
- const address = value6;
22704
- if (!isAddress(address))
22705
- throw new InvalidAddressError({ address });
22706
- return pad(address.toLowerCase(), {
22707
- size: isArray2 ? 32 : null
22708
- });
22709
- }
22710
- if (type2 === "string")
22711
- return stringToHex(value6);
22712
- if (type2 === "bytes")
22713
- return value6;
22714
- if (type2 === "bool")
22715
- return pad(boolToHex(value6), { size: isArray2 ? 32 : 1 });
22716
- const intMatch = type2.match(integerRegex);
22717
- if (intMatch) {
22718
- const [_type, baseType, bits = "256"] = intMatch;
22719
- const size22 = Number.parseInt(bits) / 8;
22720
- return numberToHex(value6, {
22721
- size: isArray2 ? 32 : size22,
22722
- signed: baseType === "int"
22723
- });
22724
- }
22725
- const bytesMatch = type2.match(bytesRegex);
22726
- if (bytesMatch) {
22727
- const [_type, size22] = bytesMatch;
22728
- if (Number.parseInt(size22) !== (value6.length - 2) / 2)
22729
- throw new BytesSizeMismatchError({
22730
- expectedSize: Number.parseInt(size22),
22731
- givenSize: (value6.length - 2) / 2
22732
- });
22733
- return pad(value6, { dir: "right", size: isArray2 ? 32 : null });
22734
- }
22735
- const arrayMatch = type2.match(arrayRegex);
22736
- if (arrayMatch && Array.isArray(value6)) {
22737
- const [_type, childType] = arrayMatch;
22738
- const data = [];
22739
- for (let i = 0;i < value6.length; i++) {
22740
- data.push(encode6(childType, value6[i], true));
22741
- }
22742
- if (data.length === 0)
22743
- return "0x";
22744
- return concatHex(data);
22745
- }
22746
- throw new UnsupportedPackedAbiType(type2);
22747
- }
22748
-
22749
- // ../node_modules/viem/_esm/index.js
22750
- init_toBytes();
22751
- init_toHex();
22752
21906
  // ../contracts/pega/lib/hex.ts
22753
21907
  var HexString = exports_Schema.TemplateLiteral("0x", exports_Schema.String);
22754
21908
  var Address = HexString.pipe(exports_Schema.filter((s) => s.length === 42 || `Address must be a 20-byte '0x'-prefixed hex string, but got: ${s}`), exports_Schema.brand("Address"));
@@ -22758,7 +21912,6 @@ var dotenv = __toESM(require_main());
22758
21912
  var LocalNodeEnv = exports_Schema.Struct({
22759
21913
  DEPLOYER_ADDRESS: Address,
22760
21914
  STATE_DUMP: exports_Schema.String,
22761
- SESSION_VERIFIER_ADDRESS: Address,
22762
21915
  ADD_TWO_ADDRESS: Address,
22763
21916
  EXECUTOR_ADDRESS: Address,
22764
21917
  ECIES_PUBLIC_KEY: HexString,