@settlemint/sdk-cli 2.2.2-main23b60412 → 2.2.2-main5d81cd7d
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.
- package/dist/cli.js +504 -600
- package/dist/cli.js.map +30 -28
- 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.
|
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
|
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) =>
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
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/
|
4170
|
-
var
|
4171
|
-
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) */
|
4161
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/_assert.js
|
4162
|
+
var require__assert = __commonJS((exports) => {
|
4180
4163
|
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.
|
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/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
|
+
}
|
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.
|
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
|
-
|
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
|
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("
|
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
|
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
|
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));
|
@@ -4414,10 +4395,11 @@ var require_utils4 = __commonJS((exports) => {
|
|
4414
4395
|
// ../../node_modules/eciesjs/node_modules/@noble/hashes/_md.js
|
4415
4396
|
var require__md = __commonJS((exports) => {
|
4416
4397
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4417
|
-
exports.
|
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,
|
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,
|
4483
|
-
(0,
|
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
|
-
|
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/
|
4684
|
-
var
|
4512
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/sha256.js
|
4513
|
+
var require_sha256 = __commonJS((exports) => {
|
4685
4514
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4686
|
-
exports.
|
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
|
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 =
|
4762
|
-
this.B =
|
4763
|
-
this.C =
|
4764
|
-
this.D =
|
4765
|
-
this.E =
|
4766
|
-
this.F =
|
4767
|
-
this.G =
|
4768
|
-
this.H =
|
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
|
4658
|
+
SHA256_W.fill(0);
|
4821
4659
|
}
|
4822
4660
|
destroy() {
|
4823
4661
|
this.set(0, 0, 0, 0, 0, 0, 0, 0);
|
4824
|
-
|
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 =
|
4833
|
-
this.B =
|
4834
|
-
this.C =
|
4835
|
-
this.D =
|
4836
|
-
this.E =
|
4837
|
-
this.F =
|
4838
|
-
this.G =
|
4839
|
-
this.H =
|
4840
|
-
}
|
4841
|
-
}
|
4842
|
-
exports.
|
4843
|
-
|
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([
|
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 =
|
4934
|
-
this.Al =
|
4935
|
-
this.Bh =
|
4936
|
-
this.Bl =
|
4937
|
-
this.Ch =
|
4938
|
-
this.Cl =
|
4939
|
-
this.Dh =
|
4940
|
-
this.Dl =
|
4941
|
-
this.Eh =
|
4942
|
-
this.El =
|
4943
|
-
this.Fh =
|
4944
|
-
this.Fl =
|
4945
|
-
this.Gh =
|
4946
|
-
this.Gl =
|
4947
|
-
this.Hh =
|
4948
|
-
this.Hl =
|
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 =
|
4981
|
-
const s0l =
|
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 =
|
4985
|
-
const s1l =
|
4986
|
-
const SUMl =
|
4987
|
-
const SUMh =
|
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 =
|
4994
|
-
const sigma1l =
|
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 =
|
4998
|
-
const T1h =
|
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 =
|
5001
|
-
const sigma0l =
|
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 } =
|
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 =
|
5018
|
-
Ah =
|
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 } =
|
5022
|
-
({ h: Bh, l: Bl } =
|
5023
|
-
({ h: Ch, l: Cl } =
|
5024
|
-
({ h: Dh, l: Dl } =
|
5025
|
-
({ h: Eh, l: El } =
|
5026
|
-
({ h: Fh, l: Fl } =
|
5027
|
-
({ h: Gh, l: Gl } =
|
5028
|
-
({ h: Hh, l: Hl } =
|
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
|
4970
|
+
SHA512_W_H.fill(0);
|
4971
|
+
SHA512_W_L.fill(0);
|
5033
4972
|
}
|
5034
4973
|
destroy() {
|
5035
|
-
|
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 =
|
5104
|
-
this.Al =
|
5105
|
-
this.Bh =
|
5106
|
-
this.Bl =
|
5107
|
-
this.Ch =
|
5108
|
-
this.Cl =
|
5109
|
-
this.Dh =
|
5110
|
-
this.Dl =
|
5111
|
-
this.Eh =
|
5112
|
-
this.El =
|
5113
|
-
this.Fh =
|
5114
|
-
this.Fl =
|
5115
|
-
this.Gh =
|
5116
|
-
this.Gl =
|
5117
|
-
this.Hh =
|
5118
|
-
this.Hl =
|
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,31 +5003,78 @@ var require_sha2 = __commonJS((exports) => {
|
|
5123
5003
|
class SHA512_256 extends SHA512 {
|
5124
5004
|
constructor() {
|
5125
5005
|
super(32);
|
5126
|
-
this.Ah =
|
5127
|
-
this.Al =
|
5128
|
-
this.Bh =
|
5129
|
-
this.Bl =
|
5130
|
-
this.Ch =
|
5131
|
-
this.Cl =
|
5132
|
-
this.Dh =
|
5133
|
-
this.Dl =
|
5134
|
-
this.Eh =
|
5135
|
-
this.El =
|
5136
|
-
this.Fh =
|
5137
|
-
this.Fl =
|
5138
|
-
this.Gh =
|
5139
|
-
this.Gl =
|
5140
|
-
this.Hh =
|
5141
|
-
this.Hl =
|
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
|
-
|
5146
|
-
|
5147
|
-
|
5148
|
-
|
5149
|
-
|
5150
|
-
|
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
|
+
} });
|
5151
5078
|
});
|
5152
5079
|
|
5153
5080
|
// ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/utils.js
|
@@ -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
|
-
|
5513
|
-
let S
|
5514
|
-
|
5515
|
-
|
5516
|
-
|
5517
|
-
|
5518
|
-
|
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 (
|
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(
|
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
|
5545
|
+
return f.ONE;
|
5624
5546
|
if (power === _1n)
|
5625
5547
|
return num;
|
5626
|
-
let p =
|
5548
|
+
let p = f.ONE;
|
5627
5549
|
let d = num;
|
5628
5550
|
while (power > _0n) {
|
5629
5551
|
if (power & _1n)
|
5630
|
-
p =
|
5631
|
-
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(
|
5637
|
-
const
|
5638
|
-
const
|
5639
|
-
if (
|
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
|
-
|
5642
|
-
return
|
5643
|
-
},
|
5644
|
-
const
|
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 (
|
5568
|
+
if (f.is0(num))
|
5647
5569
|
return acc;
|
5648
|
-
|
5649
|
-
return
|
5650
|
-
},
|
5651
|
-
return
|
5652
|
-
}
|
5653
|
-
function FpDiv(
|
5654
|
-
return
|
5655
|
-
}
|
5656
|
-
function FpLegendre(
|
5657
|
-
const
|
5658
|
-
|
5659
|
-
|
5660
|
-
|
5661
|
-
const
|
5662
|
-
|
5663
|
-
|
5664
|
-
|
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
|
}
|
@@ -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 =
|
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
|
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
|
}
|
@@ -6467,47 +6384,43 @@ var require_hash_to_curve = __commonJS((exports) => {
|
|
6467
6384
|
return u;
|
6468
6385
|
}
|
6469
6386
|
function isogenyMap(field, map) {
|
6470
|
-
const
|
6387
|
+
const COEFF = map.map((i) => Array.from(i).reverse());
|
6471
6388
|
return (x, y) => {
|
6472
|
-
const [
|
6473
|
-
|
6474
|
-
|
6475
|
-
|
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,
|
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, { ...
|
6496
|
-
const u0 =
|
6497
|
-
const u1 =
|
6498
|
-
|
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, { ...
|
6502
|
-
|
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
|
-
|
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
|
}
|
@@ -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) =>
|
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);
|
@@ -6642,7 +6554,7 @@ var require_montgomery = __commonJS((exports) => {
|
|
6642
6554
|
// ../../node_modules/eciesjs/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.
|
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
|
6831
|
-
return { x: Fp.mul(xn,
|
6742
|
+
const inv = Fp.invertBatch([xd, yd]);
|
6743
|
+
return { x: Fp.mul(xn, inv[0]), y: Fp.mul(yn, inv[1]) };
|
6832
6744
|
}
|
6833
|
-
|
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 = (() =>
|
6843
|
-
exports.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");
|
@@ -7010,6 +6922,7 @@ var require_ed25519 = __commonJS((exports) => {
|
|
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,
|
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
|
6950
|
+
pad.fill(0);
|
7038
6951
|
}
|
7039
6952
|
update(buf) {
|
7040
|
-
(0,
|
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,
|
7046
|
-
(0,
|
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();
|
@@ -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)
|
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 =
|
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,8 +7890,7 @@ 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
|
-
|
7984
|
-
x = Fp.mul(x, tv4_inv);
|
7893
|
+
x = Fp.div(x, tv4);
|
7985
7894
|
return { x, y };
|
7986
7895
|
};
|
7987
7896
|
}
|
@@ -8012,7 +7921,7 @@ var require__shortw_utils = __commonJS((exports) => {
|
|
8012
7921
|
// ../../node_modules/eciesjs/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.
|
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
|
-
|
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 = (() =>
|
8224
|
-
exports.encodeToCurve = (() =>
|
8132
|
+
exports.hashToCurve = (() => htf.hashToCurve)();
|
8133
|
+
exports.encodeToCurve = (() => htf.encodeToCurve)();
|
8225
8134
|
});
|
8226
8135
|
|
8227
8136
|
// ../../node_modules/eciesjs/dist/utils/hex.js
|
@@ -8341,55 +8250,45 @@ var require_hkdf = __commonJS((exports) => {
|
|
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,
|
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
|
8353
|
-
var EMPTY_BUFFER = /* @__PURE__ */ Uint8Array
|
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,
|
8356
|
-
(0,
|
8357
|
-
|
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 /
|
8269
|
+
const blocks = Math.ceil(length / hash.outputLen);
|
8361
8270
|
if (info === undefined)
|
8362
8271
|
info = EMPTY_BUFFER;
|
8363
|
-
const okm = new Uint8Array(blocks *
|
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,
|
8279
|
+
okm.set(T, hash.outputLen * counter);
|
8371
8280
|
HMAC._cloneInto(HMACTmp);
|
8372
8281
|
}
|
8373
8282
|
HMAC.destroy();
|
8374
8283
|
HMACTmp.destroy();
|
8375
|
-
(0
|
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
|
-
|
10598
|
+
logger.error(error.message);
|
10700
10599
|
if (error.help) {
|
10701
|
-
|
10600
|
+
logger.error(error.help);
|
10702
10601
|
}
|
10703
10602
|
}
|
10704
10603
|
} else {
|
10705
|
-
|
10604
|
+
logger.error(error.message);
|
10706
10605
|
if (error.help) {
|
10707
|
-
|
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
|
-
|
10651
|
+
logger.error(error.message);
|
10753
10652
|
if (error.help) {
|
10754
|
-
|
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
|
-
|
10724
|
+
logger.error(error.message);
|
10826
10725
|
if (error.help) {
|
10827
|
-
|
10726
|
+
logger.error(error.help);
|
10828
10727
|
}
|
10829
10728
|
}
|
10830
10729
|
if (key) {
|
@@ -236269,13 +236168,14 @@ var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_
|
|
236269
236168
|
var dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
236270
236169
|
var dateRegex = new RegExp(`^${dateRegexSource}$`);
|
236271
236170
|
function timeRegexSource(args) {
|
236272
|
-
let
|
236171
|
+
let secondsRegexSource = `[0-5]\\d`;
|
236273
236172
|
if (args.precision) {
|
236274
|
-
|
236173
|
+
secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
|
236275
236174
|
} else if (args.precision == null) {
|
236276
|
-
|
236175
|
+
secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
|
236277
236176
|
}
|
236278
|
-
|
236177
|
+
const secondsQuantifier = args.precision ? "+" : "?";
|
236178
|
+
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
|
236279
236179
|
}
|
236280
236180
|
function timeRegex(args) {
|
236281
236181
|
return new RegExp(`^${timeRegexSource(args)}$`);
|
@@ -245445,7 +245345,7 @@ function pruneCurrentEnv(currentEnv, env2) {
|
|
245445
245345
|
var package_default = {
|
245446
245346
|
name: "@settlemint/sdk-cli",
|
245447
245347
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
245448
|
-
version: "2.2.2-
|
245348
|
+
version: "2.2.2-main5d81cd7d",
|
245449
245349
|
type: "module",
|
245450
245350
|
private: false,
|
245451
245351
|
license: "FSL-1.1-MIT",
|
@@ -245494,9 +245394,9 @@ var package_default = {
|
|
245494
245394
|
"@inquirer/input": "4.1.9",
|
245495
245395
|
"@inquirer/password": "4.0.12",
|
245496
245396
|
"@inquirer/select": "4.2.0",
|
245497
|
-
"@settlemint/sdk-js": "2.2.2-
|
245498
|
-
"@settlemint/sdk-utils": "2.2.2-
|
245499
|
-
"@types/node": "22.15.
|
245397
|
+
"@settlemint/sdk-js": "2.2.2-main5d81cd7d",
|
245398
|
+
"@settlemint/sdk-utils": "2.2.2-main5d81cd7d",
|
245399
|
+
"@types/node": "22.15.14",
|
245500
245400
|
"@types/semver": "7.7.0",
|
245501
245401
|
"@types/which": "3.0.4",
|
245502
245402
|
"get-tsconfig": "4.10.0",
|
@@ -249274,7 +249174,18 @@ async function parsePackageJson(filepath, onUnknown) {
|
|
249274
249174
|
return !filepath || !pathExists2(filepath, "file") ? null : await handlePackageManager(filepath, onUnknown);
|
249275
249175
|
}
|
249276
249176
|
async function detect(options = {}) {
|
249277
|
-
const {
|
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
|
+
}
|
249278
249189
|
for (const directory of lookup(cwd)) {
|
249279
249190
|
for (const strategy of strategies) {
|
249280
249191
|
switch (strategy) {
|
@@ -249311,6 +249222,8 @@ async function detect(options = {}) {
|
|
249311
249222
|
}
|
249312
249223
|
}
|
249313
249224
|
}
|
249225
|
+
if (stopDir?.(directory))
|
249226
|
+
break;
|
249314
249227
|
}
|
249315
249228
|
return null;
|
249316
249229
|
}
|
@@ -250455,6 +250368,17 @@ function missingApplication() {
|
|
250455
250368
|
return cancel2("No application configured, please run `settlemint connect` to connect to your application");
|
250456
250369
|
}
|
250457
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
|
+
|
250458
250382
|
// src/utils/get-app-or-personal-token.ts
|
250459
250383
|
var getApplicationOrPersonalAccessToken = async ({
|
250460
250384
|
env: env2,
|
@@ -250462,7 +250386,8 @@ var getApplicationOrPersonalAccessToken = async ({
|
|
250462
250386
|
prefer
|
250463
250387
|
}) => {
|
250464
250388
|
const applicationAccessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
250465
|
-
const
|
250389
|
+
const instanceUrl = sanitizeInstanceUrl(instance);
|
250390
|
+
const personalAccessToken = (await getInstanceCredentials(instanceUrl))?.personalAccessToken;
|
250466
250391
|
const preferredToken = prefer === "application" ? applicationAccessToken : personalAccessToken;
|
250467
250392
|
const fallbackToken = prefer === "application" ? personalAccessToken : applicationAccessToken;
|
250468
250393
|
const allowFallback = prefer === "application";
|
@@ -252979,17 +252904,6 @@ async function theGraphPrompt({
|
|
252979
252904
|
});
|
252980
252905
|
}
|
252981
252906
|
|
252982
|
-
// src/utils/instance-url-utils.ts
|
252983
|
-
function sanitizeInstanceUrl(url) {
|
252984
|
-
const instanceUrl = new URL(url);
|
252985
|
-
return instanceUrl.origin;
|
252986
|
-
}
|
252987
|
-
function sanitizeAndValidateInstanceUrl(url) {
|
252988
|
-
const sanitizedUrl = sanitizeInstanceUrl(url);
|
252989
|
-
validate2(UrlSchema2, sanitizedUrl);
|
252990
|
-
return sanitizedUrl;
|
252991
|
-
}
|
252992
|
-
|
252993
252907
|
// src/prompts/instance.prompt.ts
|
252994
252908
|
async function instancePrompt(env2, accept, freeTextInput = false, isCi = is_in_ci_default) {
|
252995
252909
|
const knownInstances = await getInstances();
|
@@ -253497,8 +253411,8 @@ function connectCommand() {
|
|
253497
253411
|
SETTLEMINT_HASURA: hasura?.uniqueName,
|
253498
253412
|
...getHasuraEndpoints(hasura),
|
253499
253413
|
SETTLEMINT_THEGRAPH: thegraph?.uniqueName,
|
253500
|
-
SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: defaultSubgraph,
|
253501
253414
|
...graphEndpoints,
|
253415
|
+
SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: defaultSubgraph,
|
253502
253416
|
SETTLEMINT_PORTAL: portal?.uniqueName,
|
253503
253417
|
...getPortalEndpoints(portal),
|
253504
253418
|
SETTLEMINT_HD_PRIVATE_KEY: hdPrivateKey?.uniqueName,
|
@@ -260299,9 +260213,6 @@ function hardhatTestCommand() {
|
|
260299
260213
|
});
|
260300
260214
|
}
|
260301
260215
|
|
260302
|
-
// src/commands/smart-contract-set/subgraph/build.ts
|
260303
|
-
import { dirname as dirname10 } from "node:path";
|
260304
|
-
|
260305
260216
|
// src/utils/subgraph/setup.ts
|
260306
260217
|
import { rm as rm4 } from "node:fs/promises";
|
260307
260218
|
var import_semver = __toESM(require_semver2(), 1);
|
@@ -260465,15 +260376,13 @@ function subgraphBuildCommand() {
|
|
260465
260376
|
});
|
260466
260377
|
const { command, args } = await getPackageManagerExecutable();
|
260467
260378
|
const subgraphYamlFile = await getSubgraphYamlFile();
|
260468
|
-
|
260469
|
-
await executeCommand(command, [...args, "graph", "
|
260470
|
-
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]);
|
260471
260381
|
outro("Subgraph built successfully");
|
260472
260382
|
});
|
260473
260383
|
}
|
260474
260384
|
|
260475
260385
|
// src/commands/smart-contract-set/subgraph/codegen.ts
|
260476
|
-
import { dirname as dirname11 } from "node:path";
|
260477
260386
|
function subgraphCodegenCommand() {
|
260478
260387
|
return new Command("codegen").description("Codegen the subgraph types").usage(createExamples([
|
260479
260388
|
{
|
@@ -260488,15 +260397,12 @@ function subgraphCodegenCommand() {
|
|
260488
260397
|
});
|
260489
260398
|
const { command, args } = await getPackageManagerExecutable();
|
260490
260399
|
const subgraphYamlFile = await getSubgraphYamlFile();
|
260491
|
-
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile]
|
260492
|
-
cwd: dirname11(subgraphYamlFile)
|
260493
|
-
});
|
260400
|
+
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile]);
|
260494
260401
|
outro("Subgraph types generated successfully");
|
260495
260402
|
});
|
260496
260403
|
}
|
260497
260404
|
|
260498
260405
|
// src/commands/smart-contract-set/subgraph/deploy.ts
|
260499
|
-
import { dirname as dirname12 } from "node:path";
|
260500
260406
|
function subgraphDeployCommand() {
|
260501
260407
|
return new Command("deploy").description("Deploy the subgraph").usage(createExamples([
|
260502
260408
|
{
|
@@ -260532,9 +260438,7 @@ function subgraphDeployCommand() {
|
|
260532
260438
|
const subgraphYamlFile = await getSubgraphYamlFile();
|
260533
260439
|
await updateSpecVersion(theGraphMiddleware.specVersion);
|
260534
260440
|
const { command, args } = await getPackageManagerExecutable();
|
260535
|
-
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile]
|
260536
|
-
cwd: dirname12(subgraphYamlFile)
|
260537
|
-
});
|
260441
|
+
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile]);
|
260538
260442
|
const generated = await isGenerated();
|
260539
260443
|
if (generated) {
|
260540
260444
|
const currentConfig = await getSubgraphConfig();
|
@@ -260598,7 +260502,7 @@ async function updateSpecVersion(specVersion) {
|
|
260598
260502
|
}
|
260599
260503
|
|
260600
260504
|
// src/commands/smart-contract-set/subgraph/remove.ts
|
260601
|
-
import { dirname as
|
260505
|
+
import { dirname as dirname10 } from "node:path";
|
260602
260506
|
function subgraphRemoveCommand() {
|
260603
260507
|
return new Command("remove").description("Remove a subgraph").usage(createExamples([
|
260604
260508
|
{
|
@@ -260633,7 +260537,7 @@ function subgraphRemoveCommand() {
|
|
260633
260537
|
serviceNotRunningError("graph middleware", theGraphMiddleware.status);
|
260634
260538
|
}
|
260635
260539
|
const subgraphYamlFile = await getSubgraphYamlFile();
|
260636
|
-
const cwd2 =
|
260540
|
+
const cwd2 = dirname10(subgraphYamlFile);
|
260637
260541
|
const { command, args } = await getPackageManagerExecutable();
|
260638
260542
|
const middlewareAdminUrl = new URL(`/${encodeURIComponent(accessToken)}/admin`, theGraphMiddleware.serviceUrl).toString();
|
260639
260543
|
await executeCommand(command, [...args, "graph", "remove", "--node", middlewareAdminUrl, graphName]);
|
@@ -260806,4 +260710,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
260806
260710
|
// src/cli.ts
|
260807
260711
|
sdkCliCommand();
|
260808
260712
|
|
260809
|
-
//# debugId=
|
260713
|
+
//# debugId=D555E27DB15C3E8F64756E2164756E21
|