@settlemint/sdk-mcp 2.2.3 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/mcp.js +574 -451
  2. package/dist/mcp.js.map +22 -24
  3. package/package.json +4 -4
package/dist/mcp.js CHANGED
@@ -29422,21 +29422,54 @@ var require_webcrypto = __commonJS((exports) => {
29422
29422
  exports.gcm = /* @__PURE__ */ (() => generate(mode.GCM))();
29423
29423
  });
29424
29424
 
29425
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/_assert.js
29426
- var require__assert = __commonJS((exports) => {
29425
+ // ../../node_modules/eciesjs/node_modules/@noble/hashes/cryptoNode.js
29426
+ var require_cryptoNode2 = __commonJS((exports) => {
29427
29427
  Object.defineProperty(exports, "__esModule", { value: true });
29428
+ exports.crypto = undefined;
29429
+ var nc = __require("node:crypto");
29430
+ exports.crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && ("randomBytes" in nc) ? nc : undefined;
29431
+ });
29432
+
29433
+ // ../../node_modules/eciesjs/node_modules/@noble/hashes/utils.js
29434
+ var require_utils7 = __commonJS((exports) => {
29435
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
29436
+ Object.defineProperty(exports, "__esModule", { value: true });
29437
+ exports.wrapXOFConstructorWithOpts = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.Hash = exports.nextTick = exports.swap32IfBE = exports.byteSwapIfBE = exports.swap8IfBE = exports.isLE = undefined;
29438
+ exports.isBytes = isBytes;
29428
29439
  exports.anumber = anumber;
29429
29440
  exports.abytes = abytes;
29430
29441
  exports.ahash = ahash;
29431
29442
  exports.aexists = aexists;
29432
29443
  exports.aoutput = aoutput;
29444
+ exports.u8 = u8;
29445
+ exports.u32 = u32;
29446
+ exports.clean = clean;
29447
+ exports.createView = createView;
29448
+ exports.rotr = rotr;
29449
+ exports.rotl = rotl;
29450
+ exports.byteSwap = byteSwap;
29451
+ exports.byteSwap32 = byteSwap32;
29452
+ exports.bytesToHex = bytesToHex;
29453
+ exports.hexToBytes = hexToBytes;
29454
+ exports.asyncLoop = asyncLoop;
29455
+ exports.utf8ToBytes = utf8ToBytes;
29456
+ exports.bytesToUtf8 = bytesToUtf8;
29457
+ exports.toBytes = toBytes;
29458
+ exports.kdfInputToBytes = kdfInputToBytes;
29459
+ exports.concatBytes = concatBytes;
29460
+ exports.checkOpts = checkOpts;
29461
+ exports.createHasher = createHasher;
29462
+ exports.createOptHasher = createOptHasher;
29463
+ exports.createXOFer = createXOFer;
29464
+ exports.randomBytes = randomBytes;
29465
+ var crypto_1 = require_cryptoNode2();
29466
+ function isBytes(a) {
29467
+ return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
29468
+ }
29433
29469
  function anumber(n) {
29434
29470
  if (!Number.isSafeInteger(n) || n < 0)
29435
29471
  throw new Error("positive integer expected, got " + n);
29436
29472
  }
29437
- function isBytes(a) {
29438
- return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
29439
- }
29440
29473
  function abytes(b, ...lengths) {
29441
29474
  if (!isBytes(b))
29442
29475
  throw new Error("Uint8Array expected");
@@ -29445,7 +29478,7 @@ var require__assert = __commonJS((exports) => {
29445
29478
  }
29446
29479
  function ahash(h) {
29447
29480
  if (typeof h !== "function" || typeof h.create !== "function")
29448
- throw new Error("Hash should be wrapped by utils.wrapConstructor");
29481
+ throw new Error("Hash should be wrapped by utils.createHasher");
29449
29482
  anumber(h.outputLen);
29450
29483
  anumber(h.blockLen);
29451
29484
  }
@@ -29462,51 +29495,17 @@ var require__assert = __commonJS((exports) => {
29462
29495
  throw new Error("digestInto() expects output buffer of length at least " + min);
29463
29496
  }
29464
29497
  }
29465
- });
29466
-
29467
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/cryptoNode.js
29468
- var require_cryptoNode2 = __commonJS((exports) => {
29469
- Object.defineProperty(exports, "__esModule", { value: true });
29470
- exports.crypto = undefined;
29471
- var nc = __require("node:crypto");
29472
- exports.crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && ("randomBytes" in nc) ? nc : undefined;
29473
- });
29474
-
29475
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/utils.js
29476
- var require_utils7 = __commonJS((exports) => {
29477
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
29478
- Object.defineProperty(exports, "__esModule", { value: true });
29479
- exports.Hash = exports.nextTick = exports.byteSwapIfBE = exports.isLE = undefined;
29480
- exports.isBytes = isBytes;
29481
- exports.u8 = u8;
29482
- exports.u32 = u32;
29483
- exports.createView = createView;
29484
- exports.rotr = rotr;
29485
- exports.rotl = rotl;
29486
- exports.byteSwap = byteSwap;
29487
- exports.byteSwap32 = byteSwap32;
29488
- exports.bytesToHex = bytesToHex;
29489
- exports.hexToBytes = hexToBytes;
29490
- exports.asyncLoop = asyncLoop;
29491
- exports.utf8ToBytes = utf8ToBytes;
29492
- exports.toBytes = toBytes;
29493
- exports.concatBytes = concatBytes;
29494
- exports.checkOpts = checkOpts;
29495
- exports.wrapConstructor = wrapConstructor;
29496
- exports.wrapConstructorWithOpts = wrapConstructorWithOpts;
29497
- exports.wrapXOFConstructorWithOpts = wrapXOFConstructorWithOpts;
29498
- exports.randomBytes = randomBytes;
29499
- var crypto_1 = require_cryptoNode2();
29500
- var _assert_ts_1 = require__assert();
29501
- function isBytes(a) {
29502
- return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
29503
- }
29504
29498
  function u8(arr) {
29505
29499
  return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
29506
29500
  }
29507
29501
  function u32(arr) {
29508
29502
  return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
29509
29503
  }
29504
+ function clean(...arrays) {
29505
+ for (let i = 0;i < arrays.length; i++) {
29506
+ arrays[i].fill(0);
29507
+ }
29508
+ }
29510
29509
  function createView(arr) {
29511
29510
  return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
29512
29511
  }
@@ -29520,16 +29519,19 @@ var require_utils7 = __commonJS((exports) => {
29520
29519
  function byteSwap(word) {
29521
29520
  return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
29522
29521
  }
29523
- exports.byteSwapIfBE = exports.isLE ? (n) => n : (n) => byteSwap(n);
29522
+ exports.swap8IfBE = exports.isLE ? (n) => n : (n) => byteSwap(n);
29523
+ exports.byteSwapIfBE = exports.swap8IfBE;
29524
29524
  function byteSwap32(arr) {
29525
29525
  for (let i = 0;i < arr.length; i++) {
29526
29526
  arr[i] = byteSwap(arr[i]);
29527
29527
  }
29528
+ return arr;
29528
29529
  }
29529
- var hasHexBuiltin = typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function";
29530
+ exports.swap32IfBE = exports.isLE ? (u) => u : byteSwap32;
29531
+ var hasHexBuiltin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function")();
29530
29532
  var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
29531
29533
  function bytesToHex(bytes) {
29532
- (0, _assert_ts_1.abytes)(bytes);
29534
+ abytes(bytes);
29533
29535
  if (hasHexBuiltin)
29534
29536
  return bytes.toHex();
29535
29537
  let hex = "";
@@ -29584,20 +29586,29 @@ var require_utils7 = __commonJS((exports) => {
29584
29586
  }
29585
29587
  function utf8ToBytes(str) {
29586
29588
  if (typeof str !== "string")
29587
- throw new Error("utf8ToBytes expected string, got " + typeof str);
29589
+ throw new Error("string expected");
29588
29590
  return new Uint8Array(new TextEncoder().encode(str));
29589
29591
  }
29592
+ function bytesToUtf8(bytes) {
29593
+ return new TextDecoder().decode(bytes);
29594
+ }
29590
29595
  function toBytes(data) {
29591
29596
  if (typeof data === "string")
29592
29597
  data = utf8ToBytes(data);
29593
- (0, _assert_ts_1.abytes)(data);
29598
+ abytes(data);
29599
+ return data;
29600
+ }
29601
+ function kdfInputToBytes(data) {
29602
+ if (typeof data === "string")
29603
+ data = utf8ToBytes(data);
29604
+ abytes(data);
29594
29605
  return data;
29595
29606
  }
29596
29607
  function concatBytes(...arrays) {
29597
29608
  let sum = 0;
29598
29609
  for (let i = 0;i < arrays.length; i++) {
29599
29610
  const a = arrays[i];
29600
- (0, _assert_ts_1.abytes)(a);
29611
+ abytes(a);
29601
29612
  sum += a.length;
29602
29613
  }
29603
29614
  const res = new Uint8Array(sum);
@@ -29608,20 +29619,17 @@ var require_utils7 = __commonJS((exports) => {
29608
29619
  }
29609
29620
  return res;
29610
29621
  }
29611
-
29612
- class Hash {
29613
- clone() {
29614
- return this._cloneInto();
29615
- }
29616
- }
29617
- exports.Hash = Hash;
29618
29622
  function checkOpts(defaults, opts) {
29619
29623
  if (opts !== undefined && {}.toString.call(opts) !== "[object Object]")
29620
- throw new Error("Options should be object or undefined");
29624
+ throw new Error("options should be object or undefined");
29621
29625
  const merged = Object.assign(defaults, opts);
29622
29626
  return merged;
29623
29627
  }
29624
- function wrapConstructor(hashCons) {
29628
+
29629
+ class Hash {
29630
+ }
29631
+ exports.Hash = Hash;
29632
+ function createHasher(hashCons) {
29625
29633
  const hashC = (msg) => hashCons().update(toBytes(msg)).digest();
29626
29634
  const tmp = hashCons();
29627
29635
  hashC.outputLen = tmp.outputLen;
@@ -29629,7 +29637,7 @@ var require_utils7 = __commonJS((exports) => {
29629
29637
  hashC.create = () => hashCons();
29630
29638
  return hashC;
29631
29639
  }
29632
- function wrapConstructorWithOpts(hashCons) {
29640
+ function createOptHasher(hashCons) {
29633
29641
  const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();
29634
29642
  const tmp = hashCons({});
29635
29643
  hashC.outputLen = tmp.outputLen;
@@ -29637,7 +29645,7 @@ var require_utils7 = __commonJS((exports) => {
29637
29645
  hashC.create = (opts) => hashCons(opts);
29638
29646
  return hashC;
29639
29647
  }
29640
- function wrapXOFConstructorWithOpts(hashCons) {
29648
+ function createXOFer(hashCons) {
29641
29649
  const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();
29642
29650
  const tmp = hashCons({});
29643
29651
  hashC.outputLen = tmp.outputLen;
@@ -29645,6 +29653,9 @@ var require_utils7 = __commonJS((exports) => {
29645
29653
  hashC.create = (opts) => hashCons(opts);
29646
29654
  return hashC;
29647
29655
  }
29656
+ exports.wrapConstructor = createHasher;
29657
+ exports.wrapConstructorWithOpts = createOptHasher;
29658
+ exports.wrapXOFConstructorWithOpts = createXOFer;
29648
29659
  function randomBytes(bytesLength = 32) {
29649
29660
  if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === "function") {
29650
29661
  return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength));
@@ -29659,11 +29670,10 @@ var require_utils7 = __commonJS((exports) => {
29659
29670
  // ../../node_modules/eciesjs/node_modules/@noble/hashes/_md.js
29660
29671
  var require__md = __commonJS((exports) => {
29661
29672
  Object.defineProperty(exports, "__esModule", { value: true });
29662
- exports.HashMD = undefined;
29673
+ exports.SHA512_IV = exports.SHA384_IV = exports.SHA224_IV = exports.SHA256_IV = exports.HashMD = undefined;
29663
29674
  exports.setBigUint64 = setBigUint64;
29664
29675
  exports.Chi = Chi;
29665
29676
  exports.Maj = Maj;
29666
- var _assert_ts_1 = require__assert();
29667
29677
  var utils_ts_1 = require_utils7();
29668
29678
  function setBigUint64(view, byteOffset, value, isLE) {
29669
29679
  if (typeof view.setBigUint64 === "function")
@@ -29699,9 +29709,10 @@ var require__md = __commonJS((exports) => {
29699
29709
  this.view = (0, utils_ts_1.createView)(this.buffer);
29700
29710
  }
29701
29711
  update(data) {
29702
- (0, _assert_ts_1.aexists)(this);
29703
- const { view, buffer, blockLen } = this;
29712
+ (0, utils_ts_1.aexists)(this);
29704
29713
  data = (0, utils_ts_1.toBytes)(data);
29714
+ (0, utils_ts_1.abytes)(data);
29715
+ const { view, buffer, blockLen } = this;
29705
29716
  const len = data.length;
29706
29717
  for (let pos = 0;pos < len; ) {
29707
29718
  const take = Math.min(blockLen - this.pos, len - pos);
@@ -29724,13 +29735,13 @@ var require__md = __commonJS((exports) => {
29724
29735
  return this;
29725
29736
  }
29726
29737
  digestInto(out) {
29727
- (0, _assert_ts_1.aexists)(this);
29728
- (0, _assert_ts_1.aoutput)(out, this);
29738
+ (0, utils_ts_1.aexists)(this);
29739
+ (0, utils_ts_1.aoutput)(out, this);
29729
29740
  this.finished = true;
29730
29741
  const { buffer, view, blockLen, isLE } = this;
29731
29742
  let { pos } = this;
29732
29743
  buffer[pos++] = 128;
29733
- this.buffer.subarray(pos).fill(0);
29744
+ (0, utils_ts_1.clean)(this.buffer.subarray(pos));
29734
29745
  if (this.padOffset > blockLen - pos) {
29735
29746
  this.process(view, 0);
29736
29747
  pos = 0;
@@ -29761,25 +29772,178 @@ var require__md = __commonJS((exports) => {
29761
29772
  to || (to = new this.constructor);
29762
29773
  to.set(...this.get());
29763
29774
  const { blockLen, buffer, length, finished, destroyed, pos } = this;
29775
+ to.destroyed = destroyed;
29776
+ to.finished = finished;
29764
29777
  to.length = length;
29765
29778
  to.pos = pos;
29766
- to.finished = finished;
29767
- to.destroyed = destroyed;
29768
29779
  if (length % blockLen)
29769
29780
  to.buffer.set(buffer);
29770
29781
  return to;
29771
29782
  }
29783
+ clone() {
29784
+ return this._cloneInto();
29785
+ }
29772
29786
  }
29773
29787
  exports.HashMD = HashMD;
29788
+ exports.SHA256_IV = Uint32Array.from([
29789
+ 1779033703,
29790
+ 3144134277,
29791
+ 1013904242,
29792
+ 2773480762,
29793
+ 1359893119,
29794
+ 2600822924,
29795
+ 528734635,
29796
+ 1541459225
29797
+ ]);
29798
+ exports.SHA224_IV = Uint32Array.from([
29799
+ 3238371032,
29800
+ 914150663,
29801
+ 812702999,
29802
+ 4144912697,
29803
+ 4290775857,
29804
+ 1750603025,
29805
+ 1694076839,
29806
+ 3204075428
29807
+ ]);
29808
+ exports.SHA384_IV = Uint32Array.from([
29809
+ 3418070365,
29810
+ 3238371032,
29811
+ 1654270250,
29812
+ 914150663,
29813
+ 2438529370,
29814
+ 812702999,
29815
+ 355462360,
29816
+ 4144912697,
29817
+ 1731405415,
29818
+ 4290775857,
29819
+ 2394180231,
29820
+ 1750603025,
29821
+ 3675008525,
29822
+ 1694076839,
29823
+ 1203062813,
29824
+ 3204075428
29825
+ ]);
29826
+ exports.SHA512_IV = Uint32Array.from([
29827
+ 1779033703,
29828
+ 4089235720,
29829
+ 3144134277,
29830
+ 2227873595,
29831
+ 1013904242,
29832
+ 4271175723,
29833
+ 2773480762,
29834
+ 1595750129,
29835
+ 1359893119,
29836
+ 2917565137,
29837
+ 2600822924,
29838
+ 725511199,
29839
+ 528734635,
29840
+ 4215389547,
29841
+ 1541459225,
29842
+ 327033209
29843
+ ]);
29774
29844
  });
29775
29845
 
29776
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/sha256.js
29777
- var require_sha256 = __commonJS((exports) => {
29846
+ // ../../node_modules/eciesjs/node_modules/@noble/hashes/_u64.js
29847
+ var require__u64 = __commonJS((exports) => {
29778
29848
  Object.defineProperty(exports, "__esModule", { value: true });
29779
- exports.sha224 = exports.sha256 = exports.SHA256 = undefined;
29849
+ 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;
29850
+ exports.add = add;
29851
+ exports.fromBig = fromBig;
29852
+ exports.split = split;
29853
+ var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
29854
+ var _32n = /* @__PURE__ */ BigInt(32);
29855
+ function fromBig(n, le = false) {
29856
+ if (le)
29857
+ return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
29858
+ return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
29859
+ }
29860
+ function split(lst, le = false) {
29861
+ const len = lst.length;
29862
+ let Ah = new Uint32Array(len);
29863
+ let Al = new Uint32Array(len);
29864
+ for (let i = 0;i < len; i++) {
29865
+ const { h, l } = fromBig(lst[i], le);
29866
+ [Ah[i], Al[i]] = [h, l];
29867
+ }
29868
+ return [Ah, Al];
29869
+ }
29870
+ var toBig = (h, l) => BigInt(h >>> 0) << _32n | BigInt(l >>> 0);
29871
+ exports.toBig = toBig;
29872
+ var shrSH = (h, _l, s) => h >>> s;
29873
+ exports.shrSH = shrSH;
29874
+ var shrSL = (h, l, s) => h << 32 - s | l >>> s;
29875
+ exports.shrSL = shrSL;
29876
+ var rotrSH = (h, l, s) => h >>> s | l << 32 - s;
29877
+ exports.rotrSH = rotrSH;
29878
+ var rotrSL = (h, l, s) => h << 32 - s | l >>> s;
29879
+ exports.rotrSL = rotrSL;
29880
+ var rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32;
29881
+ exports.rotrBH = rotrBH;
29882
+ var rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s;
29883
+ exports.rotrBL = rotrBL;
29884
+ var rotr32H = (_h, l) => l;
29885
+ exports.rotr32H = rotr32H;
29886
+ var rotr32L = (h, _l) => h;
29887
+ exports.rotr32L = rotr32L;
29888
+ var rotlSH = (h, l, s) => h << s | l >>> 32 - s;
29889
+ exports.rotlSH = rotlSH;
29890
+ var rotlSL = (h, l, s) => l << s | h >>> 32 - s;
29891
+ exports.rotlSL = rotlSL;
29892
+ var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s;
29893
+ exports.rotlBH = rotlBH;
29894
+ var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
29895
+ exports.rotlBL = rotlBL;
29896
+ function add(Ah, Al, Bh, Bl) {
29897
+ const l = (Al >>> 0) + (Bl >>> 0);
29898
+ return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 };
29899
+ }
29900
+ var add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
29901
+ exports.add3L = add3L;
29902
+ var add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0;
29903
+ exports.add3H = add3H;
29904
+ var add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
29905
+ exports.add4L = add4L;
29906
+ var add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0;
29907
+ exports.add4H = add4H;
29908
+ var add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
29909
+ exports.add5L = add5L;
29910
+ var add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0;
29911
+ exports.add5H = add5H;
29912
+ var u64 = {
29913
+ fromBig,
29914
+ split,
29915
+ toBig,
29916
+ shrSH,
29917
+ shrSL,
29918
+ rotrSH,
29919
+ rotrSL,
29920
+ rotrBH,
29921
+ rotrBL,
29922
+ rotr32H,
29923
+ rotr32L,
29924
+ rotlSH,
29925
+ rotlSL,
29926
+ rotlBH,
29927
+ rotlBL,
29928
+ add,
29929
+ add3L,
29930
+ add3H,
29931
+ add4L,
29932
+ add4H,
29933
+ add5H,
29934
+ add5L
29935
+ };
29936
+ exports.default = u64;
29937
+ });
29938
+
29939
+ // ../../node_modules/eciesjs/node_modules/@noble/hashes/sha2.js
29940
+ var require_sha2 = __commonJS((exports) => {
29941
+ Object.defineProperty(exports, "__esModule", { value: true });
29942
+ 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;
29780
29943
  var _md_ts_1 = require__md();
29944
+ var u64 = require__u64();
29781
29945
  var utils_ts_1 = require_utils7();
29782
- var SHA256_K = /* @__PURE__ */ new Uint32Array([
29946
+ var SHA256_K = /* @__PURE__ */ Uint32Array.from([
29783
29947
  1116352408,
29784
29948
  1899447441,
29785
29949
  3049323471,
@@ -29845,29 +30009,19 @@ var require_sha256 = __commonJS((exports) => {
29845
30009
  3204031479,
29846
30010
  3329325298
29847
30011
  ]);
29848
- var SHA256_IV = /* @__PURE__ */ new Uint32Array([
29849
- 1779033703,
29850
- 3144134277,
29851
- 1013904242,
29852
- 2773480762,
29853
- 1359893119,
29854
- 2600822924,
29855
- 528734635,
29856
- 1541459225
29857
- ]);
29858
30012
  var SHA256_W = /* @__PURE__ */ new Uint32Array(64);
29859
30013
 
29860
30014
  class SHA256 extends _md_ts_1.HashMD {
29861
30015
  constructor(outputLen = 32) {
29862
30016
  super(64, outputLen, 8, false);
29863
- this.A = SHA256_IV[0] | 0;
29864
- this.B = SHA256_IV[1] | 0;
29865
- this.C = SHA256_IV[2] | 0;
29866
- this.D = SHA256_IV[3] | 0;
29867
- this.E = SHA256_IV[4] | 0;
29868
- this.F = SHA256_IV[5] | 0;
29869
- this.G = SHA256_IV[6] | 0;
29870
- this.H = SHA256_IV[7] | 0;
30017
+ this.A = _md_ts_1.SHA256_IV[0] | 0;
30018
+ this.B = _md_ts_1.SHA256_IV[1] | 0;
30019
+ this.C = _md_ts_1.SHA256_IV[2] | 0;
30020
+ this.D = _md_ts_1.SHA256_IV[3] | 0;
30021
+ this.E = _md_ts_1.SHA256_IV[4] | 0;
30022
+ this.F = _md_ts_1.SHA256_IV[5] | 0;
30023
+ this.G = _md_ts_1.SHA256_IV[6] | 0;
30024
+ this.H = _md_ts_1.SHA256_IV[7] | 0;
29871
30025
  }
29872
30026
  get() {
29873
30027
  const { A, B, C, D, E, F, G, H } = this;
@@ -29919,11 +30073,11 @@ var require_sha256 = __commonJS((exports) => {
29919
30073
  this.set(A, B, C, D, E, F, G, H);
29920
30074
  }
29921
30075
  roundClean() {
29922
- SHA256_W.fill(0);
30076
+ (0, utils_ts_1.clean)(SHA256_W);
29923
30077
  }
29924
30078
  destroy() {
29925
30079
  this.set(0, 0, 0, 0, 0, 0, 0, 0);
29926
- this.buffer.fill(0);
30080
+ (0, utils_ts_1.clean)(this.buffer);
29927
30081
  }
29928
30082
  }
29929
30083
  exports.SHA256 = SHA256;
@@ -29931,120 +30085,18 @@ var require_sha256 = __commonJS((exports) => {
29931
30085
  class SHA224 extends SHA256 {
29932
30086
  constructor() {
29933
30087
  super(28);
29934
- this.A = 3238371032 | 0;
29935
- this.B = 914150663 | 0;
29936
- this.C = 812702999 | 0;
29937
- this.D = 4144912697 | 0;
29938
- this.E = 4290775857 | 0;
29939
- this.F = 1750603025 | 0;
29940
- this.G = 1694076839 | 0;
29941
- this.H = 3204075428 | 0;
29942
- }
29943
- }
29944
- exports.sha256 = (0, utils_ts_1.wrapConstructor)(() => new SHA256);
29945
- exports.sha224 = (0, utils_ts_1.wrapConstructor)(() => new SHA224);
29946
- });
29947
-
29948
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/_u64.js
29949
- var require__u64 = __commonJS((exports) => {
29950
- Object.defineProperty(exports, "__esModule", { value: true });
29951
- exports.add5L = exports.add5H = exports.add4H = exports.add4L = exports.add3H = exports.add3L = exports.rotlBL = exports.rotlBH = exports.rotlSL = exports.rotlSH = exports.rotr32L = exports.rotr32H = exports.rotrBL = exports.rotrBH = exports.rotrSL = exports.rotrSH = exports.shrSL = exports.shrSH = exports.toBig = undefined;
29952
- exports.fromBig = fromBig;
29953
- exports.split = split;
29954
- exports.add = add;
29955
- var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
29956
- var _32n = /* @__PURE__ */ BigInt(32);
29957
- function fromBig(n, le = false) {
29958
- if (le)
29959
- return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
29960
- return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
29961
- }
29962
- function split(lst, le = false) {
29963
- let Ah = new Uint32Array(lst.length);
29964
- let Al = new Uint32Array(lst.length);
29965
- for (let i = 0;i < lst.length; i++) {
29966
- const { h, l } = fromBig(lst[i], le);
29967
- [Ah[i], Al[i]] = [h, l];
29968
- }
29969
- return [Ah, Al];
29970
- }
29971
- var toBig = (h, l) => BigInt(h >>> 0) << _32n | BigInt(l >>> 0);
29972
- exports.toBig = toBig;
29973
- var shrSH = (h, _l, s) => h >>> s;
29974
- exports.shrSH = shrSH;
29975
- var shrSL = (h, l, s) => h << 32 - s | l >>> s;
29976
- exports.shrSL = shrSL;
29977
- var rotrSH = (h, l, s) => h >>> s | l << 32 - s;
29978
- exports.rotrSH = rotrSH;
29979
- var rotrSL = (h, l, s) => h << 32 - s | l >>> s;
29980
- exports.rotrSL = rotrSL;
29981
- var rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32;
29982
- exports.rotrBH = rotrBH;
29983
- var rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s;
29984
- exports.rotrBL = rotrBL;
29985
- var rotr32H = (_h, l) => l;
29986
- exports.rotr32H = rotr32H;
29987
- var rotr32L = (h, _l) => h;
29988
- exports.rotr32L = rotr32L;
29989
- var rotlSH = (h, l, s) => h << s | l >>> 32 - s;
29990
- exports.rotlSH = rotlSH;
29991
- var rotlSL = (h, l, s) => l << s | h >>> 32 - s;
29992
- exports.rotlSL = rotlSL;
29993
- var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s;
29994
- exports.rotlBH = rotlBH;
29995
- var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
29996
- exports.rotlBL = rotlBL;
29997
- function add(Ah, Al, Bh, Bl) {
29998
- const l = (Al >>> 0) + (Bl >>> 0);
29999
- return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 };
30000
- }
30001
- var add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
30002
- exports.add3L = add3L;
30003
- var add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0;
30004
- exports.add3H = add3H;
30005
- var add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
30006
- exports.add4L = add4L;
30007
- var add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0;
30008
- exports.add4H = add4H;
30009
- var add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
30010
- exports.add5L = add5L;
30011
- var add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0;
30012
- exports.add5H = add5H;
30013
- var u64 = {
30014
- fromBig,
30015
- split,
30016
- toBig,
30017
- shrSH,
30018
- shrSL,
30019
- rotrSH,
30020
- rotrSL,
30021
- rotrBH,
30022
- rotrBL,
30023
- rotr32H,
30024
- rotr32L,
30025
- rotlSH,
30026
- rotlSL,
30027
- rotlBH,
30028
- rotlBL,
30029
- add,
30030
- add3L,
30031
- add3H,
30032
- add4L,
30033
- add4H,
30034
- add5H,
30035
- add5L
30036
- };
30037
- exports.default = u64;
30038
- });
30039
-
30040
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/sha512.js
30041
- var require_sha512 = __commonJS((exports) => {
30042
- Object.defineProperty(exports, "__esModule", { value: true });
30043
- exports.sha384 = exports.sha512_256 = exports.sha512_224 = exports.sha512 = exports.SHA384 = exports.SHA512_256 = exports.SHA512_224 = exports.SHA512 = undefined;
30044
- var _md_ts_1 = require__md();
30045
- var _u64_ts_1 = require__u64();
30046
- var utils_ts_1 = require_utils7();
30047
- var [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => _u64_ts_1.default.split([
30088
+ this.A = _md_ts_1.SHA224_IV[0] | 0;
30089
+ this.B = _md_ts_1.SHA224_IV[1] | 0;
30090
+ this.C = _md_ts_1.SHA224_IV[2] | 0;
30091
+ this.D = _md_ts_1.SHA224_IV[3] | 0;
30092
+ this.E = _md_ts_1.SHA224_IV[4] | 0;
30093
+ this.F = _md_ts_1.SHA224_IV[5] | 0;
30094
+ this.G = _md_ts_1.SHA224_IV[6] | 0;
30095
+ this.H = _md_ts_1.SHA224_IV[7] | 0;
30096
+ }
30097
+ }
30098
+ exports.SHA224 = SHA224;
30099
+ var K512 = /* @__PURE__ */ (() => u64.split([
30048
30100
  "0x428a2f98d728ae22",
30049
30101
  "0x7137449123ef65cd",
30050
30102
  "0xb5c0fbcfec4d3b2f",
@@ -30126,28 +30178,30 @@ var require_sha512 = __commonJS((exports) => {
30126
30178
  "0x5fcb6fab3ad6faec",
30127
30179
  "0x6c44198c4a475817"
30128
30180
  ].map((n) => BigInt(n))))();
30181
+ var SHA512_Kh = /* @__PURE__ */ (() => K512[0])();
30182
+ var SHA512_Kl = /* @__PURE__ */ (() => K512[1])();
30129
30183
  var SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);
30130
30184
  var SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);
30131
30185
 
30132
30186
  class SHA512 extends _md_ts_1.HashMD {
30133
30187
  constructor(outputLen = 64) {
30134
30188
  super(128, outputLen, 16, false);
30135
- this.Ah = 1779033703 | 0;
30136
- this.Al = 4089235720 | 0;
30137
- this.Bh = 3144134277 | 0;
30138
- this.Bl = 2227873595 | 0;
30139
- this.Ch = 1013904242 | 0;
30140
- this.Cl = 4271175723 | 0;
30141
- this.Dh = 2773480762 | 0;
30142
- this.Dl = 1595750129 | 0;
30143
- this.Eh = 1359893119 | 0;
30144
- this.El = 2917565137 | 0;
30145
- this.Fh = 2600822924 | 0;
30146
- this.Fl = 725511199 | 0;
30147
- this.Gh = 528734635 | 0;
30148
- this.Gl = 4215389547 | 0;
30149
- this.Hh = 1541459225 | 0;
30150
- this.Hl = 327033209 | 0;
30189
+ this.Ah = _md_ts_1.SHA512_IV[0] | 0;
30190
+ this.Al = _md_ts_1.SHA512_IV[1] | 0;
30191
+ this.Bh = _md_ts_1.SHA512_IV[2] | 0;
30192
+ this.Bl = _md_ts_1.SHA512_IV[3] | 0;
30193
+ this.Ch = _md_ts_1.SHA512_IV[4] | 0;
30194
+ this.Cl = _md_ts_1.SHA512_IV[5] | 0;
30195
+ this.Dh = _md_ts_1.SHA512_IV[6] | 0;
30196
+ this.Dl = _md_ts_1.SHA512_IV[7] | 0;
30197
+ this.Eh = _md_ts_1.SHA512_IV[8] | 0;
30198
+ this.El = _md_ts_1.SHA512_IV[9] | 0;
30199
+ this.Fh = _md_ts_1.SHA512_IV[10] | 0;
30200
+ this.Fl = _md_ts_1.SHA512_IV[11] | 0;
30201
+ this.Gh = _md_ts_1.SHA512_IV[12] | 0;
30202
+ this.Gl = _md_ts_1.SHA512_IV[13] | 0;
30203
+ this.Hh = _md_ts_1.SHA512_IV[14] | 0;
30204
+ this.Hl = _md_ts_1.SHA512_IV[15] | 0;
30151
30205
  }
30152
30206
  get() {
30153
30207
  const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
@@ -30179,28 +30233,28 @@ var require_sha512 = __commonJS((exports) => {
30179
30233
  for (let i = 16;i < 80; i++) {
30180
30234
  const W15h = SHA512_W_H[i - 15] | 0;
30181
30235
  const W15l = SHA512_W_L[i - 15] | 0;
30182
- const s0h = _u64_ts_1.default.rotrSH(W15h, W15l, 1) ^ _u64_ts_1.default.rotrSH(W15h, W15l, 8) ^ _u64_ts_1.default.shrSH(W15h, W15l, 7);
30183
- const s0l = _u64_ts_1.default.rotrSL(W15h, W15l, 1) ^ _u64_ts_1.default.rotrSL(W15h, W15l, 8) ^ _u64_ts_1.default.shrSL(W15h, W15l, 7);
30236
+ const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);
30237
+ const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);
30184
30238
  const W2h = SHA512_W_H[i - 2] | 0;
30185
30239
  const W2l = SHA512_W_L[i - 2] | 0;
30186
- const s1h = _u64_ts_1.default.rotrSH(W2h, W2l, 19) ^ _u64_ts_1.default.rotrBH(W2h, W2l, 61) ^ _u64_ts_1.default.shrSH(W2h, W2l, 6);
30187
- const s1l = _u64_ts_1.default.rotrSL(W2h, W2l, 19) ^ _u64_ts_1.default.rotrBL(W2h, W2l, 61) ^ _u64_ts_1.default.shrSL(W2h, W2l, 6);
30188
- const SUMl = _u64_ts_1.default.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);
30189
- const SUMh = _u64_ts_1.default.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);
30240
+ const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);
30241
+ const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);
30242
+ const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);
30243
+ const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);
30190
30244
  SHA512_W_H[i] = SUMh | 0;
30191
30245
  SHA512_W_L[i] = SUMl | 0;
30192
30246
  }
30193
30247
  let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
30194
30248
  for (let i = 0;i < 80; i++) {
30195
- const sigma1h = _u64_ts_1.default.rotrSH(Eh, El, 14) ^ _u64_ts_1.default.rotrSH(Eh, El, 18) ^ _u64_ts_1.default.rotrBH(Eh, El, 41);
30196
- const sigma1l = _u64_ts_1.default.rotrSL(Eh, El, 14) ^ _u64_ts_1.default.rotrSL(Eh, El, 18) ^ _u64_ts_1.default.rotrBL(Eh, El, 41);
30249
+ const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);
30250
+ const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);
30197
30251
  const CHIh = Eh & Fh ^ ~Eh & Gh;
30198
30252
  const CHIl = El & Fl ^ ~El & Gl;
30199
- const T1ll = _u64_ts_1.default.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);
30200
- const T1h = _u64_ts_1.default.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);
30253
+ const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);
30254
+ const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);
30201
30255
  const T1l = T1ll | 0;
30202
- const sigma0h = _u64_ts_1.default.rotrSH(Ah, Al, 28) ^ _u64_ts_1.default.rotrBH(Ah, Al, 34) ^ _u64_ts_1.default.rotrBH(Ah, Al, 39);
30203
- const sigma0l = _u64_ts_1.default.rotrSL(Ah, Al, 28) ^ _u64_ts_1.default.rotrBL(Ah, Al, 34) ^ _u64_ts_1.default.rotrBL(Ah, Al, 39);
30256
+ const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);
30257
+ const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);
30204
30258
  const MAJh = Ah & Bh ^ Ah & Ch ^ Bh & Ch;
30205
30259
  const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl;
30206
30260
  Hh = Gh | 0;
@@ -30209,57 +30263,115 @@ var require_sha512 = __commonJS((exports) => {
30209
30263
  Gl = Fl | 0;
30210
30264
  Fh = Eh | 0;
30211
30265
  Fl = El | 0;
30212
- ({ h: Eh, l: El } = _u64_ts_1.default.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));
30266
+ ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));
30213
30267
  Dh = Ch | 0;
30214
30268
  Dl = Cl | 0;
30215
30269
  Ch = Bh | 0;
30216
30270
  Cl = Bl | 0;
30217
30271
  Bh = Ah | 0;
30218
30272
  Bl = Al | 0;
30219
- const All = _u64_ts_1.default.add3L(T1l, sigma0l, MAJl);
30220
- Ah = _u64_ts_1.default.add3H(All, T1h, sigma0h, MAJh);
30273
+ const All = u64.add3L(T1l, sigma0l, MAJl);
30274
+ Ah = u64.add3H(All, T1h, sigma0h, MAJh);
30221
30275
  Al = All | 0;
30222
30276
  }
30223
- ({ h: Ah, l: Al } = _u64_ts_1.default.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));
30224
- ({ h: Bh, l: Bl } = _u64_ts_1.default.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));
30225
- ({ h: Ch, l: Cl } = _u64_ts_1.default.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));
30226
- ({ h: Dh, l: Dl } = _u64_ts_1.default.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));
30227
- ({ h: Eh, l: El } = _u64_ts_1.default.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));
30228
- ({ h: Fh, l: Fl } = _u64_ts_1.default.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));
30229
- ({ h: Gh, l: Gl } = _u64_ts_1.default.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));
30230
- ({ h: Hh, l: Hl } = _u64_ts_1.default.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));
30277
+ ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));
30278
+ ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));
30279
+ ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));
30280
+ ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));
30281
+ ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));
30282
+ ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));
30283
+ ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));
30284
+ ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));
30231
30285
  this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);
30232
30286
  }
30233
30287
  roundClean() {
30234
- SHA512_W_H.fill(0);
30235
- SHA512_W_L.fill(0);
30288
+ (0, utils_ts_1.clean)(SHA512_W_H, SHA512_W_L);
30236
30289
  }
30237
30290
  destroy() {
30238
- this.buffer.fill(0);
30291
+ (0, utils_ts_1.clean)(this.buffer);
30239
30292
  this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
30240
30293
  }
30241
30294
  }
30242
30295
  exports.SHA512 = SHA512;
30243
30296
 
30297
+ class SHA384 extends SHA512 {
30298
+ constructor() {
30299
+ super(48);
30300
+ this.Ah = _md_ts_1.SHA384_IV[0] | 0;
30301
+ this.Al = _md_ts_1.SHA384_IV[1] | 0;
30302
+ this.Bh = _md_ts_1.SHA384_IV[2] | 0;
30303
+ this.Bl = _md_ts_1.SHA384_IV[3] | 0;
30304
+ this.Ch = _md_ts_1.SHA384_IV[4] | 0;
30305
+ this.Cl = _md_ts_1.SHA384_IV[5] | 0;
30306
+ this.Dh = _md_ts_1.SHA384_IV[6] | 0;
30307
+ this.Dl = _md_ts_1.SHA384_IV[7] | 0;
30308
+ this.Eh = _md_ts_1.SHA384_IV[8] | 0;
30309
+ this.El = _md_ts_1.SHA384_IV[9] | 0;
30310
+ this.Fh = _md_ts_1.SHA384_IV[10] | 0;
30311
+ this.Fl = _md_ts_1.SHA384_IV[11] | 0;
30312
+ this.Gh = _md_ts_1.SHA384_IV[12] | 0;
30313
+ this.Gl = _md_ts_1.SHA384_IV[13] | 0;
30314
+ this.Hh = _md_ts_1.SHA384_IV[14] | 0;
30315
+ this.Hl = _md_ts_1.SHA384_IV[15] | 0;
30316
+ }
30317
+ }
30318
+ exports.SHA384 = SHA384;
30319
+ var T224_IV = /* @__PURE__ */ Uint32Array.from([
30320
+ 2352822216,
30321
+ 424955298,
30322
+ 1944164710,
30323
+ 2312950998,
30324
+ 502970286,
30325
+ 855612546,
30326
+ 1738396948,
30327
+ 1479516111,
30328
+ 258812777,
30329
+ 2077511080,
30330
+ 2011393907,
30331
+ 79989058,
30332
+ 1067287976,
30333
+ 1780299464,
30334
+ 286451373,
30335
+ 2446758561
30336
+ ]);
30337
+ var T256_IV = /* @__PURE__ */ Uint32Array.from([
30338
+ 573645204,
30339
+ 4230739756,
30340
+ 2673172387,
30341
+ 3360449730,
30342
+ 596883563,
30343
+ 1867755857,
30344
+ 2520282905,
30345
+ 1497426621,
30346
+ 2519219938,
30347
+ 2827943907,
30348
+ 3193839141,
30349
+ 1401305490,
30350
+ 721525244,
30351
+ 746961066,
30352
+ 246885852,
30353
+ 2177182882
30354
+ ]);
30355
+
30244
30356
  class SHA512_224 extends SHA512 {
30245
30357
  constructor() {
30246
30358
  super(28);
30247
- this.Ah = 2352822216 | 0;
30248
- this.Al = 424955298 | 0;
30249
- this.Bh = 1944164710 | 0;
30250
- this.Bl = 2312950998 | 0;
30251
- this.Ch = 502970286 | 0;
30252
- this.Cl = 855612546 | 0;
30253
- this.Dh = 1738396948 | 0;
30254
- this.Dl = 1479516111 | 0;
30255
- this.Eh = 258812777 | 0;
30256
- this.El = 2077511080 | 0;
30257
- this.Fh = 2011393907 | 0;
30258
- this.Fl = 79989058 | 0;
30259
- this.Gh = 1067287976 | 0;
30260
- this.Gl = 1780299464 | 0;
30261
- this.Hh = 286451373 | 0;
30262
- this.Hl = 2446758561 | 0;
30359
+ this.Ah = T224_IV[0] | 0;
30360
+ this.Al = T224_IV[1] | 0;
30361
+ this.Bh = T224_IV[2] | 0;
30362
+ this.Bl = T224_IV[3] | 0;
30363
+ this.Ch = T224_IV[4] | 0;
30364
+ this.Cl = T224_IV[5] | 0;
30365
+ this.Dh = T224_IV[6] | 0;
30366
+ this.Dl = T224_IV[7] | 0;
30367
+ this.Eh = T224_IV[8] | 0;
30368
+ this.El = T224_IV[9] | 0;
30369
+ this.Fh = T224_IV[10] | 0;
30370
+ this.Fl = T224_IV[11] | 0;
30371
+ this.Gh = T224_IV[12] | 0;
30372
+ this.Gl = T224_IV[13] | 0;
30373
+ this.Hh = T224_IV[14] | 0;
30374
+ this.Hl = T224_IV[15] | 0;
30263
30375
  }
30264
30376
  }
30265
30377
  exports.SHA512_224 = SHA512_224;
@@ -30267,78 +30379,31 @@ var require_sha512 = __commonJS((exports) => {
30267
30379
  class SHA512_256 extends SHA512 {
30268
30380
  constructor() {
30269
30381
  super(32);
30270
- this.Ah = 573645204 | 0;
30271
- this.Al = 4230739756 | 0;
30272
- this.Bh = 2673172387 | 0;
30273
- this.Bl = 3360449730 | 0;
30274
- this.Ch = 596883563 | 0;
30275
- this.Cl = 1867755857 | 0;
30276
- this.Dh = 2520282905 | 0;
30277
- this.Dl = 1497426621 | 0;
30278
- this.Eh = 2519219938 | 0;
30279
- this.El = 2827943907 | 0;
30280
- this.Fh = 3193839141 | 0;
30281
- this.Fl = 1401305490 | 0;
30282
- this.Gh = 721525244 | 0;
30283
- this.Gl = 746961066 | 0;
30284
- this.Hh = 246885852 | 0;
30285
- this.Hl = 2177182882 | 0;
30382
+ this.Ah = T256_IV[0] | 0;
30383
+ this.Al = T256_IV[1] | 0;
30384
+ this.Bh = T256_IV[2] | 0;
30385
+ this.Bl = T256_IV[3] | 0;
30386
+ this.Ch = T256_IV[4] | 0;
30387
+ this.Cl = T256_IV[5] | 0;
30388
+ this.Dh = T256_IV[6] | 0;
30389
+ this.Dl = T256_IV[7] | 0;
30390
+ this.Eh = T256_IV[8] | 0;
30391
+ this.El = T256_IV[9] | 0;
30392
+ this.Fh = T256_IV[10] | 0;
30393
+ this.Fl = T256_IV[11] | 0;
30394
+ this.Gh = T256_IV[12] | 0;
30395
+ this.Gl = T256_IV[13] | 0;
30396
+ this.Hh = T256_IV[14] | 0;
30397
+ this.Hl = T256_IV[15] | 0;
30286
30398
  }
30287
30399
  }
30288
30400
  exports.SHA512_256 = SHA512_256;
30289
-
30290
- class SHA384 extends SHA512 {
30291
- constructor() {
30292
- super(48);
30293
- this.Ah = 3418070365 | 0;
30294
- this.Al = 3238371032 | 0;
30295
- this.Bh = 1654270250 | 0;
30296
- this.Bl = 914150663 | 0;
30297
- this.Ch = 2438529370 | 0;
30298
- this.Cl = 812702999 | 0;
30299
- this.Dh = 355462360 | 0;
30300
- this.Dl = 4144912697 | 0;
30301
- this.Eh = 1731405415 | 0;
30302
- this.El = 4290775857 | 0;
30303
- this.Fh = 2394180231 | 0;
30304
- this.Fl = 1750603025 | 0;
30305
- this.Gh = 3675008525 | 0;
30306
- this.Gl = 1694076839 | 0;
30307
- this.Hh = 1203062813 | 0;
30308
- this.Hl = 3204075428 | 0;
30309
- }
30310
- }
30311
- exports.SHA384 = SHA384;
30312
- exports.sha512 = (0, utils_ts_1.wrapConstructor)(() => new SHA512);
30313
- exports.sha512_224 = (0, utils_ts_1.wrapConstructor)(() => new SHA512_224);
30314
- exports.sha512_256 = (0, utils_ts_1.wrapConstructor)(() => new SHA512_256);
30315
- exports.sha384 = (0, utils_ts_1.wrapConstructor)(() => new SHA384);
30316
- });
30317
-
30318
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/sha2.js
30319
- var require_sha2 = __commonJS((exports) => {
30320
- Object.defineProperty(exports, "__esModule", { value: true });
30321
- exports.sha512_256 = exports.sha512_224 = exports.sha512 = exports.sha384 = exports.sha256 = exports.sha224 = undefined;
30322
- var sha256_ts_1 = require_sha256();
30323
- Object.defineProperty(exports, "sha224", { enumerable: true, get: function() {
30324
- return sha256_ts_1.sha224;
30325
- } });
30326
- Object.defineProperty(exports, "sha256", { enumerable: true, get: function() {
30327
- return sha256_ts_1.sha256;
30328
- } });
30329
- var sha512_ts_1 = require_sha512();
30330
- Object.defineProperty(exports, "sha384", { enumerable: true, get: function() {
30331
- return sha512_ts_1.sha384;
30332
- } });
30333
- Object.defineProperty(exports, "sha512", { enumerable: true, get: function() {
30334
- return sha512_ts_1.sha512;
30335
- } });
30336
- Object.defineProperty(exports, "sha512_224", { enumerable: true, get: function() {
30337
- return sha512_ts_1.sha512_224;
30338
- } });
30339
- Object.defineProperty(exports, "sha512_256", { enumerable: true, get: function() {
30340
- return sha512_ts_1.sha512_256;
30341
- } });
30401
+ exports.sha256 = (0, utils_ts_1.createHasher)(() => new SHA256);
30402
+ exports.sha224 = (0, utils_ts_1.createHasher)(() => new SHA224);
30403
+ exports.sha512 = (0, utils_ts_1.createHasher)(() => new SHA512);
30404
+ exports.sha384 = (0, utils_ts_1.createHasher)(() => new SHA384);
30405
+ exports.sha512_256 = (0, utils_ts_1.createHasher)(() => new SHA512_256);
30406
+ exports.sha512_224 = (0, utils_ts_1.createHasher)(() => new SHA512_224);
30342
30407
  });
30343
30408
 
30344
30409
  // ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/utils.js
@@ -30640,6 +30705,7 @@ var require_modular = __commonJS((exports) => {
30640
30705
  exports.getMinHashLength = getMinHashLength;
30641
30706
  exports.mapHashToField = mapHashToField;
30642
30707
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
30708
+ var utils_1 = require_utils7();
30643
30709
  var utils_ts_1 = require_utils8();
30644
30710
  var _0n = BigInt(0);
30645
30711
  var _1n = BigInt(1);
@@ -30699,13 +30765,17 @@ var require_modular = __commonJS((exports) => {
30699
30765
  return mod(x, modulo);
30700
30766
  }
30701
30767
  function tonelliShanks(P) {
30702
- const legendreC = (P - _1n) / _2n;
30703
- let Q, S, Z;
30704
- for (Q = P - _1n, S = 0;Q % _2n === _0n; Q /= _2n, S++)
30705
- ;
30706
- for (Z = _2n;Z < P && pow(Z, legendreC, P) !== P - _1n; Z++) {
30707
- if (Z > 1000)
30708
- throw new Error("Cannot find square root: likely non-prime P");
30768
+ let Q = P - _1n;
30769
+ let S = 0;
30770
+ while (Q % _2n === _0n) {
30771
+ Q /= _2n;
30772
+ S++;
30773
+ }
30774
+ let Z = _2n;
30775
+ const _Fp = Field(P);
30776
+ while (Z < P && FpIsSquare(_Fp, Z)) {
30777
+ if (Z++ > 1000)
30778
+ throw new Error("Cannot find square root: probably non-prime P");
30709
30779
  }
30710
30780
  if (S === 1) {
30711
30781
  const p1div4 = (P + _1n) / _4n;
@@ -30718,7 +30788,7 @@ var require_modular = __commonJS((exports) => {
30718
30788
  }
30719
30789
  const Q1div2 = (Q + _1n) / _2n;
30720
30790
  return function tonelliSlow(Fp, n) {
30721
- if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE))
30791
+ if (!FpIsSquare(Fp, n))
30722
30792
  throw new Error("Cannot find square root");
30723
30793
  let r = S;
30724
30794
  let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q);
@@ -30744,8 +30814,8 @@ var require_modular = __commonJS((exports) => {
30744
30814
  }
30745
30815
  function FpSqrt(P) {
30746
30816
  if (P % _4n === _3n) {
30747
- const p1div4 = (P + _1n) / _4n;
30748
30817
  return function sqrt3mod4(Fp, n) {
30818
+ const p1div4 = (P + _1n) / _4n;
30749
30819
  const root = Fp.pow(n, p1div4);
30750
30820
  if (!Fp.eql(Fp.sqr(root), n))
30751
30821
  throw new Error("Cannot find square root");
@@ -30753,9 +30823,9 @@ var require_modular = __commonJS((exports) => {
30753
30823
  };
30754
30824
  }
30755
30825
  if (P % _8n === _5n) {
30756
- const c1 = (P - _5n) / _8n;
30757
30826
  return function sqrt5mod8(Fp, n) {
30758
30827
  const n2 = Fp.mul(n, _2n);
30828
+ const c1 = (P - _5n) / _8n;
30759
30829
  const v = Fp.pow(n2, c1);
30760
30830
  const nv = Fp.mul(n, v);
30761
30831
  const i = Fp.mul(Fp.mul(nv, _2n), v);
@@ -30802,55 +30872,60 @@ var require_modular = __commonJS((exports) => {
30802
30872
  }, initial);
30803
30873
  return (0, utils_ts_1.validateObject)(field, opts);
30804
30874
  }
30805
- function FpPow(f, num, power) {
30875
+ function FpPow(Fp, num, power) {
30806
30876
  if (power < _0n)
30807
30877
  throw new Error("invalid exponent, negatives unsupported");
30808
30878
  if (power === _0n)
30809
- return f.ONE;
30879
+ return Fp.ONE;
30810
30880
  if (power === _1n)
30811
30881
  return num;
30812
- let p = f.ONE;
30882
+ let p = Fp.ONE;
30813
30883
  let d = num;
30814
30884
  while (power > _0n) {
30815
30885
  if (power & _1n)
30816
- p = f.mul(p, d);
30817
- d = f.sqr(d);
30886
+ p = Fp.mul(p, d);
30887
+ d = Fp.sqr(d);
30818
30888
  power >>= _1n;
30819
30889
  }
30820
30890
  return p;
30821
30891
  }
30822
- function FpInvertBatch(f, nums) {
30823
- const tmp = new Array(nums.length);
30824
- const lastMultiplied = nums.reduce((acc, num, i) => {
30825
- if (f.is0(num))
30892
+ function FpInvertBatch(Fp, nums, passZero = false) {
30893
+ const inverted = new Array(nums.length).fill(passZero ? Fp.ZERO : undefined);
30894
+ const multipliedAcc = nums.reduce((acc, num, i) => {
30895
+ if (Fp.is0(num))
30826
30896
  return acc;
30827
- tmp[i] = acc;
30828
- return f.mul(acc, num);
30829
- }, f.ONE);
30830
- const inverted = f.inv(lastMultiplied);
30897
+ inverted[i] = acc;
30898
+ return Fp.mul(acc, num);
30899
+ }, Fp.ONE);
30900
+ const invertedAcc = Fp.inv(multipliedAcc);
30831
30901
  nums.reduceRight((acc, num, i) => {
30832
- if (f.is0(num))
30902
+ if (Fp.is0(num))
30833
30903
  return acc;
30834
- tmp[i] = f.mul(acc, tmp[i]);
30835
- return f.mul(acc, num);
30836
- }, inverted);
30837
- return tmp;
30838
- }
30839
- function FpDiv(f, lhs, rhs) {
30840
- return f.mul(lhs, typeof rhs === "bigint" ? invert(rhs, f.ORDER) : f.inv(rhs));
30841
- }
30842
- function FpLegendre(order) {
30843
- const legendreConst = (order - _1n) / _2n;
30844
- return (f, x) => f.pow(x, legendreConst);
30845
- }
30846
- function FpIsSquare(f) {
30847
- const legendre = FpLegendre(f.ORDER);
30848
- return (x) => {
30849
- const p = legendre(f, x);
30850
- return f.eql(p, f.ZERO) || f.eql(p, f.ONE);
30851
- };
30904
+ inverted[i] = Fp.mul(acc, inverted[i]);
30905
+ return Fp.mul(acc, num);
30906
+ }, invertedAcc);
30907
+ return inverted;
30908
+ }
30909
+ function FpDiv(Fp, lhs, rhs) {
30910
+ return Fp.mul(lhs, typeof rhs === "bigint" ? invert(rhs, Fp.ORDER) : Fp.inv(rhs));
30911
+ }
30912
+ function FpLegendre(Fp, n) {
30913
+ const legc = (Fp.ORDER - _1n) / _2n;
30914
+ const powered = Fp.pow(n, legc);
30915
+ const yes = Fp.eql(powered, Fp.ONE);
30916
+ const zero = Fp.eql(powered, Fp.ZERO);
30917
+ const no = Fp.eql(powered, Fp.neg(Fp.ONE));
30918
+ if (!yes && !zero && !no)
30919
+ throw new Error("Cannot find square root: probably non-prime P");
30920
+ return yes ? 1 : zero ? 0 : -1;
30921
+ }
30922
+ function FpIsSquare(Fp, n) {
30923
+ const l = FpLegendre(Fp, n);
30924
+ return l === 0 || l === 1;
30852
30925
  }
30853
30926
  function nLength(n, nBitLength) {
30927
+ if (nBitLength !== undefined)
30928
+ (0, utils_1.anumber)(nBitLength);
30854
30929
  const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length;
30855
30930
  const nByteLength = Math.ceil(_nBitLength / 8);
30856
30931
  return { nBitLength: _nBitLength, nByteLength };
@@ -30896,14 +30971,14 @@ var require_modular = __commonJS((exports) => {
30896
30971
  sqrtP = FpSqrt(ORDER);
30897
30972
  return sqrtP(f, n);
30898
30973
  }),
30899
- invertBatch: (lst) => FpInvertBatch(f, lst),
30900
- cmov: (a, b, c) => c ? b : a,
30901
30974
  toBytes: (num) => isLE ? (0, utils_ts_1.numberToBytesLE)(num, BYTES) : (0, utils_ts_1.numberToBytesBE)(num, BYTES),
30902
30975
  fromBytes: (bytes) => {
30903
30976
  if (bytes.length !== BYTES)
30904
30977
  throw new Error("Field.fromBytes: expected " + BYTES + " bytes, got " + bytes.length);
30905
30978
  return isLE ? (0, utils_ts_1.bytesToNumberLE)(bytes) : (0, utils_ts_1.bytesToNumberBE)(bytes);
30906
- }
30979
+ },
30980
+ invertBatch: (lst) => FpInvertBatch(f, lst),
30981
+ cmov: (a, b, c) => c ? b : a
30907
30982
  });
30908
30983
  return Object.freeze(f);
30909
30984
  }
@@ -31309,7 +31384,7 @@ var require_edwards = __commonJS((exports) => {
31309
31384
  return new Point(x, y, _1n, modP(x * y));
31310
31385
  }
31311
31386
  static normalizeZ(points) {
31312
- const toInv = Fp.invertBatch(points.map((p) => p.ez));
31387
+ const toInv = (0, modular_ts_1.FpInvertBatch)(Fp, points.map((p) => p.ez));
31313
31388
  return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);
31314
31389
  }
31315
31390
  static msm(points, scalars) {
@@ -31477,7 +31552,7 @@ var require_edwards = __commonJS((exports) => {
31477
31552
  function getPublicKey(privKey) {
31478
31553
  return getExtendedPublicKey(privKey).pointBytes;
31479
31554
  }
31480
- function hashDomainToScalar(context = new Uint8Array, ...msgs) {
31555
+ function hashDomainToScalar(context = Uint8Array.of(), ...msgs) {
31481
31556
  const msg = (0, utils_ts_1.concatBytes)(...msgs);
31482
31557
  return modN_LE(cHash(domain(msg, (0, utils_ts_1.ensureBytes)("context", context), !!prehash)));
31483
31558
  }
@@ -31648,43 +31723,47 @@ var require_hash_to_curve = __commonJS((exports) => {
31648
31723
  return u;
31649
31724
  }
31650
31725
  function isogenyMap(field, map2) {
31651
- const COEFF = map2.map((i) => Array.from(i).reverse());
31726
+ const coeff = map2.map((i) => Array.from(i).reverse());
31652
31727
  return (x, y) => {
31653
- const [xNum, xDen, yNum, yDen] = COEFF.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i)));
31654
- if (field.is0(xDen) || field.is0(yDen))
31655
- throw new Error("bad point: ZERO");
31656
- x = field.div(xNum, xDen);
31657
- y = field.mul(y, field.div(yNum, yDen));
31728
+ const [xn, xd, yn, yd] = coeff.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i)));
31729
+ const [xd_inv, yd_inv] = (0, modular_ts_1.FpInvertBatch)(field, [xd, yd], true);
31730
+ x = field.mul(xn, xd_inv);
31731
+ y = field.mul(y, field.mul(yn, yd_inv));
31658
31732
  return { x, y };
31659
31733
  };
31660
31734
  }
31661
- function createHasher(Point, mapToCurve, def) {
31735
+ function createHasher(Point, mapToCurve, defaults) {
31662
31736
  if (typeof mapToCurve !== "function")
31663
31737
  throw new Error("mapToCurve() must be defined");
31738
+ function map2(num) {
31739
+ return Point.fromAffine(mapToCurve(num));
31740
+ }
31741
+ function clear(initial) {
31742
+ const P = initial.clearCofactor();
31743
+ if (P.equals(Point.ZERO))
31744
+ return Point.ZERO;
31745
+ P.assertValidity();
31746
+ return P;
31747
+ }
31664
31748
  return {
31749
+ defaults,
31665
31750
  hashToCurve(msg, options) {
31666
- const u = hash_to_field(msg, 2, { ...def, DST: def.DST, ...options });
31667
- const u0 = Point.fromAffine(mapToCurve(u[0]));
31668
- const u1 = Point.fromAffine(mapToCurve(u[1]));
31669
- const P = u0.add(u1).clearCofactor();
31670
- P.assertValidity();
31671
- return P;
31751
+ const u = hash_to_field(msg, 2, { ...defaults, DST: defaults.DST, ...options });
31752
+ const u0 = map2(u[0]);
31753
+ const u1 = map2(u[1]);
31754
+ return clear(u0.add(u1));
31672
31755
  },
31673
31756
  encodeToCurve(msg, options) {
31674
- const u = hash_to_field(msg, 1, { ...def, DST: def.encodeDST, ...options });
31675
- const P = Point.fromAffine(mapToCurve(u[0])).clearCofactor();
31676
- P.assertValidity();
31677
- return P;
31757
+ const u = hash_to_field(msg, 1, { ...defaults, DST: defaults.encodeDST, ...options });
31758
+ return clear(map2(u[0]));
31678
31759
  },
31679
31760
  mapToCurve(scalars) {
31680
31761
  if (!Array.isArray(scalars))
31681
- throw new Error("mapToCurve: expected array of bigints");
31762
+ throw new Error("expected array of bigints");
31682
31763
  for (const i of scalars)
31683
31764
  if (typeof i !== "bigint")
31684
- throw new Error("mapToCurve: expected array of bigints");
31685
- const P = Point.fromAffine(mapToCurve(scalars)).clearCofactor();
31686
- P.assertValidity();
31687
- return P;
31765
+ throw new Error("expected array of bigints");
31766
+ return clear(map2(scalars));
31688
31767
  }
31689
31768
  };
31690
31769
  }
@@ -31715,12 +31794,13 @@ var require_montgomery = __commonJS((exports) => {
31715
31794
  function montgomery(curveDef) {
31716
31795
  const CURVE = validateOpts(curveDef);
31717
31796
  const { P } = CURVE;
31797
+ const Fp = (0, modular_ts_1.Field)(P);
31718
31798
  const modP = (n) => (0, modular_ts_1.mod)(n, P);
31719
31799
  const montgomeryBits = CURVE.montgomeryBits;
31720
31800
  const montgomeryBytes = Math.ceil(montgomeryBits / 8);
31721
31801
  const fieldLen = CURVE.nByteLength;
31722
31802
  const adjustScalarBytes = CURVE.adjustScalarBytes || ((bytes) => bytes);
31723
- const powPminus2 = CURVE.powPminus2 || ((x) => (0, modular_ts_1.pow)(x, P - BigInt(2), P));
31803
+ const powPminus2 = CURVE.powPminus2 || ((x) => Fp.pow(x, P - BigInt(2)));
31724
31804
  function cswap(swap, x_2, x_3) {
31725
31805
  const dummy = modP(swap * (x_2 - x_3));
31726
31806
  x_2 = modP(x_2 - dummy);
@@ -31818,7 +31898,7 @@ var require_montgomery = __commonJS((exports) => {
31818
31898
  // ../../node_modules/eciesjs/node_modules/@noble/curves/ed25519.js
31819
31899
  var require_ed25519 = __commonJS((exports) => {
31820
31900
  Object.defineProperty(exports, "__esModule", { value: true });
31821
- exports.hash_to_ristretto255 = exports.hashToRistretto255 = exports.RistrettoPoint = exports.encodeToCurve = exports.hashToCurve = exports.edwardsToMontgomery = exports.x25519 = exports.ed25519ph = exports.ed25519ctx = exports.ed25519 = exports.ED25519_TORSION_SUBGROUP = undefined;
31901
+ 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;
31822
31902
  exports.edwardsToMontgomeryPub = edwardsToMontgomeryPub;
31823
31903
  exports.edwardsToMontgomeryPriv = edwardsToMontgomeryPriv;
31824
31904
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
@@ -32003,10 +32083,10 @@ var require_ed25519 = __commonJS((exports) => {
32003
32083
  xd = Fp.cmov(xd, Fp.ONE, e3);
32004
32084
  yn = Fp.cmov(yn, Fp.ONE, e3);
32005
32085
  yd = Fp.cmov(yd, Fp.ONE, e3);
32006
- const inv = Fp.invertBatch([xd, yd]);
32007
- return { x: Fp.mul(xn, inv[0]), y: Fp.mul(yn, inv[1]) };
32086
+ const [xd_inv, yd_inv] = (0, modular_ts_1.FpInvertBatch)(Fp, [xd, yd], true);
32087
+ return { x: Fp.mul(xn, xd_inv), y: Fp.mul(yn, yd_inv) };
32008
32088
  }
32009
- var htf = /* @__PURE__ */ (() => (0, hash_to_curve_ts_1.createHasher)(exports.ed25519.ExtendedPoint, (scalars) => map_to_curve_elligator2_edwards25519(scalars[0]), {
32089
+ exports.ed25519_hasher = (() => (0, hash_to_curve_ts_1.createHasher)(exports.ed25519.ExtendedPoint, (scalars) => map_to_curve_elligator2_edwards25519(scalars[0]), {
32010
32090
  DST: "edwards25519_XMD:SHA-512_ELL2_RO_",
32011
32091
  encodeDST: "edwards25519_XMD:SHA-512_ELL2_NU_",
32012
32092
  p: Fp.ORDER,
@@ -32015,8 +32095,8 @@ var require_ed25519 = __commonJS((exports) => {
32015
32095
  expand: "xmd",
32016
32096
  hash: sha2_1.sha512
32017
32097
  }))();
32018
- exports.hashToCurve = (() => htf.hashToCurve)();
32019
- exports.encodeToCurve = (() => htf.encodeToCurve)();
32098
+ exports.hashToCurve = (() => exports.ed25519_hasher.hashToCurve)();
32099
+ exports.encodeToCurve = (() => exports.ed25519_hasher.encodeToCurve)();
32020
32100
  function aristp(other) {
32021
32101
  if (!(other instanceof RistPoint))
32022
32102
  throw new Error("RistrettoPoint expected");
@@ -32186,7 +32266,6 @@ var require_ed25519 = __commonJS((exports) => {
32186
32266
  var require_hmac = __commonJS((exports) => {
32187
32267
  Object.defineProperty(exports, "__esModule", { value: true });
32188
32268
  exports.hmac = exports.HMAC = undefined;
32189
- var _assert_ts_1 = require__assert();
32190
32269
  var utils_ts_1 = require_utils7();
32191
32270
 
32192
32271
  class HMAC extends utils_ts_1.Hash {
@@ -32194,7 +32273,7 @@ var require_hmac = __commonJS((exports) => {
32194
32273
  super();
32195
32274
  this.finished = false;
32196
32275
  this.destroyed = false;
32197
- (0, _assert_ts_1.ahash)(hash);
32276
+ (0, utils_ts_1.ahash)(hash);
32198
32277
  const key = (0, utils_ts_1.toBytes)(_key);
32199
32278
  this.iHash = hash.create();
32200
32279
  if (typeof this.iHash.update !== "function")
@@ -32211,16 +32290,16 @@ var require_hmac = __commonJS((exports) => {
32211
32290
  for (let i = 0;i < pad.length; i++)
32212
32291
  pad[i] ^= 54 ^ 92;
32213
32292
  this.oHash.update(pad);
32214
- pad.fill(0);
32293
+ (0, utils_ts_1.clean)(pad);
32215
32294
  }
32216
32295
  update(buf) {
32217
- (0, _assert_ts_1.aexists)(this);
32296
+ (0, utils_ts_1.aexists)(this);
32218
32297
  this.iHash.update(buf);
32219
32298
  return this;
32220
32299
  }
32221
32300
  digestInto(out) {
32222
- (0, _assert_ts_1.aexists)(this);
32223
- (0, _assert_ts_1.abytes)(out, this.outputLen);
32301
+ (0, utils_ts_1.aexists)(this);
32302
+ (0, utils_ts_1.abytes)(out, this.outputLen);
32224
32303
  this.finished = true;
32225
32304
  this.iHash.digestInto(out);
32226
32305
  this.oHash.update(out);
@@ -32244,6 +32323,9 @@ var require_hmac = __commonJS((exports) => {
32244
32323
  to.iHash = iHash._cloneInto(to.iHash);
32245
32324
  return to;
32246
32325
  }
32326
+ clone() {
32327
+ return this._cloneInto();
32328
+ }
32247
32329
  destroy() {
32248
32330
  this.destroyed = true;
32249
32331
  this.oHash.destroy();
@@ -32491,7 +32573,7 @@ var require_weierstrass = __commonJS((exports) => {
32491
32573
  constructor(px, py, pz) {
32492
32574
  if (px == null || !Fp.isValid(px))
32493
32575
  throw new Error("x required");
32494
- if (py == null || !Fp.isValid(py))
32576
+ if (py == null || !Fp.isValid(py) || Fp.is0(py))
32495
32577
  throw new Error("y required");
32496
32578
  if (pz == null || !Fp.isValid(pz))
32497
32579
  throw new Error("z required");
@@ -32518,7 +32600,7 @@ var require_weierstrass = __commonJS((exports) => {
32518
32600
  return this.toAffine().y;
32519
32601
  }
32520
32602
  static normalizeZ(points) {
32521
- const toInv = Fp.invertBatch(points.map((p) => p.pz));
32603
+ const toInv = (0, modular_ts_1.FpInvertBatch)(Fp, points.map((p) => p.pz));
32522
32604
  return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);
32523
32605
  }
32524
32606
  static fromHex(hex) {
@@ -32879,7 +32961,7 @@ var require_weierstrass = __commonJS((exports) => {
32879
32961
  return (0, utils_ts_1.hexToBytes)(this.toDERHex());
32880
32962
  }
32881
32963
  toDERHex() {
32882
- return exports.DER.hexFromSig({ r: this.r, s: this.s });
32964
+ return exports.DER.hexFromSig(this);
32883
32965
  }
32884
32966
  toCompactRawBytes() {
32885
32967
  return (0, utils_ts_1.hexToBytes)(this.toCompactHex());
@@ -33154,7 +33236,8 @@ var require_weierstrass = __commonJS((exports) => {
33154
33236
  y = Fp.cmov(y, value, isValid2);
33155
33237
  const e1 = Fp.isOdd(u) === Fp.isOdd(y);
33156
33238
  y = Fp.cmov(Fp.neg(y), y, e1);
33157
- x = Fp.div(x, tv4);
33239
+ const tv4_inv = (0, modular_ts_1.FpInvertBatch)(Fp, [tv4], true)[0];
33240
+ x = Fp.mul(x, tv4_inv);
33158
33241
  return { x, y };
33159
33242
  };
33160
33243
  }
@@ -33185,7 +33268,7 @@ var require__shortw_utils = __commonJS((exports) => {
33185
33268
  // ../../node_modules/eciesjs/node_modules/@noble/curves/secp256k1.js
33186
33269
  var require_secp256k1 = __commonJS((exports) => {
33187
33270
  Object.defineProperty(exports, "__esModule", { value: true });
33188
- exports.encodeToCurve = exports.hashToCurve = exports.schnorr = exports.secp256k1 = undefined;
33271
+ exports.encodeToCurve = exports.hashToCurve = exports.secp256k1_hasher = exports.schnorr = exports.secp256k1 = undefined;
33189
33272
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
33190
33273
  var sha2_1 = require_sha2();
33191
33274
  var utils_1 = require_utils7();
@@ -33381,7 +33464,7 @@ var require_secp256k1 = __commonJS((exports) => {
33381
33464
  B: BigInt("1771"),
33382
33465
  Z: Fpk1.create(BigInt("-11"))
33383
33466
  }))();
33384
- var htf = /* @__PURE__ */ (() => (0, hash_to_curve_ts_1.createHasher)(exports.secp256k1.ProjectivePoint, (scalars) => {
33467
+ exports.secp256k1_hasher = (() => (0, hash_to_curve_ts_1.createHasher)(exports.secp256k1.ProjectivePoint, (scalars) => {
33385
33468
  const { x, y } = mapSWU(Fpk1.create(scalars[0]));
33386
33469
  return isoMap(x, y);
33387
33470
  }, {
@@ -33393,8 +33476,8 @@ var require_secp256k1 = __commonJS((exports) => {
33393
33476
  expand: "xmd",
33394
33477
  hash: sha2_1.sha256
33395
33478
  }))();
33396
- exports.hashToCurve = (() => htf.hashToCurve)();
33397
- exports.encodeToCurve = (() => htf.encodeToCurve)();
33479
+ exports.hashToCurve = (() => exports.secp256k1_hasher.hashToCurve)();
33480
+ exports.encodeToCurve = (() => exports.secp256k1_hasher.encodeToCurve)();
33398
33481
  });
33399
33482
 
33400
33483
  // ../../node_modules/eciesjs/dist/utils/hex.js
@@ -33514,45 +33597,55 @@ var require_hkdf = __commonJS((exports) => {
33514
33597
  exports.hkdf = undefined;
33515
33598
  exports.extract = extract;
33516
33599
  exports.expand = expand;
33517
- var _assert_ts_1 = require__assert();
33518
33600
  var hmac_ts_1 = require_hmac();
33519
33601
  var utils_ts_1 = require_utils7();
33520
33602
  function extract(hash, ikm, salt) {
33521
- (0, _assert_ts_1.ahash)(hash);
33603
+ (0, utils_ts_1.ahash)(hash);
33522
33604
  if (salt === undefined)
33523
33605
  salt = new Uint8Array(hash.outputLen);
33524
33606
  return (0, hmac_ts_1.hmac)(hash, (0, utils_ts_1.toBytes)(salt), (0, utils_ts_1.toBytes)(ikm));
33525
33607
  }
33526
- var HKDF_COUNTER = /* @__PURE__ */ new Uint8Array([0]);
33527
- var EMPTY_BUFFER = /* @__PURE__ */ new Uint8Array;
33608
+ var HKDF_COUNTER = /* @__PURE__ */ Uint8Array.from([0]);
33609
+ var EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of();
33528
33610
  function expand(hash, prk, info, length = 32) {
33529
- (0, _assert_ts_1.ahash)(hash);
33530
- (0, _assert_ts_1.anumber)(length);
33531
- if (length > 255 * hash.outputLen)
33611
+ (0, utils_ts_1.ahash)(hash);
33612
+ (0, utils_ts_1.anumber)(length);
33613
+ const olen = hash.outputLen;
33614
+ if (length > 255 * olen)
33532
33615
  throw new Error("Length should be <= 255*HashLen");
33533
- const blocks = Math.ceil(length / hash.outputLen);
33616
+ const blocks = Math.ceil(length / olen);
33534
33617
  if (info === undefined)
33535
33618
  info = EMPTY_BUFFER;
33536
- const okm = new Uint8Array(blocks * hash.outputLen);
33619
+ const okm = new Uint8Array(blocks * olen);
33537
33620
  const HMAC = hmac_ts_1.hmac.create(hash, prk);
33538
33621
  const HMACTmp = HMAC._cloneInto();
33539
33622
  const T = new Uint8Array(HMAC.outputLen);
33540
33623
  for (let counter = 0;counter < blocks; counter++) {
33541
33624
  HKDF_COUNTER[0] = counter + 1;
33542
33625
  HMACTmp.update(counter === 0 ? EMPTY_BUFFER : T).update(info).update(HKDF_COUNTER).digestInto(T);
33543
- okm.set(T, hash.outputLen * counter);
33626
+ okm.set(T, olen * counter);
33544
33627
  HMAC._cloneInto(HMACTmp);
33545
33628
  }
33546
33629
  HMAC.destroy();
33547
33630
  HMACTmp.destroy();
33548
- T.fill(0);
33549
- HKDF_COUNTER.fill(0);
33631
+ (0, utils_ts_1.clean)(T, HKDF_COUNTER);
33550
33632
  return okm.slice(0, length);
33551
33633
  }
33552
33634
  var hkdf = (hash, ikm, salt, info, length) => expand(hash, extract(hash, ikm, salt), info, length);
33553
33635
  exports.hkdf = hkdf;
33554
33636
  });
33555
33637
 
33638
+ // ../../node_modules/eciesjs/node_modules/@noble/hashes/sha256.js
33639
+ var require_sha256 = __commonJS((exports) => {
33640
+ Object.defineProperty(exports, "__esModule", { value: true });
33641
+ exports.sha224 = exports.SHA224 = exports.sha256 = exports.SHA256 = undefined;
33642
+ var sha2_ts_1 = require_sha2();
33643
+ exports.SHA256 = sha2_ts_1.SHA256;
33644
+ exports.sha256 = sha2_ts_1.sha256;
33645
+ exports.SHA224 = sha2_ts_1.SHA224;
33646
+ exports.sha224 = sha2_ts_1.sha224;
33647
+ });
33648
+
33556
33649
  // ../../node_modules/eciesjs/dist/utils/hash.js
33557
33650
  var require_hash = __commonJS((exports) => {
33558
33651
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -55964,11 +56057,6 @@ class McpServer {
55964
56057
  if (this._registeredTools[name]) {
55965
56058
  throw new Error(`Tool ${name} is already registered`);
55966
56059
  }
55967
- const isZodRawShape = (obj) => {
55968
- if (typeof obj !== "object" || obj === null)
55969
- return false;
55970
- return Object.values(obj).some((v) => v instanceof ZodType);
55971
- };
55972
56060
  let description;
55973
56061
  if (typeof rest[0] === "string") {
55974
56062
  description = rest.shift();
@@ -56085,6 +56173,15 @@ class McpServer {
56085
56173
  var EMPTY_OBJECT_JSON_SCHEMA = {
56086
56174
  type: "object"
56087
56175
  };
56176
+ function isZodRawShape(obj) {
56177
+ if (typeof obj !== "object" || obj === null)
56178
+ return false;
56179
+ const isEmptyObject = Object.keys(obj).length === 0;
56180
+ return isEmptyObject || Object.values(obj).some(isZodTypeLike);
56181
+ }
56182
+ function isZodTypeLike(value) {
56183
+ return value !== null && typeof value === "object" && "parse" in value && typeof value.parse === "function" && "safeParse" in value && typeof value.safeParse === "function";
56184
+ }
56088
56185
  function promptArgumentsFromSchema(schema) {
56089
56186
  return Object.entries(schema.shape).map(([name, field]) => ({
56090
56187
  name,
@@ -57493,7 +57590,7 @@ minimatch.unescape = unescape;
57493
57590
  // ../../node_modules/glob/dist/esm/glob.js
57494
57591
  import { fileURLToPath as fileURLToPath2 } from "node:url";
57495
57592
 
57496
- // ../../node_modules/lru-cache/dist/esm/index.js
57593
+ // ../../node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js
57497
57594
  var perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
57498
57595
  var warned = new Set;
57499
57596
  var PROCESS = typeof process === "object" && !!process ? process : {};
@@ -61622,7 +61719,9 @@ var DotEnvSchema = z.object({
61622
61719
  SETTLEMINT_PORTAL: UniqueNameSchema.optional(),
61623
61720
  SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema.optional(),
61624
61721
  SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema.optional(),
61722
+ SETTLEMINT_PORTAL_WS_ENDPOINT: UrlSchema.optional(),
61625
61723
  SETTLEMINT_HD_PRIVATE_KEY: UniqueNameSchema.optional(),
61724
+ SETTLEMINT_HD_PRIVATE_KEY_FORWARDER_ADDRESS: z.string().optional(),
61626
61725
  SETTLEMINT_ACCESSIBLE_PRIVATE_KEY: UniqueNameSchema.optional(),
61627
61726
  SETTLEMINT_MINIO: UniqueNameSchema.optional(),
61628
61727
  SETTLEMINT_MINIO_ENDPOINT: UrlSchema.optional(),
@@ -61730,7 +61829,9 @@ var DotEnvSchema2 = z.object({
61730
61829
  SETTLEMINT_PORTAL: UniqueNameSchema2.optional(),
61731
61830
  SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema2.optional(),
61732
61831
  SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema2.optional(),
61832
+ SETTLEMINT_PORTAL_WS_ENDPOINT: UrlSchema2.optional(),
61733
61833
  SETTLEMINT_HD_PRIVATE_KEY: UniqueNameSchema2.optional(),
61834
+ SETTLEMINT_HD_PRIVATE_KEY_FORWARDER_ADDRESS: z.string().optional(),
61734
61835
  SETTLEMINT_ACCESSIBLE_PRIVATE_KEY: UniqueNameSchema2.optional(),
61735
61836
  SETTLEMINT_MINIO: UniqueNameSchema2.optional(),
61736
61837
  SETTLEMINT_MINIO_ENDPOINT: UrlSchema2.optional(),
@@ -61773,7 +61874,7 @@ var {
61773
61874
  var package_default = {
61774
61875
  name: "@settlemint/sdk-mcp",
61775
61876
  description: "MCP interface for SettleMint SDK, providing development tools and project management capabilities",
61776
- version: "2.2.3",
61877
+ version: "2.3.0",
61777
61878
  type: "module",
61778
61879
  private: false,
61779
61880
  license: "FSL-1.1-MIT",
@@ -61814,9 +61915,9 @@ var package_default = {
61814
61915
  dependencies: {
61815
61916
  "@graphql-tools/load": "8.1.0",
61816
61917
  "@graphql-tools/url-loader": "8.0.31",
61817
- "@modelcontextprotocol/sdk": "1.11.0",
61818
- "@settlemint/sdk-js": "2.2.3",
61819
- "@settlemint/sdk-utils": "2.2.3",
61918
+ "@modelcontextprotocol/sdk": "1.11.3",
61919
+ "@settlemint/sdk-js": "2.3.0",
61920
+ "@settlemint/sdk-utils": "2.3.0",
61820
61921
  "@commander-js/extra-typings": "11.1.0",
61821
61922
  commander: "11.1.0",
61822
61923
  zod: "3.24.4"
@@ -65466,7 +65567,12 @@ var getPlatformConfigQuery = graphql(`
65466
65567
  disabled
65467
65568
  }
65468
65569
  }
65469
- preDeployedContracts
65570
+ preDeployedAbis {
65571
+ id
65572
+ featureflagged
65573
+ abis
65574
+ label
65575
+ }
65470
65576
  sdkVersion
65471
65577
  kits {
65472
65578
  id
@@ -65495,6 +65601,15 @@ var PrivateKeyFragment = graphql(`
65495
65601
  provider
65496
65602
  region
65497
65603
  address
65604
+ trustedForwarderName
65605
+ trustedForwarderAddress
65606
+ relayerKey {
65607
+ ... on PrivateKey {
65608
+ id
65609
+ name
65610
+ uniqueName
65611
+ }
65612
+ }
65498
65613
  blockchainNodes {
65499
65614
  ... on BlockchainNode {
65500
65615
  id
@@ -65530,6 +65645,9 @@ var createPrivateKey = graphql(`
65530
65645
  $size: ClusterServiceSize
65531
65646
  $type: ClusterServiceType
65532
65647
  $blockchainNodes: [ID!]
65648
+ $trustedForwarderName: String
65649
+ $trustedForwarderAddress: String
65650
+ $relayerKey: ID
65533
65651
  ) {
65534
65652
  createPrivateKey(
65535
65653
  applicationId: $applicationId
@@ -65540,6 +65658,9 @@ var createPrivateKey = graphql(`
65540
65658
  size: $size
65541
65659
  type: $type
65542
65660
  blockchainNodes: $blockchainNodes
65661
+ trustedForwarderName: $trustedForwarderName
65662
+ trustedForwarderAddress: $trustedForwarderAddress
65663
+ relayerKey: $relayerKey
65543
65664
  ) {
65544
65665
  ...PrivateKey
65545
65666
  }
@@ -65570,9 +65691,10 @@ var privatekeyRead = (gqlClient) => {
65570
65691
  };
65571
65692
  var privateKeyCreate = (gqlClient) => {
65572
65693
  return async (args) => {
65573
- const { applicationUniqueName, blockchainNodeUniqueNames, ...otherArgs } = args;
65694
+ const { applicationUniqueName, blockchainNodeUniqueNames, relayerKeyUniqueName, ...otherArgs } = args;
65574
65695
  const application = await applicationRead(gqlClient)(applicationUniqueName);
65575
65696
  const blockchainNodes = blockchainNodeUniqueNames ? await Promise.all(blockchainNodeUniqueNames.map((uniqueName) => blockchainNodeRead(gqlClient)(uniqueName))) : [];
65697
+ const relayerKey = relayerKeyUniqueName ? await privatekeyRead(gqlClient)(relayerKeyUniqueName) : undefined;
65576
65698
  const platformConfig = await getPlatformConfig(gqlClient)();
65577
65699
  const defaultProvider = platformConfig.deploymentEngineTargets.find((target) => !target.disabled && target.clusters.some((cluster) => !cluster.disabled));
65578
65700
  const defaultRegion = defaultProvider?.clusters.find((cluster) => !cluster.disabled);
@@ -65580,6 +65702,7 @@ var privateKeyCreate = (gqlClient) => {
65580
65702
  ...otherArgs,
65581
65703
  applicationId: application.id,
65582
65704
  blockchainNodes: blockchainNodes.map((node) => node?.id),
65705
+ relayerKey: relayerKey?.id,
65583
65706
  provider: defaultProvider?.id ?? "gke",
65584
65707
  region: defaultRegion?.id?.split("-")[1] ?? "europe",
65585
65708
  size: "SMALL",
@@ -67564,4 +67687,4 @@ await main().catch((error2) => {
67564
67687
  process.exit(1);
67565
67688
  });
67566
67689
 
67567
- //# debugId=CA73050E6DA5340E64756E2164756E21
67690
+ //# debugId=433800AB979D17CA64756E2164756E21