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