@settlemint/sdk-cli 2.3.2-maine196276e → 2.3.2-maineefa9743

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 (3) hide show
  1. package/dist/cli.js +358 -331
  2. package/dist/cli.js.map +21 -22
  3. package/package.json +8 -8
package/dist/cli.js CHANGED
@@ -4158,7 +4158,7 @@ var require_webcrypto = __commonJS((exports) => {
4158
4158
  exports.gcm = /* @__PURE__ */ (() => generate(mode.GCM))();
4159
4159
  });
4160
4160
 
4161
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/cryptoNode.js
4161
+ // ../../node_modules/@noble/hashes/cryptoNode.js
4162
4162
  var require_cryptoNode2 = __commonJS((exports) => {
4163
4163
  Object.defineProperty(exports, "__esModule", { value: true });
4164
4164
  exports.crypto = undefined;
@@ -4166,7 +4166,7 @@ var require_cryptoNode2 = __commonJS((exports) => {
4166
4166
  exports.crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && ("randomBytes" in nc) ? nc : undefined;
4167
4167
  });
4168
4168
 
4169
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/utils.js
4169
+ // ../../node_modules/@noble/hashes/utils.js
4170
4170
  var require_utils4 = __commonJS((exports) => {
4171
4171
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
4172
4172
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -4403,7 +4403,7 @@ var require_utils4 = __commonJS((exports) => {
4403
4403
  }
4404
4404
  });
4405
4405
 
4406
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/_md.js
4406
+ // ../../node_modules/@noble/hashes/_md.js
4407
4407
  var require__md = __commonJS((exports) => {
4408
4408
  Object.defineProperty(exports, "__esModule", { value: true });
4409
4409
  exports.SHA512_IV = exports.SHA384_IV = exports.SHA224_IV = exports.SHA256_IV = exports.HashMD = undefined;
@@ -4579,7 +4579,7 @@ var require__md = __commonJS((exports) => {
4579
4579
  ]);
4580
4580
  });
4581
4581
 
4582
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/_u64.js
4582
+ // ../../node_modules/@noble/hashes/_u64.js
4583
4583
  var require__u64 = __commonJS((exports) => {
4584
4584
  Object.defineProperty(exports, "__esModule", { value: true });
4585
4585
  exports.toBig = exports.shrSL = exports.shrSH = exports.rotrSL = exports.rotrSH = exports.rotrBL = exports.rotrBH = exports.rotr32L = exports.rotr32H = exports.rotlSL = exports.rotlSH = exports.rotlBL = exports.rotlBH = exports.add5L = exports.add5H = exports.add4L = exports.add4H = exports.add3L = exports.add3H = undefined;
@@ -4672,7 +4672,7 @@ var require__u64 = __commonJS((exports) => {
4672
4672
  exports.default = u64;
4673
4673
  });
4674
4674
 
4675
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/sha2.js
4675
+ // ../../node_modules/@noble/hashes/sha2.js
4676
4676
  var require_sha2 = __commonJS((exports) => {
4677
4677
  Object.defineProperty(exports, "__esModule", { value: true });
4678
4678
  exports.sha512_224 = exports.sha512_256 = exports.sha384 = exports.sha512 = exports.sha224 = exports.sha256 = exports.SHA512_256 = exports.SHA512_224 = exports.SHA384 = exports.SHA512 = exports.SHA224 = exports.SHA256 = undefined;
@@ -5142,7 +5142,7 @@ var require_sha2 = __commonJS((exports) => {
5142
5142
  exports.sha512_224 = (0, utils_ts_1.createHasher)(() => new SHA512_224);
5143
5143
  });
5144
5144
 
5145
- // ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/utils.js
5145
+ // ../../node_modules/@noble/curves/abstract/utils.js
5146
5146
  var require_utils5 = __commonJS((exports) => {
5147
5147
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
5148
5148
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5416,7 +5416,7 @@ var require_utils5 = __commonJS((exports) => {
5416
5416
  }
5417
5417
  });
5418
5418
 
5419
- // ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/modular.js
5419
+ // ../../node_modules/@noble/curves/abstract/modular.js
5420
5420
  var require_modular = __commonJS((exports) => {
5421
5421
  Object.defineProperty(exports, "__esModule", { value: true });
5422
5422
  exports.isNegativeLE = undefined;
@@ -5746,7 +5746,7 @@ var require_modular = __commonJS((exports) => {
5746
5746
  }
5747
5747
  });
5748
5748
 
5749
- // ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/curve.js
5749
+ // ../../node_modules/@noble/curves/abstract/curve.js
5750
5750
  var require_curve = __commonJS((exports) => {
5751
5751
  Object.defineProperty(exports, "__esModule", { value: true });
5752
5752
  exports.wNAF = wNAF;
@@ -5995,7 +5995,7 @@ var require_curve = __commonJS((exports) => {
5995
5995
  }
5996
5996
  });
5997
5997
 
5998
- // ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/edwards.js
5998
+ // ../../node_modules/@noble/curves/abstract/edwards.js
5999
5999
  var require_edwards = __commonJS((exports) => {
6000
6000
  Object.defineProperty(exports, "__esModule", { value: true });
6001
6001
  exports.twistedEdwards = twistedEdwards;
@@ -6354,7 +6354,7 @@ var require_edwards = __commonJS((exports) => {
6354
6354
  }
6355
6355
  });
6356
6356
 
6357
- // ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/hash-to-curve.js
6357
+ // ../../node_modules/@noble/curves/abstract/hash-to-curve.js
6358
6358
  var require_hash_to_curve = __commonJS((exports) => {
6359
6359
  Object.defineProperty(exports, "__esModule", { value: true });
6360
6360
  exports.expand_message_xmd = expand_message_xmd;
@@ -6507,7 +6507,7 @@ var require_hash_to_curve = __commonJS((exports) => {
6507
6507
  }
6508
6508
  });
6509
6509
 
6510
- // ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/montgomery.js
6510
+ // ../../node_modules/@noble/curves/abstract/montgomery.js
6511
6511
  var require_montgomery = __commonJS((exports) => {
6512
6512
  Object.defineProperty(exports, "__esModule", { value: true });
6513
6513
  exports.montgomery = montgomery;
@@ -6614,7 +6614,7 @@ var require_montgomery = __commonJS((exports) => {
6614
6614
  }
6615
6615
  });
6616
6616
 
6617
- // ../../node_modules/eciesjs/node_modules/@noble/curves/ed25519.js
6617
+ // ../../node_modules/@noble/curves/ed25519.js
6618
6618
  var require_ed25519 = __commonJS((exports) => {
6619
6619
  Object.defineProperty(exports, "__esModule", { value: true });
6620
6620
  exports.hash_to_ristretto255 = exports.hashToRistretto255 = exports.RistrettoPoint = exports.encodeToCurve = exports.hashToCurve = exports.ed25519_hasher = exports.edwardsToMontgomery = exports.x25519 = exports.ed25519ph = exports.ed25519ctx = exports.ed25519 = exports.ED25519_TORSION_SUBGROUP = undefined;
@@ -6978,7 +6978,7 @@ var require_ed25519 = __commonJS((exports) => {
6978
6978
  exports.hash_to_ristretto255 = exports.hashToRistretto255;
6979
6979
  });
6980
6980
 
6981
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/hmac.js
6981
+ // ../../node_modules/@noble/hashes/hmac.js
6982
6982
  var require_hmac = __commonJS((exports) => {
6983
6983
  Object.defineProperty(exports, "__esModule", { value: true });
6984
6984
  exports.hmac = exports.HMAC = undefined;
@@ -7054,7 +7054,7 @@ var require_hmac = __commonJS((exports) => {
7054
7054
  exports.hmac.create = (hash, key) => new HMAC(hash, key);
7055
7055
  });
7056
7056
 
7057
- // ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/weierstrass.js
7057
+ // ../../node_modules/@noble/curves/abstract/weierstrass.js
7058
7058
  var require_weierstrass = __commonJS((exports) => {
7059
7059
  Object.defineProperty(exports, "__esModule", { value: true });
7060
7060
  exports.DER = exports.DERErr = undefined;
@@ -7973,7 +7973,7 @@ var require_weierstrass = __commonJS((exports) => {
7973
7973
  }
7974
7974
  });
7975
7975
 
7976
- // ../../node_modules/eciesjs/node_modules/@noble/curves/_shortw_utils.js
7976
+ // ../../node_modules/@noble/curves/_shortw_utils.js
7977
7977
  var require__shortw_utils = __commonJS((exports) => {
7978
7978
  Object.defineProperty(exports, "__esModule", { value: true });
7979
7979
  exports.getHash = getHash;
@@ -7995,7 +7995,7 @@ var require__shortw_utils = __commonJS((exports) => {
7995
7995
  }
7996
7996
  });
7997
7997
 
7998
- // ../../node_modules/eciesjs/node_modules/@noble/curves/secp256k1.js
7998
+ // ../../node_modules/@noble/curves/secp256k1.js
7999
7999
  var require_secp256k1 = __commonJS((exports) => {
8000
8000
  Object.defineProperty(exports, "__esModule", { value: true });
8001
8001
  exports.encodeToCurve = exports.hashToCurve = exports.secp256k1_hasher = exports.schnorr = exports.secp256k1 = undefined;
@@ -8321,7 +8321,7 @@ var require_elliptic = __commonJS((exports) => {
8321
8321
  };
8322
8322
  });
8323
8323
 
8324
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/hkdf.js
8324
+ // ../../node_modules/@noble/hashes/hkdf.js
8325
8325
  var require_hkdf = __commonJS((exports) => {
8326
8326
  Object.defineProperty(exports, "__esModule", { value: true });
8327
8327
  exports.hkdf = undefined;
@@ -231606,7 +231606,7 @@ function size(value4) {
231606
231606
  var init_size = () => {};
231607
231607
 
231608
231608
  // ../../node_modules/viem/_esm/errors/version.js
231609
- var version3 = "2.30.0";
231609
+ var version3 = "2.30.1";
231610
231610
 
231611
231611
  // ../../node_modules/viem/_esm/errors/base.js
231612
231612
  function walk(err, fn) {
@@ -232319,14 +232319,43 @@ var init_toBytes = __esm(() => {
232319
232319
  };
232320
232320
  });
232321
232321
 
232322
- // ../../node_modules/@noble/hashes/esm/_assert.js
232323
- function anumber(n6) {
232324
- if (!Number.isSafeInteger(n6) || n6 < 0)
232325
- throw new Error("positive integer expected, got " + n6);
232322
+ // ../../node_modules/@noble/hashes/esm/_u64.js
232323
+ function fromBig(n6, le4 = false) {
232324
+ if (le4)
232325
+ return { h: Number(n6 & U32_MASK64), l: Number(n6 >> _32n & U32_MASK64) };
232326
+ return { h: Number(n6 >> _32n & U32_MASK64) | 0, l: Number(n6 & U32_MASK64) | 0 };
232326
232327
  }
232328
+ function split3(lst, le4 = false) {
232329
+ const len = lst.length;
232330
+ let Ah = new Uint32Array(len);
232331
+ let Al = new Uint32Array(len);
232332
+ for (let i6 = 0;i6 < len; i6++) {
232333
+ const { h: h8, l: l3 } = fromBig(lst[i6], le4);
232334
+ [Ah[i6], Al[i6]] = [h8, l3];
232335
+ }
232336
+ return [Ah, Al];
232337
+ }
232338
+ var U32_MASK64, _32n, rotlSH = (h8, l3, s7) => h8 << s7 | l3 >>> 32 - s7, rotlSL = (h8, l3, s7) => l3 << s7 | h8 >>> 32 - s7, rotlBH = (h8, l3, s7) => l3 << s7 - 32 | h8 >>> 64 - s7, rotlBL = (h8, l3, s7) => h8 << s7 - 32 | l3 >>> 64 - s7;
232339
+ var init__u64 = __esm(() => {
232340
+ U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
232341
+ _32n = /* @__PURE__ */ BigInt(32);
232342
+ });
232343
+
232344
+ // ../../node_modules/@noble/hashes/esm/cryptoNode.js
232345
+ import * as nc from "node:crypto";
232346
+ var crypto2;
232347
+ var init_cryptoNode = __esm(() => {
232348
+ crypto2 = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && ("randomBytes" in nc) ? nc : undefined;
232349
+ });
232350
+
232351
+ // ../../node_modules/@noble/hashes/esm/utils.js
232327
232352
  function isBytes(a7) {
232328
232353
  return a7 instanceof Uint8Array || ArrayBuffer.isView(a7) && a7.constructor.name === "Uint8Array";
232329
232354
  }
232355
+ function anumber(n6) {
232356
+ if (!Number.isSafeInteger(n6) || n6 < 0)
232357
+ throw new Error("positive integer expected, got " + n6);
232358
+ }
232330
232359
  function abytes(b4, ...lengths) {
232331
232360
  if (!isBytes(b4))
232332
232361
  throw new Error("Uint8Array expected");
@@ -232335,7 +232364,7 @@ function abytes(b4, ...lengths) {
232335
232364
  }
232336
232365
  function ahash(h8) {
232337
232366
  if (typeof h8 !== "function" || typeof h8.create !== "function")
232338
- throw new Error("Hash should be wrapped by utils.wrapConstructor");
232367
+ throw new Error("Hash should be wrapped by utils.createHasher");
232339
232368
  anumber(h8.outputLen);
232340
232369
  anumber(h8.blockLen);
232341
232370
  }
@@ -232352,40 +232381,14 @@ function aoutput(out, instance) {
232352
232381
  throw new Error("digestInto() expects output buffer of length at least " + min);
232353
232382
  }
232354
232383
  }
232355
- var init__assert = () => {};
232356
-
232357
- // ../../node_modules/@noble/hashes/esm/_u64.js
232358
- function fromBig(n6, le4 = false) {
232359
- if (le4)
232360
- return { h: Number(n6 & U32_MASK64), l: Number(n6 >> _32n & U32_MASK64) };
232361
- return { h: Number(n6 >> _32n & U32_MASK64) | 0, l: Number(n6 & U32_MASK64) | 0 };
232362
- }
232363
- function split3(lst, le4 = false) {
232364
- let Ah = new Uint32Array(lst.length);
232365
- let Al = new Uint32Array(lst.length);
232366
- for (let i6 = 0;i6 < lst.length; i6++) {
232367
- const { h: h8, l: l3 } = fromBig(lst[i6], le4);
232368
- [Ah[i6], Al[i6]] = [h8, l3];
232369
- }
232370
- return [Ah, Al];
232371
- }
232372
- var U32_MASK64, _32n, rotlSH = (h8, l3, s7) => h8 << s7 | l3 >>> 32 - s7, rotlSL = (h8, l3, s7) => l3 << s7 | h8 >>> 32 - s7, rotlBH = (h8, l3, s7) => l3 << s7 - 32 | h8 >>> 64 - s7, rotlBL = (h8, l3, s7) => h8 << s7 - 32 | l3 >>> 64 - s7;
232373
- var init__u64 = __esm(() => {
232374
- U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
232375
- _32n = /* @__PURE__ */ BigInt(32);
232376
- });
232377
-
232378
- // ../../node_modules/@noble/hashes/esm/cryptoNode.js
232379
- import * as nc from "node:crypto";
232380
- var crypto2;
232381
- var init_cryptoNode = __esm(() => {
232382
- crypto2 = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && ("randomBytes" in nc) ? nc : undefined;
232383
- });
232384
-
232385
- // ../../node_modules/@noble/hashes/esm/utils.js
232386
232384
  function u32(arr) {
232387
232385
  return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
232388
232386
  }
232387
+ function clean(...arrays) {
232388
+ for (let i6 = 0;i6 < arrays.length; i6++) {
232389
+ arrays[i6].fill(0);
232390
+ }
232391
+ }
232389
232392
  function createView(arr) {
232390
232393
  return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
232391
232394
  }
@@ -232399,10 +232402,11 @@ function byteSwap32(arr) {
232399
232402
  for (let i6 = 0;i6 < arr.length; i6++) {
232400
232403
  arr[i6] = byteSwap(arr[i6]);
232401
232404
  }
232405
+ return arr;
232402
232406
  }
232403
232407
  function utf8ToBytes(str) {
232404
232408
  if (typeof str !== "string")
232405
- throw new Error("utf8ToBytes expected string, got " + typeof str);
232409
+ throw new Error("string expected");
232406
232410
  return new Uint8Array(new TextEncoder().encode(str));
232407
232411
  }
232408
232412
  function toBytes2(data) {
@@ -232428,11 +232432,8 @@ function concatBytes(...arrays) {
232428
232432
  }
232429
232433
 
232430
232434
  class Hash {
232431
- clone() {
232432
- return this._cloneInto();
232433
- }
232434
232435
  }
232435
- function wrapConstructor(hashCons) {
232436
+ function createHasher(hashCons) {
232436
232437
  const hashC = (msg) => hashCons().update(toBytes2(msg)).digest();
232437
232438
  const tmp = hashCons();
232438
232439
  hashC.outputLen = tmp.outputLen;
@@ -232440,14 +232441,6 @@ function wrapConstructor(hashCons) {
232440
232441
  hashC.create = () => hashCons();
232441
232442
  return hashC;
232442
232443
  }
232443
- function wrapXOFConstructorWithOpts(hashCons) {
232444
- const hashC = (msg, opts) => hashCons(opts).update(toBytes2(msg)).digest();
232445
- const tmp = hashCons({});
232446
- hashC.outputLen = tmp.outputLen;
232447
- hashC.blockLen = tmp.blockLen;
232448
- hashC.create = (opts) => hashCons(opts);
232449
- return hashC;
232450
- }
232451
232444
  function randomBytes(bytesLength = 32) {
232452
232445
  if (crypto2 && typeof crypto2.getRandomValues === "function") {
232453
232446
  return crypto2.getRandomValues(new Uint8Array(bytesLength));
@@ -232457,13 +232450,12 @@ function randomBytes(bytesLength = 32) {
232457
232450
  }
232458
232451
  throw new Error("crypto.getRandomValues must be defined");
232459
232452
  }
232460
- var isLE, hasHexBuiltin;
232453
+ var isLE, swap32IfBE;
232461
232454
  var init_utils2 = __esm(() => {
232462
232455
  init_cryptoNode();
232463
- init__assert();
232464
232456
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
232465
232457
  isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
232466
- hasHexBuiltin = typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function";
232458
+ swap32IfBE = isLE ? (u6) => u6 : byteSwap32;
232467
232459
  });
232468
232460
 
232469
232461
  // ../../node_modules/@noble/hashes/esm/sha3.js
@@ -232505,22 +232497,21 @@ function keccakP(s7, rounds = 24) {
232505
232497
  s7[0] ^= SHA3_IOTA_H[round];
232506
232498
  s7[1] ^= SHA3_IOTA_L[round];
232507
232499
  }
232508
- B4.fill(0);
232500
+ clean(B4);
232509
232501
  }
232510
- var SHA3_PI, SHA3_ROTL, _SHA3_IOTA, _0n, _1n, _2n, _7n, _256n, _0x71n, SHA3_IOTA_H, SHA3_IOTA_L, rotlH = (h8, l3, s7) => s7 > 32 ? rotlBH(h8, l3, s7) : rotlSH(h8, l3, s7), rotlL = (h8, l3, s7) => s7 > 32 ? rotlBL(h8, l3, s7) : rotlSL(h8, l3, s7), Keccak, gen = (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;
232502
+ var _0n, _1n, _2n, _7n, _256n, _0x71n, SHA3_PI, SHA3_ROTL, _SHA3_IOTA, IOTAS, SHA3_IOTA_H, SHA3_IOTA_L, rotlH = (h8, l3, s7) => s7 > 32 ? rotlBH(h8, l3, s7) : rotlSH(h8, l3, s7), rotlL = (h8, l3, s7) => s7 > 32 ? rotlBL(h8, l3, s7) : rotlSL(h8, l3, s7), Keccak, gen = (suffix, blockLen, outputLen) => createHasher(() => new Keccak(blockLen, suffix, outputLen)), keccak_256;
232511
232503
  var init_sha3 = __esm(() => {
232512
- init__assert();
232513
232504
  init__u64();
232514
232505
  init_utils2();
232506
+ _0n = BigInt(0);
232507
+ _1n = BigInt(1);
232508
+ _2n = BigInt(2);
232509
+ _7n = BigInt(7);
232510
+ _256n = BigInt(256);
232511
+ _0x71n = BigInt(113);
232515
232512
  SHA3_PI = [];
232516
232513
  SHA3_ROTL = [];
232517
232514
  _SHA3_IOTA = [];
232518
- _0n = /* @__PURE__ */ BigInt(0);
232519
- _1n = /* @__PURE__ */ BigInt(1);
232520
- _2n = /* @__PURE__ */ BigInt(2);
232521
- _7n = /* @__PURE__ */ BigInt(7);
232522
- _256n = /* @__PURE__ */ BigInt(256);
232523
- _0x71n = /* @__PURE__ */ BigInt(113);
232524
232515
  for (let round = 0, R7 = _1n, x6 = 1, y4 = 0;round < 24; round++) {
232525
232516
  [x6, y4] = [y4, (2 * x6 + 3 * y4) % 5];
232526
232517
  SHA3_PI.push(2 * (5 * y4 + x6));
@@ -232533,7 +232524,9 @@ var init_sha3 = __esm(() => {
232533
232524
  }
232534
232525
  _SHA3_IOTA.push(t8);
232535
232526
  }
232536
- [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split3(_SHA3_IOTA, true);
232527
+ IOTAS = split3(_SHA3_IOTA, true);
232528
+ SHA3_IOTA_H = IOTAS[0];
232529
+ SHA3_IOTA_L = IOTAS[1];
232537
232530
  Keccak = class Keccak extends Hash {
232538
232531
  constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
232539
232532
  super();
@@ -232548,24 +232541,26 @@ var init_sha3 = __esm(() => {
232548
232541
  this.enableXOF = enableXOF;
232549
232542
  this.rounds = rounds;
232550
232543
  anumber(outputLen);
232551
- if (0 >= this.blockLen || this.blockLen >= 200)
232552
- throw new Error("Sha3 supports only keccak-f1600 function");
232544
+ if (!(0 < blockLen && blockLen < 200))
232545
+ throw new Error("only keccak-f1600 function is supported");
232553
232546
  this.state = new Uint8Array(200);
232554
232547
  this.state32 = u32(this.state);
232555
232548
  }
232549
+ clone() {
232550
+ return this._cloneInto();
232551
+ }
232556
232552
  keccak() {
232557
- if (!isLE)
232558
- byteSwap32(this.state32);
232553
+ swap32IfBE(this.state32);
232559
232554
  keccakP(this.state32, this.rounds);
232560
- if (!isLE)
232561
- byteSwap32(this.state32);
232555
+ swap32IfBE(this.state32);
232562
232556
  this.posOut = 0;
232563
232557
  this.pos = 0;
232564
232558
  }
232565
232559
  update(data) {
232566
232560
  aexists(this);
232567
- const { blockLen, state } = this;
232568
232561
  data = toBytes2(data);
232562
+ abytes(data);
232563
+ const { blockLen, state } = this;
232569
232564
  const len = data.length;
232570
232565
  for (let pos = 0;pos < len; ) {
232571
232566
  const take2 = Math.min(blockLen - this.pos, len - pos);
@@ -232625,7 +232620,7 @@ var init_sha3 = __esm(() => {
232625
232620
  }
232626
232621
  destroy() {
232627
232622
  this.destroyed = true;
232628
- this.state.fill(0);
232623
+ clean(this.state);
232629
232624
  }
232630
232625
  _cloneInto(to) {
232631
232626
  const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
@@ -232642,16 +232637,7 @@ var init_sha3 = __esm(() => {
232642
232637
  return to;
232643
232638
  }
232644
232639
  };
232645
- sha3_224 = /* @__PURE__ */ gen(6, 144, 224 / 8);
232646
- sha3_256 = /* @__PURE__ */ gen(6, 136, 256 / 8);
232647
- sha3_384 = /* @__PURE__ */ gen(6, 104, 384 / 8);
232648
- sha3_512 = /* @__PURE__ */ gen(6, 72, 512 / 8);
232649
- keccak_224 = /* @__PURE__ */ gen(1, 144, 224 / 8);
232650
- keccak_256 = /* @__PURE__ */ gen(1, 136, 256 / 8);
232651
- keccak_384 = /* @__PURE__ */ gen(1, 104, 384 / 8);
232652
- keccak_512 = /* @__PURE__ */ gen(1, 72, 512 / 8);
232653
- shake128 = /* @__PURE__ */ genShake(31, 168, 128 / 8);
232654
- shake256 = /* @__PURE__ */ genShake(31, 136, 256 / 8);
232640
+ keccak_256 = /* @__PURE__ */ (() => gen(1, 136, 256 / 8))();
232655
232641
  });
232656
232642
 
232657
232643
  // ../../node_modules/viem/_esm/utils/hash/keccak256.js
@@ -234815,9 +234801,8 @@ function Chi(a7, b4, c3) {
234815
234801
  function Maj(a7, b4, c3) {
234816
234802
  return a7 & b4 ^ a7 & c3 ^ b4 & c3;
234817
234803
  }
234818
- var HashMD;
234804
+ var HashMD, SHA256_IV;
234819
234805
  var init__md = __esm(() => {
234820
- init__assert();
234821
234806
  init_utils2();
234822
234807
  HashMD = class HashMD extends Hash {
234823
234808
  constructor(blockLen, outputLen, padOffset, isLE2) {
@@ -234835,8 +234820,9 @@ var init__md = __esm(() => {
234835
234820
  }
234836
234821
  update(data) {
234837
234822
  aexists(this);
234838
- const { view, buffer, blockLen } = this;
234839
234823
  data = toBytes2(data);
234824
+ abytes(data);
234825
+ const { view, buffer, blockLen } = this;
234840
234826
  const len = data.length;
234841
234827
  for (let pos = 0;pos < len; ) {
234842
234828
  const take2 = Math.min(blockLen - this.pos, len - pos);
@@ -234865,7 +234851,7 @@ var init__md = __esm(() => {
234865
234851
  const { buffer, view, blockLen, isLE: isLE2 } = this;
234866
234852
  let { pos } = this;
234867
234853
  buffer[pos++] = 128;
234868
- this.buffer.subarray(pos).fill(0);
234854
+ clean(this.buffer.subarray(pos));
234869
234855
  if (this.padOffset > blockLen - pos) {
234870
234856
  this.process(view, 0);
234871
234857
  pos = 0;
@@ -234896,23 +234882,36 @@ var init__md = __esm(() => {
234896
234882
  to || (to = new this.constructor);
234897
234883
  to.set(...this.get());
234898
234884
  const { blockLen, buffer, length, finished, destroyed, pos } = this;
234885
+ to.destroyed = destroyed;
234886
+ to.finished = finished;
234899
234887
  to.length = length;
234900
234888
  to.pos = pos;
234901
- to.finished = finished;
234902
- to.destroyed = destroyed;
234903
234889
  if (length % blockLen)
234904
234890
  to.buffer.set(buffer);
234905
234891
  return to;
234906
234892
  }
234893
+ clone() {
234894
+ return this._cloneInto();
234895
+ }
234907
234896
  };
234897
+ SHA256_IV = /* @__PURE__ */ Uint32Array.from([
234898
+ 1779033703,
234899
+ 3144134277,
234900
+ 1013904242,
234901
+ 2773480762,
234902
+ 1359893119,
234903
+ 2600822924,
234904
+ 528734635,
234905
+ 1541459225
234906
+ ]);
234908
234907
  });
234909
234908
 
234910
- // ../../node_modules/@noble/hashes/esm/sha256.js
234911
- var SHA256_K, SHA256_IV, SHA256_W, SHA256, sha256;
234912
- var init_sha256 = __esm(() => {
234909
+ // ../../node_modules/@noble/hashes/esm/sha2.js
234910
+ var SHA256_K, SHA256_W, SHA256, sha256;
234911
+ var init_sha2 = __esm(() => {
234913
234912
  init__md();
234914
234913
  init_utils2();
234915
- SHA256_K = /* @__PURE__ */ new Uint32Array([
234914
+ SHA256_K = /* @__PURE__ */ Uint32Array.from([
234916
234915
  1116352408,
234917
234916
  1899447441,
234918
234917
  3049323471,
@@ -234978,16 +234977,6 @@ var init_sha256 = __esm(() => {
234978
234977
  3204031479,
234979
234978
  3329325298
234980
234979
  ]);
234981
- SHA256_IV = /* @__PURE__ */ new Uint32Array([
234982
- 1779033703,
234983
- 3144134277,
234984
- 1013904242,
234985
- 2773480762,
234986
- 1359893119,
234987
- 2600822924,
234988
- 528734635,
234989
- 1541459225
234990
- ]);
234991
234980
  SHA256_W = /* @__PURE__ */ new Uint32Array(64);
234992
234981
  SHA256 = class SHA256 extends HashMD {
234993
234982
  constructor(outputLen = 32) {
@@ -235051,25 +235040,19 @@ var init_sha256 = __esm(() => {
235051
235040
  this.set(A5, B4, C4, D3, E6, F3, G4, H4);
235052
235041
  }
235053
235042
  roundClean() {
235054
- SHA256_W.fill(0);
235043
+ clean(SHA256_W);
235055
235044
  }
235056
235045
  destroy() {
235057
235046
  this.set(0, 0, 0, 0, 0, 0, 0, 0);
235058
- this.buffer.fill(0);
235047
+ clean(this.buffer);
235059
235048
  }
235060
235049
  };
235061
- sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256);
235062
- });
235063
-
235064
- // ../../node_modules/@noble/hashes/esm/sha2.js
235065
- var init_sha2 = __esm(() => {
235066
- init_sha256();
235050
+ sha256 = /* @__PURE__ */ createHasher(() => new SHA256);
235067
235051
  });
235068
235052
 
235069
235053
  // ../../node_modules/@noble/hashes/esm/hmac.js
235070
235054
  var HMAC, hmac = (hash2, key2, message) => new HMAC(hash2, key2).update(message).digest();
235071
235055
  var init_hmac = __esm(() => {
235072
- init__assert();
235073
235056
  init_utils2();
235074
235057
  HMAC = class HMAC extends Hash {
235075
235058
  constructor(hash2, _key) {
@@ -235093,7 +235076,7 @@ var init_hmac = __esm(() => {
235093
235076
  for (let i6 = 0;i6 < pad2.length; i6++)
235094
235077
  pad2[i6] ^= 54 ^ 92;
235095
235078
  this.oHash.update(pad2);
235096
- pad2.fill(0);
235079
+ clean(pad2);
235097
235080
  }
235098
235081
  update(buf) {
235099
235082
  aexists(this);
@@ -235126,6 +235109,9 @@ var init_hmac = __esm(() => {
235126
235109
  to.iHash = iHash._cloneInto(to.iHash);
235127
235110
  return to;
235128
235111
  }
235112
+ clone() {
235113
+ return this._cloneInto();
235114
+ }
235129
235115
  destroy() {
235130
235116
  this.destroyed = true;
235131
235117
  this.oHash.destroy();
@@ -235158,7 +235144,7 @@ function hexToNumber2(hex) {
235158
235144
  }
235159
235145
  function bytesToHex2(bytes) {
235160
235146
  abytes2(bytes);
235161
- if (hasHexBuiltin2)
235147
+ if (hasHexBuiltin)
235162
235148
  return bytes.toHex();
235163
235149
  let hex = "";
235164
235150
  for (let i6 = 0;i6 < bytes.length; i6++) {
@@ -235178,7 +235164,7 @@ function asciiToBase16(ch) {
235178
235164
  function hexToBytes2(hex) {
235179
235165
  if (typeof hex !== "string")
235180
235166
  throw new Error("hex string expected, got " + typeof hex);
235181
- if (hasHexBuiltin2)
235167
+ if (hasHexBuiltin)
235182
235168
  return Uint8Array.fromHex(hex);
235183
235169
  const hl = hex.length;
235184
235170
  const al = hl / 2;
@@ -235337,12 +235323,12 @@ function memoized(fn) {
235337
235323
  return computed;
235338
235324
  };
235339
235325
  }
235340
- var _0n2, _1n2, hasHexBuiltin2, hexes2, asciis, isPosBig = (n6) => typeof n6 === "bigint" && _0n2 <= n6, bitMask = (n6) => (_1n2 << BigInt(n6)) - _1n2, u8n = (len) => new Uint8Array(len), u8fr = (arr) => Uint8Array.from(arr), validatorFns;
235326
+ var _0n2, _1n2, hasHexBuiltin, hexes2, asciis, isPosBig = (n6) => typeof n6 === "bigint" && _0n2 <= n6, bitMask = (n6) => (_1n2 << BigInt(n6)) - _1n2, u8n = (len) => new Uint8Array(len), u8fr = (arr) => Uint8Array.from(arr), validatorFns;
235341
235327
  var init_utils3 = __esm(() => {
235342
235328
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
235343
235329
  _0n2 = /* @__PURE__ */ BigInt(0);
235344
235330
  _1n2 = /* @__PURE__ */ BigInt(1);
235345
- hasHexBuiltin2 = typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function";
235331
+ hasHexBuiltin = typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function";
235346
235332
  hexes2 = /* @__PURE__ */ Array.from({ length: 256 }, (_5, i6) => i6.toString(16).padStart(2, "0"));
235347
235333
  asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
235348
235334
  validatorFns = {
@@ -235363,22 +235349,6 @@ function mod(a7, b4) {
235363
235349
  const result = a7 % b4;
235364
235350
  return result >= _0n3 ? result : b4 + result;
235365
235351
  }
235366
- function pow(num, power, modulo) {
235367
- if (power < _0n3)
235368
- throw new Error("invalid exponent, negatives unsupported");
235369
- if (modulo <= _0n3)
235370
- throw new Error("invalid modulus");
235371
- if (modulo === _1n3)
235372
- return _0n3;
235373
- let res = _1n3;
235374
- while (power > _0n3) {
235375
- if (power & _1n3)
235376
- res = res * num % modulo;
235377
- num = num * num % modulo;
235378
- power >>= _1n3;
235379
- }
235380
- return res;
235381
- }
235382
235352
  function pow2(x6, power, modulo) {
235383
235353
  let res = x6;
235384
235354
  while (power-- > _0n3) {
@@ -235407,74 +235377,78 @@ function invert(number4, modulo) {
235407
235377
  throw new Error("invert: does not exist");
235408
235378
  return mod(x6, modulo);
235409
235379
  }
235380
+ function sqrt3mod4(Fp, n6) {
235381
+ const p1div4 = (Fp.ORDER + _1n3) / _4n;
235382
+ const root = Fp.pow(n6, p1div4);
235383
+ if (!Fp.eql(Fp.sqr(root), n6))
235384
+ throw new Error("Cannot find square root");
235385
+ return root;
235386
+ }
235387
+ function sqrt5mod8(Fp, n6) {
235388
+ const p5div8 = (Fp.ORDER - _5n) / _8n;
235389
+ const n22 = Fp.mul(n6, _2n2);
235390
+ const v6 = Fp.pow(n22, p5div8);
235391
+ const nv = Fp.mul(n6, v6);
235392
+ const i6 = Fp.mul(Fp.mul(nv, _2n2), v6);
235393
+ const root = Fp.mul(nv, Fp.sub(i6, Fp.ONE));
235394
+ if (!Fp.eql(Fp.sqr(root), n6))
235395
+ throw new Error("Cannot find square root");
235396
+ return root;
235397
+ }
235410
235398
  function tonelliShanks(P5) {
235411
- const legendreC = (P5 - _1n3) / _2n2;
235412
- let Q4, S4, Z4;
235413
- for (Q4 = P5 - _1n3, S4 = 0;Q4 % _2n2 === _0n3; Q4 /= _2n2, S4++)
235414
- ;
235415
- for (Z4 = _2n2;Z4 < P5 && pow(Z4, legendreC, P5) !== P5 - _1n3; Z4++) {
235416
- if (Z4 > 1000)
235417
- throw new Error("Cannot find square root: likely non-prime P");
235418
- }
235419
- if (S4 === 1) {
235420
- const p1div4 = (P5 + _1n3) / _4n;
235421
- return function tonelliFast(Fp, n6) {
235422
- const root = Fp.pow(n6, p1div4);
235423
- if (!Fp.eql(Fp.sqr(root), n6))
235424
- throw new Error("Cannot find square root");
235425
- return root;
235426
- };
235427
- }
235399
+ if (P5 < BigInt(3))
235400
+ throw new Error("sqrt is not defined for small field");
235401
+ let Q4 = P5 - _1n3;
235402
+ let S4 = 0;
235403
+ while (Q4 % _2n2 === _0n3) {
235404
+ Q4 /= _2n2;
235405
+ S4++;
235406
+ }
235407
+ let Z4 = _2n2;
235408
+ const _Fp = Field(P5);
235409
+ while (FpLegendre(_Fp, Z4) === 1) {
235410
+ if (Z4++ > 1000)
235411
+ throw new Error("Cannot find square root: probably non-prime P");
235412
+ }
235413
+ if (S4 === 1)
235414
+ return sqrt3mod4;
235415
+ let cc = _Fp.pow(Z4, Q4);
235428
235416
  const Q1div2 = (Q4 + _1n3) / _2n2;
235429
235417
  return function tonelliSlow(Fp, n6) {
235430
- if (Fp.pow(n6, legendreC) === Fp.neg(Fp.ONE))
235418
+ if (Fp.is0(n6))
235419
+ return n6;
235420
+ if (FpLegendre(Fp, n6) !== 1)
235431
235421
  throw new Error("Cannot find square root");
235432
- let r6 = S4;
235433
- let g5 = Fp.pow(Fp.mul(Fp.ONE, Z4), Q4);
235434
- let x6 = Fp.pow(n6, Q1div2);
235435
- let b4 = Fp.pow(n6, Q4);
235436
- while (!Fp.eql(b4, Fp.ONE)) {
235437
- if (Fp.eql(b4, Fp.ZERO))
235422
+ let M5 = S4;
235423
+ let c3 = Fp.mul(Fp.ONE, cc);
235424
+ let t8 = Fp.pow(n6, Q4);
235425
+ let R7 = Fp.pow(n6, Q1div2);
235426
+ while (!Fp.eql(t8, Fp.ONE)) {
235427
+ if (Fp.is0(t8))
235438
235428
  return Fp.ZERO;
235439
- let m7 = 1;
235440
- for (let t22 = Fp.sqr(b4);m7 < r6; m7++) {
235441
- if (Fp.eql(t22, Fp.ONE))
235442
- break;
235443
- t22 = Fp.sqr(t22);
235429
+ let i6 = 1;
235430
+ let t_tmp = Fp.sqr(t8);
235431
+ while (!Fp.eql(t_tmp, Fp.ONE)) {
235432
+ i6++;
235433
+ t_tmp = Fp.sqr(t_tmp);
235434
+ if (i6 === M5)
235435
+ throw new Error("Cannot find square root");
235444
235436
  }
235445
- const ge4 = Fp.pow(g5, _1n3 << BigInt(r6 - m7 - 1));
235446
- g5 = Fp.sqr(ge4);
235447
- x6 = Fp.mul(x6, ge4);
235448
- b4 = Fp.mul(b4, g5);
235449
- r6 = m7;
235437
+ const exponent = _1n3 << BigInt(M5 - i6 - 1);
235438
+ const b4 = Fp.pow(c3, exponent);
235439
+ M5 = i6;
235440
+ c3 = Fp.sqr(b4);
235441
+ t8 = Fp.mul(t8, c3);
235442
+ R7 = Fp.mul(R7, b4);
235450
235443
  }
235451
- return x6;
235444
+ return R7;
235452
235445
  };
235453
235446
  }
235454
235447
  function FpSqrt(P5) {
235455
- if (P5 % _4n === _3n) {
235456
- const p1div4 = (P5 + _1n3) / _4n;
235457
- return function sqrt3mod4(Fp, n6) {
235458
- const root = Fp.pow(n6, p1div4);
235459
- if (!Fp.eql(Fp.sqr(root), n6))
235460
- throw new Error("Cannot find square root");
235461
- return root;
235462
- };
235463
- }
235464
- if (P5 % _8n === _5n) {
235465
- const c1 = (P5 - _5n) / _8n;
235466
- return function sqrt5mod8(Fp, n6) {
235467
- const n22 = Fp.mul(n6, _2n2);
235468
- const v6 = Fp.pow(n22, c1);
235469
- const nv = Fp.mul(n6, v6);
235470
- const i6 = Fp.mul(Fp.mul(nv, _2n2), v6);
235471
- const root = Fp.mul(nv, Fp.sub(i6, Fp.ONE));
235472
- if (!Fp.eql(Fp.sqr(root), n6))
235473
- throw new Error("Cannot find square root");
235474
- return root;
235475
- };
235476
- }
235477
- if (P5 % _16n === _9n) {}
235448
+ if (P5 % _4n === _3n)
235449
+ return sqrt3mod4;
235450
+ if (P5 % _8n === _5n)
235451
+ return sqrt5mod8;
235478
235452
  return tonelliShanks(P5);
235479
235453
  }
235480
235454
  function validateField(field2) {
@@ -235490,41 +235464,53 @@ function validateField(field2) {
235490
235464
  }, initial);
235491
235465
  return validateObject(field2, opts);
235492
235466
  }
235493
- function FpPow(f5, num, power) {
235467
+ function FpPow(Fp, num, power) {
235494
235468
  if (power < _0n3)
235495
235469
  throw new Error("invalid exponent, negatives unsupported");
235496
235470
  if (power === _0n3)
235497
- return f5.ONE;
235471
+ return Fp.ONE;
235498
235472
  if (power === _1n3)
235499
235473
  return num;
235500
- let p5 = f5.ONE;
235474
+ let p5 = Fp.ONE;
235501
235475
  let d6 = num;
235502
235476
  while (power > _0n3) {
235503
235477
  if (power & _1n3)
235504
- p5 = f5.mul(p5, d6);
235505
- d6 = f5.sqr(d6);
235478
+ p5 = Fp.mul(p5, d6);
235479
+ d6 = Fp.sqr(d6);
235506
235480
  power >>= _1n3;
235507
235481
  }
235508
235482
  return p5;
235509
235483
  }
235510
- function FpInvertBatch(f5, nums) {
235511
- const tmp = new Array(nums.length);
235512
- const lastMultiplied = nums.reduce((acc, num, i6) => {
235513
- if (f5.is0(num))
235484
+ function FpInvertBatch(Fp, nums, passZero = false) {
235485
+ const inverted = new Array(nums.length).fill(passZero ? Fp.ZERO : undefined);
235486
+ const multipliedAcc = nums.reduce((acc, num, i6) => {
235487
+ if (Fp.is0(num))
235514
235488
  return acc;
235515
- tmp[i6] = acc;
235516
- return f5.mul(acc, num);
235517
- }, f5.ONE);
235518
- const inverted = f5.inv(lastMultiplied);
235489
+ inverted[i6] = acc;
235490
+ return Fp.mul(acc, num);
235491
+ }, Fp.ONE);
235492
+ const invertedAcc = Fp.inv(multipliedAcc);
235519
235493
  nums.reduceRight((acc, num, i6) => {
235520
- if (f5.is0(num))
235494
+ if (Fp.is0(num))
235521
235495
  return acc;
235522
- tmp[i6] = f5.mul(acc, tmp[i6]);
235523
- return f5.mul(acc, num);
235524
- }, inverted);
235525
- return tmp;
235496
+ inverted[i6] = Fp.mul(acc, inverted[i6]);
235497
+ return Fp.mul(acc, num);
235498
+ }, invertedAcc);
235499
+ return inverted;
235500
+ }
235501
+ function FpLegendre(Fp, n6) {
235502
+ const p1mod2 = (Fp.ORDER - _1n3) / _2n2;
235503
+ const powered = Fp.pow(n6, p1mod2);
235504
+ const yes = Fp.eql(powered, Fp.ONE);
235505
+ const zero = Fp.eql(powered, Fp.ZERO);
235506
+ const no = Fp.eql(powered, Fp.neg(Fp.ONE));
235507
+ if (!yes && !zero && !no)
235508
+ throw new Error("invalid Legendre symbol result");
235509
+ return yes ? 1 : zero ? 0 : -1;
235526
235510
  }
235527
235511
  function nLength(n6, nBitLength) {
235512
+ if (nBitLength !== undefined)
235513
+ anumber(nBitLength);
235528
235514
  const _nBitLength = nBitLength !== undefined ? nBitLength : n6.toString(2).length;
235529
235515
  const nByteLength = Math.ceil(_nBitLength / 8);
235530
235516
  return { nBitLength: _nBitLength, nByteLength };
@@ -235570,14 +235556,14 @@ function Field(ORDER, bitLen2, isLE2 = false, redef = {}) {
235570
235556
  sqrtP = FpSqrt(ORDER);
235571
235557
  return sqrtP(f5, n6);
235572
235558
  }),
235573
- invertBatch: (lst) => FpInvertBatch(f5, lst),
235574
- cmov: (a7, b4, c3) => c3 ? b4 : a7,
235575
235559
  toBytes: (num) => isLE2 ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES),
235576
235560
  fromBytes: (bytes) => {
235577
235561
  if (bytes.length !== BYTES)
235578
235562
  throw new Error("Field.fromBytes: expected " + BYTES + " bytes, got " + bytes.length);
235579
235563
  return isLE2 ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes);
235580
- }
235564
+ },
235565
+ invertBatch: (lst) => FpInvertBatch(f5, lst),
235566
+ cmov: (a7, b4, c3) => c3 ? b4 : a7
235581
235567
  });
235582
235568
  return Object.freeze(f5);
235583
235569
  }
@@ -235601,8 +235587,9 @@ function mapHashToField(key2, fieldOrder, isLE2 = false) {
235601
235587
  const reduced = mod(num, fieldOrder - _1n3) + _1n3;
235602
235588
  return isLE2 ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);
235603
235589
  }
235604
- var _0n3, _1n3, _2n2, _3n, _4n, _5n, _8n, _9n, _16n, FIELD_FIELDS;
235590
+ var _0n3, _1n3, _2n2, _3n, _4n, _5n, _8n, FIELD_FIELDS;
235605
235591
  var init_modular = __esm(() => {
235592
+ init_utils2();
235606
235593
  init_utils3();
235607
235594
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
235608
235595
  _0n3 = BigInt(0);
@@ -235612,8 +235599,6 @@ var init_modular = __esm(() => {
235612
235599
  _4n = /* @__PURE__ */ BigInt(4);
235613
235600
  _5n = /* @__PURE__ */ BigInt(5);
235614
235601
  _8n = /* @__PURE__ */ BigInt(8);
235615
- _9n = /* @__PURE__ */ BigInt(9);
235616
- _16n = /* @__PURE__ */ BigInt(16);
235617
235602
  FIELD_FIELDS = [
235618
235603
  "create",
235619
235604
  "isValid",
@@ -235780,18 +235765,26 @@ function wNAF(c3, bits) {
235780
235765
  function pippenger(c3, fieldN, points, scalars) {
235781
235766
  validateMSMPoints(points, c3);
235782
235767
  validateMSMScalars(scalars, fieldN);
235783
- if (points.length !== scalars.length)
235768
+ const plength = points.length;
235769
+ const slength = scalars.length;
235770
+ if (plength !== slength)
235784
235771
  throw new Error("arrays of points and scalars must have equal length");
235785
235772
  const zero = c3.ZERO;
235786
- const wbits = bitLen(BigInt(points.length));
235787
- const windowSize = wbits > 12 ? wbits - 3 : wbits > 4 ? wbits - 2 : wbits ? 2 : 1;
235773
+ const wbits = bitLen(BigInt(plength));
235774
+ let windowSize = 1;
235775
+ if (wbits > 12)
235776
+ windowSize = wbits - 3;
235777
+ else if (wbits > 4)
235778
+ windowSize = wbits - 2;
235779
+ else if (wbits > 0)
235780
+ windowSize = 2;
235788
235781
  const MASK = bitMask(windowSize);
235789
235782
  const buckets = new Array(Number(MASK) + 1).fill(zero);
235790
235783
  const lastBits = Math.floor((fieldN.BITS - 1) / windowSize) * windowSize;
235791
235784
  let sum = zero;
235792
235785
  for (let i6 = lastBits;i6 >= 0; i6 -= windowSize) {
235793
235786
  buckets.fill(zero);
235794
- for (let j3 = 0;j3 < scalars.length; j3++) {
235787
+ for (let j3 = 0;j3 < slength; j3++) {
235795
235788
  const scalar = scalars[j3];
235796
235789
  const wbits2 = Number(scalar >> BigInt(i6) & MASK);
235797
235790
  buckets[wbits2] = buckets[wbits2].add(points[j3]);
@@ -235849,25 +235842,28 @@ function validatePointOpts(curve) {
235849
235842
  a: "field",
235850
235843
  b: "field"
235851
235844
  }, {
235845
+ allowInfinityPoint: "boolean",
235852
235846
  allowedPrivateKeyLengths: "array",
235853
- wrapPrivateKey: "boolean",
235854
- isTorsionFree: "function",
235855
235847
  clearCofactor: "function",
235856
- allowInfinityPoint: "boolean",
235857
235848
  fromBytes: "function",
235858
- toBytes: "function"
235849
+ isTorsionFree: "function",
235850
+ toBytes: "function",
235851
+ wrapPrivateKey: "boolean"
235859
235852
  });
235860
235853
  const { endo, Fp, a: a7 } = opts;
235861
235854
  if (endo) {
235862
235855
  if (!Fp.eql(a7, Fp.ZERO)) {
235863
- throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");
235856
+ throw new Error("invalid endo: CURVE.a must be 0");
235864
235857
  }
235865
235858
  if (typeof endo !== "object" || typeof endo.beta !== "bigint" || typeof endo.splitScalar !== "function") {
235866
- throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function");
235859
+ throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function');
235867
235860
  }
235868
235861
  }
235869
235862
  return Object.freeze({ ...opts });
235870
235863
  }
235864
+ function numToSizedHex(num, size2) {
235865
+ return bytesToHex2(numberToBytesBE(num, size2));
235866
+ }
235871
235867
  function weierstrassPoints(opts) {
235872
235868
  const CURVE = validatePointOpts(opts);
235873
235869
  const { Fp } = CURVE;
@@ -235888,8 +235884,17 @@ function weierstrassPoints(opts) {
235888
235884
  const x32 = Fp.mul(x22, x6);
235889
235885
  return Fp.add(Fp.add(x32, Fp.mul(x6, a7)), b4);
235890
235886
  }
235891
- if (!Fp.eql(Fp.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx)))
235892
- throw new Error("bad generator point: equation left != right");
235887
+ function isValidXY(x6, y4) {
235888
+ const left = Fp.sqr(y4);
235889
+ const right = weierstrassEquation(x6);
235890
+ return Fp.eql(left, right);
235891
+ }
235892
+ if (!isValidXY(CURVE.Gx, CURVE.Gy))
235893
+ throw new Error("bad curve params: generator point");
235894
+ const _4a3 = Fp.mul(Fp.pow(CURVE.a, _3n2), _4n2);
235895
+ const _27b2 = Fp.mul(Fp.sqr(CURVE.b), BigInt(27));
235896
+ if (Fp.is0(Fp.add(_4a3, _27b2)))
235897
+ throw new Error("bad curve params: a or b");
235893
235898
  function isWithinCurveOrder(num) {
235894
235899
  return inRange(num, _1n5, CURVE.n);
235895
235900
  }
@@ -235942,9 +235947,7 @@ function weierstrassPoints(opts) {
235942
235947
  const { x: x6, y: y4 } = p5.toAffine();
235943
235948
  if (!Fp.isValid(x6) || !Fp.isValid(y4))
235944
235949
  throw new Error("bad point: x or y not FE");
235945
- const left = Fp.sqr(y4);
235946
- const right = weierstrassEquation(x6);
235947
- if (!Fp.eql(left, right))
235950
+ if (!isValidXY(x6, y4))
235948
235951
  throw new Error("bad point: equation left != right");
235949
235952
  if (!p5.isTorsionFree())
235950
235953
  throw new Error("bad point: not in prime-order subgroup");
@@ -235955,7 +235958,7 @@ function weierstrassPoints(opts) {
235955
235958
  constructor(px, py, pz) {
235956
235959
  if (px == null || !Fp.isValid(px))
235957
235960
  throw new Error("x required");
235958
- if (py == null || !Fp.isValid(py))
235961
+ if (py == null || !Fp.isValid(py) || Fp.is0(py))
235959
235962
  throw new Error("y required");
235960
235963
  if (pz == null || !Fp.isValid(pz))
235961
235964
  throw new Error("z required");
@@ -235982,7 +235985,7 @@ function weierstrassPoints(opts) {
235982
235985
  return this.toAffine().y;
235983
235986
  }
235984
235987
  static normalizeZ(points) {
235985
- const toInv = Fp.invertBatch(points.map((p5) => p5.pz));
235988
+ const toInv = FpInvertBatch(Fp, points.map((p5) => p5.pz));
235986
235989
  return points.map((p5, i6) => p5.toAffine(toInv[i6])).map(Point.fromAffine);
235987
235990
  }
235988
235991
  static fromHex(hex) {
@@ -236116,16 +236119,16 @@ function weierstrassPoints(opts) {
236116
236119
  return wnaf.wNAFCached(this, n6, Point.normalizeZ);
236117
236120
  }
236118
236121
  multiplyUnsafe(sc) {
236119
- const { endo, n: N6 } = CURVE;
236122
+ const { endo: endo2, n: N6 } = CURVE;
236120
236123
  aInRange("scalar", sc, _0n5, N6);
236121
236124
  const I6 = Point.ZERO;
236122
236125
  if (sc === _0n5)
236123
236126
  return I6;
236124
236127
  if (this.is0() || sc === _1n5)
236125
236128
  return this;
236126
- if (!endo || wnaf.hasPrecomputes(this))
236129
+ if (!endo2 || wnaf.hasPrecomputes(this))
236127
236130
  return wnaf.wNAFCachedUnsafe(this, sc, Point.normalizeZ);
236128
- let { k1neg, k1, k2neg, k2: k22 } = endo.splitScalar(sc);
236131
+ let { k1neg, k1, k2neg, k2: k22 } = endo2.splitScalar(sc);
236129
236132
  let k1p = I6;
236130
236133
  let k2p = I6;
236131
236134
  let d6 = this;
@@ -236142,20 +236145,20 @@ function weierstrassPoints(opts) {
236142
236145
  k1p = k1p.negate();
236143
236146
  if (k2neg)
236144
236147
  k2p = k2p.negate();
236145
- k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz);
236148
+ k2p = new Point(Fp.mul(k2p.px, endo2.beta), k2p.py, k2p.pz);
236146
236149
  return k1p.add(k2p);
236147
236150
  }
236148
236151
  multiply(scalar) {
236149
- const { endo, n: N6 } = CURVE;
236152
+ const { endo: endo2, n: N6 } = CURVE;
236150
236153
  aInRange("scalar", scalar, _1n5, N6);
236151
236154
  let point, fake;
236152
- if (endo) {
236153
- const { k1neg, k1, k2neg, k2: k22 } = endo.splitScalar(scalar);
236155
+ if (endo2) {
236156
+ const { k1neg, k1, k2neg, k2: k22 } = endo2.splitScalar(scalar);
236154
236157
  let { p: k1p, f: f1p } = this.wNAF(k1);
236155
236158
  let { p: k2p, f: f2p } = this.wNAF(k22);
236156
236159
  k1p = wnaf.constTimeNegate(k1neg, k1p);
236157
236160
  k2p = wnaf.constTimeNegate(k2neg, k2p);
236158
- k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz);
236161
+ k2p = new Point(Fp.mul(k2p.px, endo2.beta), k2p.py, k2p.pz);
236159
236162
  point = k1p.add(k2p);
236160
236163
  fake = f1p.add(f2p);
236161
236164
  } else {
@@ -236202,8 +236205,8 @@ function weierstrassPoints(opts) {
236202
236205
  }
236203
236206
  Point.BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE);
236204
236207
  Point.ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO);
236205
- const _bits = CURVE.nBitLength;
236206
- const wnaf = wNAF(Point, CURVE.endo ? Math.ceil(_bits / 2) : _bits);
236208
+ const { endo, nBitLength } = CURVE;
236209
+ const wnaf = wNAF(Point, endo ? Math.ceil(nBitLength / 2) : nBitLength);
236207
236210
  return {
236208
236211
  CURVE,
236209
236212
  ProjectivePoint: Point,
@@ -236227,7 +236230,7 @@ function validateOpts(curve) {
236227
236230
  }
236228
236231
  function weierstrass(curveDef) {
236229
236232
  const CURVE = validateOpts(curveDef);
236230
- const { Fp, n: CURVE_ORDER } = CURVE;
236233
+ const { Fp, n: CURVE_ORDER, nByteLength, nBitLength } = CURVE;
236231
236234
  const compressedLen = Fp.BYTES + 1;
236232
236235
  const uncompressedLen = 2 * Fp.BYTES + 1;
236233
236236
  function modN(a7) {
@@ -236281,7 +236284,6 @@ function weierstrass(curveDef) {
236281
236284
  }
236282
236285
  }
236283
236286
  });
236284
- const numToNByteHex = (num) => bytesToHex2(numberToBytesBE(num, CURVE.nByteLength));
236285
236287
  function isBiggerThanHalfOrder(number4) {
236286
236288
  const HALF = CURVE_ORDER >> _1n5;
236287
236289
  return number4 > HALF;
@@ -236302,7 +236304,7 @@ function weierstrass(curveDef) {
236302
236304
  Object.freeze(this);
236303
236305
  }
236304
236306
  static fromCompact(hex) {
236305
- const l3 = CURVE.nByteLength;
236307
+ const l3 = nByteLength;
236306
236308
  hex = ensureBytes("compactSignature", hex, l3 * 2);
236307
236309
  return new Signature(slcNum(hex, 0, l3), slcNum(hex, l3, 2 * l3));
236308
236310
  }
@@ -236323,7 +236325,7 @@ function weierstrass(curveDef) {
236323
236325
  if (radj >= Fp.ORDER)
236324
236326
  throw new Error("recovery id 2 or 3 invalid");
236325
236327
  const prefix = (rec & 1) === 0 ? "02" : "03";
236326
- const R7 = Point.fromHex(prefix + numToNByteHex(radj));
236328
+ const R7 = Point.fromHex(prefix + numToSizedHex(radj, Fp.BYTES));
236327
236329
  const ir2 = invN(radj);
236328
236330
  const u1 = modN(-h8 * ir2);
236329
236331
  const u22 = modN(s7 * ir2);
@@ -236343,13 +236345,14 @@ function weierstrass(curveDef) {
236343
236345
  return hexToBytes2(this.toDERHex());
236344
236346
  }
236345
236347
  toDERHex() {
236346
- return DER.hexFromSig({ r: this.r, s: this.s });
236348
+ return DER.hexFromSig(this);
236347
236349
  }
236348
236350
  toCompactRawBytes() {
236349
236351
  return hexToBytes2(this.toCompactHex());
236350
236352
  }
236351
236353
  toCompactHex() {
236352
- return numToNByteHex(this.r) + numToNByteHex(this.s);
236354
+ const l3 = nByteLength;
236355
+ return numToSizedHex(this.r, l3) + numToSizedHex(this.s, l3);
236353
236356
  }
236354
236357
  }
236355
236358
  const utils = {
@@ -236376,21 +236379,25 @@ function weierstrass(curveDef) {
236376
236379
  return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed);
236377
236380
  }
236378
236381
  function isProbPub(item) {
236379
- const arr = isBytes2(item);
236380
- const str = typeof item === "string";
236381
- const len = (arr || str) && item.length;
236382
- if (arr)
236383
- return len === compressedLen || len === uncompressedLen;
236384
- if (str)
236385
- return len === 2 * compressedLen || len === 2 * uncompressedLen;
236382
+ if (typeof item === "bigint")
236383
+ return false;
236386
236384
  if (item instanceof Point)
236387
236385
  return true;
236388
- return false;
236386
+ const arr = ensureBytes("key", item);
236387
+ const len = arr.length;
236388
+ const fpl = Fp.BYTES;
236389
+ const compLen = fpl + 1;
236390
+ const uncompLen = 2 * fpl + 1;
236391
+ if (CURVE.allowedPrivateKeyLengths || nByteLength === compLen) {
236392
+ return;
236393
+ } else {
236394
+ return len === compLen || len === uncompLen;
236395
+ }
236389
236396
  }
236390
236397
  function getSharedSecret(privateA, publicB, isCompressed = true) {
236391
- if (isProbPub(privateA))
236398
+ if (isProbPub(privateA) === true)
236392
236399
  throw new Error("first arg must be private key");
236393
- if (!isProbPub(publicB))
236400
+ if (isProbPub(publicB) === false)
236394
236401
  throw new Error("second arg must be public key");
236395
236402
  const b4 = Point.fromHex(publicB);
236396
236403
  return b4.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed);
@@ -236399,16 +236406,16 @@ function weierstrass(curveDef) {
236399
236406
  if (bytes.length > 8192)
236400
236407
  throw new Error("input is too large");
236401
236408
  const num = bytesToNumberBE(bytes);
236402
- const delta = bytes.length * 8 - CURVE.nBitLength;
236409
+ const delta = bytes.length * 8 - nBitLength;
236403
236410
  return delta > 0 ? num >> BigInt(delta) : num;
236404
236411
  };
236405
236412
  const bits2int_modN = CURVE.bits2int_modN || function(bytes) {
236406
236413
  return modN(bits2int(bytes));
236407
236414
  };
236408
- const ORDER_MASK = bitMask(CURVE.nBitLength);
236415
+ const ORDER_MASK = bitMask(nBitLength);
236409
236416
  function int2octets(num) {
236410
- aInRange("num < 2^" + CURVE.nBitLength, num, _0n5, ORDER_MASK);
236411
- return numberToBytesBE(num, CURVE.nByteLength);
236417
+ aInRange("num < 2^" + nBitLength, num, _0n5, ORDER_MASK);
236418
+ return numberToBytesBE(num, nByteLength);
236412
236419
  }
236413
236420
  function prepSig(msgHash, privateKey, opts = defaultSigOpts) {
236414
236421
  if (["recovered", "canonical"].some((k5) => (k5 in opts)))
@@ -236618,7 +236625,8 @@ function mapToCurveSimpleSWU(Fp, opts) {
236618
236625
  y4 = Fp.cmov(y4, value4, isValid);
236619
236626
  const e1 = Fp.isOdd(u6) === Fp.isOdd(y4);
236620
236627
  y4 = Fp.cmov(Fp.neg(y4), y4, e1);
236621
- x6 = Fp.div(x6, tv4);
236628
+ const tv4_inv = FpInvertBatch(Fp, [tv4], true)[0];
236629
+ x6 = Fp.mul(x6, tv4_inv);
236622
236630
  return { x: x6, y: y4 };
236623
236631
  };
236624
236632
  }
@@ -236849,43 +236857,47 @@ function hash_to_field(msg, count, options) {
236849
236857
  return u6;
236850
236858
  }
236851
236859
  function isogenyMap(field2, map4) {
236852
- const COEFF = map4.map((i6) => Array.from(i6).reverse());
236860
+ const coeff = map4.map((i6) => Array.from(i6).reverse());
236853
236861
  return (x6, y4) => {
236854
- const [xNum, xDen, yNum, yDen] = COEFF.map((val) => val.reduce((acc, i6) => field2.add(field2.mul(acc, x6), i6)));
236855
- if (field2.is0(xDen) || field2.is0(yDen))
236856
- throw new Error("bad point: ZERO");
236857
- x6 = field2.div(xNum, xDen);
236858
- y4 = field2.mul(y4, field2.div(yNum, yDen));
236862
+ const [xn, xd, yn, yd] = coeff.map((val) => val.reduce((acc, i6) => field2.add(field2.mul(acc, x6), i6)));
236863
+ const [xd_inv, yd_inv] = FpInvertBatch(field2, [xd, yd], true);
236864
+ x6 = field2.mul(xn, xd_inv);
236865
+ y4 = field2.mul(y4, field2.mul(yn, yd_inv));
236859
236866
  return { x: x6, y: y4 };
236860
236867
  };
236861
236868
  }
236862
- function createHasher(Point, mapToCurve, def) {
236869
+ function createHasher2(Point, mapToCurve, defaults2) {
236863
236870
  if (typeof mapToCurve !== "function")
236864
236871
  throw new Error("mapToCurve() must be defined");
236872
+ function map4(num) {
236873
+ return Point.fromAffine(mapToCurve(num));
236874
+ }
236875
+ function clear(initial) {
236876
+ const P5 = initial.clearCofactor();
236877
+ if (P5.equals(Point.ZERO))
236878
+ return Point.ZERO;
236879
+ P5.assertValidity();
236880
+ return P5;
236881
+ }
236865
236882
  return {
236883
+ defaults: defaults2,
236866
236884
  hashToCurve(msg, options) {
236867
- const u6 = hash_to_field(msg, 2, { ...def, DST: def.DST, ...options });
236868
- const u0 = Point.fromAffine(mapToCurve(u6[0]));
236869
- const u1 = Point.fromAffine(mapToCurve(u6[1]));
236870
- const P5 = u0.add(u1).clearCofactor();
236871
- P5.assertValidity();
236872
- return P5;
236885
+ const u6 = hash_to_field(msg, 2, { ...defaults2, DST: defaults2.DST, ...options });
236886
+ const u0 = map4(u6[0]);
236887
+ const u1 = map4(u6[1]);
236888
+ return clear(u0.add(u1));
236873
236889
  },
236874
236890
  encodeToCurve(msg, options) {
236875
- const u6 = hash_to_field(msg, 1, { ...def, DST: def.encodeDST, ...options });
236876
- const P5 = Point.fromAffine(mapToCurve(u6[0])).clearCofactor();
236877
- P5.assertValidity();
236878
- return P5;
236891
+ const u6 = hash_to_field(msg, 1, { ...defaults2, DST: defaults2.encodeDST, ...options });
236892
+ return clear(map4(u6[0]));
236879
236893
  },
236880
236894
  mapToCurve(scalars) {
236881
236895
  if (!Array.isArray(scalars))
236882
- throw new Error("mapToCurve: expected array of bigints");
236896
+ throw new Error("expected array of bigints");
236883
236897
  for (const i6 of scalars)
236884
236898
  if (typeof i6 !== "bigint")
236885
- throw new Error("mapToCurve: expected array of bigints");
236886
- const P5 = Point.fromAffine(mapToCurve(scalars)).clearCofactor();
236887
- P5.assertValidity();
236888
- return P5;
236899
+ throw new Error("expected array of bigints");
236900
+ return clear(map4(scalars));
236889
236901
  }
236890
236902
  };
236891
236903
  }
@@ -236899,6 +236911,7 @@ var init_hash_to_curve = __esm(() => {
236899
236911
  // ../../node_modules/@noble/curves/esm/secp256k1.js
236900
236912
  var exports_secp256k1 = {};
236901
236913
  __export(exports_secp256k1, {
236914
+ secp256k1_hasher: () => secp256k1_hasher,
236902
236915
  secp256k1: () => secp256k1,
236903
236916
  schnorr: () => schnorr,
236904
236917
  hashToCurve: () => hashToCurve,
@@ -236997,7 +237010,7 @@ function schnorrVerify(signature, message, publicKey) {
236997
237010
  return false;
236998
237011
  }
236999
237012
  }
237000
- var secp256k1P, secp256k1N, _1n6, _2n4, divNearest = (a7, b4) => (a7 + b4 / _2n4) / b4, Fpk1, secp256k1, _0n6, TAGGED_HASH_PREFIXES, pointToBytes = (point) => point.toRawBytes(true).slice(1), numTo32b = (n6) => numberToBytesBE(n6, 32), modP = (x6) => mod(x6, secp256k1P), modN = (x6) => mod(x6, secp256k1N), Point, GmulAdd = (Q4, a7, b4) => Point.BASE.multiplyAndAddUnsafe(Q4, a7, b4), num, schnorr, isoMap, mapSWU, htf, hashToCurve, encodeToCurve;
237013
+ var secp256k1P, secp256k1N, _0n6, _1n6, _2n4, divNearest = (a7, b4) => (a7 + b4 / _2n4) / b4, Fpk1, secp256k1, TAGGED_HASH_PREFIXES, pointToBytes = (point) => point.toRawBytes(true).slice(1), numTo32b = (n6) => numberToBytesBE(n6, 32), modP = (x6) => mod(x6, secp256k1P), modN = (x6) => mod(x6, secp256k1N), Point, GmulAdd = (Q4, a7, b4) => Point.BASE.multiplyAndAddUnsafe(Q4, a7, b4), num, schnorr, isoMap, mapSWU, secp256k1_hasher, hashToCurve, encodeToCurve;
237001
237014
  var init_secp256k1 = __esm(() => {
237002
237015
  init_sha2();
237003
237016
  init_utils2();
@@ -237009,11 +237022,12 @@ var init_secp256k1 = __esm(() => {
237009
237022
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
237010
237023
  secp256k1P = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f");
237011
237024
  secp256k1N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");
237025
+ _0n6 = BigInt(0);
237012
237026
  _1n6 = BigInt(1);
237013
237027
  _2n4 = BigInt(2);
237014
237028
  Fpk1 = Field(secp256k1P, undefined, undefined, { sqrt: sqrtMod });
237015
237029
  secp256k1 = createCurve({
237016
- a: BigInt(0),
237030
+ a: _0n6,
237017
237031
  b: BigInt(7),
237018
237032
  Fp: Fpk1,
237019
237033
  n: secp256k1N,
@@ -237047,9 +237061,8 @@ var init_secp256k1 = __esm(() => {
237047
237061
  }
237048
237062
  }
237049
237063
  }, sha256);
237050
- _0n6 = BigInt(0);
237051
237064
  TAGGED_HASH_PREFIXES = {};
237052
- Point = secp256k1.ProjectivePoint;
237065
+ Point = /* @__PURE__ */ (() => secp256k1.ProjectivePoint)();
237053
237066
  num = bytesToNumberBE;
237054
237067
  schnorr = /* @__PURE__ */ (() => ({
237055
237068
  getPublicKey: schnorrGetPublicKey,
@@ -237095,7 +237108,7 @@ var init_secp256k1 = __esm(() => {
237095
237108
  B: BigInt("1771"),
237096
237109
  Z: Fpk1.create(BigInt("-11"))
237097
237110
  }))();
237098
- htf = /* @__PURE__ */ (() => createHasher(secp256k1.ProjectivePoint, (scalars) => {
237111
+ secp256k1_hasher = /* @__PURE__ */ (() => createHasher2(secp256k1.ProjectivePoint, (scalars) => {
237099
237112
  const { x: x6, y: y4 } = mapSWU(Fpk1.create(scalars[0]));
237100
237113
  return isoMap(x6, y4);
237101
237114
  }, {
@@ -237107,8 +237120,8 @@ var init_secp256k1 = __esm(() => {
237107
237120
  expand: "xmd",
237108
237121
  hash: sha256
237109
237122
  }))();
237110
- hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)();
237111
- encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)();
237123
+ hashToCurve = /* @__PURE__ */ (() => secp256k1_hasher.hashToCurve)();
237124
+ encodeToCurve = /* @__PURE__ */ (() => secp256k1_hasher.encodeToCurve)();
237112
237125
  });
237113
237126
 
237114
237127
  // ../../node_modules/viem/_esm/errors/node.js
@@ -237686,6 +237699,8 @@ var init_Errors = __esm(() => {
237686
237699
  if (options.cause.shortMessage)
237687
237700
  return options.cause.shortMessage;
237688
237701
  }
237702
+ if (options.cause && "details" in options.cause && typeof options.cause.details === "string")
237703
+ return options.cause.details;
237689
237704
  if (options.cause?.message)
237690
237705
  return options.cause.message;
237691
237706
  return options.details;
@@ -262458,7 +262473,7 @@ function pruneCurrentEnv(currentEnv, env2) {
262458
262473
  var package_default = {
262459
262474
  name: "@settlemint/sdk-cli",
262460
262475
  description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
262461
- version: "2.3.2-maine196276e",
262476
+ version: "2.3.2-maineefa9743",
262462
262477
  type: "module",
262463
262478
  private: false,
262464
262479
  license: "FSL-1.1-MIT",
@@ -262503,12 +262518,12 @@ var package_default = {
262503
262518
  devDependencies: {
262504
262519
  "@commander-js/extra-typings": "14.0.0",
262505
262520
  commander: "14.0.0",
262506
- "@inquirer/confirm": "5.1.10",
262507
- "@inquirer/input": "4.1.10",
262508
- "@inquirer/password": "4.0.13",
262509
- "@inquirer/select": "4.2.1",
262510
- "@settlemint/sdk-js": "2.3.2-maine196276e",
262511
- "@settlemint/sdk-utils": "2.3.2-maine196276e",
262521
+ "@inquirer/confirm": "5.1.11",
262522
+ "@inquirer/input": "4.1.11",
262523
+ "@inquirer/password": "4.0.14",
262524
+ "@inquirer/select": "4.2.2",
262525
+ "@settlemint/sdk-js": "2.3.2-maineefa9743",
262526
+ "@settlemint/sdk-utils": "2.3.2-maineefa9743",
262512
262527
  "@types/node": "22.15.21",
262513
262528
  "@types/semver": "7.7.0",
262514
262529
  "@types/which": "3.0.4",
@@ -262517,7 +262532,7 @@ var package_default = {
262517
262532
  "is-in-ci": "1.0.0",
262518
262533
  semver: "7.7.2",
262519
262534
  slugify: "1.6.6",
262520
- viem: "2.30.0",
262535
+ viem: "2.30.1",
262521
262536
  which: "5.0.0",
262522
262537
  yaml: "2.8.0",
262523
262538
  yoctocolors: "2.1.1"
@@ -262630,6 +262645,9 @@ class ValidationError extends Error {
262630
262645
  name = "ValidationError";
262631
262646
  }
262632
262647
  // ../../node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
262648
+ import { AsyncResource as AsyncResource3 } from "node:async_hooks";
262649
+
262650
+ // ../../node_modules/@inquirer/core/dist/esm/lib/use-state.js
262633
262651
  import { AsyncResource as AsyncResource2 } from "node:async_hooks";
262634
262652
 
262635
262653
  // ../../node_modules/@inquirer/core/dist/esm/lib/hook-engine.js
@@ -262740,18 +262758,18 @@ var effectScheduler = {
262740
262758
  // ../../node_modules/@inquirer/core/dist/esm/lib/use-state.js
262741
262759
  function useState(defaultValue) {
262742
262760
  return withPointer((pointer) => {
262743
- const setFn = (newValue) => {
262761
+ const setState = AsyncResource2.bind(function setState(newValue) {
262744
262762
  if (pointer.get() !== newValue) {
262745
262763
  pointer.set(newValue);
262746
262764
  handleChange();
262747
262765
  }
262748
- };
262766
+ });
262749
262767
  if (pointer.initialized) {
262750
- return [pointer.get(), setFn];
262768
+ return [pointer.get(), setState];
262751
262769
  }
262752
262770
  const value = typeof defaultValue === "function" ? defaultValue() : defaultValue;
262753
262771
  pointer.set(value);
262754
- return [value, setFn];
262772
+ return [value, setState];
262755
262773
  });
262756
262774
  }
262757
262775
 
@@ -263114,9 +263132,9 @@ function usePrefix({ status = "idle", theme }) {
263114
263132
  if (status === "loading") {
263115
263133
  let tickInterval;
263116
263134
  let inc = -1;
263117
- const delayTimeout = setTimeout(AsyncResource2.bind(() => {
263135
+ const delayTimeout = setTimeout(AsyncResource3.bind(() => {
263118
263136
  setShowLoader(true);
263119
- tickInterval = setInterval(AsyncResource2.bind(() => {
263137
+ tickInterval = setInterval(AsyncResource3.bind(() => {
263120
263138
  inc = inc + 1;
263121
263139
  setTick(inc % spinner.frames.length);
263122
263140
  }), spinner.interval);
@@ -263274,7 +263292,7 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
263274
263292
  // ../../node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
263275
263293
  var import_mute_stream = __toESM(require_lib(), 1);
263276
263294
  import * as readline2 from "node:readline";
263277
- import { AsyncResource as AsyncResource3 } from "node:async_hooks";
263295
+ import { AsyncResource as AsyncResource4 } from "node:async_hooks";
263278
263296
 
263279
263297
  // ../../node_modules/signal-exit/dist/mjs/signals.js
263280
263298
  var signals = [];
@@ -263618,7 +263636,7 @@ function createPrompt(view) {
263618
263636
  rl.input.on("keypress", checkCursorPos);
263619
263637
  cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
263620
263638
  return withHooks(rl, (cycle) => {
263621
- const hooksCleanup = AsyncResource3.bind(() => effectScheduler.clearAll());
263639
+ const hooksCleanup = AsyncResource4.bind(() => effectScheduler.clearAll());
263622
263640
  rl.on("close", hooksCleanup);
263623
263641
  cleanups.add(() => rl.removeListener("close", hooksCleanup));
263624
263642
  cycle(() => {
@@ -270047,13 +270065,16 @@ function blobsToProofs(parameters) {
270047
270065
  // ../../node_modules/viem/_esm/utils/blob/commitmentToVersionedHash.js
270048
270066
  init_toHex();
270049
270067
 
270068
+ // ../../node_modules/@noble/hashes/esm/sha256.js
270069
+ init_sha2();
270070
+ var sha2562 = sha256;
270071
+
270050
270072
  // ../../node_modules/viem/_esm/utils/hash/sha256.js
270051
- init_sha256();
270052
270073
  init_toBytes();
270053
270074
  init_toHex();
270054
- function sha2562(value4, to_) {
270075
+ function sha2563(value4, to_) {
270055
270076
  const to = to_ || "hex";
270056
- const bytes = sha256(isHex(value4, { strict: false }) ? toBytes(value4) : value4);
270077
+ const bytes = sha2562(isHex(value4, { strict: false }) ? toBytes(value4) : value4);
270057
270078
  if (to === "bytes")
270058
270079
  return bytes;
270059
270080
  return toHex(bytes);
@@ -270063,7 +270084,7 @@ function sha2562(value4, to_) {
270063
270084
  function commitmentToVersionedHash(parameters) {
270064
270085
  const { commitment, version: version4 = 1 } = parameters;
270065
270086
  const to = parameters.to ?? (typeof commitment === "string" ? "hex" : "bytes");
270066
- const versionedHash = sha2562(commitment, "bytes");
270087
+ const versionedHash = sha2563(commitment, "bytes");
270067
270088
  versionedHash.set([version4], 0);
270068
270089
  return to === "bytes" ? versionedHash : bytesToHex(versionedHash);
270069
270090
  }
@@ -274305,10 +274326,16 @@ async function waitForTransactionReceipt(client, {
274305
274326
  let replacedTransaction;
274306
274327
  let receipt;
274307
274328
  let retrying = false;
274329
+ let _unobserve;
274330
+ let _unwatch;
274308
274331
  const { promise: promise2, resolve: resolve6, reject } = withResolvers();
274309
- const timer = timeout ? setTimeout(() => reject(new WaitForTransactionReceiptTimeoutError({ hash: hash2 })), timeout) : undefined;
274310
- const _unobserve = observe(observerId, { onReplaced, resolve: resolve6, reject }, (emit) => {
274311
- const _unwatch = getAction(client, watchBlockNumber, "watchBlockNumber")({
274332
+ const timer = timeout ? setTimeout(() => {
274333
+ _unwatch();
274334
+ _unobserve();
274335
+ reject(new WaitForTransactionReceiptTimeoutError({ hash: hash2 }));
274336
+ }, timeout) : undefined;
274337
+ _unobserve = observe(observerId, { onReplaced, resolve: resolve6, reject }, (emit) => {
274338
+ _unwatch = getAction(client, watchBlockNumber, "watchBlockNumber")({
274312
274339
  emitMissed: true,
274313
274340
  emitOnBegin: true,
274314
274341
  poll: true,
@@ -284458,4 +284485,4 @@ async function sdkCliCommand(argv = process.argv) {
284458
284485
  // src/cli.ts
284459
284486
  sdkCliCommand();
284460
284487
 
284461
- //# debugId=81C26843B980220864756E2164756E21
284488
+ //# debugId=5A1CC22649BE687C64756E2164756E21