@settlemint/sdk-cli 2.2.2-prb5500d27 → 2.2.2-prc6c765df

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 +512 -609
  2. package/dist/cli.js.map +29 -27
  3. package/package.json +4 -4
package/dist/cli.js CHANGED
@@ -837,7 +837,7 @@ var require_dist2 = __commonJS((exports) => {
837
837
  // ../../node_modules/@dotenvx/dotenvx/package.json
838
838
  var require_package = __commonJS((exports, module) => {
839
839
  module.exports = {
840
- version: "1.41.0",
840
+ version: "1.43.0",
841
841
  name: "@dotenvx/dotenvx",
842
842
  description: "a better dotenv–from the creator of `dotenv`",
843
843
  author: "@motdotla",
@@ -990,14 +990,11 @@ var require_logger = __commonJS((exports, module) => {
990
990
  var { getColor, bold: bold2 } = require_colors();
991
991
  var levels = {
992
992
  error: 0,
993
- errorv: 0,
994
- errornocolor: 0,
995
993
  warn: 1,
996
994
  success: 2,
997
995
  successv: 2,
998
996
  info: 2,
999
997
  help: 2,
1000
- blank: 2,
1001
998
  verbose: 4,
1002
999
  debug: 5,
1003
1000
  silly: 6
@@ -1010,7 +1007,11 @@ var require_logger = __commonJS((exports, module) => {
1010
1007
  var verbose = getColor("plum");
1011
1008
  var debug = getColor("plum");
1012
1009
  var currentLevel = levels.info;
1013
- function log(level, message) {
1010
+ function stderr(level, message) {
1011
+ const formattedMessage = formatMessage(level, message);
1012
+ console.error(formattedMessage);
1013
+ }
1014
+ function stdout(level, message) {
1014
1015
  if (levels[level] === undefined) {
1015
1016
  throw new Error(`MISSING_LOG_LEVEL: '${level}'. implement in logger.`);
1016
1017
  }
@@ -1024,10 +1025,6 @@ var require_logger = __commonJS((exports, module) => {
1024
1025
  switch (level.toLowerCase()) {
1025
1026
  case "error":
1026
1027
  return error(formattedMessage);
1027
- case "errorv":
1028
- return error(`[dotenvx@${packageJson.version}] ${formattedMessage}`);
1029
- case "errornocolor":
1030
- return formattedMessage;
1031
1028
  case "warn":
1032
1029
  return warn(formattedMessage);
1033
1030
  case "success":
@@ -1042,23 +1039,18 @@ var require_logger = __commonJS((exports, module) => {
1042
1039
  return verbose(formattedMessage);
1043
1040
  case "debug":
1044
1041
  return debug(formattedMessage);
1045
- case "blank":
1046
- return formattedMessage;
1047
1042
  }
1048
1043
  }
1049
1044
  var logger = {
1050
1045
  level: "info",
1051
- error: (msg) => log("error", msg),
1052
- errorv: (msg) => log("errorv", msg),
1053
- errornocolor: (msg) => log("errornocolor", msg),
1054
- warn: (msg) => log("warn", msg),
1055
- success: (msg) => log("success", msg),
1056
- successv: (msg) => log("successv", msg),
1057
- info: (msg) => log("info", msg),
1058
- help: (msg) => log("help", msg),
1059
- verbose: (msg) => log("verbose", msg),
1060
- debug: (msg) => log("debug", msg),
1061
- blank: (msg) => log("blank", msg),
1046
+ error: (msg) => stderr("error", msg),
1047
+ warn: (msg) => stdout("warn", msg),
1048
+ success: (msg) => stdout("success", msg),
1049
+ successv: (msg) => stdout("successv", msg),
1050
+ info: (msg) => stdout("info", msg),
1051
+ help: (msg) => stdout("help", msg),
1052
+ verbose: (msg) => stdout("verbose", msg),
1053
+ debug: (msg) => stdout("debug", msg),
1062
1054
  setLevel: (level) => {
1063
1055
  if (levels[level] !== undefined) {
1064
1056
  currentLevel = levels[level];
@@ -4166,54 +4158,21 @@ var require_webcrypto = __commonJS((exports) => {
4166
4158
  exports.gcm = /* @__PURE__ */ (() => generate(mode.GCM))();
4167
4159
  });
4168
4160
 
4169
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/cryptoNode.js
4170
- var require_cryptoNode2 = __commonJS((exports) => {
4161
+ // ../../node_modules/@noble/hashes/_assert.js
4162
+ var require__assert = __commonJS((exports) => {
4171
4163
  Object.defineProperty(exports, "__esModule", { value: true });
4172
- exports.crypto = undefined;
4173
- var nc = __require("node:crypto");
4174
- exports.crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && ("randomBytes" in nc) ? nc : undefined;
4175
- });
4176
-
4177
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/utils.js
4178
- var require_utils4 = __commonJS((exports) => {
4179
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
4180
- Object.defineProperty(exports, "__esModule", { value: true });
4181
- exports.wrapXOFConstructorWithOpts = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.Hash = exports.nextTick = exports.swap32IfBE = exports.byteSwapIfBE = exports.swap8IfBE = exports.isLE = undefined;
4182
- exports.isBytes = isBytes;
4183
4164
  exports.anumber = anumber;
4184
4165
  exports.abytes = abytes;
4185
4166
  exports.ahash = ahash;
4186
4167
  exports.aexists = aexists;
4187
4168
  exports.aoutput = aoutput;
4188
- exports.u8 = u8;
4189
- exports.u32 = u32;
4190
- exports.clean = clean;
4191
- exports.createView = createView;
4192
- exports.rotr = rotr;
4193
- exports.rotl = rotl;
4194
- exports.byteSwap = byteSwap;
4195
- exports.byteSwap32 = byteSwap32;
4196
- exports.bytesToHex = bytesToHex;
4197
- exports.hexToBytes = hexToBytes;
4198
- exports.asyncLoop = asyncLoop;
4199
- exports.utf8ToBytes = utf8ToBytes;
4200
- exports.bytesToUtf8 = bytesToUtf8;
4201
- exports.toBytes = toBytes;
4202
- exports.kdfInputToBytes = kdfInputToBytes;
4203
- exports.concatBytes = concatBytes;
4204
- exports.checkOpts = checkOpts;
4205
- exports.createHasher = createHasher;
4206
- exports.createOptHasher = createOptHasher;
4207
- exports.createXOFer = createXOFer;
4208
- exports.randomBytes = randomBytes;
4209
- var crypto_1 = require_cryptoNode2();
4210
- function isBytes(a) {
4211
- return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
4212
- }
4213
4169
  function anumber(n) {
4214
4170
  if (!Number.isSafeInteger(n) || n < 0)
4215
4171
  throw new Error("positive integer expected, got " + n);
4216
4172
  }
4173
+ function isBytes(a) {
4174
+ return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
4175
+ }
4217
4176
  function abytes(b, ...lengths) {
4218
4177
  if (!isBytes(b))
4219
4178
  throw new Error("Uint8Array expected");
@@ -4222,7 +4181,7 @@ var require_utils4 = __commonJS((exports) => {
4222
4181
  }
4223
4182
  function ahash(h) {
4224
4183
  if (typeof h !== "function" || typeof h.create !== "function")
4225
- throw new Error("Hash should be wrapped by utils.createHasher");
4184
+ throw new Error("Hash should be wrapped by utils.wrapConstructor");
4226
4185
  anumber(h.outputLen);
4227
4186
  anumber(h.blockLen);
4228
4187
  }
@@ -4239,17 +4198,51 @@ var require_utils4 = __commonJS((exports) => {
4239
4198
  throw new Error("digestInto() expects output buffer of length at least " + min);
4240
4199
  }
4241
4200
  }
4201
+ });
4202
+
4203
+ // ../../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/@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
+ }
4242
4240
  function u8(arr) {
4243
4241
  return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
4244
4242
  }
4245
4243
  function u32(arr) {
4246
4244
  return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
4247
4245
  }
4248
- function clean(...arrays) {
4249
- for (let i = 0;i < arrays.length; i++) {
4250
- arrays[i].fill(0);
4251
- }
4252
- }
4253
4246
  function createView(arr) {
4254
4247
  return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
4255
4248
  }
@@ -4263,19 +4256,16 @@ var require_utils4 = __commonJS((exports) => {
4263
4256
  function byteSwap(word) {
4264
4257
  return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
4265
4258
  }
4266
- exports.swap8IfBE = exports.isLE ? (n) => n : (n) => byteSwap(n);
4267
- exports.byteSwapIfBE = exports.swap8IfBE;
4259
+ exports.byteSwapIfBE = exports.isLE ? (n) => n : (n) => byteSwap(n);
4268
4260
  function byteSwap32(arr) {
4269
4261
  for (let i = 0;i < arr.length; i++) {
4270
4262
  arr[i] = byteSwap(arr[i]);
4271
4263
  }
4272
- return arr;
4273
4264
  }
4274
- exports.swap32IfBE = exports.isLE ? (u) => u : byteSwap32;
4275
- var hasHexBuiltin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function")();
4265
+ var hasHexBuiltin = typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function";
4276
4266
  var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
4277
4267
  function bytesToHex(bytes) {
4278
- abytes(bytes);
4268
+ (0, _assert_ts_1.abytes)(bytes);
4279
4269
  if (hasHexBuiltin)
4280
4270
  return bytes.toHex();
4281
4271
  let hex = "";
@@ -4330,29 +4320,20 @@ var require_utils4 = __commonJS((exports) => {
4330
4320
  }
4331
4321
  function utf8ToBytes(str) {
4332
4322
  if (typeof str !== "string")
4333
- throw new Error("string expected");
4323
+ throw new Error("utf8ToBytes expected string, got " + typeof str);
4334
4324
  return new Uint8Array(new TextEncoder().encode(str));
4335
4325
  }
4336
- function bytesToUtf8(bytes) {
4337
- return new TextDecoder().decode(bytes);
4338
- }
4339
4326
  function toBytes(data) {
4340
4327
  if (typeof data === "string")
4341
4328
  data = utf8ToBytes(data);
4342
- abytes(data);
4343
- return data;
4344
- }
4345
- function kdfInputToBytes(data) {
4346
- if (typeof data === "string")
4347
- data = utf8ToBytes(data);
4348
- abytes(data);
4329
+ (0, _assert_ts_1.abytes)(data);
4349
4330
  return data;
4350
4331
  }
4351
4332
  function concatBytes(...arrays) {
4352
4333
  let sum = 0;
4353
4334
  for (let i = 0;i < arrays.length; i++) {
4354
4335
  const a = arrays[i];
4355
- abytes(a);
4336
+ (0, _assert_ts_1.abytes)(a);
4356
4337
  sum += a.length;
4357
4338
  }
4358
4339
  const res = new Uint8Array(sum);
@@ -4363,17 +4344,20 @@ var require_utils4 = __commonJS((exports) => {
4363
4344
  }
4364
4345
  return res;
4365
4346
  }
4347
+
4348
+ class Hash {
4349
+ clone() {
4350
+ return this._cloneInto();
4351
+ }
4352
+ }
4353
+ exports.Hash = Hash;
4366
4354
  function checkOpts(defaults, opts) {
4367
4355
  if (opts !== undefined && {}.toString.call(opts) !== "[object Object]")
4368
- throw new Error("options should be object or undefined");
4356
+ throw new Error("Options should be object or undefined");
4369
4357
  const merged = Object.assign(defaults, opts);
4370
4358
  return merged;
4371
4359
  }
4372
-
4373
- class Hash {
4374
- }
4375
- exports.Hash = Hash;
4376
- function createHasher(hashCons) {
4360
+ function wrapConstructor(hashCons) {
4377
4361
  const hashC = (msg) => hashCons().update(toBytes(msg)).digest();
4378
4362
  const tmp = hashCons();
4379
4363
  hashC.outputLen = tmp.outputLen;
@@ -4381,7 +4365,7 @@ var require_utils4 = __commonJS((exports) => {
4381
4365
  hashC.create = () => hashCons();
4382
4366
  return hashC;
4383
4367
  }
4384
- function createOptHasher(hashCons) {
4368
+ function wrapConstructorWithOpts(hashCons) {
4385
4369
  const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();
4386
4370
  const tmp = hashCons({});
4387
4371
  hashC.outputLen = tmp.outputLen;
@@ -4389,7 +4373,7 @@ var require_utils4 = __commonJS((exports) => {
4389
4373
  hashC.create = (opts) => hashCons(opts);
4390
4374
  return hashC;
4391
4375
  }
4392
- function createXOFer(hashCons) {
4376
+ function wrapXOFConstructorWithOpts(hashCons) {
4393
4377
  const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();
4394
4378
  const tmp = hashCons({});
4395
4379
  hashC.outputLen = tmp.outputLen;
@@ -4397,9 +4381,6 @@ var require_utils4 = __commonJS((exports) => {
4397
4381
  hashC.create = (opts) => hashCons(opts);
4398
4382
  return hashC;
4399
4383
  }
4400
- exports.wrapConstructor = createHasher;
4401
- exports.wrapConstructorWithOpts = createOptHasher;
4402
- exports.wrapXOFConstructorWithOpts = createXOFer;
4403
4384
  function randomBytes(bytesLength = 32) {
4404
4385
  if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === "function") {
4405
4386
  return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength));
@@ -4411,13 +4392,14 @@ var require_utils4 = __commonJS((exports) => {
4411
4392
  }
4412
4393
  });
4413
4394
 
4414
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/_md.js
4395
+ // ../../node_modules/@noble/hashes/_md.js
4415
4396
  var require__md = __commonJS((exports) => {
4416
4397
  Object.defineProperty(exports, "__esModule", { value: true });
4417
- exports.SHA512_IV = exports.SHA384_IV = exports.SHA224_IV = exports.SHA256_IV = exports.HashMD = undefined;
4398
+ exports.HashMD = undefined;
4418
4399
  exports.setBigUint64 = setBigUint64;
4419
4400
  exports.Chi = Chi;
4420
4401
  exports.Maj = Maj;
4402
+ var _assert_ts_1 = require__assert();
4421
4403
  var utils_ts_1 = require_utils4();
4422
4404
  function setBigUint64(view, byteOffset, value, isLE) {
4423
4405
  if (typeof view.setBigUint64 === "function")
@@ -4453,10 +4435,9 @@ var require__md = __commonJS((exports) => {
4453
4435
  this.view = (0, utils_ts_1.createView)(this.buffer);
4454
4436
  }
4455
4437
  update(data) {
4456
- (0, utils_ts_1.aexists)(this);
4457
- data = (0, utils_ts_1.toBytes)(data);
4458
- (0, utils_ts_1.abytes)(data);
4438
+ (0, _assert_ts_1.aexists)(this);
4459
4439
  const { view, buffer, blockLen } = this;
4440
+ data = (0, utils_ts_1.toBytes)(data);
4460
4441
  const len = data.length;
4461
4442
  for (let pos = 0;pos < len; ) {
4462
4443
  const take = Math.min(blockLen - this.pos, len - pos);
@@ -4479,13 +4460,13 @@ var require__md = __commonJS((exports) => {
4479
4460
  return this;
4480
4461
  }
4481
4462
  digestInto(out) {
4482
- (0, utils_ts_1.aexists)(this);
4483
- (0, utils_ts_1.aoutput)(out, this);
4463
+ (0, _assert_ts_1.aexists)(this);
4464
+ (0, _assert_ts_1.aoutput)(out, this);
4484
4465
  this.finished = true;
4485
4466
  const { buffer, view, blockLen, isLE } = this;
4486
4467
  let { pos } = this;
4487
4468
  buffer[pos++] = 128;
4488
- (0, utils_ts_1.clean)(this.buffer.subarray(pos));
4469
+ this.buffer.subarray(pos).fill(0);
4489
4470
  if (this.padOffset > blockLen - pos) {
4490
4471
  this.process(view, 0);
4491
4472
  pos = 0;
@@ -4516,178 +4497,25 @@ var require__md = __commonJS((exports) => {
4516
4497
  to || (to = new this.constructor);
4517
4498
  to.set(...this.get());
4518
4499
  const { blockLen, buffer, length, finished, destroyed, pos } = this;
4519
- to.destroyed = destroyed;
4520
- to.finished = finished;
4521
4500
  to.length = length;
4522
4501
  to.pos = pos;
4502
+ to.finished = finished;
4503
+ to.destroyed = destroyed;
4523
4504
  if (length % blockLen)
4524
4505
  to.buffer.set(buffer);
4525
4506
  return to;
4526
4507
  }
4527
- clone() {
4528
- return this._cloneInto();
4529
- }
4530
4508
  }
4531
4509
  exports.HashMD = HashMD;
4532
- exports.SHA256_IV = Uint32Array.from([
4533
- 1779033703,
4534
- 3144134277,
4535
- 1013904242,
4536
- 2773480762,
4537
- 1359893119,
4538
- 2600822924,
4539
- 528734635,
4540
- 1541459225
4541
- ]);
4542
- exports.SHA224_IV = Uint32Array.from([
4543
- 3238371032,
4544
- 914150663,
4545
- 812702999,
4546
- 4144912697,
4547
- 4290775857,
4548
- 1750603025,
4549
- 1694076839,
4550
- 3204075428
4551
- ]);
4552
- exports.SHA384_IV = Uint32Array.from([
4553
- 3418070365,
4554
- 3238371032,
4555
- 1654270250,
4556
- 914150663,
4557
- 2438529370,
4558
- 812702999,
4559
- 355462360,
4560
- 4144912697,
4561
- 1731405415,
4562
- 4290775857,
4563
- 2394180231,
4564
- 1750603025,
4565
- 3675008525,
4566
- 1694076839,
4567
- 1203062813,
4568
- 3204075428
4569
- ]);
4570
- exports.SHA512_IV = Uint32Array.from([
4571
- 1779033703,
4572
- 4089235720,
4573
- 3144134277,
4574
- 2227873595,
4575
- 1013904242,
4576
- 4271175723,
4577
- 2773480762,
4578
- 1595750129,
4579
- 1359893119,
4580
- 2917565137,
4581
- 2600822924,
4582
- 725511199,
4583
- 528734635,
4584
- 4215389547,
4585
- 1541459225,
4586
- 327033209
4587
- ]);
4588
- });
4589
-
4590
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/_u64.js
4591
- var require__u64 = __commonJS((exports) => {
4592
- Object.defineProperty(exports, "__esModule", { value: true });
4593
- 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;
4594
- exports.add = add;
4595
- exports.fromBig = fromBig;
4596
- exports.split = split;
4597
- var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
4598
- var _32n = /* @__PURE__ */ BigInt(32);
4599
- function fromBig(n, le = false) {
4600
- if (le)
4601
- return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
4602
- return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
4603
- }
4604
- function split(lst, le = false) {
4605
- const len = lst.length;
4606
- let Ah = new Uint32Array(len);
4607
- let Al = new Uint32Array(len);
4608
- for (let i = 0;i < len; i++) {
4609
- const { h, l } = fromBig(lst[i], le);
4610
- [Ah[i], Al[i]] = [h, l];
4611
- }
4612
- return [Ah, Al];
4613
- }
4614
- var toBig = (h, l) => BigInt(h >>> 0) << _32n | BigInt(l >>> 0);
4615
- exports.toBig = toBig;
4616
- var shrSH = (h, _l, s) => h >>> s;
4617
- exports.shrSH = shrSH;
4618
- var shrSL = (h, l, s) => h << 32 - s | l >>> s;
4619
- exports.shrSL = shrSL;
4620
- var rotrSH = (h, l, s) => h >>> s | l << 32 - s;
4621
- exports.rotrSH = rotrSH;
4622
- var rotrSL = (h, l, s) => h << 32 - s | l >>> s;
4623
- exports.rotrSL = rotrSL;
4624
- var rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32;
4625
- exports.rotrBH = rotrBH;
4626
- var rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s;
4627
- exports.rotrBL = rotrBL;
4628
- var rotr32H = (_h, l) => l;
4629
- exports.rotr32H = rotr32H;
4630
- var rotr32L = (h, _l) => h;
4631
- exports.rotr32L = rotr32L;
4632
- var rotlSH = (h, l, s) => h << s | l >>> 32 - s;
4633
- exports.rotlSH = rotlSH;
4634
- var rotlSL = (h, l, s) => l << s | h >>> 32 - s;
4635
- exports.rotlSL = rotlSL;
4636
- var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s;
4637
- exports.rotlBH = rotlBH;
4638
- var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
4639
- exports.rotlBL = rotlBL;
4640
- function add(Ah, Al, Bh, Bl) {
4641
- const l = (Al >>> 0) + (Bl >>> 0);
4642
- return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 };
4643
- }
4644
- var add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
4645
- exports.add3L = add3L;
4646
- var add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0;
4647
- exports.add3H = add3H;
4648
- var add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
4649
- exports.add4L = add4L;
4650
- var add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0;
4651
- exports.add4H = add4H;
4652
- var add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
4653
- exports.add5L = add5L;
4654
- var add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0;
4655
- exports.add5H = add5H;
4656
- var u64 = {
4657
- fromBig,
4658
- split,
4659
- toBig,
4660
- shrSH,
4661
- shrSL,
4662
- rotrSH,
4663
- rotrSL,
4664
- rotrBH,
4665
- rotrBL,
4666
- rotr32H,
4667
- rotr32L,
4668
- rotlSH,
4669
- rotlSL,
4670
- rotlBH,
4671
- rotlBL,
4672
- add,
4673
- add3L,
4674
- add3H,
4675
- add4L,
4676
- add4H,
4677
- add5H,
4678
- add5L
4679
- };
4680
- exports.default = u64;
4681
4510
  });
4682
4511
 
4683
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/sha2.js
4684
- var require_sha2 = __commonJS((exports) => {
4512
+ // ../../node_modules/@noble/hashes/sha256.js
4513
+ var require_sha256 = __commonJS((exports) => {
4685
4514
  Object.defineProperty(exports, "__esModule", { value: true });
4686
- 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;
4515
+ exports.sha224 = exports.sha256 = exports.SHA256 = undefined;
4687
4516
  var _md_ts_1 = require__md();
4688
- var u64 = require__u64();
4689
4517
  var utils_ts_1 = require_utils4();
4690
- var SHA256_K = /* @__PURE__ */ Uint32Array.from([
4518
+ var SHA256_K = /* @__PURE__ */ new Uint32Array([
4691
4519
  1116352408,
4692
4520
  1899447441,
4693
4521
  3049323471,
@@ -4753,19 +4581,29 @@ var require_sha2 = __commonJS((exports) => {
4753
4581
  3204031479,
4754
4582
  3329325298
4755
4583
  ]);
4584
+ var SHA256_IV = /* @__PURE__ */ new Uint32Array([
4585
+ 1779033703,
4586
+ 3144134277,
4587
+ 1013904242,
4588
+ 2773480762,
4589
+ 1359893119,
4590
+ 2600822924,
4591
+ 528734635,
4592
+ 1541459225
4593
+ ]);
4756
4594
  var SHA256_W = /* @__PURE__ */ new Uint32Array(64);
4757
4595
 
4758
4596
  class SHA256 extends _md_ts_1.HashMD {
4759
4597
  constructor(outputLen = 32) {
4760
4598
  super(64, outputLen, 8, false);
4761
- this.A = _md_ts_1.SHA256_IV[0] | 0;
4762
- this.B = _md_ts_1.SHA256_IV[1] | 0;
4763
- this.C = _md_ts_1.SHA256_IV[2] | 0;
4764
- this.D = _md_ts_1.SHA256_IV[3] | 0;
4765
- this.E = _md_ts_1.SHA256_IV[4] | 0;
4766
- this.F = _md_ts_1.SHA256_IV[5] | 0;
4767
- this.G = _md_ts_1.SHA256_IV[6] | 0;
4768
- this.H = _md_ts_1.SHA256_IV[7] | 0;
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;
4769
4607
  }
4770
4608
  get() {
4771
4609
  const { A, B, C, D, E, F, G, H } = this;
@@ -4817,11 +4655,11 @@ var require_sha2 = __commonJS((exports) => {
4817
4655
  this.set(A, B, C, D, E, F, G, H);
4818
4656
  }
4819
4657
  roundClean() {
4820
- (0, utils_ts_1.clean)(SHA256_W);
4658
+ SHA256_W.fill(0);
4821
4659
  }
4822
4660
  destroy() {
4823
4661
  this.set(0, 0, 0, 0, 0, 0, 0, 0);
4824
- (0, utils_ts_1.clean)(this.buffer);
4662
+ this.buffer.fill(0);
4825
4663
  }
4826
4664
  }
4827
4665
  exports.SHA256 = SHA256;
@@ -4829,18 +4667,120 @@ var require_sha2 = __commonJS((exports) => {
4829
4667
  class SHA224 extends SHA256 {
4830
4668
  constructor() {
4831
4669
  super(28);
4832
- this.A = _md_ts_1.SHA224_IV[0] | 0;
4833
- this.B = _md_ts_1.SHA224_IV[1] | 0;
4834
- this.C = _md_ts_1.SHA224_IV[2] | 0;
4835
- this.D = _md_ts_1.SHA224_IV[3] | 0;
4836
- this.E = _md_ts_1.SHA224_IV[4] | 0;
4837
- this.F = _md_ts_1.SHA224_IV[5] | 0;
4838
- this.G = _md_ts_1.SHA224_IV[6] | 0;
4839
- this.H = _md_ts_1.SHA224_IV[7] | 0;
4840
- }
4841
- }
4842
- exports.SHA224 = SHA224;
4843
- var K512 = /* @__PURE__ */ (() => u64.split([
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/@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/@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([
4844
4784
  "0x428a2f98d728ae22",
4845
4785
  "0x7137449123ef65cd",
4846
4786
  "0xb5c0fbcfec4d3b2f",
@@ -4922,30 +4862,28 @@ var require_sha2 = __commonJS((exports) => {
4922
4862
  "0x5fcb6fab3ad6faec",
4923
4863
  "0x6c44198c4a475817"
4924
4864
  ].map((n) => BigInt(n))))();
4925
- var SHA512_Kh = /* @__PURE__ */ (() => K512[0])();
4926
- var SHA512_Kl = /* @__PURE__ */ (() => K512[1])();
4927
4865
  var SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);
4928
4866
  var SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);
4929
4867
 
4930
4868
  class SHA512 extends _md_ts_1.HashMD {
4931
4869
  constructor(outputLen = 64) {
4932
4870
  super(128, outputLen, 16, false);
4933
- this.Ah = _md_ts_1.SHA512_IV[0] | 0;
4934
- this.Al = _md_ts_1.SHA512_IV[1] | 0;
4935
- this.Bh = _md_ts_1.SHA512_IV[2] | 0;
4936
- this.Bl = _md_ts_1.SHA512_IV[3] | 0;
4937
- this.Ch = _md_ts_1.SHA512_IV[4] | 0;
4938
- this.Cl = _md_ts_1.SHA512_IV[5] | 0;
4939
- this.Dh = _md_ts_1.SHA512_IV[6] | 0;
4940
- this.Dl = _md_ts_1.SHA512_IV[7] | 0;
4941
- this.Eh = _md_ts_1.SHA512_IV[8] | 0;
4942
- this.El = _md_ts_1.SHA512_IV[9] | 0;
4943
- this.Fh = _md_ts_1.SHA512_IV[10] | 0;
4944
- this.Fl = _md_ts_1.SHA512_IV[11] | 0;
4945
- this.Gh = _md_ts_1.SHA512_IV[12] | 0;
4946
- this.Gl = _md_ts_1.SHA512_IV[13] | 0;
4947
- this.Hh = _md_ts_1.SHA512_IV[14] | 0;
4948
- this.Hl = _md_ts_1.SHA512_IV[15] | 0;
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;
4949
4887
  }
4950
4888
  get() {
4951
4889
  const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
@@ -4977,28 +4915,28 @@ var require_sha2 = __commonJS((exports) => {
4977
4915
  for (let i = 16;i < 80; i++) {
4978
4916
  const W15h = SHA512_W_H[i - 15] | 0;
4979
4917
  const W15l = SHA512_W_L[i - 15] | 0;
4980
- const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);
4981
- const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);
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);
4982
4920
  const W2h = SHA512_W_H[i - 2] | 0;
4983
4921
  const W2l = SHA512_W_L[i - 2] | 0;
4984
- const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);
4985
- const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);
4986
- const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);
4987
- const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);
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]);
4988
4926
  SHA512_W_H[i] = SUMh | 0;
4989
4927
  SHA512_W_L[i] = SUMl | 0;
4990
4928
  }
4991
4929
  let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
4992
4930
  for (let i = 0;i < 80; i++) {
4993
- const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);
4994
- const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);
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);
4995
4933
  const CHIh = Eh & Fh ^ ~Eh & Gh;
4996
4934
  const CHIl = El & Fl ^ ~El & Gl;
4997
- const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);
4998
- const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);
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]);
4999
4937
  const T1l = T1ll | 0;
5000
- const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);
5001
- const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);
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);
5002
4940
  const MAJh = Ah & Bh ^ Ah & Ch ^ Bh & Ch;
5003
4941
  const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl;
5004
4942
  Hh = Gh | 0;
@@ -5007,115 +4945,57 @@ var require_sha2 = __commonJS((exports) => {
5007
4945
  Gl = Fl | 0;
5008
4946
  Fh = Eh | 0;
5009
4947
  Fl = El | 0;
5010
- ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));
4948
+ ({ h: Eh, l: El } = _u64_ts_1.default.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));
5011
4949
  Dh = Ch | 0;
5012
4950
  Dl = Cl | 0;
5013
4951
  Ch = Bh | 0;
5014
4952
  Cl = Bl | 0;
5015
4953
  Bh = Ah | 0;
5016
4954
  Bl = Al | 0;
5017
- const All = u64.add3L(T1l, sigma0l, MAJl);
5018
- Ah = u64.add3H(All, T1h, sigma0h, MAJh);
4955
+ const All = _u64_ts_1.default.add3L(T1l, sigma0l, MAJl);
4956
+ Ah = _u64_ts_1.default.add3H(All, T1h, sigma0h, MAJh);
5019
4957
  Al = All | 0;
5020
4958
  }
5021
- ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));
5022
- ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));
5023
- ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));
5024
- ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));
5025
- ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));
5026
- ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));
5027
- ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));
5028
- ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));
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));
5029
4967
  this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);
5030
4968
  }
5031
4969
  roundClean() {
5032
- (0, utils_ts_1.clean)(SHA512_W_H, SHA512_W_L);
4970
+ SHA512_W_H.fill(0);
4971
+ SHA512_W_L.fill(0);
5033
4972
  }
5034
4973
  destroy() {
5035
- (0, utils_ts_1.clean)(this.buffer);
4974
+ this.buffer.fill(0);
5036
4975
  this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
5037
4976
  }
5038
4977
  }
5039
4978
  exports.SHA512 = SHA512;
5040
4979
 
5041
- class SHA384 extends SHA512 {
5042
- constructor() {
5043
- super(48);
5044
- this.Ah = _md_ts_1.SHA384_IV[0] | 0;
5045
- this.Al = _md_ts_1.SHA384_IV[1] | 0;
5046
- this.Bh = _md_ts_1.SHA384_IV[2] | 0;
5047
- this.Bl = _md_ts_1.SHA384_IV[3] | 0;
5048
- this.Ch = _md_ts_1.SHA384_IV[4] | 0;
5049
- this.Cl = _md_ts_1.SHA384_IV[5] | 0;
5050
- this.Dh = _md_ts_1.SHA384_IV[6] | 0;
5051
- this.Dl = _md_ts_1.SHA384_IV[7] | 0;
5052
- this.Eh = _md_ts_1.SHA384_IV[8] | 0;
5053
- this.El = _md_ts_1.SHA384_IV[9] | 0;
5054
- this.Fh = _md_ts_1.SHA384_IV[10] | 0;
5055
- this.Fl = _md_ts_1.SHA384_IV[11] | 0;
5056
- this.Gh = _md_ts_1.SHA384_IV[12] | 0;
5057
- this.Gl = _md_ts_1.SHA384_IV[13] | 0;
5058
- this.Hh = _md_ts_1.SHA384_IV[14] | 0;
5059
- this.Hl = _md_ts_1.SHA384_IV[15] | 0;
5060
- }
5061
- }
5062
- exports.SHA384 = SHA384;
5063
- var T224_IV = /* @__PURE__ */ Uint32Array.from([
5064
- 2352822216,
5065
- 424955298,
5066
- 1944164710,
5067
- 2312950998,
5068
- 502970286,
5069
- 855612546,
5070
- 1738396948,
5071
- 1479516111,
5072
- 258812777,
5073
- 2077511080,
5074
- 2011393907,
5075
- 79989058,
5076
- 1067287976,
5077
- 1780299464,
5078
- 286451373,
5079
- 2446758561
5080
- ]);
5081
- var T256_IV = /* @__PURE__ */ Uint32Array.from([
5082
- 573645204,
5083
- 4230739756,
5084
- 2673172387,
5085
- 3360449730,
5086
- 596883563,
5087
- 1867755857,
5088
- 2520282905,
5089
- 1497426621,
5090
- 2519219938,
5091
- 2827943907,
5092
- 3193839141,
5093
- 1401305490,
5094
- 721525244,
5095
- 746961066,
5096
- 246885852,
5097
- 2177182882
5098
- ]);
5099
-
5100
4980
  class SHA512_224 extends SHA512 {
5101
4981
  constructor() {
5102
4982
  super(28);
5103
- this.Ah = T224_IV[0] | 0;
5104
- this.Al = T224_IV[1] | 0;
5105
- this.Bh = T224_IV[2] | 0;
5106
- this.Bl = T224_IV[3] | 0;
5107
- this.Ch = T224_IV[4] | 0;
5108
- this.Cl = T224_IV[5] | 0;
5109
- this.Dh = T224_IV[6] | 0;
5110
- this.Dl = T224_IV[7] | 0;
5111
- this.Eh = T224_IV[8] | 0;
5112
- this.El = T224_IV[9] | 0;
5113
- this.Fh = T224_IV[10] | 0;
5114
- this.Fl = T224_IV[11] | 0;
5115
- this.Gh = T224_IV[12] | 0;
5116
- this.Gl = T224_IV[13] | 0;
5117
- this.Hh = T224_IV[14] | 0;
5118
- this.Hl = T224_IV[15] | 0;
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;
5119
4999
  }
5120
5000
  }
5121
5001
  exports.SHA512_224 = SHA512_224;
@@ -5123,34 +5003,81 @@ var require_sha2 = __commonJS((exports) => {
5123
5003
  class SHA512_256 extends SHA512 {
5124
5004
  constructor() {
5125
5005
  super(32);
5126
- this.Ah = T256_IV[0] | 0;
5127
- this.Al = T256_IV[1] | 0;
5128
- this.Bh = T256_IV[2] | 0;
5129
- this.Bl = T256_IV[3] | 0;
5130
- this.Ch = T256_IV[4] | 0;
5131
- this.Cl = T256_IV[5] | 0;
5132
- this.Dh = T256_IV[6] | 0;
5133
- this.Dl = T256_IV[7] | 0;
5134
- this.Eh = T256_IV[8] | 0;
5135
- this.El = T256_IV[9] | 0;
5136
- this.Fh = T256_IV[10] | 0;
5137
- this.Fl = T256_IV[11] | 0;
5138
- this.Gh = T256_IV[12] | 0;
5139
- this.Gl = T256_IV[13] | 0;
5140
- this.Hh = T256_IV[14] | 0;
5141
- this.Hl = T256_IV[15] | 0;
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;
5142
5022
  }
5143
5023
  }
5144
5024
  exports.SHA512_256 = SHA512_256;
5145
- exports.sha256 = (0, utils_ts_1.createHasher)(() => new SHA256);
5146
- exports.sha224 = (0, utils_ts_1.createHasher)(() => new SHA224);
5147
- exports.sha512 = (0, utils_ts_1.createHasher)(() => new SHA512);
5148
- exports.sha384 = (0, utils_ts_1.createHasher)(() => new SHA384);
5149
- exports.sha512_256 = (0, utils_ts_1.createHasher)(() => new SHA512_256);
5150
- exports.sha512_224 = (0, utils_ts_1.createHasher)(() => new SHA512_224);
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);
5151
5052
  });
5152
5053
 
5153
- // ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/utils.js
5054
+ // ../../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
+ } });
5078
+ });
5079
+
5080
+ // ../../node_modules/@noble/curves/abstract/utils.js
5154
5081
  var require_utils5 = __commonJS((exports) => {
5155
5082
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
5156
5083
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -5424,7 +5351,7 @@ var require_utils5 = __commonJS((exports) => {
5424
5351
  }
5425
5352
  });
5426
5353
 
5427
- // ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/modular.js
5354
+ // ../../node_modules/@noble/curves/abstract/modular.js
5428
5355
  var require_modular = __commonJS((exports) => {
5429
5356
  Object.defineProperty(exports, "__esModule", { value: true });
5430
5357
  exports.isNegativeLE = undefined;
@@ -5449,7 +5376,6 @@ var require_modular = __commonJS((exports) => {
5449
5376
  exports.getMinHashLength = getMinHashLength;
5450
5377
  exports.mapHashToField = mapHashToField;
5451
5378
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
5452
- var utils_1 = require_utils4();
5453
5379
  var utils_ts_1 = require_utils5();
5454
5380
  var _0n = BigInt(0);
5455
5381
  var _1n = BigInt(1);
@@ -5509,17 +5435,13 @@ var require_modular = __commonJS((exports) => {
5509
5435
  return mod(x, modulo);
5510
5436
  }
5511
5437
  function tonelliShanks(P) {
5512
- let Q = P - _1n;
5513
- let S = 0;
5514
- while (Q % _2n === _0n) {
5515
- Q /= _2n;
5516
- S++;
5517
- }
5518
- let Z = _2n;
5519
- const _Fp = Field(P);
5520
- while (Z < P && FpIsSquare(_Fp, Z)) {
5521
- if (Z++ > 1000)
5522
- throw new Error("Cannot find square root: probably non-prime 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");
5523
5445
  }
5524
5446
  if (S === 1) {
5525
5447
  const p1div4 = (P + _1n) / _4n;
@@ -5532,7 +5454,7 @@ var require_modular = __commonJS((exports) => {
5532
5454
  }
5533
5455
  const Q1div2 = (Q + _1n) / _2n;
5534
5456
  return function tonelliSlow(Fp, n) {
5535
- if (!FpIsSquare(Fp, n))
5457
+ if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE))
5536
5458
  throw new Error("Cannot find square root");
5537
5459
  let r = S;
5538
5460
  let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q);
@@ -5558,8 +5480,8 @@ var require_modular = __commonJS((exports) => {
5558
5480
  }
5559
5481
  function FpSqrt(P) {
5560
5482
  if (P % _4n === _3n) {
5483
+ const p1div4 = (P + _1n) / _4n;
5561
5484
  return function sqrt3mod4(Fp, n) {
5562
- const p1div4 = (P + _1n) / _4n;
5563
5485
  const root = Fp.pow(n, p1div4);
5564
5486
  if (!Fp.eql(Fp.sqr(root), n))
5565
5487
  throw new Error("Cannot find square root");
@@ -5567,9 +5489,9 @@ var require_modular = __commonJS((exports) => {
5567
5489
  };
5568
5490
  }
5569
5491
  if (P % _8n === _5n) {
5492
+ const c1 = (P - _5n) / _8n;
5570
5493
  return function sqrt5mod8(Fp, n) {
5571
5494
  const n2 = Fp.mul(n, _2n);
5572
- const c1 = (P - _5n) / _8n;
5573
5495
  const v = Fp.pow(n2, c1);
5574
5496
  const nv = Fp.mul(n, v);
5575
5497
  const i = Fp.mul(Fp.mul(nv, _2n), v);
@@ -5616,60 +5538,55 @@ var require_modular = __commonJS((exports) => {
5616
5538
  }, initial);
5617
5539
  return (0, utils_ts_1.validateObject)(field, opts);
5618
5540
  }
5619
- function FpPow(Fp, num, power) {
5541
+ function FpPow(f, num, power) {
5620
5542
  if (power < _0n)
5621
5543
  throw new Error("invalid exponent, negatives unsupported");
5622
5544
  if (power === _0n)
5623
- return Fp.ONE;
5545
+ return f.ONE;
5624
5546
  if (power === _1n)
5625
5547
  return num;
5626
- let p = Fp.ONE;
5548
+ let p = f.ONE;
5627
5549
  let d = num;
5628
5550
  while (power > _0n) {
5629
5551
  if (power & _1n)
5630
- p = Fp.mul(p, d);
5631
- d = Fp.sqr(d);
5552
+ p = f.mul(p, d);
5553
+ d = f.sqr(d);
5632
5554
  power >>= _1n;
5633
5555
  }
5634
5556
  return p;
5635
5557
  }
5636
- function FpInvertBatch(Fp, nums, passZero = false) {
5637
- const inverted = new Array(nums.length).fill(passZero ? Fp.ZERO : undefined);
5638
- const multipliedAcc = nums.reduce((acc, num, i) => {
5639
- if (Fp.is0(num))
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))
5640
5562
  return acc;
5641
- inverted[i] = acc;
5642
- return Fp.mul(acc, num);
5643
- }, Fp.ONE);
5644
- const invertedAcc = Fp.inv(multipliedAcc);
5563
+ tmp[i] = acc;
5564
+ return f.mul(acc, num);
5565
+ }, f.ONE);
5566
+ const inverted = f.inv(lastMultiplied);
5645
5567
  nums.reduceRight((acc, num, i) => {
5646
- if (Fp.is0(num))
5568
+ if (f.is0(num))
5647
5569
  return acc;
5648
- inverted[i] = Fp.mul(acc, inverted[i]);
5649
- return Fp.mul(acc, num);
5650
- }, invertedAcc);
5651
- return inverted;
5652
- }
5653
- function FpDiv(Fp, lhs, rhs) {
5654
- return Fp.mul(lhs, typeof rhs === "bigint" ? invert(rhs, Fp.ORDER) : Fp.inv(rhs));
5655
- }
5656
- function FpLegendre(Fp, n) {
5657
- const legc = (Fp.ORDER - _1n) / _2n;
5658
- const powered = Fp.pow(n, legc);
5659
- const yes = Fp.eql(powered, Fp.ONE);
5660
- const zero = Fp.eql(powered, Fp.ZERO);
5661
- const no = Fp.eql(powered, Fp.neg(Fp.ONE));
5662
- if (!yes && !zero && !no)
5663
- throw new Error("Cannot find square root: probably non-prime P");
5664
- return yes ? 1 : zero ? 0 : -1;
5665
- }
5666
- function FpIsSquare(Fp, n) {
5667
- const l = FpLegendre(Fp, n);
5668
- return l === 0 || l === 1;
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
+ };
5669
5588
  }
5670
5589
  function nLength(n, nBitLength) {
5671
- if (nBitLength !== undefined)
5672
- (0, utils_1.anumber)(nBitLength);
5673
5590
  const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length;
5674
5591
  const nByteLength = Math.ceil(_nBitLength / 8);
5675
5592
  return { nBitLength: _nBitLength, nByteLength };
@@ -5715,14 +5632,14 @@ var require_modular = __commonJS((exports) => {
5715
5632
  sqrtP = FpSqrt(ORDER);
5716
5633
  return sqrtP(f, n);
5717
5634
  }),
5635
+ invertBatch: (lst) => FpInvertBatch(f, lst),
5636
+ cmov: (a, b, c) => c ? b : a,
5718
5637
  toBytes: (num) => isLE ? (0, utils_ts_1.numberToBytesLE)(num, BYTES) : (0, utils_ts_1.numberToBytesBE)(num, BYTES),
5719
5638
  fromBytes: (bytes) => {
5720
5639
  if (bytes.length !== BYTES)
5721
5640
  throw new Error("Field.fromBytes: expected " + BYTES + " bytes, got " + bytes.length);
5722
5641
  return isLE ? (0, utils_ts_1.bytesToNumberLE)(bytes) : (0, utils_ts_1.bytesToNumberBE)(bytes);
5723
- },
5724
- invertBatch: (lst) => FpInvertBatch(f, lst),
5725
- cmov: (a, b, c) => c ? b : a
5642
+ }
5726
5643
  });
5727
5644
  return Object.freeze(f);
5728
5645
  }
@@ -5769,7 +5686,7 @@ var require_modular = __commonJS((exports) => {
5769
5686
  }
5770
5687
  });
5771
5688
 
5772
- // ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/curve.js
5689
+ // ../../node_modules/@noble/curves/abstract/curve.js
5773
5690
  var require_curve = __commonJS((exports) => {
5774
5691
  Object.defineProperty(exports, "__esModule", { value: true });
5775
5692
  exports.wNAF = wNAF;
@@ -6010,7 +5927,7 @@ var require_curve = __commonJS((exports) => {
6010
5927
  }
6011
5928
  });
6012
5929
 
6013
- // ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/edwards.js
5930
+ // ../../node_modules/@noble/curves/abstract/edwards.js
6014
5931
  var require_edwards = __commonJS((exports) => {
6015
5932
  Object.defineProperty(exports, "__esModule", { value: true });
6016
5933
  exports.twistedEdwards = twistedEdwards;
@@ -6128,7 +6045,7 @@ var require_edwards = __commonJS((exports) => {
6128
6045
  return new Point(x, y, _1n, modP(x * y));
6129
6046
  }
6130
6047
  static normalizeZ(points) {
6131
- const toInv = (0, modular_ts_1.FpInvertBatch)(Fp, points.map((p) => p.ez));
6048
+ const toInv = Fp.invertBatch(points.map((p) => p.ez));
6132
6049
  return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);
6133
6050
  }
6134
6051
  static msm(points, scalars) {
@@ -6296,7 +6213,7 @@ var require_edwards = __commonJS((exports) => {
6296
6213
  function getPublicKey(privKey) {
6297
6214
  return getExtendedPublicKey(privKey).pointBytes;
6298
6215
  }
6299
- function hashDomainToScalar(context = Uint8Array.of(), ...msgs) {
6216
+ function hashDomainToScalar(context = new Uint8Array, ...msgs) {
6300
6217
  const msg = (0, utils_ts_1.concatBytes)(...msgs);
6301
6218
  return modN_LE(cHash(domain(msg, (0, utils_ts_1.ensureBytes)("context", context), !!prehash)));
6302
6219
  }
@@ -6360,7 +6277,7 @@ var require_edwards = __commonJS((exports) => {
6360
6277
  }
6361
6278
  });
6362
6279
 
6363
- // ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/hash-to-curve.js
6280
+ // ../../node_modules/@noble/curves/abstract/hash-to-curve.js
6364
6281
  var require_hash_to_curve = __commonJS((exports) => {
6365
6282
  Object.defineProperty(exports, "__esModule", { value: true });
6366
6283
  exports.expand_message_xmd = expand_message_xmd;
@@ -6467,53 +6384,49 @@ var require_hash_to_curve = __commonJS((exports) => {
6467
6384
  return u;
6468
6385
  }
6469
6386
  function isogenyMap(field, map) {
6470
- const coeff = map.map((i) => Array.from(i).reverse());
6387
+ const COEFF = map.map((i) => Array.from(i).reverse());
6471
6388
  return (x, y) => {
6472
- const [xn, xd, yn, yd] = coeff.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i)));
6473
- const [xd_inv, yd_inv] = (0, modular_ts_1.FpInvertBatch)(field, [xd, yd], true);
6474
- x = field.mul(xn, xd_inv);
6475
- y = field.mul(y, field.mul(yn, yd_inv));
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));
6476
6394
  return { x, y };
6477
6395
  };
6478
6396
  }
6479
- function createHasher(Point, mapToCurve, defaults) {
6397
+ function createHasher(Point, mapToCurve, def) {
6480
6398
  if (typeof mapToCurve !== "function")
6481
6399
  throw new Error("mapToCurve() must be defined");
6482
- function map(num) {
6483
- return Point.fromAffine(mapToCurve(num));
6484
- }
6485
- function clear(initial) {
6486
- const P = initial.clearCofactor();
6487
- if (P.equals(Point.ZERO))
6488
- return Point.ZERO;
6489
- P.assertValidity();
6490
- return P;
6491
- }
6492
6400
  return {
6493
- defaults,
6494
6401
  hashToCurve(msg, options) {
6495
- const u = hash_to_field(msg, 2, { ...defaults, DST: defaults.DST, ...options });
6496
- const u0 = map(u[0]);
6497
- const u1 = map(u[1]);
6498
- return clear(u0.add(u1));
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;
6499
6408
  },
6500
6409
  encodeToCurve(msg, options) {
6501
- const u = hash_to_field(msg, 1, { ...defaults, DST: defaults.encodeDST, ...options });
6502
- return clear(map(u[0]));
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;
6503
6414
  },
6504
6415
  mapToCurve(scalars) {
6505
6416
  if (!Array.isArray(scalars))
6506
- throw new Error("expected array of bigints");
6417
+ throw new Error("mapToCurve: expected array of bigints");
6507
6418
  for (const i of scalars)
6508
6419
  if (typeof i !== "bigint")
6509
- throw new Error("expected array of bigints");
6510
- return clear(map(scalars));
6420
+ throw new Error("mapToCurve: expected array of bigints");
6421
+ const P = Point.fromAffine(mapToCurve(scalars)).clearCofactor();
6422
+ P.assertValidity();
6423
+ return P;
6511
6424
  }
6512
6425
  };
6513
6426
  }
6514
6427
  });
6515
6428
 
6516
- // ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/montgomery.js
6429
+ // ../../node_modules/@noble/curves/abstract/montgomery.js
6517
6430
  var require_montgomery = __commonJS((exports) => {
6518
6431
  Object.defineProperty(exports, "__esModule", { value: true });
6519
6432
  exports.montgomery = montgomery;
@@ -6538,13 +6451,12 @@ var require_montgomery = __commonJS((exports) => {
6538
6451
  function montgomery(curveDef) {
6539
6452
  const CURVE = validateOpts(curveDef);
6540
6453
  const { P } = CURVE;
6541
- const Fp = (0, modular_ts_1.Field)(P);
6542
6454
  const modP = (n) => (0, modular_ts_1.mod)(n, P);
6543
6455
  const montgomeryBits = CURVE.montgomeryBits;
6544
6456
  const montgomeryBytes = Math.ceil(montgomeryBits / 8);
6545
6457
  const fieldLen = CURVE.nByteLength;
6546
6458
  const adjustScalarBytes = CURVE.adjustScalarBytes || ((bytes) => bytes);
6547
- const powPminus2 = CURVE.powPminus2 || ((x) => Fp.pow(x, P - BigInt(2)));
6459
+ const powPminus2 = CURVE.powPminus2 || ((x) => (0, modular_ts_1.pow)(x, P - BigInt(2), P));
6548
6460
  function cswap(swap, x_2, x_3) {
6549
6461
  const dummy = modP(swap * (x_2 - x_3));
6550
6462
  x_2 = modP(x_2 - dummy);
@@ -6639,10 +6551,10 @@ var require_montgomery = __commonJS((exports) => {
6639
6551
  }
6640
6552
  });
6641
6553
 
6642
- // ../../node_modules/eciesjs/node_modules/@noble/curves/ed25519.js
6554
+ // ../../node_modules/@noble/curves/ed25519.js
6643
6555
  var require_ed25519 = __commonJS((exports) => {
6644
6556
  Object.defineProperty(exports, "__esModule", { value: true });
6645
- 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;
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;
6646
6558
  exports.edwardsToMontgomeryPub = edwardsToMontgomeryPub;
6647
6559
  exports.edwardsToMontgomeryPriv = edwardsToMontgomeryPriv;
6648
6560
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
@@ -6827,10 +6739,10 @@ var require_ed25519 = __commonJS((exports) => {
6827
6739
  xd = Fp.cmov(xd, Fp.ONE, e);
6828
6740
  yn = Fp.cmov(yn, Fp.ONE, e);
6829
6741
  yd = Fp.cmov(yd, Fp.ONE, e);
6830
- const [xd_inv, yd_inv] = (0, modular_ts_1.FpInvertBatch)(Fp, [xd, yd], true);
6831
- return { x: Fp.mul(xn, xd_inv), y: Fp.mul(yn, yd_inv) };
6742
+ const inv = Fp.invertBatch([xd, yd]);
6743
+ return { x: Fp.mul(xn, inv[0]), y: Fp.mul(yn, inv[1]) };
6832
6744
  }
6833
- exports.ed25519_hasher = (() => (0, hash_to_curve_ts_1.createHasher)(exports.ed25519.ExtendedPoint, (scalars) => map_to_curve_elligator2_edwards25519(scalars[0]), {
6745
+ var htf = /* @__PURE__ */ (() => (0, hash_to_curve_ts_1.createHasher)(exports.ed25519.ExtendedPoint, (scalars) => map_to_curve_elligator2_edwards25519(scalars[0]), {
6834
6746
  DST: "edwards25519_XMD:SHA-512_ELL2_RO_",
6835
6747
  encodeDST: "edwards25519_XMD:SHA-512_ELL2_NU_",
6836
6748
  p: Fp.ORDER,
@@ -6839,8 +6751,8 @@ var require_ed25519 = __commonJS((exports) => {
6839
6751
  expand: "xmd",
6840
6752
  hash: sha2_1.sha512
6841
6753
  }))();
6842
- exports.hashToCurve = (() => exports.ed25519_hasher.hashToCurve)();
6843
- exports.encodeToCurve = (() => exports.ed25519_hasher.encodeToCurve)();
6754
+ exports.hashToCurve = (() => htf.hashToCurve)();
6755
+ exports.encodeToCurve = (() => htf.encodeToCurve)();
6844
6756
  function aristp(other) {
6845
6757
  if (!(other instanceof RistPoint))
6846
6758
  throw new Error("RistrettoPoint expected");
@@ -7006,10 +6918,11 @@ var require_ed25519 = __commonJS((exports) => {
7006
6918
  exports.hash_to_ristretto255 = exports.hashToRistretto255;
7007
6919
  });
7008
6920
 
7009
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/hmac.js
6921
+ // ../../node_modules/@noble/hashes/hmac.js
7010
6922
  var require_hmac = __commonJS((exports) => {
7011
6923
  Object.defineProperty(exports, "__esModule", { value: true });
7012
6924
  exports.hmac = exports.HMAC = undefined;
6925
+ var _assert_ts_1 = require__assert();
7013
6926
  var utils_ts_1 = require_utils4();
7014
6927
 
7015
6928
  class HMAC extends utils_ts_1.Hash {
@@ -7017,7 +6930,7 @@ var require_hmac = __commonJS((exports) => {
7017
6930
  super();
7018
6931
  this.finished = false;
7019
6932
  this.destroyed = false;
7020
- (0, utils_ts_1.ahash)(hash);
6933
+ (0, _assert_ts_1.ahash)(hash);
7021
6934
  const key = (0, utils_ts_1.toBytes)(_key);
7022
6935
  this.iHash = hash.create();
7023
6936
  if (typeof this.iHash.update !== "function")
@@ -7034,16 +6947,16 @@ var require_hmac = __commonJS((exports) => {
7034
6947
  for (let i = 0;i < pad.length; i++)
7035
6948
  pad[i] ^= 54 ^ 92;
7036
6949
  this.oHash.update(pad);
7037
- (0, utils_ts_1.clean)(pad);
6950
+ pad.fill(0);
7038
6951
  }
7039
6952
  update(buf) {
7040
- (0, utils_ts_1.aexists)(this);
6953
+ (0, _assert_ts_1.aexists)(this);
7041
6954
  this.iHash.update(buf);
7042
6955
  return this;
7043
6956
  }
7044
6957
  digestInto(out) {
7045
- (0, utils_ts_1.aexists)(this);
7046
- (0, utils_ts_1.abytes)(out, this.outputLen);
6958
+ (0, _assert_ts_1.aexists)(this);
6959
+ (0, _assert_ts_1.abytes)(out, this.outputLen);
7047
6960
  this.finished = true;
7048
6961
  this.iHash.digestInto(out);
7049
6962
  this.oHash.update(out);
@@ -7067,9 +6980,6 @@ var require_hmac = __commonJS((exports) => {
7067
6980
  to.iHash = iHash._cloneInto(to.iHash);
7068
6981
  return to;
7069
6982
  }
7070
- clone() {
7071
- return this._cloneInto();
7072
- }
7073
6983
  destroy() {
7074
6984
  this.destroyed = true;
7075
6985
  this.oHash.destroy();
@@ -7082,7 +6992,7 @@ var require_hmac = __commonJS((exports) => {
7082
6992
  exports.hmac.create = (hash, key) => new HMAC(hash, key);
7083
6993
  });
7084
6994
 
7085
- // ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/weierstrass.js
6995
+ // ../../node_modules/@noble/curves/abstract/weierstrass.js
7086
6996
  var require_weierstrass = __commonJS((exports) => {
7087
6997
  Object.defineProperty(exports, "__esModule", { value: true });
7088
6998
  exports.DER = exports.DERErr = undefined;
@@ -7317,7 +7227,7 @@ var require_weierstrass = __commonJS((exports) => {
7317
7227
  constructor(px, py, pz) {
7318
7228
  if (px == null || !Fp.isValid(px))
7319
7229
  throw new Error("x required");
7320
- if (py == null || !Fp.isValid(py) || Fp.is0(py))
7230
+ if (py == null || !Fp.isValid(py))
7321
7231
  throw new Error("y required");
7322
7232
  if (pz == null || !Fp.isValid(pz))
7323
7233
  throw new Error("z required");
@@ -7344,7 +7254,7 @@ var require_weierstrass = __commonJS((exports) => {
7344
7254
  return this.toAffine().y;
7345
7255
  }
7346
7256
  static normalizeZ(points) {
7347
- const toInv = (0, modular_ts_1.FpInvertBatch)(Fp, points.map((p) => p.pz));
7257
+ const toInv = Fp.invertBatch(points.map((p) => p.pz));
7348
7258
  return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);
7349
7259
  }
7350
7260
  static fromHex(hex) {
@@ -7705,7 +7615,7 @@ var require_weierstrass = __commonJS((exports) => {
7705
7615
  return (0, utils_ts_1.hexToBytes)(this.toDERHex());
7706
7616
  }
7707
7617
  toDERHex() {
7708
- return exports.DER.hexFromSig(this);
7618
+ return exports.DER.hexFromSig({ r: this.r, s: this.s });
7709
7619
  }
7710
7620
  toCompactRawBytes() {
7711
7621
  return (0, utils_ts_1.hexToBytes)(this.toCompactHex());
@@ -7980,14 +7890,13 @@ var require_weierstrass = __commonJS((exports) => {
7980
7890
  y = Fp.cmov(y, value, isValid2);
7981
7891
  const e1 = Fp.isOdd(u) === Fp.isOdd(y);
7982
7892
  y = Fp.cmov(Fp.neg(y), y, e1);
7983
- const tv4_inv = (0, modular_ts_1.FpInvertBatch)(Fp, [tv4], true)[0];
7984
- x = Fp.mul(x, tv4_inv);
7893
+ x = Fp.div(x, tv4);
7985
7894
  return { x, y };
7986
7895
  };
7987
7896
  }
7988
7897
  });
7989
7898
 
7990
- // ../../node_modules/eciesjs/node_modules/@noble/curves/_shortw_utils.js
7899
+ // ../../node_modules/@noble/curves/_shortw_utils.js
7991
7900
  var require__shortw_utils = __commonJS((exports) => {
7992
7901
  Object.defineProperty(exports, "__esModule", { value: true });
7993
7902
  exports.getHash = getHash;
@@ -8009,10 +7918,10 @@ var require__shortw_utils = __commonJS((exports) => {
8009
7918
  }
8010
7919
  });
8011
7920
 
8012
- // ../../node_modules/eciesjs/node_modules/@noble/curves/secp256k1.js
7921
+ // ../../node_modules/@noble/curves/secp256k1.js
8013
7922
  var require_secp256k1 = __commonJS((exports) => {
8014
7923
  Object.defineProperty(exports, "__esModule", { value: true });
8015
- exports.encodeToCurve = exports.hashToCurve = exports.secp256k1_hasher = exports.schnorr = exports.secp256k1 = undefined;
7924
+ exports.encodeToCurve = exports.hashToCurve = exports.schnorr = exports.secp256k1 = undefined;
8016
7925
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
8017
7926
  var sha2_1 = require_sha2();
8018
7927
  var utils_1 = require_utils4();
@@ -8208,7 +8117,7 @@ var require_secp256k1 = __commonJS((exports) => {
8208
8117
  B: BigInt("1771"),
8209
8118
  Z: Fpk1.create(BigInt("-11"))
8210
8119
  }))();
8211
- exports.secp256k1_hasher = (() => (0, hash_to_curve_ts_1.createHasher)(exports.secp256k1.ProjectivePoint, (scalars) => {
8120
+ var htf = /* @__PURE__ */ (() => (0, hash_to_curve_ts_1.createHasher)(exports.secp256k1.ProjectivePoint, (scalars) => {
8212
8121
  const { x, y } = mapSWU(Fpk1.create(scalars[0]));
8213
8122
  return isoMap(x, y);
8214
8123
  }, {
@@ -8220,8 +8129,8 @@ var require_secp256k1 = __commonJS((exports) => {
8220
8129
  expand: "xmd",
8221
8130
  hash: sha2_1.sha256
8222
8131
  }))();
8223
- exports.hashToCurve = (() => exports.secp256k1_hasher.hashToCurve)();
8224
- exports.encodeToCurve = (() => exports.secp256k1_hasher.encodeToCurve)();
8132
+ exports.hashToCurve = (() => htf.hashToCurve)();
8133
+ exports.encodeToCurve = (() => htf.encodeToCurve)();
8225
8134
  });
8226
8135
 
8227
8136
  // ../../node_modules/eciesjs/dist/utils/hex.js
@@ -8335,61 +8244,51 @@ var require_elliptic = __commonJS((exports) => {
8335
8244
  };
8336
8245
  });
8337
8246
 
8338
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/hkdf.js
8247
+ // ../../node_modules/@noble/hashes/hkdf.js
8339
8248
  var require_hkdf = __commonJS((exports) => {
8340
8249
  Object.defineProperty(exports, "__esModule", { value: true });
8341
8250
  exports.hkdf = undefined;
8342
8251
  exports.extract = extract;
8343
8252
  exports.expand = expand;
8253
+ var _assert_ts_1 = require__assert();
8344
8254
  var hmac_ts_1 = require_hmac();
8345
8255
  var utils_ts_1 = require_utils4();
8346
8256
  function extract(hash, ikm, salt) {
8347
- (0, utils_ts_1.ahash)(hash);
8257
+ (0, _assert_ts_1.ahash)(hash);
8348
8258
  if (salt === undefined)
8349
8259
  salt = new Uint8Array(hash.outputLen);
8350
8260
  return (0, hmac_ts_1.hmac)(hash, (0, utils_ts_1.toBytes)(salt), (0, utils_ts_1.toBytes)(ikm));
8351
8261
  }
8352
- var HKDF_COUNTER = /* @__PURE__ */ Uint8Array.from([0]);
8353
- var EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of();
8262
+ var HKDF_COUNTER = /* @__PURE__ */ new Uint8Array([0]);
8263
+ var EMPTY_BUFFER = /* @__PURE__ */ new Uint8Array;
8354
8264
  function expand(hash, prk, info, length = 32) {
8355
- (0, utils_ts_1.ahash)(hash);
8356
- (0, utils_ts_1.anumber)(length);
8357
- const olen = hash.outputLen;
8358
- if (length > 255 * olen)
8265
+ (0, _assert_ts_1.ahash)(hash);
8266
+ (0, _assert_ts_1.anumber)(length);
8267
+ if (length > 255 * hash.outputLen)
8359
8268
  throw new Error("Length should be <= 255*HashLen");
8360
- const blocks = Math.ceil(length / olen);
8269
+ const blocks = Math.ceil(length / hash.outputLen);
8361
8270
  if (info === undefined)
8362
8271
  info = EMPTY_BUFFER;
8363
- const okm = new Uint8Array(blocks * olen);
8272
+ const okm = new Uint8Array(blocks * hash.outputLen);
8364
8273
  const HMAC = hmac_ts_1.hmac.create(hash, prk);
8365
8274
  const HMACTmp = HMAC._cloneInto();
8366
8275
  const T = new Uint8Array(HMAC.outputLen);
8367
8276
  for (let counter = 0;counter < blocks; counter++) {
8368
8277
  HKDF_COUNTER[0] = counter + 1;
8369
8278
  HMACTmp.update(counter === 0 ? EMPTY_BUFFER : T).update(info).update(HKDF_COUNTER).digestInto(T);
8370
- okm.set(T, olen * counter);
8279
+ okm.set(T, hash.outputLen * counter);
8371
8280
  HMAC._cloneInto(HMACTmp);
8372
8281
  }
8373
8282
  HMAC.destroy();
8374
8283
  HMACTmp.destroy();
8375
- (0, utils_ts_1.clean)(T, HKDF_COUNTER);
8284
+ T.fill(0);
8285
+ HKDF_COUNTER.fill(0);
8376
8286
  return okm.slice(0, length);
8377
8287
  }
8378
8288
  var hkdf = (hash, ikm, salt, info, length) => expand(hash, extract(hash, ikm, salt), info, length);
8379
8289
  exports.hkdf = hkdf;
8380
8290
  });
8381
8291
 
8382
- // ../../node_modules/eciesjs/node_modules/@noble/hashes/sha256.js
8383
- var require_sha256 = __commonJS((exports) => {
8384
- Object.defineProperty(exports, "__esModule", { value: true });
8385
- exports.sha224 = exports.SHA224 = exports.sha256 = exports.SHA256 = undefined;
8386
- var sha2_ts_1 = require_sha2();
8387
- exports.SHA256 = sha2_ts_1.SHA256;
8388
- exports.sha256 = sha2_ts_1.sha256;
8389
- exports.SHA224 = sha2_ts_1.SHA224;
8390
- exports.sha224 = sha2_ts_1.sha224;
8391
- });
8392
-
8393
8292
  // ../../node_modules/eciesjs/dist/utils/hash.js
8394
8293
  var require_hash = __commonJS((exports) => {
8395
8294
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -10696,15 +10595,15 @@ var require_main2 = __commonJS((exports, module) => {
10696
10595
  lastError = error;
10697
10596
  if (error.code === "MISSING_ENV_FILE") {
10698
10597
  if (!options.convention) {
10699
- console.error(error.message);
10598
+ logger.error(error.message);
10700
10599
  if (error.help) {
10701
- console.error(error.help);
10600
+ logger.error(error.help);
10702
10601
  }
10703
10602
  }
10704
10603
  } else {
10705
- console.error(error.message);
10604
+ logger.error(error.message);
10706
10605
  if (error.help) {
10707
- console.error(error.help);
10606
+ logger.error(error.help);
10708
10607
  }
10709
10608
  }
10710
10609
  }
@@ -10749,9 +10648,9 @@ var require_main2 = __commonJS((exports, module) => {
10749
10648
  const overload = options.overload || options.override;
10750
10649
  const { parsed, errors } = new Parse(src, privateKey, processEnv, overload).run();
10751
10650
  for (const error of errors) {
10752
- console.error(error.message);
10651
+ logger.error(error.message);
10753
10652
  if (error.help) {
10754
- console.error(error.help);
10653
+ logger.error(error.help);
10755
10654
  }
10756
10655
  }
10757
10656
  return parsed;
@@ -10822,9 +10721,9 @@ var require_main2 = __commonJS((exports, module) => {
10822
10721
  }
10823
10722
  if (options.strict)
10824
10723
  throw error;
10825
- console.error(error.message);
10724
+ logger.error(error.message);
10826
10725
  if (error.help) {
10827
- console.error(error.help);
10726
+ logger.error(error.help);
10828
10727
  }
10829
10728
  }
10830
10729
  if (key) {
@@ -245446,7 +245345,7 @@ function pruneCurrentEnv(currentEnv, env2) {
245446
245345
  var package_default = {
245447
245346
  name: "@settlemint/sdk-cli",
245448
245347
  description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
245449
- version: "2.2.2-prb5500d27",
245348
+ version: "2.2.2-prc6c765df",
245450
245349
  type: "module",
245451
245350
  private: false,
245452
245351
  license: "FSL-1.1-MIT",
@@ -245495,9 +245394,9 @@ var package_default = {
245495
245394
  "@inquirer/input": "4.1.9",
245496
245395
  "@inquirer/password": "4.0.12",
245497
245396
  "@inquirer/select": "4.2.0",
245498
- "@settlemint/sdk-js": "2.2.2-prb5500d27",
245499
- "@settlemint/sdk-utils": "2.2.2-prb5500d27",
245500
- "@types/node": "22.15.3",
245397
+ "@settlemint/sdk-js": "2.2.2-prc6c765df",
245398
+ "@settlemint/sdk-utils": "2.2.2-prc6c765df",
245399
+ "@types/node": "22.15.14",
245501
245400
  "@types/semver": "7.7.0",
245502
245401
  "@types/which": "3.0.4",
245503
245402
  "get-tsconfig": "4.10.0",
@@ -249275,7 +249174,18 @@ async function parsePackageJson(filepath, onUnknown) {
249275
249174
  return !filepath || !pathExists2(filepath, "file") ? null : await handlePackageManager(filepath, onUnknown);
249276
249175
  }
249277
249176
  async function detect(options = {}) {
249278
- const { cwd, strategies = ["lockfile", "packageManager-field", "devEngines-field"], onUnknown } = options;
249177
+ const {
249178
+ cwd,
249179
+ strategies = ["lockfile", "packageManager-field", "devEngines-field"],
249180
+ onUnknown
249181
+ } = options;
249182
+ let stopDir;
249183
+ if (typeof options.stopDir === "string") {
249184
+ const resolved = path4.resolve(options.stopDir);
249185
+ stopDir = (dir) => dir === resolved;
249186
+ } else {
249187
+ stopDir = options.stopDir;
249188
+ }
249279
249189
  for (const directory of lookup(cwd)) {
249280
249190
  for (const strategy of strategies) {
249281
249191
  switch (strategy) {
@@ -249312,6 +249222,8 @@ async function detect(options = {}) {
249312
249222
  }
249313
249223
  }
249314
249224
  }
249225
+ if (stopDir?.(directory))
249226
+ break;
249315
249227
  }
249316
249228
  return null;
249317
249229
  }
@@ -250456,6 +250368,17 @@ function missingApplication() {
250456
250368
  return cancel2("No application configured, please run `settlemint connect` to connect to your application");
250457
250369
  }
250458
250370
 
250371
+ // src/utils/instance-url-utils.ts
250372
+ function sanitizeInstanceUrl(url) {
250373
+ const instanceUrl = new URL(url);
250374
+ return instanceUrl.origin;
250375
+ }
250376
+ function sanitizeAndValidateInstanceUrl(url) {
250377
+ const sanitizedUrl = sanitizeInstanceUrl(url);
250378
+ validate2(UrlSchema2, sanitizedUrl);
250379
+ return sanitizedUrl;
250380
+ }
250381
+
250459
250382
  // src/utils/get-app-or-personal-token.ts
250460
250383
  var getApplicationOrPersonalAccessToken = async ({
250461
250384
  env: env2,
@@ -250463,7 +250386,8 @@ var getApplicationOrPersonalAccessToken = async ({
250463
250386
  prefer
250464
250387
  }) => {
250465
250388
  const applicationAccessToken = env2.SETTLEMINT_ACCESS_TOKEN;
250466
- const personalAccessToken = (await getInstanceCredentials(instance))?.personalAccessToken;
250389
+ const instanceUrl = sanitizeInstanceUrl(instance);
250390
+ const personalAccessToken = (await getInstanceCredentials(instanceUrl))?.personalAccessToken;
250467
250391
  const preferredToken = prefer === "application" ? applicationAccessToken : personalAccessToken;
250468
250392
  const fallbackToken = prefer === "application" ? personalAccessToken : applicationAccessToken;
250469
250393
  const allowFallback = prefer === "application";
@@ -252980,17 +252904,6 @@ async function theGraphPrompt({
252980
252904
  });
252981
252905
  }
252982
252906
 
252983
- // src/utils/instance-url-utils.ts
252984
- function sanitizeInstanceUrl(url) {
252985
- const instanceUrl = new URL(url);
252986
- return instanceUrl.origin;
252987
- }
252988
- function sanitizeAndValidateInstanceUrl(url) {
252989
- const sanitizedUrl = sanitizeInstanceUrl(url);
252990
- validate2(UrlSchema2, sanitizedUrl);
252991
- return sanitizedUrl;
252992
- }
252993
-
252994
252907
  // src/prompts/instance.prompt.ts
252995
252908
  async function instancePrompt(env2, accept, freeTextInput = false, isCi = is_in_ci_default) {
252996
252909
  const knownInstances = await getInstances();
@@ -253498,8 +253411,8 @@ function connectCommand() {
253498
253411
  SETTLEMINT_HASURA: hasura?.uniqueName,
253499
253412
  ...getHasuraEndpoints(hasura),
253500
253413
  SETTLEMINT_THEGRAPH: thegraph?.uniqueName,
253501
- SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: defaultSubgraph,
253502
253414
  ...graphEndpoints,
253415
+ SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: defaultSubgraph,
253503
253416
  SETTLEMINT_PORTAL: portal?.uniqueName,
253504
253417
  ...getPortalEndpoints(portal),
253505
253418
  SETTLEMINT_HD_PRIVATE_KEY: hdPrivateKey?.uniqueName,
@@ -260300,9 +260213,6 @@ function hardhatTestCommand() {
260300
260213
  });
260301
260214
  }
260302
260215
 
260303
- // src/commands/smart-contract-set/subgraph/build.ts
260304
- import { dirname as dirname10 } from "node:path";
260305
-
260306
260216
  // src/utils/subgraph/setup.ts
260307
260217
  import { rm as rm4 } from "node:fs/promises";
260308
260218
  var import_semver = __toESM(require_semver2(), 1);
@@ -260466,15 +260376,13 @@ function subgraphBuildCommand() {
260466
260376
  });
260467
260377
  const { command, args } = await getPackageManagerExecutable();
260468
260378
  const subgraphYamlFile = await getSubgraphYamlFile();
260469
- const cwd2 = dirname10(subgraphYamlFile);
260470
- await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], { cwd: cwd2 });
260471
- await executeCommand(command, [...args, "graph", "build", subgraphYamlFile], { cwd: cwd2 });
260379
+ await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile]);
260380
+ await executeCommand(command, [...args, "graph", "build", subgraphYamlFile]);
260472
260381
  outro("Subgraph built successfully");
260473
260382
  });
260474
260383
  }
260475
260384
 
260476
260385
  // src/commands/smart-contract-set/subgraph/codegen.ts
260477
- import { dirname as dirname11 } from "node:path";
260478
260386
  function subgraphCodegenCommand() {
260479
260387
  return new Command("codegen").description("Codegen the subgraph types").usage(createExamples([
260480
260388
  {
@@ -260489,15 +260397,12 @@ function subgraphCodegenCommand() {
260489
260397
  });
260490
260398
  const { command, args } = await getPackageManagerExecutable();
260491
260399
  const subgraphYamlFile = await getSubgraphYamlFile();
260492
- await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], {
260493
- cwd: dirname11(subgraphYamlFile)
260494
- });
260400
+ await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile]);
260495
260401
  outro("Subgraph types generated successfully");
260496
260402
  });
260497
260403
  }
260498
260404
 
260499
260405
  // src/commands/smart-contract-set/subgraph/deploy.ts
260500
- import { dirname as dirname12 } from "node:path";
260501
260406
  function subgraphDeployCommand() {
260502
260407
  return new Command("deploy").description("Deploy the subgraph").usage(createExamples([
260503
260408
  {
@@ -260533,9 +260438,7 @@ function subgraphDeployCommand() {
260533
260438
  const subgraphYamlFile = await getSubgraphYamlFile();
260534
260439
  await updateSpecVersion(theGraphMiddleware.specVersion);
260535
260440
  const { command, args } = await getPackageManagerExecutable();
260536
- await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], {
260537
- cwd: dirname12(subgraphYamlFile)
260538
- });
260441
+ await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile]);
260539
260442
  const generated = await isGenerated();
260540
260443
  if (generated) {
260541
260444
  const currentConfig = await getSubgraphConfig();
@@ -260599,7 +260502,7 @@ async function updateSpecVersion(specVersion) {
260599
260502
  }
260600
260503
 
260601
260504
  // src/commands/smart-contract-set/subgraph/remove.ts
260602
- import { dirname as dirname13 } from "node:path";
260505
+ import { dirname as dirname10 } from "node:path";
260603
260506
  function subgraphRemoveCommand() {
260604
260507
  return new Command("remove").description("Remove a subgraph").usage(createExamples([
260605
260508
  {
@@ -260634,7 +260537,7 @@ function subgraphRemoveCommand() {
260634
260537
  serviceNotRunningError("graph middleware", theGraphMiddleware.status);
260635
260538
  }
260636
260539
  const subgraphYamlFile = await getSubgraphYamlFile();
260637
- const cwd2 = dirname13(subgraphYamlFile);
260540
+ const cwd2 = dirname10(subgraphYamlFile);
260638
260541
  const { command, args } = await getPackageManagerExecutable();
260639
260542
  const middlewareAdminUrl = new URL(`/${encodeURIComponent(accessToken)}/admin`, theGraphMiddleware.serviceUrl).toString();
260640
260543
  await executeCommand(command, [...args, "graph", "remove", "--node", middlewareAdminUrl, graphName]);
@@ -260807,4 +260710,4 @@ async function sdkCliCommand(argv = process.argv) {
260807
260710
  // src/cli.ts
260808
260711
  sdkCliCommand();
260809
260712
 
260810
- //# debugId=90EAFE0F034BC64164756E2164756E21
260713
+ //# debugId=8E578EEEC7467F1864756E2164756E21