@settlemint/sdk-cli 2.2.3-main522b8411 → 2.2.3-main52fcdf28

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 +665 -501
  2. package/dist/cli.js.map +39 -41
  3. package/package.json +3 -3
package/dist/cli.js CHANGED
@@ -4158,21 +4158,54 @@ 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/_assert.js
4162
- var require__assert = __commonJS((exports) => {
4161
+ // ../../node_modules/eciesjs/node_modules/@noble/hashes/cryptoNode.js
4162
+ var require_cryptoNode2 = __commonJS((exports) => {
4163
4163
  Object.defineProperty(exports, "__esModule", { value: true });
4164
+ exports.crypto = undefined;
4165
+ var nc = __require("node:crypto");
4166
+ exports.crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && ("randomBytes" in nc) ? nc : undefined;
4167
+ });
4168
+
4169
+ // ../../node_modules/eciesjs/node_modules/@noble/hashes/utils.js
4170
+ var require_utils4 = __commonJS((exports) => {
4171
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
4172
+ Object.defineProperty(exports, "__esModule", { value: true });
4173
+ exports.wrapXOFConstructorWithOpts = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.Hash = exports.nextTick = exports.swap32IfBE = exports.byteSwapIfBE = exports.swap8IfBE = exports.isLE = undefined;
4174
+ exports.isBytes = isBytes;
4164
4175
  exports.anumber = anumber;
4165
4176
  exports.abytes = abytes;
4166
4177
  exports.ahash = ahash;
4167
4178
  exports.aexists = aexists;
4168
4179
  exports.aoutput = aoutput;
4180
+ exports.u8 = u8;
4181
+ exports.u32 = u32;
4182
+ exports.clean = clean;
4183
+ exports.createView = createView;
4184
+ exports.rotr = rotr;
4185
+ exports.rotl = rotl;
4186
+ exports.byteSwap = byteSwap;
4187
+ exports.byteSwap32 = byteSwap32;
4188
+ exports.bytesToHex = bytesToHex;
4189
+ exports.hexToBytes = hexToBytes;
4190
+ exports.asyncLoop = asyncLoop;
4191
+ exports.utf8ToBytes = utf8ToBytes;
4192
+ exports.bytesToUtf8 = bytesToUtf8;
4193
+ exports.toBytes = toBytes;
4194
+ exports.kdfInputToBytes = kdfInputToBytes;
4195
+ exports.concatBytes = concatBytes;
4196
+ exports.checkOpts = checkOpts;
4197
+ exports.createHasher = createHasher;
4198
+ exports.createOptHasher = createOptHasher;
4199
+ exports.createXOFer = createXOFer;
4200
+ exports.randomBytes = randomBytes;
4201
+ var crypto_1 = require_cryptoNode2();
4202
+ function isBytes(a) {
4203
+ return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
4204
+ }
4169
4205
  function anumber(n) {
4170
4206
  if (!Number.isSafeInteger(n) || n < 0)
4171
4207
  throw new Error("positive integer expected, got " + n);
4172
4208
  }
4173
- function isBytes(a) {
4174
- return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
4175
- }
4176
4209
  function abytes(b, ...lengths) {
4177
4210
  if (!isBytes(b))
4178
4211
  throw new Error("Uint8Array expected");
@@ -4181,7 +4214,7 @@ var require__assert = __commonJS((exports) => {
4181
4214
  }
4182
4215
  function ahash(h) {
4183
4216
  if (typeof h !== "function" || typeof h.create !== "function")
4184
- throw new Error("Hash should be wrapped by utils.wrapConstructor");
4217
+ throw new Error("Hash should be wrapped by utils.createHasher");
4185
4218
  anumber(h.outputLen);
4186
4219
  anumber(h.blockLen);
4187
4220
  }
@@ -4198,51 +4231,17 @@ var require__assert = __commonJS((exports) => {
4198
4231
  throw new Error("digestInto() expects output buffer of length at least " + min);
4199
4232
  }
4200
4233
  }
4201
- });
4202
-
4203
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/cryptoNode.js
4204
- var require_cryptoNode2 = __commonJS((exports) => {
4205
- Object.defineProperty(exports, "__esModule", { value: true });
4206
- exports.crypto = undefined;
4207
- var nc = __require("node:crypto");
4208
- exports.crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && ("randomBytes" in nc) ? nc : undefined;
4209
- });
4210
-
4211
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/utils.js
4212
- var require_utils4 = __commonJS((exports) => {
4213
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
4214
- Object.defineProperty(exports, "__esModule", { value: true });
4215
- exports.Hash = exports.nextTick = exports.byteSwapIfBE = exports.isLE = undefined;
4216
- exports.isBytes = isBytes;
4217
- exports.u8 = u8;
4218
- exports.u32 = u32;
4219
- exports.createView = createView;
4220
- exports.rotr = rotr;
4221
- exports.rotl = rotl;
4222
- exports.byteSwap = byteSwap;
4223
- exports.byteSwap32 = byteSwap32;
4224
- exports.bytesToHex = bytesToHex;
4225
- exports.hexToBytes = hexToBytes;
4226
- exports.asyncLoop = asyncLoop;
4227
- exports.utf8ToBytes = utf8ToBytes;
4228
- exports.toBytes = toBytes;
4229
- exports.concatBytes = concatBytes;
4230
- exports.checkOpts = checkOpts;
4231
- exports.wrapConstructor = wrapConstructor;
4232
- exports.wrapConstructorWithOpts = wrapConstructorWithOpts;
4233
- exports.wrapXOFConstructorWithOpts = wrapXOFConstructorWithOpts;
4234
- exports.randomBytes = randomBytes;
4235
- var crypto_1 = require_cryptoNode2();
4236
- var _assert_ts_1 = require__assert();
4237
- function isBytes(a) {
4238
- return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
4239
- }
4240
4234
  function u8(arr) {
4241
4235
  return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
4242
4236
  }
4243
4237
  function u32(arr) {
4244
4238
  return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
4245
4239
  }
4240
+ function clean(...arrays) {
4241
+ for (let i = 0;i < arrays.length; i++) {
4242
+ arrays[i].fill(0);
4243
+ }
4244
+ }
4246
4245
  function createView(arr) {
4247
4246
  return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
4248
4247
  }
@@ -4256,16 +4255,19 @@ var require_utils4 = __commonJS((exports) => {
4256
4255
  function byteSwap(word) {
4257
4256
  return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
4258
4257
  }
4259
- exports.byteSwapIfBE = exports.isLE ? (n) => n : (n) => byteSwap(n);
4258
+ exports.swap8IfBE = exports.isLE ? (n) => n : (n) => byteSwap(n);
4259
+ exports.byteSwapIfBE = exports.swap8IfBE;
4260
4260
  function byteSwap32(arr) {
4261
4261
  for (let i = 0;i < arr.length; i++) {
4262
4262
  arr[i] = byteSwap(arr[i]);
4263
4263
  }
4264
+ return arr;
4264
4265
  }
4265
- var hasHexBuiltin = typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function";
4266
+ exports.swap32IfBE = exports.isLE ? (u) => u : byteSwap32;
4267
+ var hasHexBuiltin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function")();
4266
4268
  var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
4267
4269
  function bytesToHex(bytes) {
4268
- (0, _assert_ts_1.abytes)(bytes);
4270
+ abytes(bytes);
4269
4271
  if (hasHexBuiltin)
4270
4272
  return bytes.toHex();
4271
4273
  let hex = "";
@@ -4320,20 +4322,29 @@ var require_utils4 = __commonJS((exports) => {
4320
4322
  }
4321
4323
  function utf8ToBytes(str) {
4322
4324
  if (typeof str !== "string")
4323
- throw new Error("utf8ToBytes expected string, got " + typeof str);
4325
+ throw new Error("string expected");
4324
4326
  return new Uint8Array(new TextEncoder().encode(str));
4325
4327
  }
4328
+ function bytesToUtf8(bytes) {
4329
+ return new TextDecoder().decode(bytes);
4330
+ }
4326
4331
  function toBytes(data) {
4327
4332
  if (typeof data === "string")
4328
4333
  data = utf8ToBytes(data);
4329
- (0, _assert_ts_1.abytes)(data);
4334
+ abytes(data);
4335
+ return data;
4336
+ }
4337
+ function kdfInputToBytes(data) {
4338
+ if (typeof data === "string")
4339
+ data = utf8ToBytes(data);
4340
+ abytes(data);
4330
4341
  return data;
4331
4342
  }
4332
4343
  function concatBytes(...arrays) {
4333
4344
  let sum = 0;
4334
4345
  for (let i = 0;i < arrays.length; i++) {
4335
4346
  const a = arrays[i];
4336
- (0, _assert_ts_1.abytes)(a);
4347
+ abytes(a);
4337
4348
  sum += a.length;
4338
4349
  }
4339
4350
  const res = new Uint8Array(sum);
@@ -4344,20 +4355,17 @@ var require_utils4 = __commonJS((exports) => {
4344
4355
  }
4345
4356
  return res;
4346
4357
  }
4347
-
4348
- class Hash {
4349
- clone() {
4350
- return this._cloneInto();
4351
- }
4352
- }
4353
- exports.Hash = Hash;
4354
4358
  function checkOpts(defaults, opts) {
4355
4359
  if (opts !== undefined && {}.toString.call(opts) !== "[object Object]")
4356
- throw new Error("Options should be object or undefined");
4360
+ throw new Error("options should be object or undefined");
4357
4361
  const merged = Object.assign(defaults, opts);
4358
4362
  return merged;
4359
4363
  }
4360
- function wrapConstructor(hashCons) {
4364
+
4365
+ class Hash {
4366
+ }
4367
+ exports.Hash = Hash;
4368
+ function createHasher(hashCons) {
4361
4369
  const hashC = (msg) => hashCons().update(toBytes(msg)).digest();
4362
4370
  const tmp = hashCons();
4363
4371
  hashC.outputLen = tmp.outputLen;
@@ -4365,7 +4373,7 @@ var require_utils4 = __commonJS((exports) => {
4365
4373
  hashC.create = () => hashCons();
4366
4374
  return hashC;
4367
4375
  }
4368
- function wrapConstructorWithOpts(hashCons) {
4376
+ function createOptHasher(hashCons) {
4369
4377
  const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();
4370
4378
  const tmp = hashCons({});
4371
4379
  hashC.outputLen = tmp.outputLen;
@@ -4373,7 +4381,7 @@ var require_utils4 = __commonJS((exports) => {
4373
4381
  hashC.create = (opts) => hashCons(opts);
4374
4382
  return hashC;
4375
4383
  }
4376
- function wrapXOFConstructorWithOpts(hashCons) {
4384
+ function createXOFer(hashCons) {
4377
4385
  const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();
4378
4386
  const tmp = hashCons({});
4379
4387
  hashC.outputLen = tmp.outputLen;
@@ -4381,6 +4389,9 @@ var require_utils4 = __commonJS((exports) => {
4381
4389
  hashC.create = (opts) => hashCons(opts);
4382
4390
  return hashC;
4383
4391
  }
4392
+ exports.wrapConstructor = createHasher;
4393
+ exports.wrapConstructorWithOpts = createOptHasher;
4394
+ exports.wrapXOFConstructorWithOpts = createXOFer;
4384
4395
  function randomBytes(bytesLength = 32) {
4385
4396
  if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === "function") {
4386
4397
  return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength));
@@ -4395,11 +4406,10 @@ var require_utils4 = __commonJS((exports) => {
4395
4406
  // ../../node_modules/eciesjs/node_modules/@noble/hashes/_md.js
4396
4407
  var require__md = __commonJS((exports) => {
4397
4408
  Object.defineProperty(exports, "__esModule", { value: true });
4398
- exports.HashMD = undefined;
4409
+ exports.SHA512_IV = exports.SHA384_IV = exports.SHA224_IV = exports.SHA256_IV = exports.HashMD = undefined;
4399
4410
  exports.setBigUint64 = setBigUint64;
4400
4411
  exports.Chi = Chi;
4401
4412
  exports.Maj = Maj;
4402
- var _assert_ts_1 = require__assert();
4403
4413
  var utils_ts_1 = require_utils4();
4404
4414
  function setBigUint64(view, byteOffset, value, isLE) {
4405
4415
  if (typeof view.setBigUint64 === "function")
@@ -4435,9 +4445,10 @@ var require__md = __commonJS((exports) => {
4435
4445
  this.view = (0, utils_ts_1.createView)(this.buffer);
4436
4446
  }
4437
4447
  update(data) {
4438
- (0, _assert_ts_1.aexists)(this);
4439
- const { view, buffer, blockLen } = this;
4448
+ (0, utils_ts_1.aexists)(this);
4440
4449
  data = (0, utils_ts_1.toBytes)(data);
4450
+ (0, utils_ts_1.abytes)(data);
4451
+ const { view, buffer, blockLen } = this;
4441
4452
  const len = data.length;
4442
4453
  for (let pos = 0;pos < len; ) {
4443
4454
  const take = Math.min(blockLen - this.pos, len - pos);
@@ -4460,13 +4471,13 @@ var require__md = __commonJS((exports) => {
4460
4471
  return this;
4461
4472
  }
4462
4473
  digestInto(out) {
4463
- (0, _assert_ts_1.aexists)(this);
4464
- (0, _assert_ts_1.aoutput)(out, this);
4474
+ (0, utils_ts_1.aexists)(this);
4475
+ (0, utils_ts_1.aoutput)(out, this);
4465
4476
  this.finished = true;
4466
4477
  const { buffer, view, blockLen, isLE } = this;
4467
4478
  let { pos } = this;
4468
4479
  buffer[pos++] = 128;
4469
- this.buffer.subarray(pos).fill(0);
4480
+ (0, utils_ts_1.clean)(this.buffer.subarray(pos));
4470
4481
  if (this.padOffset > blockLen - pos) {
4471
4482
  this.process(view, 0);
4472
4483
  pos = 0;
@@ -4497,25 +4508,178 @@ var require__md = __commonJS((exports) => {
4497
4508
  to || (to = new this.constructor);
4498
4509
  to.set(...this.get());
4499
4510
  const { blockLen, buffer, length, finished, destroyed, pos } = this;
4511
+ to.destroyed = destroyed;
4512
+ to.finished = finished;
4500
4513
  to.length = length;
4501
4514
  to.pos = pos;
4502
- to.finished = finished;
4503
- to.destroyed = destroyed;
4504
4515
  if (length % blockLen)
4505
4516
  to.buffer.set(buffer);
4506
4517
  return to;
4507
4518
  }
4519
+ clone() {
4520
+ return this._cloneInto();
4521
+ }
4508
4522
  }
4509
4523
  exports.HashMD = HashMD;
4524
+ exports.SHA256_IV = Uint32Array.from([
4525
+ 1779033703,
4526
+ 3144134277,
4527
+ 1013904242,
4528
+ 2773480762,
4529
+ 1359893119,
4530
+ 2600822924,
4531
+ 528734635,
4532
+ 1541459225
4533
+ ]);
4534
+ exports.SHA224_IV = Uint32Array.from([
4535
+ 3238371032,
4536
+ 914150663,
4537
+ 812702999,
4538
+ 4144912697,
4539
+ 4290775857,
4540
+ 1750603025,
4541
+ 1694076839,
4542
+ 3204075428
4543
+ ]);
4544
+ exports.SHA384_IV = Uint32Array.from([
4545
+ 3418070365,
4546
+ 3238371032,
4547
+ 1654270250,
4548
+ 914150663,
4549
+ 2438529370,
4550
+ 812702999,
4551
+ 355462360,
4552
+ 4144912697,
4553
+ 1731405415,
4554
+ 4290775857,
4555
+ 2394180231,
4556
+ 1750603025,
4557
+ 3675008525,
4558
+ 1694076839,
4559
+ 1203062813,
4560
+ 3204075428
4561
+ ]);
4562
+ exports.SHA512_IV = Uint32Array.from([
4563
+ 1779033703,
4564
+ 4089235720,
4565
+ 3144134277,
4566
+ 2227873595,
4567
+ 1013904242,
4568
+ 4271175723,
4569
+ 2773480762,
4570
+ 1595750129,
4571
+ 1359893119,
4572
+ 2917565137,
4573
+ 2600822924,
4574
+ 725511199,
4575
+ 528734635,
4576
+ 4215389547,
4577
+ 1541459225,
4578
+ 327033209
4579
+ ]);
4510
4580
  });
4511
4581
 
4512
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/sha256.js
4513
- var require_sha256 = __commonJS((exports) => {
4582
+ // ../../node_modules/eciesjs/node_modules/@noble/hashes/_u64.js
4583
+ var require__u64 = __commonJS((exports) => {
4584
+ Object.defineProperty(exports, "__esModule", { value: true });
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;
4586
+ exports.add = add;
4587
+ exports.fromBig = fromBig;
4588
+ exports.split = split;
4589
+ var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
4590
+ var _32n = /* @__PURE__ */ BigInt(32);
4591
+ function fromBig(n, le = false) {
4592
+ if (le)
4593
+ return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
4594
+ return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
4595
+ }
4596
+ function split(lst, le = false) {
4597
+ const len = lst.length;
4598
+ let Ah = new Uint32Array(len);
4599
+ let Al = new Uint32Array(len);
4600
+ for (let i = 0;i < len; i++) {
4601
+ const { h, l } = fromBig(lst[i], le);
4602
+ [Ah[i], Al[i]] = [h, l];
4603
+ }
4604
+ return [Ah, Al];
4605
+ }
4606
+ var toBig = (h, l) => BigInt(h >>> 0) << _32n | BigInt(l >>> 0);
4607
+ exports.toBig = toBig;
4608
+ var shrSH = (h, _l, s) => h >>> s;
4609
+ exports.shrSH = shrSH;
4610
+ var shrSL = (h, l, s) => h << 32 - s | l >>> s;
4611
+ exports.shrSL = shrSL;
4612
+ var rotrSH = (h, l, s) => h >>> s | l << 32 - s;
4613
+ exports.rotrSH = rotrSH;
4614
+ var rotrSL = (h, l, s) => h << 32 - s | l >>> s;
4615
+ exports.rotrSL = rotrSL;
4616
+ var rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32;
4617
+ exports.rotrBH = rotrBH;
4618
+ var rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s;
4619
+ exports.rotrBL = rotrBL;
4620
+ var rotr32H = (_h, l) => l;
4621
+ exports.rotr32H = rotr32H;
4622
+ var rotr32L = (h, _l) => h;
4623
+ exports.rotr32L = rotr32L;
4624
+ var rotlSH = (h, l, s) => h << s | l >>> 32 - s;
4625
+ exports.rotlSH = rotlSH;
4626
+ var rotlSL = (h, l, s) => l << s | h >>> 32 - s;
4627
+ exports.rotlSL = rotlSL;
4628
+ var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s;
4629
+ exports.rotlBH = rotlBH;
4630
+ var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
4631
+ exports.rotlBL = rotlBL;
4632
+ function add(Ah, Al, Bh, Bl) {
4633
+ const l = (Al >>> 0) + (Bl >>> 0);
4634
+ return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 };
4635
+ }
4636
+ var add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
4637
+ exports.add3L = add3L;
4638
+ var add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0;
4639
+ exports.add3H = add3H;
4640
+ var add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
4641
+ exports.add4L = add4L;
4642
+ var add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0;
4643
+ exports.add4H = add4H;
4644
+ var add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
4645
+ exports.add5L = add5L;
4646
+ var add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0;
4647
+ exports.add5H = add5H;
4648
+ var u64 = {
4649
+ fromBig,
4650
+ split,
4651
+ toBig,
4652
+ shrSH,
4653
+ shrSL,
4654
+ rotrSH,
4655
+ rotrSL,
4656
+ rotrBH,
4657
+ rotrBL,
4658
+ rotr32H,
4659
+ rotr32L,
4660
+ rotlSH,
4661
+ rotlSL,
4662
+ rotlBH,
4663
+ rotlBL,
4664
+ add,
4665
+ add3L,
4666
+ add3H,
4667
+ add4L,
4668
+ add4H,
4669
+ add5H,
4670
+ add5L
4671
+ };
4672
+ exports.default = u64;
4673
+ });
4674
+
4675
+ // ../../node_modules/eciesjs/node_modules/@noble/hashes/sha2.js
4676
+ var require_sha2 = __commonJS((exports) => {
4514
4677
  Object.defineProperty(exports, "__esModule", { value: true });
4515
- exports.sha224 = exports.sha256 = exports.SHA256 = undefined;
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;
4516
4679
  var _md_ts_1 = require__md();
4680
+ var u64 = require__u64();
4517
4681
  var utils_ts_1 = require_utils4();
4518
- var SHA256_K = /* @__PURE__ */ new Uint32Array([
4682
+ var SHA256_K = /* @__PURE__ */ Uint32Array.from([
4519
4683
  1116352408,
4520
4684
  1899447441,
4521
4685
  3049323471,
@@ -4581,29 +4745,19 @@ var require_sha256 = __commonJS((exports) => {
4581
4745
  3204031479,
4582
4746
  3329325298
4583
4747
  ]);
4584
- var SHA256_IV = /* @__PURE__ */ new Uint32Array([
4585
- 1779033703,
4586
- 3144134277,
4587
- 1013904242,
4588
- 2773480762,
4589
- 1359893119,
4590
- 2600822924,
4591
- 528734635,
4592
- 1541459225
4593
- ]);
4594
4748
  var SHA256_W = /* @__PURE__ */ new Uint32Array(64);
4595
4749
 
4596
4750
  class SHA256 extends _md_ts_1.HashMD {
4597
4751
  constructor(outputLen = 32) {
4598
4752
  super(64, outputLen, 8, false);
4599
- this.A = SHA256_IV[0] | 0;
4600
- this.B = SHA256_IV[1] | 0;
4601
- this.C = SHA256_IV[2] | 0;
4602
- this.D = SHA256_IV[3] | 0;
4603
- this.E = SHA256_IV[4] | 0;
4604
- this.F = SHA256_IV[5] | 0;
4605
- this.G = SHA256_IV[6] | 0;
4606
- this.H = SHA256_IV[7] | 0;
4753
+ this.A = _md_ts_1.SHA256_IV[0] | 0;
4754
+ this.B = _md_ts_1.SHA256_IV[1] | 0;
4755
+ this.C = _md_ts_1.SHA256_IV[2] | 0;
4756
+ this.D = _md_ts_1.SHA256_IV[3] | 0;
4757
+ this.E = _md_ts_1.SHA256_IV[4] | 0;
4758
+ this.F = _md_ts_1.SHA256_IV[5] | 0;
4759
+ this.G = _md_ts_1.SHA256_IV[6] | 0;
4760
+ this.H = _md_ts_1.SHA256_IV[7] | 0;
4607
4761
  }
4608
4762
  get() {
4609
4763
  const { A, B, C, D, E, F, G, H } = this;
@@ -4655,11 +4809,11 @@ var require_sha256 = __commonJS((exports) => {
4655
4809
  this.set(A, B, C, D, E, F, G, H);
4656
4810
  }
4657
4811
  roundClean() {
4658
- SHA256_W.fill(0);
4812
+ (0, utils_ts_1.clean)(SHA256_W);
4659
4813
  }
4660
4814
  destroy() {
4661
4815
  this.set(0, 0, 0, 0, 0, 0, 0, 0);
4662
- this.buffer.fill(0);
4816
+ (0, utils_ts_1.clean)(this.buffer);
4663
4817
  }
4664
4818
  }
4665
4819
  exports.SHA256 = SHA256;
@@ -4667,120 +4821,18 @@ var require_sha256 = __commonJS((exports) => {
4667
4821
  class SHA224 extends SHA256 {
4668
4822
  constructor() {
4669
4823
  super(28);
4670
- this.A = 3238371032 | 0;
4671
- this.B = 914150663 | 0;
4672
- this.C = 812702999 | 0;
4673
- this.D = 4144912697 | 0;
4674
- this.E = 4290775857 | 0;
4675
- this.F = 1750603025 | 0;
4676
- this.G = 1694076839 | 0;
4677
- this.H = 3204075428 | 0;
4678
- }
4679
- }
4680
- exports.sha256 = (0, utils_ts_1.wrapConstructor)(() => new SHA256);
4681
- exports.sha224 = (0, utils_ts_1.wrapConstructor)(() => new SHA224);
4682
- });
4683
-
4684
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/_u64.js
4685
- var require__u64 = __commonJS((exports) => {
4686
- Object.defineProperty(exports, "__esModule", { value: true });
4687
- 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;
4688
- exports.fromBig = fromBig;
4689
- exports.split = split;
4690
- exports.add = add;
4691
- var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
4692
- var _32n = /* @__PURE__ */ BigInt(32);
4693
- function fromBig(n, le = false) {
4694
- if (le)
4695
- return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
4696
- return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
4697
- }
4698
- function split(lst, le = false) {
4699
- let Ah = new Uint32Array(lst.length);
4700
- let Al = new Uint32Array(lst.length);
4701
- for (let i = 0;i < lst.length; i++) {
4702
- const { h, l } = fromBig(lst[i], le);
4703
- [Ah[i], Al[i]] = [h, l];
4704
- }
4705
- return [Ah, Al];
4706
- }
4707
- var toBig = (h, l) => BigInt(h >>> 0) << _32n | BigInt(l >>> 0);
4708
- exports.toBig = toBig;
4709
- var shrSH = (h, _l, s) => h >>> s;
4710
- exports.shrSH = shrSH;
4711
- var shrSL = (h, l, s) => h << 32 - s | l >>> s;
4712
- exports.shrSL = shrSL;
4713
- var rotrSH = (h, l, s) => h >>> s | l << 32 - s;
4714
- exports.rotrSH = rotrSH;
4715
- var rotrSL = (h, l, s) => h << 32 - s | l >>> s;
4716
- exports.rotrSL = rotrSL;
4717
- var rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32;
4718
- exports.rotrBH = rotrBH;
4719
- var rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s;
4720
- exports.rotrBL = rotrBL;
4721
- var rotr32H = (_h, l) => l;
4722
- exports.rotr32H = rotr32H;
4723
- var rotr32L = (h, _l) => h;
4724
- exports.rotr32L = rotr32L;
4725
- var rotlSH = (h, l, s) => h << s | l >>> 32 - s;
4726
- exports.rotlSH = rotlSH;
4727
- var rotlSL = (h, l, s) => l << s | h >>> 32 - s;
4728
- exports.rotlSL = rotlSL;
4729
- var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s;
4730
- exports.rotlBH = rotlBH;
4731
- var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
4732
- exports.rotlBL = rotlBL;
4733
- function add(Ah, Al, Bh, Bl) {
4734
- const l = (Al >>> 0) + (Bl >>> 0);
4735
- return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 };
4736
- }
4737
- var add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
4738
- exports.add3L = add3L;
4739
- var add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0;
4740
- exports.add3H = add3H;
4741
- var add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
4742
- exports.add4L = add4L;
4743
- var add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0;
4744
- exports.add4H = add4H;
4745
- var add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
4746
- exports.add5L = add5L;
4747
- var add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0;
4748
- exports.add5H = add5H;
4749
- var u64 = {
4750
- fromBig,
4751
- split,
4752
- toBig,
4753
- shrSH,
4754
- shrSL,
4755
- rotrSH,
4756
- rotrSL,
4757
- rotrBH,
4758
- rotrBL,
4759
- rotr32H,
4760
- rotr32L,
4761
- rotlSH,
4762
- rotlSL,
4763
- rotlBH,
4764
- rotlBL,
4765
- add,
4766
- add3L,
4767
- add3H,
4768
- add4L,
4769
- add4H,
4770
- add5H,
4771
- add5L
4772
- };
4773
- exports.default = u64;
4774
- });
4775
-
4776
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/sha512.js
4777
- var require_sha512 = __commonJS((exports) => {
4778
- Object.defineProperty(exports, "__esModule", { value: true });
4779
- exports.sha384 = exports.sha512_256 = exports.sha512_224 = exports.sha512 = exports.SHA384 = exports.SHA512_256 = exports.SHA512_224 = exports.SHA512 = undefined;
4780
- var _md_ts_1 = require__md();
4781
- var _u64_ts_1 = require__u64();
4782
- var utils_ts_1 = require_utils4();
4783
- var [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => _u64_ts_1.default.split([
4824
+ this.A = _md_ts_1.SHA224_IV[0] | 0;
4825
+ this.B = _md_ts_1.SHA224_IV[1] | 0;
4826
+ this.C = _md_ts_1.SHA224_IV[2] | 0;
4827
+ this.D = _md_ts_1.SHA224_IV[3] | 0;
4828
+ this.E = _md_ts_1.SHA224_IV[4] | 0;
4829
+ this.F = _md_ts_1.SHA224_IV[5] | 0;
4830
+ this.G = _md_ts_1.SHA224_IV[6] | 0;
4831
+ this.H = _md_ts_1.SHA224_IV[7] | 0;
4832
+ }
4833
+ }
4834
+ exports.SHA224 = SHA224;
4835
+ var K512 = /* @__PURE__ */ (() => u64.split([
4784
4836
  "0x428a2f98d728ae22",
4785
4837
  "0x7137449123ef65cd",
4786
4838
  "0xb5c0fbcfec4d3b2f",
@@ -4862,28 +4914,30 @@ var require_sha512 = __commonJS((exports) => {
4862
4914
  "0x5fcb6fab3ad6faec",
4863
4915
  "0x6c44198c4a475817"
4864
4916
  ].map((n) => BigInt(n))))();
4917
+ var SHA512_Kh = /* @__PURE__ */ (() => K512[0])();
4918
+ var SHA512_Kl = /* @__PURE__ */ (() => K512[1])();
4865
4919
  var SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);
4866
4920
  var SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);
4867
4921
 
4868
4922
  class SHA512 extends _md_ts_1.HashMD {
4869
4923
  constructor(outputLen = 64) {
4870
4924
  super(128, outputLen, 16, false);
4871
- this.Ah = 1779033703 | 0;
4872
- this.Al = 4089235720 | 0;
4873
- this.Bh = 3144134277 | 0;
4874
- this.Bl = 2227873595 | 0;
4875
- this.Ch = 1013904242 | 0;
4876
- this.Cl = 4271175723 | 0;
4877
- this.Dh = 2773480762 | 0;
4878
- this.Dl = 1595750129 | 0;
4879
- this.Eh = 1359893119 | 0;
4880
- this.El = 2917565137 | 0;
4881
- this.Fh = 2600822924 | 0;
4882
- this.Fl = 725511199 | 0;
4883
- this.Gh = 528734635 | 0;
4884
- this.Gl = 4215389547 | 0;
4885
- this.Hh = 1541459225 | 0;
4886
- this.Hl = 327033209 | 0;
4925
+ this.Ah = _md_ts_1.SHA512_IV[0] | 0;
4926
+ this.Al = _md_ts_1.SHA512_IV[1] | 0;
4927
+ this.Bh = _md_ts_1.SHA512_IV[2] | 0;
4928
+ this.Bl = _md_ts_1.SHA512_IV[3] | 0;
4929
+ this.Ch = _md_ts_1.SHA512_IV[4] | 0;
4930
+ this.Cl = _md_ts_1.SHA512_IV[5] | 0;
4931
+ this.Dh = _md_ts_1.SHA512_IV[6] | 0;
4932
+ this.Dl = _md_ts_1.SHA512_IV[7] | 0;
4933
+ this.Eh = _md_ts_1.SHA512_IV[8] | 0;
4934
+ this.El = _md_ts_1.SHA512_IV[9] | 0;
4935
+ this.Fh = _md_ts_1.SHA512_IV[10] | 0;
4936
+ this.Fl = _md_ts_1.SHA512_IV[11] | 0;
4937
+ this.Gh = _md_ts_1.SHA512_IV[12] | 0;
4938
+ this.Gl = _md_ts_1.SHA512_IV[13] | 0;
4939
+ this.Hh = _md_ts_1.SHA512_IV[14] | 0;
4940
+ this.Hl = _md_ts_1.SHA512_IV[15] | 0;
4887
4941
  }
4888
4942
  get() {
4889
4943
  const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
@@ -4915,28 +4969,28 @@ var require_sha512 = __commonJS((exports) => {
4915
4969
  for (let i = 16;i < 80; i++) {
4916
4970
  const W15h = SHA512_W_H[i - 15] | 0;
4917
4971
  const W15l = SHA512_W_L[i - 15] | 0;
4918
- 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);
4919
- 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);
4972
+ const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);
4973
+ const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);
4920
4974
  const W2h = SHA512_W_H[i - 2] | 0;
4921
4975
  const W2l = SHA512_W_L[i - 2] | 0;
4922
- 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);
4923
- 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);
4924
- const SUMl = _u64_ts_1.default.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);
4925
- const SUMh = _u64_ts_1.default.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);
4976
+ const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);
4977
+ const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);
4978
+ const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);
4979
+ const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);
4926
4980
  SHA512_W_H[i] = SUMh | 0;
4927
4981
  SHA512_W_L[i] = SUMl | 0;
4928
4982
  }
4929
4983
  let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
4930
4984
  for (let i = 0;i < 80; i++) {
4931
- 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);
4932
- 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);
4985
+ const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);
4986
+ const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);
4933
4987
  const CHIh = Eh & Fh ^ ~Eh & Gh;
4934
4988
  const CHIl = El & Fl ^ ~El & Gl;
4935
- const T1ll = _u64_ts_1.default.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);
4936
- const T1h = _u64_ts_1.default.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);
4989
+ const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);
4990
+ const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);
4937
4991
  const T1l = T1ll | 0;
4938
- 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);
4939
- 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);
4992
+ const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);
4993
+ const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);
4940
4994
  const MAJh = Ah & Bh ^ Ah & Ch ^ Bh & Ch;
4941
4995
  const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl;
4942
4996
  Hh = Gh | 0;
@@ -4945,57 +4999,115 @@ var require_sha512 = __commonJS((exports) => {
4945
4999
  Gl = Fl | 0;
4946
5000
  Fh = Eh | 0;
4947
5001
  Fl = El | 0;
4948
- ({ h: Eh, l: El } = _u64_ts_1.default.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));
5002
+ ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));
4949
5003
  Dh = Ch | 0;
4950
5004
  Dl = Cl | 0;
4951
5005
  Ch = Bh | 0;
4952
5006
  Cl = Bl | 0;
4953
5007
  Bh = Ah | 0;
4954
5008
  Bl = Al | 0;
4955
- const All = _u64_ts_1.default.add3L(T1l, sigma0l, MAJl);
4956
- Ah = _u64_ts_1.default.add3H(All, T1h, sigma0h, MAJh);
5009
+ const All = u64.add3L(T1l, sigma0l, MAJl);
5010
+ Ah = u64.add3H(All, T1h, sigma0h, MAJh);
4957
5011
  Al = All | 0;
4958
5012
  }
4959
- ({ h: Ah, l: Al } = _u64_ts_1.default.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));
4960
- ({ h: Bh, l: Bl } = _u64_ts_1.default.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));
4961
- ({ h: Ch, l: Cl } = _u64_ts_1.default.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));
4962
- ({ h: Dh, l: Dl } = _u64_ts_1.default.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));
4963
- ({ h: Eh, l: El } = _u64_ts_1.default.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));
4964
- ({ h: Fh, l: Fl } = _u64_ts_1.default.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));
4965
- ({ h: Gh, l: Gl } = _u64_ts_1.default.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));
4966
- ({ h: Hh, l: Hl } = _u64_ts_1.default.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));
5013
+ ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));
5014
+ ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));
5015
+ ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));
5016
+ ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));
5017
+ ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));
5018
+ ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));
5019
+ ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));
5020
+ ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));
4967
5021
  this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);
4968
5022
  }
4969
5023
  roundClean() {
4970
- SHA512_W_H.fill(0);
4971
- SHA512_W_L.fill(0);
5024
+ (0, utils_ts_1.clean)(SHA512_W_H, SHA512_W_L);
4972
5025
  }
4973
5026
  destroy() {
4974
- this.buffer.fill(0);
5027
+ (0, utils_ts_1.clean)(this.buffer);
4975
5028
  this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
4976
5029
  }
4977
5030
  }
4978
5031
  exports.SHA512 = SHA512;
4979
5032
 
5033
+ class SHA384 extends SHA512 {
5034
+ constructor() {
5035
+ super(48);
5036
+ this.Ah = _md_ts_1.SHA384_IV[0] | 0;
5037
+ this.Al = _md_ts_1.SHA384_IV[1] | 0;
5038
+ this.Bh = _md_ts_1.SHA384_IV[2] | 0;
5039
+ this.Bl = _md_ts_1.SHA384_IV[3] | 0;
5040
+ this.Ch = _md_ts_1.SHA384_IV[4] | 0;
5041
+ this.Cl = _md_ts_1.SHA384_IV[5] | 0;
5042
+ this.Dh = _md_ts_1.SHA384_IV[6] | 0;
5043
+ this.Dl = _md_ts_1.SHA384_IV[7] | 0;
5044
+ this.Eh = _md_ts_1.SHA384_IV[8] | 0;
5045
+ this.El = _md_ts_1.SHA384_IV[9] | 0;
5046
+ this.Fh = _md_ts_1.SHA384_IV[10] | 0;
5047
+ this.Fl = _md_ts_1.SHA384_IV[11] | 0;
5048
+ this.Gh = _md_ts_1.SHA384_IV[12] | 0;
5049
+ this.Gl = _md_ts_1.SHA384_IV[13] | 0;
5050
+ this.Hh = _md_ts_1.SHA384_IV[14] | 0;
5051
+ this.Hl = _md_ts_1.SHA384_IV[15] | 0;
5052
+ }
5053
+ }
5054
+ exports.SHA384 = SHA384;
5055
+ var T224_IV = /* @__PURE__ */ Uint32Array.from([
5056
+ 2352822216,
5057
+ 424955298,
5058
+ 1944164710,
5059
+ 2312950998,
5060
+ 502970286,
5061
+ 855612546,
5062
+ 1738396948,
5063
+ 1479516111,
5064
+ 258812777,
5065
+ 2077511080,
5066
+ 2011393907,
5067
+ 79989058,
5068
+ 1067287976,
5069
+ 1780299464,
5070
+ 286451373,
5071
+ 2446758561
5072
+ ]);
5073
+ var T256_IV = /* @__PURE__ */ Uint32Array.from([
5074
+ 573645204,
5075
+ 4230739756,
5076
+ 2673172387,
5077
+ 3360449730,
5078
+ 596883563,
5079
+ 1867755857,
5080
+ 2520282905,
5081
+ 1497426621,
5082
+ 2519219938,
5083
+ 2827943907,
5084
+ 3193839141,
5085
+ 1401305490,
5086
+ 721525244,
5087
+ 746961066,
5088
+ 246885852,
5089
+ 2177182882
5090
+ ]);
5091
+
4980
5092
  class SHA512_224 extends SHA512 {
4981
5093
  constructor() {
4982
5094
  super(28);
4983
- this.Ah = 2352822216 | 0;
4984
- this.Al = 424955298 | 0;
4985
- this.Bh = 1944164710 | 0;
4986
- this.Bl = 2312950998 | 0;
4987
- this.Ch = 502970286 | 0;
4988
- this.Cl = 855612546 | 0;
4989
- this.Dh = 1738396948 | 0;
4990
- this.Dl = 1479516111 | 0;
4991
- this.Eh = 258812777 | 0;
4992
- this.El = 2077511080 | 0;
4993
- this.Fh = 2011393907 | 0;
4994
- this.Fl = 79989058 | 0;
4995
- this.Gh = 1067287976 | 0;
4996
- this.Gl = 1780299464 | 0;
4997
- this.Hh = 286451373 | 0;
4998
- this.Hl = 2446758561 | 0;
5095
+ this.Ah = T224_IV[0] | 0;
5096
+ this.Al = T224_IV[1] | 0;
5097
+ this.Bh = T224_IV[2] | 0;
5098
+ this.Bl = T224_IV[3] | 0;
5099
+ this.Ch = T224_IV[4] | 0;
5100
+ this.Cl = T224_IV[5] | 0;
5101
+ this.Dh = T224_IV[6] | 0;
5102
+ this.Dl = T224_IV[7] | 0;
5103
+ this.Eh = T224_IV[8] | 0;
5104
+ this.El = T224_IV[9] | 0;
5105
+ this.Fh = T224_IV[10] | 0;
5106
+ this.Fl = T224_IV[11] | 0;
5107
+ this.Gh = T224_IV[12] | 0;
5108
+ this.Gl = T224_IV[13] | 0;
5109
+ this.Hh = T224_IV[14] | 0;
5110
+ this.Hl = T224_IV[15] | 0;
4999
5111
  }
5000
5112
  }
5001
5113
  exports.SHA512_224 = SHA512_224;
@@ -5003,78 +5115,31 @@ var require_sha512 = __commonJS((exports) => {
5003
5115
  class SHA512_256 extends SHA512 {
5004
5116
  constructor() {
5005
5117
  super(32);
5006
- this.Ah = 573645204 | 0;
5007
- this.Al = 4230739756 | 0;
5008
- this.Bh = 2673172387 | 0;
5009
- this.Bl = 3360449730 | 0;
5010
- this.Ch = 596883563 | 0;
5011
- this.Cl = 1867755857 | 0;
5012
- this.Dh = 2520282905 | 0;
5013
- this.Dl = 1497426621 | 0;
5014
- this.Eh = 2519219938 | 0;
5015
- this.El = 2827943907 | 0;
5016
- this.Fh = 3193839141 | 0;
5017
- this.Fl = 1401305490 | 0;
5018
- this.Gh = 721525244 | 0;
5019
- this.Gl = 746961066 | 0;
5020
- this.Hh = 246885852 | 0;
5021
- this.Hl = 2177182882 | 0;
5118
+ this.Ah = T256_IV[0] | 0;
5119
+ this.Al = T256_IV[1] | 0;
5120
+ this.Bh = T256_IV[2] | 0;
5121
+ this.Bl = T256_IV[3] | 0;
5122
+ this.Ch = T256_IV[4] | 0;
5123
+ this.Cl = T256_IV[5] | 0;
5124
+ this.Dh = T256_IV[6] | 0;
5125
+ this.Dl = T256_IV[7] | 0;
5126
+ this.Eh = T256_IV[8] | 0;
5127
+ this.El = T256_IV[9] | 0;
5128
+ this.Fh = T256_IV[10] | 0;
5129
+ this.Fl = T256_IV[11] | 0;
5130
+ this.Gh = T256_IV[12] | 0;
5131
+ this.Gl = T256_IV[13] | 0;
5132
+ this.Hh = T256_IV[14] | 0;
5133
+ this.Hl = T256_IV[15] | 0;
5022
5134
  }
5023
5135
  }
5024
5136
  exports.SHA512_256 = SHA512_256;
5025
-
5026
- class SHA384 extends SHA512 {
5027
- constructor() {
5028
- super(48);
5029
- this.Ah = 3418070365 | 0;
5030
- this.Al = 3238371032 | 0;
5031
- this.Bh = 1654270250 | 0;
5032
- this.Bl = 914150663 | 0;
5033
- this.Ch = 2438529370 | 0;
5034
- this.Cl = 812702999 | 0;
5035
- this.Dh = 355462360 | 0;
5036
- this.Dl = 4144912697 | 0;
5037
- this.Eh = 1731405415 | 0;
5038
- this.El = 4290775857 | 0;
5039
- this.Fh = 2394180231 | 0;
5040
- this.Fl = 1750603025 | 0;
5041
- this.Gh = 3675008525 | 0;
5042
- this.Gl = 1694076839 | 0;
5043
- this.Hh = 1203062813 | 0;
5044
- this.Hl = 3204075428 | 0;
5045
- }
5046
- }
5047
- exports.SHA384 = SHA384;
5048
- exports.sha512 = (0, utils_ts_1.wrapConstructor)(() => new SHA512);
5049
- exports.sha512_224 = (0, utils_ts_1.wrapConstructor)(() => new SHA512_224);
5050
- exports.sha512_256 = (0, utils_ts_1.wrapConstructor)(() => new SHA512_256);
5051
- exports.sha384 = (0, utils_ts_1.wrapConstructor)(() => new SHA384);
5052
- });
5053
-
5054
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/sha2.js
5055
- var require_sha2 = __commonJS((exports) => {
5056
- Object.defineProperty(exports, "__esModule", { value: true });
5057
- exports.sha512_256 = exports.sha512_224 = exports.sha512 = exports.sha384 = exports.sha256 = exports.sha224 = undefined;
5058
- var sha256_ts_1 = require_sha256();
5059
- Object.defineProperty(exports, "sha224", { enumerable: true, get: function() {
5060
- return sha256_ts_1.sha224;
5061
- } });
5062
- Object.defineProperty(exports, "sha256", { enumerable: true, get: function() {
5063
- return sha256_ts_1.sha256;
5064
- } });
5065
- var sha512_ts_1 = require_sha512();
5066
- Object.defineProperty(exports, "sha384", { enumerable: true, get: function() {
5067
- return sha512_ts_1.sha384;
5068
- } });
5069
- Object.defineProperty(exports, "sha512", { enumerable: true, get: function() {
5070
- return sha512_ts_1.sha512;
5071
- } });
5072
- Object.defineProperty(exports, "sha512_224", { enumerable: true, get: function() {
5073
- return sha512_ts_1.sha512_224;
5074
- } });
5075
- Object.defineProperty(exports, "sha512_256", { enumerable: true, get: function() {
5076
- return sha512_ts_1.sha512_256;
5077
- } });
5137
+ exports.sha256 = (0, utils_ts_1.createHasher)(() => new SHA256);
5138
+ exports.sha224 = (0, utils_ts_1.createHasher)(() => new SHA224);
5139
+ exports.sha512 = (0, utils_ts_1.createHasher)(() => new SHA512);
5140
+ exports.sha384 = (0, utils_ts_1.createHasher)(() => new SHA384);
5141
+ exports.sha512_256 = (0, utils_ts_1.createHasher)(() => new SHA512_256);
5142
+ exports.sha512_224 = (0, utils_ts_1.createHasher)(() => new SHA512_224);
5078
5143
  });
5079
5144
 
5080
5145
  // ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/utils.js
@@ -5376,6 +5441,7 @@ var require_modular = __commonJS((exports) => {
5376
5441
  exports.getMinHashLength = getMinHashLength;
5377
5442
  exports.mapHashToField = mapHashToField;
5378
5443
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
5444
+ var utils_1 = require_utils4();
5379
5445
  var utils_ts_1 = require_utils5();
5380
5446
  var _0n = BigInt(0);
5381
5447
  var _1n = BigInt(1);
@@ -5435,13 +5501,17 @@ var require_modular = __commonJS((exports) => {
5435
5501
  return mod(x, modulo);
5436
5502
  }
5437
5503
  function tonelliShanks(P) {
5438
- const legendreC = (P - _1n) / _2n;
5439
- let Q, S, Z;
5440
- for (Q = P - _1n, S = 0;Q % _2n === _0n; Q /= _2n, S++)
5441
- ;
5442
- for (Z = _2n;Z < P && pow(Z, legendreC, P) !== P - _1n; Z++) {
5443
- if (Z > 1000)
5444
- throw new Error("Cannot find square root: likely non-prime P");
5504
+ let Q = P - _1n;
5505
+ let S = 0;
5506
+ while (Q % _2n === _0n) {
5507
+ Q /= _2n;
5508
+ S++;
5509
+ }
5510
+ let Z = _2n;
5511
+ const _Fp = Field(P);
5512
+ while (Z < P && FpIsSquare(_Fp, Z)) {
5513
+ if (Z++ > 1000)
5514
+ throw new Error("Cannot find square root: probably non-prime P");
5445
5515
  }
5446
5516
  if (S === 1) {
5447
5517
  const p1div4 = (P + _1n) / _4n;
@@ -5454,7 +5524,7 @@ var require_modular = __commonJS((exports) => {
5454
5524
  }
5455
5525
  const Q1div2 = (Q + _1n) / _2n;
5456
5526
  return function tonelliSlow(Fp, n) {
5457
- if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE))
5527
+ if (!FpIsSquare(Fp, n))
5458
5528
  throw new Error("Cannot find square root");
5459
5529
  let r = S;
5460
5530
  let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q);
@@ -5480,8 +5550,8 @@ var require_modular = __commonJS((exports) => {
5480
5550
  }
5481
5551
  function FpSqrt(P) {
5482
5552
  if (P % _4n === _3n) {
5483
- const p1div4 = (P + _1n) / _4n;
5484
5553
  return function sqrt3mod4(Fp, n) {
5554
+ const p1div4 = (P + _1n) / _4n;
5485
5555
  const root = Fp.pow(n, p1div4);
5486
5556
  if (!Fp.eql(Fp.sqr(root), n))
5487
5557
  throw new Error("Cannot find square root");
@@ -5489,9 +5559,9 @@ var require_modular = __commonJS((exports) => {
5489
5559
  };
5490
5560
  }
5491
5561
  if (P % _8n === _5n) {
5492
- const c1 = (P - _5n) / _8n;
5493
5562
  return function sqrt5mod8(Fp, n) {
5494
5563
  const n2 = Fp.mul(n, _2n);
5564
+ const c1 = (P - _5n) / _8n;
5495
5565
  const v = Fp.pow(n2, c1);
5496
5566
  const nv = Fp.mul(n, v);
5497
5567
  const i = Fp.mul(Fp.mul(nv, _2n), v);
@@ -5538,55 +5608,60 @@ var require_modular = __commonJS((exports) => {
5538
5608
  }, initial);
5539
5609
  return (0, utils_ts_1.validateObject)(field, opts);
5540
5610
  }
5541
- function FpPow(f, num, power) {
5611
+ function FpPow(Fp, num, power) {
5542
5612
  if (power < _0n)
5543
5613
  throw new Error("invalid exponent, negatives unsupported");
5544
5614
  if (power === _0n)
5545
- return f.ONE;
5615
+ return Fp.ONE;
5546
5616
  if (power === _1n)
5547
5617
  return num;
5548
- let p = f.ONE;
5618
+ let p = Fp.ONE;
5549
5619
  let d = num;
5550
5620
  while (power > _0n) {
5551
5621
  if (power & _1n)
5552
- p = f.mul(p, d);
5553
- d = f.sqr(d);
5622
+ p = Fp.mul(p, d);
5623
+ d = Fp.sqr(d);
5554
5624
  power >>= _1n;
5555
5625
  }
5556
5626
  return p;
5557
5627
  }
5558
- function FpInvertBatch(f, nums) {
5559
- const tmp = new Array(nums.length);
5560
- const lastMultiplied = nums.reduce((acc, num, i) => {
5561
- if (f.is0(num))
5628
+ function FpInvertBatch(Fp, nums, passZero = false) {
5629
+ const inverted = new Array(nums.length).fill(passZero ? Fp.ZERO : undefined);
5630
+ const multipliedAcc = nums.reduce((acc, num, i) => {
5631
+ if (Fp.is0(num))
5562
5632
  return acc;
5563
- tmp[i] = acc;
5564
- return f.mul(acc, num);
5565
- }, f.ONE);
5566
- const inverted = f.inv(lastMultiplied);
5633
+ inverted[i] = acc;
5634
+ return Fp.mul(acc, num);
5635
+ }, Fp.ONE);
5636
+ const invertedAcc = Fp.inv(multipliedAcc);
5567
5637
  nums.reduceRight((acc, num, i) => {
5568
- if (f.is0(num))
5638
+ if (Fp.is0(num))
5569
5639
  return acc;
5570
- tmp[i] = f.mul(acc, tmp[i]);
5571
- return f.mul(acc, num);
5572
- }, inverted);
5573
- return tmp;
5574
- }
5575
- function FpDiv(f, lhs, rhs) {
5576
- return f.mul(lhs, typeof rhs === "bigint" ? invert(rhs, f.ORDER) : f.inv(rhs));
5577
- }
5578
- function FpLegendre(order) {
5579
- const legendreConst = (order - _1n) / _2n;
5580
- return (f, x) => f.pow(x, legendreConst);
5581
- }
5582
- function FpIsSquare(f) {
5583
- const legendre = FpLegendre(f.ORDER);
5584
- return (x) => {
5585
- const p = legendre(f, x);
5586
- return f.eql(p, f.ZERO) || f.eql(p, f.ONE);
5587
- };
5640
+ inverted[i] = Fp.mul(acc, inverted[i]);
5641
+ return Fp.mul(acc, num);
5642
+ }, invertedAcc);
5643
+ return inverted;
5644
+ }
5645
+ function FpDiv(Fp, lhs, rhs) {
5646
+ return Fp.mul(lhs, typeof rhs === "bigint" ? invert(rhs, Fp.ORDER) : Fp.inv(rhs));
5647
+ }
5648
+ function FpLegendre(Fp, n) {
5649
+ const legc = (Fp.ORDER - _1n) / _2n;
5650
+ const powered = Fp.pow(n, legc);
5651
+ const yes = Fp.eql(powered, Fp.ONE);
5652
+ const zero = Fp.eql(powered, Fp.ZERO);
5653
+ const no = Fp.eql(powered, Fp.neg(Fp.ONE));
5654
+ if (!yes && !zero && !no)
5655
+ throw new Error("Cannot find square root: probably non-prime P");
5656
+ return yes ? 1 : zero ? 0 : -1;
5657
+ }
5658
+ function FpIsSquare(Fp, n) {
5659
+ const l = FpLegendre(Fp, n);
5660
+ return l === 0 || l === 1;
5588
5661
  }
5589
5662
  function nLength(n, nBitLength) {
5663
+ if (nBitLength !== undefined)
5664
+ (0, utils_1.anumber)(nBitLength);
5590
5665
  const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length;
5591
5666
  const nByteLength = Math.ceil(_nBitLength / 8);
5592
5667
  return { nBitLength: _nBitLength, nByteLength };
@@ -5632,14 +5707,14 @@ var require_modular = __commonJS((exports) => {
5632
5707
  sqrtP = FpSqrt(ORDER);
5633
5708
  return sqrtP(f, n);
5634
5709
  }),
5635
- invertBatch: (lst) => FpInvertBatch(f, lst),
5636
- cmov: (a, b, c) => c ? b : a,
5637
5710
  toBytes: (num) => isLE ? (0, utils_ts_1.numberToBytesLE)(num, BYTES) : (0, utils_ts_1.numberToBytesBE)(num, BYTES),
5638
5711
  fromBytes: (bytes) => {
5639
5712
  if (bytes.length !== BYTES)
5640
5713
  throw new Error("Field.fromBytes: expected " + BYTES + " bytes, got " + bytes.length);
5641
5714
  return isLE ? (0, utils_ts_1.bytesToNumberLE)(bytes) : (0, utils_ts_1.bytesToNumberBE)(bytes);
5642
- }
5715
+ },
5716
+ invertBatch: (lst) => FpInvertBatch(f, lst),
5717
+ cmov: (a, b, c) => c ? b : a
5643
5718
  });
5644
5719
  return Object.freeze(f);
5645
5720
  }
@@ -6045,7 +6120,7 @@ var require_edwards = __commonJS((exports) => {
6045
6120
  return new Point(x, y, _1n, modP(x * y));
6046
6121
  }
6047
6122
  static normalizeZ(points) {
6048
- const toInv = Fp.invertBatch(points.map((p) => p.ez));
6123
+ const toInv = (0, modular_ts_1.FpInvertBatch)(Fp, points.map((p) => p.ez));
6049
6124
  return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);
6050
6125
  }
6051
6126
  static msm(points, scalars) {
@@ -6213,7 +6288,7 @@ var require_edwards = __commonJS((exports) => {
6213
6288
  function getPublicKey(privKey) {
6214
6289
  return getExtendedPublicKey(privKey).pointBytes;
6215
6290
  }
6216
- function hashDomainToScalar(context = new Uint8Array, ...msgs) {
6291
+ function hashDomainToScalar(context = Uint8Array.of(), ...msgs) {
6217
6292
  const msg = (0, utils_ts_1.concatBytes)(...msgs);
6218
6293
  return modN_LE(cHash(domain(msg, (0, utils_ts_1.ensureBytes)("context", context), !!prehash)));
6219
6294
  }
@@ -6384,43 +6459,47 @@ var require_hash_to_curve = __commonJS((exports) => {
6384
6459
  return u;
6385
6460
  }
6386
6461
  function isogenyMap(field, map) {
6387
- const COEFF = map.map((i) => Array.from(i).reverse());
6462
+ const coeff = map.map((i) => Array.from(i).reverse());
6388
6463
  return (x, y) => {
6389
- const [xNum, xDen, yNum, yDen] = COEFF.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i)));
6390
- if (field.is0(xDen) || field.is0(yDen))
6391
- throw new Error("bad point: ZERO");
6392
- x = field.div(xNum, xDen);
6393
- y = field.mul(y, field.div(yNum, yDen));
6464
+ const [xn, xd, yn, yd] = coeff.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i)));
6465
+ const [xd_inv, yd_inv] = (0, modular_ts_1.FpInvertBatch)(field, [xd, yd], true);
6466
+ x = field.mul(xn, xd_inv);
6467
+ y = field.mul(y, field.mul(yn, yd_inv));
6394
6468
  return { x, y };
6395
6469
  };
6396
6470
  }
6397
- function createHasher(Point, mapToCurve, def) {
6471
+ function createHasher(Point, mapToCurve, defaults) {
6398
6472
  if (typeof mapToCurve !== "function")
6399
6473
  throw new Error("mapToCurve() must be defined");
6474
+ function map(num) {
6475
+ return Point.fromAffine(mapToCurve(num));
6476
+ }
6477
+ function clear(initial) {
6478
+ const P = initial.clearCofactor();
6479
+ if (P.equals(Point.ZERO))
6480
+ return Point.ZERO;
6481
+ P.assertValidity();
6482
+ return P;
6483
+ }
6400
6484
  return {
6485
+ defaults,
6401
6486
  hashToCurve(msg, options) {
6402
- const u = hash_to_field(msg, 2, { ...def, DST: def.DST, ...options });
6403
- const u0 = Point.fromAffine(mapToCurve(u[0]));
6404
- const u1 = Point.fromAffine(mapToCurve(u[1]));
6405
- const P = u0.add(u1).clearCofactor();
6406
- P.assertValidity();
6407
- return P;
6487
+ const u = hash_to_field(msg, 2, { ...defaults, DST: defaults.DST, ...options });
6488
+ const u0 = map(u[0]);
6489
+ const u1 = map(u[1]);
6490
+ return clear(u0.add(u1));
6408
6491
  },
6409
6492
  encodeToCurve(msg, options) {
6410
- const u = hash_to_field(msg, 1, { ...def, DST: def.encodeDST, ...options });
6411
- const P = Point.fromAffine(mapToCurve(u[0])).clearCofactor();
6412
- P.assertValidity();
6413
- return P;
6493
+ const u = hash_to_field(msg, 1, { ...defaults, DST: defaults.encodeDST, ...options });
6494
+ return clear(map(u[0]));
6414
6495
  },
6415
6496
  mapToCurve(scalars) {
6416
6497
  if (!Array.isArray(scalars))
6417
- throw new Error("mapToCurve: expected array of bigints");
6498
+ throw new Error("expected array of bigints");
6418
6499
  for (const i of scalars)
6419
6500
  if (typeof i !== "bigint")
6420
- throw new Error("mapToCurve: expected array of bigints");
6421
- const P = Point.fromAffine(mapToCurve(scalars)).clearCofactor();
6422
- P.assertValidity();
6423
- return P;
6501
+ throw new Error("expected array of bigints");
6502
+ return clear(map(scalars));
6424
6503
  }
6425
6504
  };
6426
6505
  }
@@ -6451,12 +6530,13 @@ var require_montgomery = __commonJS((exports) => {
6451
6530
  function montgomery(curveDef) {
6452
6531
  const CURVE = validateOpts(curveDef);
6453
6532
  const { P } = CURVE;
6533
+ const Fp = (0, modular_ts_1.Field)(P);
6454
6534
  const modP = (n) => (0, modular_ts_1.mod)(n, P);
6455
6535
  const montgomeryBits = CURVE.montgomeryBits;
6456
6536
  const montgomeryBytes = Math.ceil(montgomeryBits / 8);
6457
6537
  const fieldLen = CURVE.nByteLength;
6458
6538
  const adjustScalarBytes = CURVE.adjustScalarBytes || ((bytes) => bytes);
6459
- const powPminus2 = CURVE.powPminus2 || ((x) => (0, modular_ts_1.pow)(x, P - BigInt(2), P));
6539
+ const powPminus2 = CURVE.powPminus2 || ((x) => Fp.pow(x, P - BigInt(2)));
6460
6540
  function cswap(swap, x_2, x_3) {
6461
6541
  const dummy = modP(swap * (x_2 - x_3));
6462
6542
  x_2 = modP(x_2 - dummy);
@@ -6554,7 +6634,7 @@ var require_montgomery = __commonJS((exports) => {
6554
6634
  // ../../node_modules/eciesjs/node_modules/@noble/curves/ed25519.js
6555
6635
  var require_ed25519 = __commonJS((exports) => {
6556
6636
  Object.defineProperty(exports, "__esModule", { value: true });
6557
- 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;
6637
+ 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;
6558
6638
  exports.edwardsToMontgomeryPub = edwardsToMontgomeryPub;
6559
6639
  exports.edwardsToMontgomeryPriv = edwardsToMontgomeryPriv;
6560
6640
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
@@ -6739,10 +6819,10 @@ var require_ed25519 = __commonJS((exports) => {
6739
6819
  xd = Fp.cmov(xd, Fp.ONE, e);
6740
6820
  yn = Fp.cmov(yn, Fp.ONE, e);
6741
6821
  yd = Fp.cmov(yd, Fp.ONE, e);
6742
- const inv = Fp.invertBatch([xd, yd]);
6743
- return { x: Fp.mul(xn, inv[0]), y: Fp.mul(yn, inv[1]) };
6822
+ const [xd_inv, yd_inv] = (0, modular_ts_1.FpInvertBatch)(Fp, [xd, yd], true);
6823
+ return { x: Fp.mul(xn, xd_inv), y: Fp.mul(yn, yd_inv) };
6744
6824
  }
6745
- var htf = /* @__PURE__ */ (() => (0, hash_to_curve_ts_1.createHasher)(exports.ed25519.ExtendedPoint, (scalars) => map_to_curve_elligator2_edwards25519(scalars[0]), {
6825
+ exports.ed25519_hasher = (() => (0, hash_to_curve_ts_1.createHasher)(exports.ed25519.ExtendedPoint, (scalars) => map_to_curve_elligator2_edwards25519(scalars[0]), {
6746
6826
  DST: "edwards25519_XMD:SHA-512_ELL2_RO_",
6747
6827
  encodeDST: "edwards25519_XMD:SHA-512_ELL2_NU_",
6748
6828
  p: Fp.ORDER,
@@ -6751,8 +6831,8 @@ var require_ed25519 = __commonJS((exports) => {
6751
6831
  expand: "xmd",
6752
6832
  hash: sha2_1.sha512
6753
6833
  }))();
6754
- exports.hashToCurve = (() => htf.hashToCurve)();
6755
- exports.encodeToCurve = (() => htf.encodeToCurve)();
6834
+ exports.hashToCurve = (() => exports.ed25519_hasher.hashToCurve)();
6835
+ exports.encodeToCurve = (() => exports.ed25519_hasher.encodeToCurve)();
6756
6836
  function aristp(other) {
6757
6837
  if (!(other instanceof RistPoint))
6758
6838
  throw new Error("RistrettoPoint expected");
@@ -6922,7 +7002,6 @@ var require_ed25519 = __commonJS((exports) => {
6922
7002
  var require_hmac = __commonJS((exports) => {
6923
7003
  Object.defineProperty(exports, "__esModule", { value: true });
6924
7004
  exports.hmac = exports.HMAC = undefined;
6925
- var _assert_ts_1 = require__assert();
6926
7005
  var utils_ts_1 = require_utils4();
6927
7006
 
6928
7007
  class HMAC extends utils_ts_1.Hash {
@@ -6930,7 +7009,7 @@ var require_hmac = __commonJS((exports) => {
6930
7009
  super();
6931
7010
  this.finished = false;
6932
7011
  this.destroyed = false;
6933
- (0, _assert_ts_1.ahash)(hash);
7012
+ (0, utils_ts_1.ahash)(hash);
6934
7013
  const key = (0, utils_ts_1.toBytes)(_key);
6935
7014
  this.iHash = hash.create();
6936
7015
  if (typeof this.iHash.update !== "function")
@@ -6947,16 +7026,16 @@ var require_hmac = __commonJS((exports) => {
6947
7026
  for (let i = 0;i < pad.length; i++)
6948
7027
  pad[i] ^= 54 ^ 92;
6949
7028
  this.oHash.update(pad);
6950
- pad.fill(0);
7029
+ (0, utils_ts_1.clean)(pad);
6951
7030
  }
6952
7031
  update(buf) {
6953
- (0, _assert_ts_1.aexists)(this);
7032
+ (0, utils_ts_1.aexists)(this);
6954
7033
  this.iHash.update(buf);
6955
7034
  return this;
6956
7035
  }
6957
7036
  digestInto(out) {
6958
- (0, _assert_ts_1.aexists)(this);
6959
- (0, _assert_ts_1.abytes)(out, this.outputLen);
7037
+ (0, utils_ts_1.aexists)(this);
7038
+ (0, utils_ts_1.abytes)(out, this.outputLen);
6960
7039
  this.finished = true;
6961
7040
  this.iHash.digestInto(out);
6962
7041
  this.oHash.update(out);
@@ -6980,6 +7059,9 @@ var require_hmac = __commonJS((exports) => {
6980
7059
  to.iHash = iHash._cloneInto(to.iHash);
6981
7060
  return to;
6982
7061
  }
7062
+ clone() {
7063
+ return this._cloneInto();
7064
+ }
6983
7065
  destroy() {
6984
7066
  this.destroyed = true;
6985
7067
  this.oHash.destroy();
@@ -7227,7 +7309,7 @@ var require_weierstrass = __commonJS((exports) => {
7227
7309
  constructor(px, py, pz) {
7228
7310
  if (px == null || !Fp.isValid(px))
7229
7311
  throw new Error("x required");
7230
- if (py == null || !Fp.isValid(py))
7312
+ if (py == null || !Fp.isValid(py) || Fp.is0(py))
7231
7313
  throw new Error("y required");
7232
7314
  if (pz == null || !Fp.isValid(pz))
7233
7315
  throw new Error("z required");
@@ -7254,7 +7336,7 @@ var require_weierstrass = __commonJS((exports) => {
7254
7336
  return this.toAffine().y;
7255
7337
  }
7256
7338
  static normalizeZ(points) {
7257
- const toInv = Fp.invertBatch(points.map((p) => p.pz));
7339
+ const toInv = (0, modular_ts_1.FpInvertBatch)(Fp, points.map((p) => p.pz));
7258
7340
  return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);
7259
7341
  }
7260
7342
  static fromHex(hex) {
@@ -7615,7 +7697,7 @@ var require_weierstrass = __commonJS((exports) => {
7615
7697
  return (0, utils_ts_1.hexToBytes)(this.toDERHex());
7616
7698
  }
7617
7699
  toDERHex() {
7618
- return exports.DER.hexFromSig({ r: this.r, s: this.s });
7700
+ return exports.DER.hexFromSig(this);
7619
7701
  }
7620
7702
  toCompactRawBytes() {
7621
7703
  return (0, utils_ts_1.hexToBytes)(this.toCompactHex());
@@ -7890,7 +7972,8 @@ var require_weierstrass = __commonJS((exports) => {
7890
7972
  y = Fp.cmov(y, value, isValid2);
7891
7973
  const e1 = Fp.isOdd(u) === Fp.isOdd(y);
7892
7974
  y = Fp.cmov(Fp.neg(y), y, e1);
7893
- x = Fp.div(x, tv4);
7975
+ const tv4_inv = (0, modular_ts_1.FpInvertBatch)(Fp, [tv4], true)[0];
7976
+ x = Fp.mul(x, tv4_inv);
7894
7977
  return { x, y };
7895
7978
  };
7896
7979
  }
@@ -7921,7 +8004,7 @@ var require__shortw_utils = __commonJS((exports) => {
7921
8004
  // ../../node_modules/eciesjs/node_modules/@noble/curves/secp256k1.js
7922
8005
  var require_secp256k1 = __commonJS((exports) => {
7923
8006
  Object.defineProperty(exports, "__esModule", { value: true });
7924
- exports.encodeToCurve = exports.hashToCurve = exports.schnorr = exports.secp256k1 = undefined;
8007
+ exports.encodeToCurve = exports.hashToCurve = exports.secp256k1_hasher = exports.schnorr = exports.secp256k1 = undefined;
7925
8008
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
7926
8009
  var sha2_1 = require_sha2();
7927
8010
  var utils_1 = require_utils4();
@@ -8117,7 +8200,7 @@ var require_secp256k1 = __commonJS((exports) => {
8117
8200
  B: BigInt("1771"),
8118
8201
  Z: Fpk1.create(BigInt("-11"))
8119
8202
  }))();
8120
- var htf = /* @__PURE__ */ (() => (0, hash_to_curve_ts_1.createHasher)(exports.secp256k1.ProjectivePoint, (scalars) => {
8203
+ exports.secp256k1_hasher = (() => (0, hash_to_curve_ts_1.createHasher)(exports.secp256k1.ProjectivePoint, (scalars) => {
8121
8204
  const { x, y } = mapSWU(Fpk1.create(scalars[0]));
8122
8205
  return isoMap(x, y);
8123
8206
  }, {
@@ -8129,8 +8212,8 @@ var require_secp256k1 = __commonJS((exports) => {
8129
8212
  expand: "xmd",
8130
8213
  hash: sha2_1.sha256
8131
8214
  }))();
8132
- exports.hashToCurve = (() => htf.hashToCurve)();
8133
- exports.encodeToCurve = (() => htf.encodeToCurve)();
8215
+ exports.hashToCurve = (() => exports.secp256k1_hasher.hashToCurve)();
8216
+ exports.encodeToCurve = (() => exports.secp256k1_hasher.encodeToCurve)();
8134
8217
  });
8135
8218
 
8136
8219
  // ../../node_modules/eciesjs/dist/utils/hex.js
@@ -8250,45 +8333,55 @@ var require_hkdf = __commonJS((exports) => {
8250
8333
  exports.hkdf = undefined;
8251
8334
  exports.extract = extract;
8252
8335
  exports.expand = expand;
8253
- var _assert_ts_1 = require__assert();
8254
8336
  var hmac_ts_1 = require_hmac();
8255
8337
  var utils_ts_1 = require_utils4();
8256
8338
  function extract(hash, ikm, salt) {
8257
- (0, _assert_ts_1.ahash)(hash);
8339
+ (0, utils_ts_1.ahash)(hash);
8258
8340
  if (salt === undefined)
8259
8341
  salt = new Uint8Array(hash.outputLen);
8260
8342
  return (0, hmac_ts_1.hmac)(hash, (0, utils_ts_1.toBytes)(salt), (0, utils_ts_1.toBytes)(ikm));
8261
8343
  }
8262
- var HKDF_COUNTER = /* @__PURE__ */ new Uint8Array([0]);
8263
- var EMPTY_BUFFER = /* @__PURE__ */ new Uint8Array;
8344
+ var HKDF_COUNTER = /* @__PURE__ */ Uint8Array.from([0]);
8345
+ var EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of();
8264
8346
  function expand(hash, prk, info, length = 32) {
8265
- (0, _assert_ts_1.ahash)(hash);
8266
- (0, _assert_ts_1.anumber)(length);
8267
- if (length > 255 * hash.outputLen)
8347
+ (0, utils_ts_1.ahash)(hash);
8348
+ (0, utils_ts_1.anumber)(length);
8349
+ const olen = hash.outputLen;
8350
+ if (length > 255 * olen)
8268
8351
  throw new Error("Length should be <= 255*HashLen");
8269
- const blocks = Math.ceil(length / hash.outputLen);
8352
+ const blocks = Math.ceil(length / olen);
8270
8353
  if (info === undefined)
8271
8354
  info = EMPTY_BUFFER;
8272
- const okm = new Uint8Array(blocks * hash.outputLen);
8355
+ const okm = new Uint8Array(blocks * olen);
8273
8356
  const HMAC = hmac_ts_1.hmac.create(hash, prk);
8274
8357
  const HMACTmp = HMAC._cloneInto();
8275
8358
  const T = new Uint8Array(HMAC.outputLen);
8276
8359
  for (let counter = 0;counter < blocks; counter++) {
8277
8360
  HKDF_COUNTER[0] = counter + 1;
8278
8361
  HMACTmp.update(counter === 0 ? EMPTY_BUFFER : T).update(info).update(HKDF_COUNTER).digestInto(T);
8279
- okm.set(T, hash.outputLen * counter);
8362
+ okm.set(T, olen * counter);
8280
8363
  HMAC._cloneInto(HMACTmp);
8281
8364
  }
8282
8365
  HMAC.destroy();
8283
8366
  HMACTmp.destroy();
8284
- T.fill(0);
8285
- HKDF_COUNTER.fill(0);
8367
+ (0, utils_ts_1.clean)(T, HKDF_COUNTER);
8286
8368
  return okm.slice(0, length);
8287
8369
  }
8288
8370
  var hkdf = (hash, ikm, salt, info, length) => expand(hash, extract(hash, ikm, salt), info, length);
8289
8371
  exports.hkdf = hkdf;
8290
8372
  });
8291
8373
 
8374
+ // ../../node_modules/eciesjs/node_modules/@noble/hashes/sha256.js
8375
+ var require_sha256 = __commonJS((exports) => {
8376
+ Object.defineProperty(exports, "__esModule", { value: true });
8377
+ exports.sha224 = exports.SHA224 = exports.sha256 = exports.SHA256 = undefined;
8378
+ var sha2_ts_1 = require_sha2();
8379
+ exports.SHA256 = sha2_ts_1.SHA256;
8380
+ exports.sha256 = sha2_ts_1.sha256;
8381
+ exports.SHA224 = sha2_ts_1.SHA224;
8382
+ exports.sha224 = sha2_ts_1.sha224;
8383
+ });
8384
+
8292
8385
  // ../../node_modules/eciesjs/dist/utils/hash.js
8293
8386
  var require_hash = __commonJS((exports) => {
8294
8387
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -254885,7 +254978,9 @@ var DotEnvSchema = z.object({
254885
254978
  SETTLEMINT_PORTAL: UniqueNameSchema.optional(),
254886
254979
  SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema.optional(),
254887
254980
  SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema.optional(),
254981
+ SETTLEMINT_PORTAL_WS_ENDPOINT: UrlSchema.optional(),
254888
254982
  SETTLEMINT_HD_PRIVATE_KEY: UniqueNameSchema.optional(),
254983
+ SETTLEMINT_HD_PRIVATE_KEY_FORWARDER_ADDRESS: z.string().optional(),
254889
254984
  SETTLEMINT_ACCESSIBLE_PRIVATE_KEY: UniqueNameSchema.optional(),
254890
254985
  SETTLEMINT_MINIO: UniqueNameSchema.optional(),
254891
254986
  SETTLEMINT_MINIO_ENDPOINT: UrlSchema.optional(),
@@ -255026,7 +255121,8 @@ async function writeEnv({
255026
255121
  if (!currentEnv) {
255027
255122
  currentEnv = {};
255028
255123
  }
255029
- const mergedEnv = deepmerge(pruneCurrentEnv(currentEnv, env2), env2);
255124
+ const prunedEnv = pruneCurrentEnv(currentEnv, env2);
255125
+ const mergedEnv = deepmerge(prunedEnv, env2);
255030
255126
  await writeFile(envFile, stringify(mergedEnv));
255031
255127
  }));
255032
255128
  }
@@ -255067,7 +255163,7 @@ function pruneCurrentEnv(currentEnv, env2) {
255067
255163
  var package_default = {
255068
255164
  name: "@settlemint/sdk-cli",
255069
255165
  description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
255070
- version: "2.2.3-main522b8411",
255166
+ version: "2.2.3-main52fcdf28",
255071
255167
  type: "module",
255072
255168
  private: false,
255073
255169
  license: "FSL-1.1-MIT",
@@ -255116,8 +255212,8 @@ var package_default = {
255116
255212
  "@inquirer/input": "4.1.10",
255117
255213
  "@inquirer/password": "4.0.13",
255118
255214
  "@inquirer/select": "4.2.1",
255119
- "@settlemint/sdk-js": "2.2.3-main522b8411",
255120
- "@settlemint/sdk-utils": "2.2.3-main522b8411",
255215
+ "@settlemint/sdk-js": "2.2.3-main52fcdf28",
255216
+ "@settlemint/sdk-utils": "2.2.3-main52fcdf28",
255121
255217
  "@types/node": "22.15.18",
255122
255218
  "@types/semver": "7.7.0",
255123
255219
  "@types/which": "3.0.4",
@@ -256576,7 +256672,9 @@ var DotEnvSchema2 = z.object({
256576
256672
  SETTLEMINT_PORTAL: UniqueNameSchema2.optional(),
256577
256673
  SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema2.optional(),
256578
256674
  SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema2.optional(),
256675
+ SETTLEMINT_PORTAL_WS_ENDPOINT: UrlSchema2.optional(),
256579
256676
  SETTLEMINT_HD_PRIVATE_KEY: UniqueNameSchema2.optional(),
256677
+ SETTLEMINT_HD_PRIVATE_KEY_FORWARDER_ADDRESS: z.string().optional(),
256580
256678
  SETTLEMINT_ACCESSIBLE_PRIVATE_KEY: UniqueNameSchema2.optional(),
256581
256679
  SETTLEMINT_MINIO: UniqueNameSchema2.optional(),
256582
256680
  SETTLEMINT_MINIO_ENDPOINT: UrlSchema2.optional(),
@@ -258583,6 +258681,15 @@ var PrivateKeyFragment = graphql(`
258583
258681
  provider
258584
258682
  region
258585
258683
  address
258684
+ trustedForwarderName
258685
+ trustedForwarderAddress
258686
+ relayerKey {
258687
+ ... on PrivateKey {
258688
+ id
258689
+ name
258690
+ uniqueName
258691
+ }
258692
+ }
258586
258693
  blockchainNodes {
258587
258694
  ... on BlockchainNode {
258588
258695
  id
@@ -258618,6 +258725,9 @@ var createPrivateKey = graphql(`
258618
258725
  $size: ClusterServiceSize
258619
258726
  $type: ClusterServiceType
258620
258727
  $blockchainNodes: [ID!]
258728
+ $trustedForwarderName: String
258729
+ $trustedForwarderAddress: String
258730
+ $relayerKey: ID
258621
258731
  ) {
258622
258732
  createPrivateKey(
258623
258733
  applicationId: $applicationId
@@ -258628,6 +258738,9 @@ var createPrivateKey = graphql(`
258628
258738
  size: $size
258629
258739
  type: $type
258630
258740
  blockchainNodes: $blockchainNodes
258741
+ trustedForwarderName: $trustedForwarderName
258742
+ trustedForwarderAddress: $trustedForwarderAddress
258743
+ relayerKey: $relayerKey
258631
258744
  ) {
258632
258745
  ...PrivateKey
258633
258746
  }
@@ -258658,9 +258771,10 @@ var privatekeyRead = (gqlClient) => {
258658
258771
  };
258659
258772
  var privateKeyCreate = (gqlClient) => {
258660
258773
  return async (args) => {
258661
- const { applicationUniqueName, blockchainNodeUniqueNames, ...otherArgs } = args;
258774
+ const { applicationUniqueName, blockchainNodeUniqueNames, relayerKeyUniqueName, ...otherArgs } = args;
258662
258775
  const application = await applicationRead(gqlClient)(applicationUniqueName);
258663
258776
  const blockchainNodes = blockchainNodeUniqueNames ? await Promise.all(blockchainNodeUniqueNames.map((uniqueName) => blockchainNodeRead(gqlClient)(uniqueName))) : [];
258777
+ const relayerKey = relayerKeyUniqueName ? await privatekeyRead(gqlClient)(relayerKeyUniqueName) : undefined;
258664
258778
  const platformConfig = await getPlatformConfig(gqlClient)();
258665
258779
  const defaultProvider = platformConfig.deploymentEngineTargets.find((target) => !target.disabled && target.clusters.some((cluster) => !cluster.disabled));
258666
258780
  const defaultRegion = defaultProvider?.clusters.find((cluster) => !cluster.disabled);
@@ -258668,6 +258782,7 @@ var privateKeyCreate = (gqlClient) => {
258668
258782
  ...otherArgs,
258669
258783
  applicationId: application.id,
258670
258784
  blockchainNodes: blockchainNodes.map((node) => node?.id),
258785
+ relayerKey: relayerKey?.id,
258671
258786
  provider: defaultProvider?.id ?? "gke",
258672
258787
  region: defaultRegion?.id?.split("-")[1] ?? "europe",
258673
258788
  size: "SMALL",
@@ -262799,7 +262914,9 @@ async function writeEnvSpinner(prod, env2) {
262799
262914
  SETTLEMINT_PORTAL: env2.SETTLEMINT_PORTAL,
262800
262915
  SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: env2.SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT,
262801
262916
  SETTLEMINT_PORTAL_REST_ENDPOINT: env2.SETTLEMINT_PORTAL_REST_ENDPOINT,
262917
+ SETTLEMINT_PORTAL_WS_ENDPOINT: env2.SETTLEMINT_PORTAL_WS_ENDPOINT,
262802
262918
  SETTLEMINT_HD_PRIVATE_KEY: env2.SETTLEMINT_HD_PRIVATE_KEY,
262919
+ SETTLEMINT_HD_PRIVATE_KEY_FORWARDER_ADDRESS: env2.SETTLEMINT_HD_PRIVATE_KEY_FORWARDER_ADDRESS,
262803
262920
  SETTLEMINT_ACCESSIBLE_PRIVATE_KEY: env2.SETTLEMINT_ACCESSIBLE_PRIVATE_KEY,
262804
262921
  SETTLEMINT_MINIO: env2.SETTLEMINT_MINIO,
262805
262922
  SETTLEMINT_MINIO_ENDPOINT: env2.SETTLEMINT_MINIO_ENDPOINT,
@@ -262833,8 +262950,8 @@ function getBlockchainNetworkChainId(blockchainNetwork) {
262833
262950
  return "chainId" in blockchainNetwork && typeof blockchainNetwork.chainId === "number" ? blockchainNetwork.chainId.toString() : undefined;
262834
262951
  }
262835
262952
 
262836
- // src/utils/get-cluster-service-endpoint.ts
262837
- async function getGraphEndpoint(settlemint, service, graphName) {
262953
+ // src/utils/get-cluster-service-env.ts
262954
+ async function getGraphEnv(settlemint, service, graphName) {
262838
262955
  if (!service || service.__typename !== "HAGraphMiddleware") {
262839
262956
  return {};
262840
262957
  }
@@ -262859,36 +262976,37 @@ async function getGraphEndpoint(settlemint, service, graphName) {
262859
262976
  SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: hasKitSubgraph ? DEFAULT_SUBGRAPH_NAME : undefined
262860
262977
  };
262861
262978
  }
262862
- function getIpfsEndpoints(service) {
262979
+ function getIpfsEnv(service) {
262863
262980
  if (!service || service.__typename !== "IPFSStorage") {
262864
262981
  return {};
262865
262982
  }
262866
262983
  return {
262867
- SETTLEMINT_IPFS_API_ENDPOINT: service?.endpoints.find((endpoint) => endpoint.id.includes("api"))?.displayValue,
262868
- SETTLEMINT_IPFS_PINNING_ENDPOINT: service?.endpoints.find((endpoint) => endpoint.id.includes("cluster-pinning-api"))?.displayValue,
262869
- SETTLEMINT_IPFS_GATEWAY_ENDPOINT: service?.endpoints.find((endpoint) => endpoint.id.includes("gateway"))?.displayValue
262984
+ SETTLEMINT_IPFS_API_ENDPOINT: service?.endpoints.find((endpoint) => endpoint.id.endsWith("-api") && !endpoint.id.endsWith("-cluster-api"))?.displayValue,
262985
+ SETTLEMINT_IPFS_PINNING_ENDPOINT: service?.endpoints.find((endpoint) => endpoint.id.endsWith("-cluster-pinning-api"))?.displayValue,
262986
+ SETTLEMINT_IPFS_GATEWAY_ENDPOINT: service?.endpoints.find((endpoint) => endpoint.id.endsWith("-gateway"))?.displayValue
262870
262987
  };
262871
262988
  }
262872
- function getPortalEndpoints(service) {
262989
+ function getPortalEnv(service) {
262873
262990
  if (!service || service.__typename !== "SmartContractPortalMiddleware") {
262874
262991
  return {};
262875
262992
  }
262876
262993
  return {
262877
- SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: service.endpoints.find((endpoint) => endpoint.id.includes("graphql"))?.displayValue,
262878
- SETTLEMINT_PORTAL_REST_ENDPOINT: service.endpoints.find((endpoint) => endpoint.id.includes("rest"))?.displayValue
262994
+ SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: service.endpoints.find((endpoint) => endpoint.id.endsWith("-graphql"))?.displayValue,
262995
+ SETTLEMINT_PORTAL_REST_ENDPOINT: service.endpoints.find((endpoint) => endpoint.id.endsWith("-rest"))?.displayValue,
262996
+ SETTLEMINT_PORTAL_WS_ENDPOINT: service.endpoints.find((endpoint) => endpoint.id.endsWith("-ws"))?.displayValue
262879
262997
  };
262880
262998
  }
262881
- function getHasuraEndpoints(service) {
262999
+ function getHasuraEnv(service) {
262882
263000
  if (!service || service.__typename !== "Hasura") {
262883
263001
  return {};
262884
263002
  }
262885
263003
  return {
262886
- SETTLEMINT_HASURA_ENDPOINT: service.endpoints.find((endpoint) => endpoint.id.includes("graphql"))?.displayValue,
262887
- SETTLEMINT_HASURA_ADMIN_SECRET: service.credentials.find((credential) => credential.id.includes("admin-secret"))?.displayValue,
262888
- SETTLEMINT_HASURA_DATABASE_URL: service.endpoints.find((endpoint) => endpoint.id.includes("postgresql"))?.displayValue
263004
+ SETTLEMINT_HASURA_ENDPOINT: service.endpoints.find((endpoint) => endpoint.id.endsWith("-graphql"))?.displayValue,
263005
+ SETTLEMINT_HASURA_ADMIN_SECRET: service.credentials.find((credential) => credential.id.endsWith("-admin-secret"))?.displayValue,
263006
+ SETTLEMINT_HASURA_DATABASE_URL: service.endpoints.find((endpoint) => endpoint.id.endsWith("-postgresql"))?.displayValue
262889
263007
  };
262890
263008
  }
262891
- function getBlockscoutEndpoints(service) {
263009
+ function getBlockscoutEnv(service) {
262892
263010
  if (!service || service.__typename !== "BlockchainExplorer") {
262893
263011
  return {};
262894
263012
  }
@@ -262898,30 +263016,46 @@ function getBlockscoutEndpoints(service) {
262898
263016
  SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT: uiEndpoint
262899
263017
  };
262900
263018
  }
262901
- function getMinioEndpoints(service) {
263019
+ function getMinioEnv(service) {
262902
263020
  if (!service || service.__typename !== "MinioStorage") {
262903
263021
  return {};
262904
263022
  }
262905
263023
  return {
262906
- SETTLEMINT_MINIO_ENDPOINT: service?.endpoints.find((endpoint) => endpoint.id.includes("s3-api"))?.displayValue,
262907
- SETTLEMINT_MINIO_ACCESS_KEY: service?.credentials.find((credential) => credential.id.includes("access-key"))?.displayValue,
262908
- SETTLEMINT_MINIO_SECRET_KEY: service?.credentials.find((credential) => credential.id.includes("secret-key"))?.displayValue
263024
+ SETTLEMINT_MINIO_ENDPOINT: service?.endpoints.find((endpoint) => endpoint.id.endsWith("-s3-api"))?.displayValue,
263025
+ SETTLEMINT_MINIO_ACCESS_KEY: service?.credentials.find((credential) => credential.id.endsWith("access-key"))?.displayValue,
263026
+ SETTLEMINT_MINIO_SECRET_KEY: service?.credentials.find((credential) => credential.id.endsWith("secret-key"))?.displayValue
262909
263027
  };
262910
263028
  }
262911
- function getBlockchainNodeEndpoints(service) {
263029
+ function getBlockchainNodeEnv(service) {
262912
263030
  if (!service) {
262913
263031
  return {};
262914
263032
  }
262915
263033
  return {
262916
- SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT: service.endpoints.find((endpoint) => endpoint.id.includes("json-rpc"))?.displayValue
263034
+ SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT: service.endpoints.find((endpoint) => endpoint.id.endsWith("-json-rpc"))?.displayValue
262917
263035
  };
262918
263036
  }
262919
- function getBlockchainNodeOrLoadBalancerEndpoints(service) {
263037
+ function getBlockchainNodeOrLoadBalancerEnv(service) {
262920
263038
  if (!service) {
262921
263039
  return {};
262922
263040
  }
262923
263041
  return {
262924
- SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT: service.endpoints.find((endpoint) => endpoint.id.includes("json-rpc"))?.displayValue
263042
+ SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT: service.endpoints.find((endpoint) => endpoint.id.endsWith("-json-rpc"))?.displayValue
263043
+ };
263044
+ }
263045
+ function getCustomDeploymentEnv(service) {
263046
+ if (!service) {
263047
+ return {};
263048
+ }
263049
+ return {
263050
+ SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: service?.endpoints.find((endpoint) => endpoint.id.endsWith("-internal"))?.displayValue
263051
+ };
263052
+ }
263053
+ function getHdPrivateKeyEnv(service) {
263054
+ if (!service || service.__typename !== "HdEcdsaP256PrivateKey") {
263055
+ return {};
263056
+ }
263057
+ return {
263058
+ SETTLEMINT_HD_PRIVATE_KEY_FORWARDER_ADDRESS: service?.trustedForwarderAddress ?? undefined
262925
263059
  };
262926
263060
  }
262927
263061
 
@@ -263021,12 +263155,12 @@ function connectCommand() {
263021
263155
  middlewares,
263022
263156
  accept: acceptDefaults
263023
263157
  });
263024
- const graphEndpoints = await getGraphEndpoint(settlemint, thegraph);
263158
+ const graphEnv = await getGraphEnv(settlemint, thegraph);
263025
263159
  const [defaultSubgraph] = thegraph ? await subgraphPrompt({
263026
- env: { ...env2, ...graphEndpoints },
263160
+ env: { ...env2, ...graphEnv },
263027
263161
  accept: acceptDefaults,
263028
263162
  message: "Which The Graph subgraph do you want to use as the default?"
263029
- }) : [graphEndpoints.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH];
263163
+ }) : [graphEnv.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH];
263030
263164
  const portal = await portalPrompt({
263031
263165
  env: env2,
263032
263166
  middlewares,
@@ -263135,25 +263269,26 @@ function connectCommand() {
263135
263269
  SETTLEMINT_BLOCKCHAIN_NETWORK: blockchainNode?.blockchainNetwork?.uniqueName,
263136
263270
  SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID: getBlockchainNetworkChainId(blockchainNode?.blockchainNetwork),
263137
263271
  SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.uniqueName,
263138
- ...getBlockchainNodeEndpoints(blockchainNode),
263272
+ ...getBlockchainNodeEnv(blockchainNode),
263139
263273
  SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: loadBalancerOrBlockchainNode?.uniqueName,
263140
- ...getBlockchainNodeOrLoadBalancerEndpoints(loadBalancerOrBlockchainNode),
263274
+ ...getBlockchainNodeOrLoadBalancerEnv(loadBalancerOrBlockchainNode),
263141
263275
  SETTLEMINT_HASURA: hasura?.uniqueName,
263142
- ...getHasuraEndpoints(hasura),
263276
+ ...getHasuraEnv(hasura),
263143
263277
  SETTLEMINT_THEGRAPH: thegraph?.uniqueName,
263144
- ...graphEndpoints,
263278
+ ...graphEnv,
263145
263279
  SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: defaultSubgraph,
263146
263280
  SETTLEMINT_PORTAL: portal?.uniqueName,
263147
- ...getPortalEndpoints(portal),
263281
+ ...getPortalEnv(portal),
263148
263282
  SETTLEMINT_HD_PRIVATE_KEY: hdPrivateKey?.uniqueName,
263283
+ ...getHdPrivateKeyEnv(hdPrivateKey),
263149
263284
  SETTLEMINT_MINIO: minio?.uniqueName,
263150
- ...getMinioEndpoints(minio),
263285
+ ...getMinioEnv(minio),
263151
263286
  SETTLEMINT_IPFS: ipfs?.uniqueName,
263152
- ...getIpfsEndpoints(ipfs),
263287
+ ...getIpfsEnv(ipfs),
263153
263288
  SETTLEMINT_CUSTOM_DEPLOYMENT: cDeployment?.uniqueName,
263154
- SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: cDeployment?.endpoints.find((endpoint) => endpoint.id.includes("internal"))?.displayValue,
263289
+ ...getCustomDeploymentEnv(cDeployment),
263155
263290
  SETTLEMINT_BLOCKSCOUT: blockscout?.uniqueName,
263156
- ...getBlockscoutEndpoints(blockscout)
263291
+ ...getBlockscoutEnv(blockscout)
263157
263292
  });
263158
263293
  outro("Connected to SettleMint");
263159
263294
  });
@@ -266566,9 +266701,9 @@ function hasuraTrackCommand() {
266566
266701
  if (!hasura) {
266567
266702
  return nothingSelectedError("Hasura instance");
266568
266703
  }
266569
- const hasuraEndpoints = getHasuraEndpoints(hasura);
266570
- const hasuraGraphqlEndpoint = hasuraEndpoints.SETTLEMINT_HASURA_ENDPOINT;
266571
- const hasuraAdminSecret = hasuraEndpoints.SETTLEMINT_HASURA_ADMIN_SECRET;
266704
+ const hasuraEnv = getHasuraEnv(hasura);
266705
+ const hasuraGraphqlEndpoint = hasuraEnv.SETTLEMINT_HASURA_ENDPOINT;
266706
+ const hasuraAdminSecret = hasuraEnv.SETTLEMINT_HASURA_ADMIN_SECRET;
266572
266707
  if (!hasuraGraphqlEndpoint || !hasuraAdminSecret) {
266573
266708
  return note("Could not retrieve Hasura endpoint or admin secret. Please check your configuration.");
266574
266709
  }
@@ -267114,7 +267249,7 @@ function getCreateCommand({
267114
267249
  const newNode = await settlemint.blockchainNode.read(newEnv.SETTLEMINT_BLOCKCHAIN_NODE);
267115
267250
  newEnv.SETTLEMINT_BLOCKCHAIN_NETWORK = newNode.blockchainNetwork.uniqueName;
267116
267251
  newEnv.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID = getBlockchainNetworkChainId(newNode.blockchainNetwork);
267117
- newEnv.SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT = getBlockchainNodeEndpoints(newNode).SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT;
267252
+ newEnv.SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT = getBlockchainNodeEnv(newNode).SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT;
267118
267253
  }
267119
267254
  await writeEnvSpinner(!!prod, newEnv);
267120
267255
  note(`${capitalizeFirstLetter2(type4)} ${result.name} set as default`);
@@ -267188,9 +267323,9 @@ function blockchainNetworkBesuCreateCommand() {
267188
267323
  SETTLEMINT_BLOCKCHAIN_NETWORK: result.uniqueName,
267189
267324
  SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID: getBlockchainNetworkChainId(result),
267190
267325
  SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.uniqueName,
267191
- ...getBlockchainNodeEndpoints(blockchainNode),
267326
+ ...getBlockchainNodeEnv(blockchainNode),
267192
267327
  SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: undefined,
267193
- ...getBlockchainNodeOrLoadBalancerEndpoints(undefined)
267328
+ ...getBlockchainNodeOrLoadBalancerEnv(undefined)
267194
267329
  };
267195
267330
  }
267196
267331
  };
@@ -267673,7 +267808,7 @@ function blockscoutInsightsCreateCommand() {
267673
267808
  return {
267674
267809
  SETTLEMINT_APPLICATION: applicationUniqueName,
267675
267810
  SETTLEMINT_BLOCKSCOUT: result.uniqueName,
267676
- ...getBlockscoutEndpoints(result)
267811
+ ...getBlockscoutEnv(result)
267677
267812
  };
267678
267813
  }
267679
267814
  };
@@ -267741,7 +267876,7 @@ function hasuraIntegrationCreateCommand() {
267741
267876
  return {
267742
267877
  SETTLEMINT_APPLICATION: applicationUniqueName,
267743
267878
  SETTLEMINT_HASURA: result.uniqueName,
267744
- ...getHasuraEndpoints(result)
267879
+ ...getHasuraEnv(result)
267745
267880
  };
267746
267881
  }
267747
267882
  };
@@ -267850,7 +267985,7 @@ function loadBalancerEvmCreateCommand() {
267850
267985
  return {
267851
267986
  SETTLEMINT_APPLICATION: applicationUniqueName,
267852
267987
  SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: result.uniqueName,
267853
- ...getBlockchainNodeOrLoadBalancerEndpoints(result)
267988
+ ...getBlockchainNodeOrLoadBalancerEnv(result)
267854
267989
  };
267855
267990
  }
267856
267991
  };
@@ -267937,7 +268072,7 @@ function graphMiddlewareCreateCommand() {
267937
268072
  return {
267938
268073
  SETTLEMINT_APPLICATION: applicationUniqueName,
267939
268074
  SETTLEMINT_THEGRAPH: result.uniqueName,
267940
- ...await getGraphEndpoint(settlemint, graphMiddleware)
268075
+ ...await getGraphEnv(settlemint, graphMiddleware)
267941
268076
  };
267942
268077
  }
267943
268078
  };
@@ -268052,7 +268187,7 @@ function smartContractPortalMiddlewareCreateCommand() {
268052
268187
  return {
268053
268188
  SETTLEMINT_APPLICATION: applicationUniqueName,
268054
268189
  SETTLEMINT_PORTAL: result.uniqueName,
268055
- ...getPortalEndpoints(result)
268190
+ ...getPortalEnv(result)
268056
268191
  };
268057
268192
  }
268058
268193
  };
@@ -268093,15 +268228,26 @@ function privateKeyAccessibleCreateCommand() {
268093
268228
  subType: "ACCESSIBLE-ECDSA-P256",
268094
268229
  alias: "acc",
268095
268230
  execute: (cmd2, baseAction) => {
268096
- cmd2.option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name3, { application, blockchainNode, acceptDefaults, ...defaultArgs }) => {
268231
+ cmd2.option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").option("-tfa, --trusted-forwarder-address <trustedForwarderAddress>", "The address of the trusted forwarder contract. Must inherit from OpenZeppelin's ERC2771Forwarder contract").option("-tfn, --trusted-forwarder-name <trustedForwarderName>", "The name of the trusted forwarder contract as known to OpenZeppelin's extension (e.g. 'OpenZeppelinERC2771Forwarder'). This exact name is required for the verification process").option("-rku, --relayer-key-unique-name <relayerKeyUniqueName>", "Private key unique name to use for relaying meta-transactions").action(async (name3, {
268232
+ application,
268233
+ blockchainNode,
268234
+ trustedForwarderAddress,
268235
+ trustedForwarderName,
268236
+ relayerKeyUniqueName,
268237
+ acceptDefaults,
268238
+ ...defaultArgs
268239
+ }) => {
268097
268240
  return baseAction({
268098
268241
  ...defaultArgs,
268099
268242
  acceptDefaults
268100
- }, async ({ settlemint, env: env2, showSpinner, provider, region }) => {
268243
+ }, async ({ settlemint, env: env2, showSpinner }) => {
268101
268244
  const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
268102
268245
  if (!applicationUniqueName) {
268103
268246
  return missingApplication();
268104
268247
  }
268248
+ if ((trustedForwarderAddress || trustedForwarderName || relayerKeyUniqueName) && !(trustedForwarderAddress && trustedForwarderName && relayerKeyUniqueName)) {
268249
+ throw new Error("When using meta-transaction functionality, you must provide all three options: " + "--trusted-forwarder-address, --trusted-forwarder-name, and --relayer-key-unique-name");
268250
+ }
268105
268251
  let blockchainNodeUniqueName = blockchainNode;
268106
268252
  if (!blockchainNodeUniqueName) {
268107
268253
  const blockchainNodes = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
@@ -268120,7 +268266,10 @@ function privateKeyAccessibleCreateCommand() {
268120
268266
  name: name3,
268121
268267
  applicationUniqueName,
268122
268268
  privateKeyType: "ACCESSIBLE_ECDSA_P256",
268123
- blockchainNodeUniqueNames: blockchainNodeUniqueName ? [blockchainNodeUniqueName] : []
268269
+ blockchainNodeUniqueNames: blockchainNodeUniqueName ? [blockchainNodeUniqueName] : [],
268270
+ trustedForwarderAddress,
268271
+ trustedForwarderName,
268272
+ relayerKeyUniqueName
268124
268273
  }));
268125
268274
  return {
268126
268275
  result
@@ -268153,15 +268302,26 @@ function privateKeyHdCreateCommand() {
268153
268302
  subType: "HD-ECDSA-P256",
268154
268303
  alias: "hd",
268155
268304
  execute: (cmd2, baseAction) => {
268156
- cmd2.option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name3, { application, blockchainNode, acceptDefaults, ...defaultArgs }) => {
268305
+ cmd2.option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").option("-tfa, --trusted-forwarder-address <trustedForwarderAddress>", "The address of the trusted forwarder contract. Must inherit from OpenZeppelin's ERC2771Forwarder contract").option("-tfn, --trusted-forwarder-name <trustedForwarderName>", "The name of the trusted forwarder contract as known to OpenZeppelin's extension (e.g. 'OpenZeppelinERC2771Forwarder'). This exact name is required for the verification process").option("-rku, --relayer-key-unique-name <relayerKeyUniqueName>", "Private key unique name to use for relaying meta-transactions").action(async (name3, {
268306
+ application,
268307
+ blockchainNode,
268308
+ trustedForwarderAddress,
268309
+ trustedForwarderName,
268310
+ relayerKeyUniqueName,
268311
+ acceptDefaults,
268312
+ ...defaultArgs
268313
+ }) => {
268157
268314
  return baseAction({
268158
268315
  ...defaultArgs,
268159
268316
  acceptDefaults
268160
- }, async ({ settlemint, env: env2, showSpinner, provider, region }) => {
268317
+ }, async ({ settlemint, env: env2, showSpinner }) => {
268161
268318
  const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
268162
268319
  if (!applicationUniqueName) {
268163
268320
  return missingApplication();
268164
268321
  }
268322
+ if ((trustedForwarderAddress || trustedForwarderName || relayerKeyUniqueName) && !(trustedForwarderAddress && trustedForwarderName && relayerKeyUniqueName)) {
268323
+ throw new Error("When using meta-transaction functionality, you must provide all three options: " + "--trusted-forwarder-address, --trusted-forwarder-name, and --relayer-key-unique-name");
268324
+ }
268165
268325
  let blockchainNodeUniqueName = blockchainNode;
268166
268326
  if (!blockchainNodeUniqueName) {
268167
268327
  const blockchainNodes = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
@@ -268180,14 +268340,18 @@ function privateKeyHdCreateCommand() {
268180
268340
  name: name3,
268181
268341
  applicationUniqueName,
268182
268342
  privateKeyType: "HD_ECDSA_P256",
268183
- blockchainNodeUniqueNames: blockchainNodeUniqueName ? [blockchainNodeUniqueName] : []
268343
+ blockchainNodeUniqueNames: blockchainNodeUniqueName ? [blockchainNodeUniqueName] : [],
268344
+ trustedForwarderAddress,
268345
+ trustedForwarderName,
268346
+ relayerKeyUniqueName
268184
268347
  }));
268185
268348
  return {
268186
268349
  result,
268187
268350
  mapDefaultEnv: () => {
268188
268351
  return {
268189
268352
  SETTLEMINT_APPLICATION: applicationUniqueName,
268190
- SETTLEMINT_HD_PRIVATE_KEY: result.uniqueName
268353
+ SETTLEMINT_HD_PRIVATE_KEY: result.uniqueName,
268354
+ ...getHdPrivateKeyEnv(result)
268191
268355
  };
268192
268356
  }
268193
268357
  };
@@ -268309,7 +268473,7 @@ function ipfsStorageCreateCommand() {
268309
268473
  return {
268310
268474
  SETTLEMINT_APPLICATION: applicationUniqueName,
268311
268475
  SETTLEMINT_IPFS: result.uniqueName,
268312
- ...getIpfsEndpoints(result)
268476
+ ...getIpfsEnv(result)
268313
268477
  };
268314
268478
  }
268315
268479
  };
@@ -268362,7 +268526,7 @@ function minioStorageCreateCommand() {
268362
268526
  return {
268363
268527
  SETTLEMINT_APPLICATION: applicationUniqueName,
268364
268528
  SETTLEMINT_MINIO: result.uniqueName,
268365
- ...getMinioEndpoints(result)
268529
+ ...getMinioEnv(result)
268366
268530
  };
268367
268531
  }
268368
268532
  };
@@ -270215,11 +270379,11 @@ function subgraphDeployCommand() {
270215
270379
  instance
270216
270380
  });
270217
270381
  const middleware = await settlemintClient.middleware.read(theGraphMiddleware.uniqueName);
270218
- const graphEndpoints = await getGraphEndpoint(settlemintClient, middleware, graphName);
270382
+ const graphEnv = await getGraphEnv(settlemintClient, middleware, graphName);
270219
270383
  await writeEnvSpinner(!!prod, {
270220
270384
  ...env2,
270221
270385
  SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
270222
- ...graphEndpoints,
270386
+ ...graphEnv,
270223
270387
  SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH ?? graphName
270224
270388
  });
270225
270389
  outro(`Subgraph ${graphName} deployed successfully`);
@@ -270279,7 +270443,7 @@ function subgraphRemoveCommand() {
270279
270443
  startMessage: "Waiting for subgraph to be removed",
270280
270444
  task: () => retryWhenFailed2(async () => {
270281
270445
  const middleware = await settlemintClient.middleware.read(theGraphMiddleware.uniqueName);
270282
- const endpoints = await getGraphEndpoint(settlemintClient, middleware);
270446
+ const endpoints = await getGraphEnv(settlemintClient, middleware);
270283
270447
  if (endpoints.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS?.some((endpoint) => endpoint.endsWith(graphName))) {
270284
270448
  throw new Error(`Subgraph '${graphName}' not removed from middleware '${theGraphMiddleware.uniqueName}'`);
270285
270449
  }
@@ -270440,4 +270604,4 @@ async function sdkCliCommand(argv = process.argv) {
270440
270604
  // src/cli.ts
270441
270605
  sdkCliCommand();
270442
270606
 
270443
- //# debugId=FE388A0CD778A57664756E2164756E21
270607
+ //# debugId=E95A41E81EBF79AC64756E2164756E21