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