@settlemint/sdk-cli 2.1.4-pr472d24a4 → 2.1.4-pr48da9f8f
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 +167 -115
- package/dist/cli.js.map +17 -18
- package/package.json +3 -3
package/dist/cli.js
CHANGED
@@ -3709,23 +3709,51 @@ var require_decrypt = __commonJS((exports, module) => {
|
|
3709
3709
|
module.exports = decrypt;
|
3710
3710
|
});
|
3711
3711
|
|
3712
|
-
// ../../node_modules/@noble/ciphers/
|
3713
|
-
var
|
3712
|
+
// ../../node_modules/@noble/ciphers/utils.js
|
3713
|
+
var require_utils3 = __commonJS((exports) => {
|
3714
|
+
/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */
|
3714
3715
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3716
|
+
exports.wrapCipher = exports.Hash = exports.nextTick = exports.isLE = undefined;
|
3717
|
+
exports.isBytes = isBytes;
|
3715
3718
|
exports.abool = abool;
|
3719
|
+
exports.anumber = anumber;
|
3716
3720
|
exports.abytes = abytes;
|
3717
|
-
exports.aexists = aexists;
|
3718
3721
|
exports.ahash = ahash;
|
3719
|
-
exports.
|
3722
|
+
exports.aexists = aexists;
|
3720
3723
|
exports.aoutput = aoutput;
|
3721
|
-
exports.
|
3724
|
+
exports.u8 = u8;
|
3725
|
+
exports.u32 = u32;
|
3726
|
+
exports.clean = clean;
|
3727
|
+
exports.createView = createView;
|
3728
|
+
exports.bytesToHex = bytesToHex;
|
3729
|
+
exports.hexToBytes = hexToBytes;
|
3730
|
+
exports.hexToNumber = hexToNumber;
|
3731
|
+
exports.bytesToNumberBE = bytesToNumberBE;
|
3732
|
+
exports.numberToBytesBE = numberToBytesBE;
|
3733
|
+
exports.utf8ToBytes = utf8ToBytes;
|
3734
|
+
exports.bytesToUtf8 = bytesToUtf8;
|
3735
|
+
exports.toBytes = toBytes;
|
3736
|
+
exports.overlapBytes = overlapBytes;
|
3737
|
+
exports.complexOverlapBytes = complexOverlapBytes;
|
3738
|
+
exports.concatBytes = concatBytes;
|
3739
|
+
exports.checkOpts = checkOpts;
|
3740
|
+
exports.equalBytes = equalBytes;
|
3741
|
+
exports.getOutput = getOutput;
|
3742
|
+
exports.setBigUint64 = setBigUint64;
|
3743
|
+
exports.u64Lengths = u64Lengths;
|
3744
|
+
exports.isAligned32 = isAligned32;
|
3745
|
+
exports.copyBytes = copyBytes;
|
3746
|
+
function isBytes(a) {
|
3747
|
+
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
3748
|
+
}
|
3749
|
+
function abool(b) {
|
3750
|
+
if (typeof b !== "boolean")
|
3751
|
+
throw new Error(`boolean expected, not ${b}`);
|
3752
|
+
}
|
3722
3753
|
function anumber(n) {
|
3723
3754
|
if (!Number.isSafeInteger(n) || n < 0)
|
3724
3755
|
throw new Error("positive integer expected, got " + n);
|
3725
3756
|
}
|
3726
|
-
function isBytes(a) {
|
3727
|
-
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
3728
|
-
}
|
3729
3757
|
function abytes(b, ...lengths) {
|
3730
3758
|
if (!isBytes(b))
|
3731
3759
|
throw new Error("Uint8Array expected");
|
@@ -3734,7 +3762,7 @@ var require__assert = __commonJS((exports) => {
|
|
3734
3762
|
}
|
3735
3763
|
function ahash(h) {
|
3736
3764
|
if (typeof h !== "function" || typeof h.create !== "function")
|
3737
|
-
throw new Error("Hash should be wrapped by utils.
|
3765
|
+
throw new Error("Hash should be wrapped by utils.createHasher");
|
3738
3766
|
anumber(h.outputLen);
|
3739
3767
|
anumber(h.blockLen);
|
3740
3768
|
}
|
@@ -3751,49 +3779,27 @@ var require__assert = __commonJS((exports) => {
|
|
3751
3779
|
throw new Error("digestInto() expects output buffer of length at least " + min);
|
3752
3780
|
}
|
3753
3781
|
}
|
3754
|
-
function
|
3755
|
-
|
3756
|
-
throw new Error(`boolean expected, not ${b}`);
|
3782
|
+
function u8(arr) {
|
3783
|
+
return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
|
3757
3784
|
}
|
3758
|
-
|
3759
|
-
|
3760
|
-
|
3761
|
-
|
3762
|
-
|
3763
|
-
|
3764
|
-
|
3765
|
-
|
3766
|
-
|
3767
|
-
|
3768
|
-
|
3769
|
-
exports.
|
3770
|
-
|
3771
|
-
exports.toBytes = toBytes;
|
3772
|
-
exports.overlapBytes = overlapBytes;
|
3773
|
-
exports.complexOverlapBytes = complexOverlapBytes;
|
3774
|
-
exports.concatBytes = concatBytes;
|
3775
|
-
exports.checkOpts = checkOpts;
|
3776
|
-
exports.equalBytes = equalBytes;
|
3777
|
-
exports.getOutput = getOutput;
|
3778
|
-
exports.setBigUint64 = setBigUint64;
|
3779
|
-
exports.u64Lengths = u64Lengths;
|
3780
|
-
exports.isAligned32 = isAligned32;
|
3781
|
-
exports.copyBytes = copyBytes;
|
3782
|
-
exports.clean = clean;
|
3783
|
-
/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */
|
3784
|
-
var _assert_js_1 = require__assert();
|
3785
|
-
var u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
|
3786
|
-
exports.u8 = u8;
|
3787
|
-
var u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
|
3788
|
-
exports.u32 = u32;
|
3789
|
-
var createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
|
3790
|
-
exports.createView = createView;
|
3791
|
-
exports.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
3792
|
-
if (!exports.isLE)
|
3793
|
-
throw new Error("Non little-endian hardware is not supported");
|
3785
|
+
function u32(arr) {
|
3786
|
+
return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
|
3787
|
+
}
|
3788
|
+
function clean(...arrays) {
|
3789
|
+
for (let i = 0;i < arrays.length; i++) {
|
3790
|
+
arrays[i].fill(0);
|
3791
|
+
}
|
3792
|
+
}
|
3793
|
+
function createView(arr) {
|
3794
|
+
return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
|
3795
|
+
}
|
3796
|
+
exports.isLE = (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
|
3797
|
+
var hasHexBuiltin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function")();
|
3794
3798
|
var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
|
3795
3799
|
function bytesToHex(bytes) {
|
3796
|
-
|
3800
|
+
abytes(bytes);
|
3801
|
+
if (hasHexBuiltin)
|
3802
|
+
return bytes.toHex();
|
3797
3803
|
let hex = "";
|
3798
3804
|
for (let i = 0;i < bytes.length; i++) {
|
3799
3805
|
hex += hexes[bytes[i]];
|
@@ -3813,6 +3819,8 @@ var require_utils3 = __commonJS((exports) => {
|
|
3813
3819
|
function hexToBytes(hex) {
|
3814
3820
|
if (typeof hex !== "string")
|
3815
3821
|
throw new Error("hex string expected, got " + typeof hex);
|
3822
|
+
if (hasHexBuiltin)
|
3823
|
+
return Uint8Array.fromHex(hex);
|
3816
3824
|
const hl = hex.length;
|
3817
3825
|
const al = hl / 2;
|
3818
3826
|
if (hl % 2)
|
@@ -3853,7 +3861,7 @@ var require_utils3 = __commonJS((exports) => {
|
|
3853
3861
|
function toBytes(data) {
|
3854
3862
|
if (typeof data === "string")
|
3855
3863
|
data = utf8ToBytes(data);
|
3856
|
-
else if (
|
3864
|
+
else if (isBytes(data))
|
3857
3865
|
data = copyBytes(data);
|
3858
3866
|
else
|
3859
3867
|
throw new Error("Uint8Array expected, got " + typeof data);
|
@@ -3870,7 +3878,7 @@ var require_utils3 = __commonJS((exports) => {
|
|
3870
3878
|
let sum = 0;
|
3871
3879
|
for (let i = 0;i < arrays.length; i++) {
|
3872
3880
|
const a = arrays[i];
|
3873
|
-
|
3881
|
+
abytes(a);
|
3874
3882
|
sum += a.length;
|
3875
3883
|
}
|
3876
3884
|
const res = new Uint8Array(sum);
|
@@ -3901,26 +3909,28 @@ var require_utils3 = __commonJS((exports) => {
|
|
3901
3909
|
exports.Hash = Hash;
|
3902
3910
|
var wrapCipher = (params, constructor) => {
|
3903
3911
|
function wrappedCipher(key, ...args) {
|
3904
|
-
|
3912
|
+
abytes(key);
|
3913
|
+
if (!exports.isLE)
|
3914
|
+
throw new Error("Non little-endian hardware is not yet supported");
|
3905
3915
|
if (params.nonceLength !== undefined) {
|
3906
3916
|
const nonce = args[0];
|
3907
3917
|
if (!nonce)
|
3908
3918
|
throw new Error("nonce / iv required");
|
3909
3919
|
if (params.varSizeNonce)
|
3910
|
-
|
3920
|
+
abytes(nonce);
|
3911
3921
|
else
|
3912
|
-
|
3922
|
+
abytes(nonce, params.nonceLength);
|
3913
3923
|
}
|
3914
3924
|
const tagl = params.tagLength;
|
3915
3925
|
if (tagl && args[1] !== undefined) {
|
3916
|
-
|
3926
|
+
abytes(args[1]);
|
3917
3927
|
}
|
3918
3928
|
const cipher = constructor(key, ...args);
|
3919
3929
|
const checkOutput = (fnLength, output) => {
|
3920
3930
|
if (output !== undefined) {
|
3921
3931
|
if (fnLength !== 2)
|
3922
3932
|
throw new Error("cipher output not supported");
|
3923
|
-
|
3933
|
+
abytes(output);
|
3924
3934
|
}
|
3925
3935
|
};
|
3926
3936
|
let called = false;
|
@@ -3929,12 +3939,12 @@ var require_utils3 = __commonJS((exports) => {
|
|
3929
3939
|
if (called)
|
3930
3940
|
throw new Error("cannot encrypt() twice with same key + nonce");
|
3931
3941
|
called = true;
|
3932
|
-
|
3942
|
+
abytes(data);
|
3933
3943
|
checkOutput(cipher.encrypt.length, output);
|
3934
3944
|
return cipher.encrypt(data, output);
|
3935
3945
|
},
|
3936
3946
|
decrypt(data, output) {
|
3937
|
-
|
3947
|
+
abytes(data);
|
3938
3948
|
if (tagl && data.length < tagl)
|
3939
3949
|
throw new Error("invalid ciphertext length: smaller than tagLength=" + tagl);
|
3940
3950
|
checkOutput(cipher.decrypt.length, output);
|
@@ -3968,11 +3978,12 @@ var require_utils3 = __commonJS((exports) => {
|
|
3968
3978
|
view.setUint32(byteOffset + h, wh, isLE);
|
3969
3979
|
view.setUint32(byteOffset + l, wl, isLE);
|
3970
3980
|
}
|
3971
|
-
function u64Lengths(
|
3981
|
+
function u64Lengths(dataLength, aadLength, isLE) {
|
3982
|
+
abool(isLE);
|
3972
3983
|
const num = new Uint8Array(16);
|
3973
|
-
const view =
|
3974
|
-
setBigUint64(view, 0, BigInt(
|
3975
|
-
setBigUint64(view, 8, BigInt(
|
3984
|
+
const view = createView(num);
|
3985
|
+
setBigUint64(view, 0, BigInt(aadLength), isLE);
|
3986
|
+
setBigUint64(view, 8, BigInt(dataLength), isLE);
|
3976
3987
|
return num;
|
3977
3988
|
}
|
3978
3989
|
function isAligned32(bytes) {
|
@@ -3981,11 +3992,6 @@ var require_utils3 = __commonJS((exports) => {
|
|
3981
3992
|
function copyBytes(bytes) {
|
3982
3993
|
return Uint8Array.from(bytes);
|
3983
3994
|
}
|
3984
|
-
function clean(...arrays) {
|
3985
|
-
for (let i = 0;i < arrays.length; i++) {
|
3986
|
-
arrays[i].fill(0);
|
3987
|
-
}
|
3988
|
-
}
|
3989
3995
|
});
|
3990
3996
|
|
3991
3997
|
// ../../node_modules/eciesjs/dist/consts.js
|
@@ -4068,14 +4074,13 @@ var require_webcrypto = __commonJS((exports) => {
|
|
4068
4074
|
exports.getWebcryptoSubtle = getWebcryptoSubtle;
|
4069
4075
|
exports.managedNonce = managedNonce;
|
4070
4076
|
var crypto_1 = require_cryptoNode();
|
4071
|
-
var
|
4072
|
-
var utils_js_1 = require_utils3();
|
4077
|
+
var utils_ts_1 = require_utils3();
|
4073
4078
|
function randomBytes(bytesLength = 32) {
|
4074
4079
|
if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === "function") {
|
4075
4080
|
return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength));
|
4076
4081
|
}
|
4077
4082
|
if (crypto_1.crypto && typeof crypto_1.crypto.randomBytes === "function") {
|
4078
|
-
return crypto_1.crypto.randomBytes(bytesLength);
|
4083
|
+
return Uint8Array.from(crypto_1.crypto.randomBytes(bytesLength));
|
4079
4084
|
}
|
4080
4085
|
throw new Error("crypto.getRandomValues must be defined");
|
4081
4086
|
}
|
@@ -4086,12 +4091,12 @@ var require_webcrypto = __commonJS((exports) => {
|
|
4086
4091
|
}
|
4087
4092
|
function managedNonce(fn) {
|
4088
4093
|
const { nonceLength } = fn;
|
4089
|
-
(0,
|
4094
|
+
(0, utils_ts_1.anumber)(nonceLength);
|
4090
4095
|
return (key, ...args) => ({
|
4091
4096
|
encrypt(plaintext, ...argsEnc) {
|
4092
4097
|
const nonce = randomBytes(nonceLength);
|
4093
4098
|
const ciphertext = fn(key, nonce, ...args).encrypt(plaintext, ...argsEnc);
|
4094
|
-
const out = (0,
|
4099
|
+
const out = (0, utils_ts_1.concatBytes)(nonce, ciphertext);
|
4095
4100
|
ciphertext.fill(0);
|
4096
4101
|
return out;
|
4097
4102
|
},
|
@@ -4136,21 +4141,21 @@ var require_webcrypto = __commonJS((exports) => {
|
|
4136
4141
|
}
|
4137
4142
|
function generate(algo) {
|
4138
4143
|
return (key, nonce, AAD) => {
|
4139
|
-
(0,
|
4140
|
-
(0,
|
4144
|
+
(0, utils_ts_1.abytes)(key);
|
4145
|
+
(0, utils_ts_1.abytes)(nonce);
|
4141
4146
|
const keyParams = { name: algo, length: key.length * 8 };
|
4142
4147
|
const cryptParams = getCryptParams(algo, nonce, AAD);
|
4143
4148
|
let consumed = false;
|
4144
4149
|
return {
|
4145
4150
|
encrypt(plaintext) {
|
4146
|
-
(0,
|
4151
|
+
(0, utils_ts_1.abytes)(plaintext);
|
4147
4152
|
if (consumed)
|
4148
4153
|
throw new Error("Cannot encrypt() twice with same key / nonce");
|
4149
4154
|
consumed = true;
|
4150
4155
|
return exports.utils.encrypt(key, keyParams, cryptParams, plaintext);
|
4151
4156
|
},
|
4152
4157
|
decrypt(ciphertext) {
|
4153
|
-
(0,
|
4158
|
+
(0, utils_ts_1.abytes)(ciphertext);
|
4154
4159
|
return exports.utils.decrypt(key, keyParams, cryptParams, ciphertext);
|
4155
4160
|
}
|
4156
4161
|
};
|
@@ -4162,7 +4167,7 @@ var require_webcrypto = __commonJS((exports) => {
|
|
4162
4167
|
});
|
4163
4168
|
|
4164
4169
|
// ../../node_modules/@noble/hashes/_assert.js
|
4165
|
-
var
|
4170
|
+
var require__assert = __commonJS((exports) => {
|
4166
4171
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4167
4172
|
exports.anumber = anumber;
|
4168
4173
|
exports.abytes = abytes;
|
@@ -4236,7 +4241,7 @@ var require_utils4 = __commonJS((exports) => {
|
|
4236
4241
|
exports.wrapXOFConstructorWithOpts = wrapXOFConstructorWithOpts;
|
4237
4242
|
exports.randomBytes = randomBytes;
|
4238
4243
|
var crypto_1 = require_cryptoNode2();
|
4239
|
-
var _assert_ts_1 =
|
4244
|
+
var _assert_ts_1 = require__assert();
|
4240
4245
|
function isBytes(a) {
|
4241
4246
|
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
4242
4247
|
}
|
@@ -4402,7 +4407,7 @@ var require__md = __commonJS((exports) => {
|
|
4402
4407
|
exports.setBigUint64 = setBigUint64;
|
4403
4408
|
exports.Chi = Chi;
|
4404
4409
|
exports.Maj = Maj;
|
4405
|
-
var _assert_ts_1 =
|
4410
|
+
var _assert_ts_1 = require__assert();
|
4406
4411
|
var utils_ts_1 = require_utils4();
|
4407
4412
|
function setBigUint64(view, byteOffset, value, isLE) {
|
4408
4413
|
if (typeof view.setBigUint64 === "function")
|
@@ -6925,7 +6930,7 @@ var require_ed25519 = __commonJS((exports) => {
|
|
6925
6930
|
var require_hmac = __commonJS((exports) => {
|
6926
6931
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6927
6932
|
exports.hmac = exports.HMAC = undefined;
|
6928
|
-
var _assert_ts_1 =
|
6933
|
+
var _assert_ts_1 = require__assert();
|
6929
6934
|
var utils_ts_1 = require_utils4();
|
6930
6935
|
|
6931
6936
|
class HMAC extends utils_ts_1.Hash {
|
@@ -8253,7 +8258,7 @@ var require_hkdf = __commonJS((exports) => {
|
|
8253
8258
|
exports.hkdf = undefined;
|
8254
8259
|
exports.extract = extract;
|
8255
8260
|
exports.expand = expand;
|
8256
|
-
var _assert_ts_1 =
|
8261
|
+
var _assert_ts_1 = require__assert();
|
8257
8262
|
var hmac_ts_1 = require_hmac();
|
8258
8263
|
var utils_ts_1 = require_utils4();
|
8259
8264
|
function extract(hash, ikm, salt) {
|
@@ -245340,7 +245345,7 @@ function pruneCurrentEnv(currentEnv, env2) {
|
|
245340
245345
|
var package_default = {
|
245341
245346
|
name: "@settlemint/sdk-cli",
|
245342
245347
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
245343
|
-
version: "2.1.4-
|
245348
|
+
version: "2.1.4-pr48da9f8f",
|
245344
245349
|
type: "module",
|
245345
245350
|
private: false,
|
245346
245351
|
license: "FSL-1.1-MIT",
|
@@ -245389,8 +245394,8 @@ var package_default = {
|
|
245389
245394
|
"@inquirer/input": "4.1.9",
|
245390
245395
|
"@inquirer/password": "4.0.12",
|
245391
245396
|
"@inquirer/select": "4.1.1",
|
245392
|
-
"@settlemint/sdk-js": "2.1.4-
|
245393
|
-
"@settlemint/sdk-utils": "2.1.4-
|
245397
|
+
"@settlemint/sdk-js": "2.1.4-pr48da9f8f",
|
245398
|
+
"@settlemint/sdk-utils": "2.1.4-pr48da9f8f",
|
245394
245399
|
"@types/node": "22.14.1",
|
245395
245400
|
"@types/semver": "7.7.0",
|
245396
245401
|
"@types/which": "3.0.4",
|
@@ -246566,6 +246571,13 @@ var cancel2 = (msg) => {
|
|
246566
246571
|
console.log("");
|
246567
246572
|
throw new CancelError2(msg);
|
246568
246573
|
};
|
246574
|
+
var CommandError = class extends Error {
|
246575
|
+
constructor(message, code, output) {
|
246576
|
+
super(message);
|
246577
|
+
this.code = code;
|
246578
|
+
this.output = output;
|
246579
|
+
}
|
246580
|
+
};
|
246569
246581
|
async function executeCommand(command, args, options) {
|
246570
246582
|
const child = spawn(command, args, { env: { ...process.env, ...options?.env } });
|
246571
246583
|
process.stdin.pipe(child.stdin);
|
@@ -246585,14 +246597,14 @@ async function executeCommand(command, args, options) {
|
|
246585
246597
|
}
|
246586
246598
|
output.push(maskedData);
|
246587
246599
|
});
|
246588
|
-
child.on("error", (err) => reject(err));
|
246600
|
+
child.on("error", (err) => reject(new CommandError(err.message, "code" in err && typeof err.code === "number" ? err.code : 1, output)));
|
246589
246601
|
child.on("close", (code) => {
|
246590
246602
|
if (code === 0 || code === null || code === 143) {
|
246591
246603
|
process.stdin.unpipe(child.stdin);
|
246592
246604
|
resolve(output);
|
246593
246605
|
return;
|
246594
246606
|
}
|
246595
|
-
reject(new
|
246607
|
+
reject(new CommandError(`Command "${command}" exited with code ${code}`, code, output));
|
246596
246608
|
});
|
246597
246609
|
});
|
246598
246610
|
}
|
@@ -248203,6 +248215,7 @@ var getEnv = (gqlClient) => {
|
|
248203
248215
|
};
|
248204
248216
|
var LoadBalancerFragment = graphql(`
|
248205
248217
|
fragment LoadBalancer on LoadBalancer {
|
248218
|
+
__typename
|
248206
248219
|
id
|
248207
248220
|
uniqueName
|
248208
248221
|
name
|
@@ -250085,6 +250098,16 @@ function tryParseJson3(value2, defaultValue = null) {
|
|
250085
250098
|
return defaultValue;
|
250086
250099
|
}
|
250087
250100
|
}
|
250101
|
+
function extractJsonObject(value2) {
|
250102
|
+
if (value2.length > 5000) {
|
250103
|
+
throw new Error("Input too long");
|
250104
|
+
}
|
250105
|
+
const result = /\{([\s\S]*)\}/.exec(value2);
|
250106
|
+
if (!result) {
|
250107
|
+
return null;
|
250108
|
+
}
|
250109
|
+
return tryParseJson3(result[0]);
|
250110
|
+
}
|
250088
250111
|
async function retryWhenFailed2(fn, maxRetries = 5, initialSleepTime = 1000, stopOnError) {
|
250089
250112
|
let attempt = 0;
|
250090
250113
|
while (attempt < maxRetries) {
|
@@ -251848,7 +251871,13 @@ async function subgraphPrompt({
|
|
251848
251871
|
if (env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH) {
|
251849
251872
|
return [env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH];
|
251850
251873
|
}
|
251851
|
-
|
251874
|
+
if (subgraphNames.length === 1) {
|
251875
|
+
return subgraphNames;
|
251876
|
+
}
|
251877
|
+
if (subgraphNames.includes("kit")) {
|
251878
|
+
return ["kit"];
|
251879
|
+
}
|
251880
|
+
return [];
|
251852
251881
|
}
|
251853
251882
|
if (!allowNew) {
|
251854
251883
|
if (subgraphNames.length === 0) {
|
@@ -252033,7 +252062,8 @@ async function codegenBlockscout(env2) {
|
|
252033
252062
|
}
|
252034
252063
|
}
|
252035
252064
|
}
|
252036
|
-
|
252065
|
+
`,
|
252066
|
+
operationName: "IntrospectionQuery"
|
252037
252067
|
})
|
252038
252068
|
});
|
252039
252069
|
await writeFile6(introspectionJsonPath, JSON.stringify(data));
|
@@ -252800,7 +252830,7 @@ async function theGraphPrompt({
|
|
252800
252830
|
envKey: "SETTLEMINT_THEGRAPH",
|
252801
252831
|
isRequired,
|
252802
252832
|
defaultHandler: async ({ defaultService: defaultMiddleware, choices }) => {
|
252803
|
-
const filteredChoices = filterRunningOnly ? choices.filter(({ value: middleware }) => middleware
|
252833
|
+
const filteredChoices = filterRunningOnly ? choices.filter(({ value: middleware }) => isRunning(middleware)) : choices;
|
252804
252834
|
return esm_default3({
|
252805
252835
|
message: "Which The Graph instance do you want to connect to?",
|
252806
252836
|
choices: filteredChoices,
|
@@ -253128,7 +253158,7 @@ async function blockchainNodeOrLoadBalancerPrompt({
|
|
253128
253158
|
envKey: "SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER",
|
253129
253159
|
isRequired,
|
253130
253160
|
defaultHandler: async ({ defaultService: defaultNode, choices }) => {
|
253131
|
-
const filteredChoices = filterRunningOnly ? choices.filter(({ value: node }) => node
|
253161
|
+
const filteredChoices = filterRunningOnly ? choices.filter(({ value: node }) => isRunning(node)) : choices;
|
253132
253162
|
return esm_default3({
|
253133
253163
|
message: promptMessage ?? "Which blockchain node or load balancer do you want to connect to?",
|
253134
253164
|
choices: filteredChoices,
|
@@ -257773,22 +257803,26 @@ function blockscoutInsightsCreateCommand() {
|
|
257773
257803
|
if (!applicationUniqueName) {
|
257774
257804
|
return missingApplication();
|
257775
257805
|
}
|
257776
|
-
let blockchainNodeUniqueName =
|
257777
|
-
|
257806
|
+
let blockchainNodeUniqueName = blockchainNode;
|
257807
|
+
let loadBalancerUniqueName = loadBalancer;
|
257778
257808
|
if (!blockchainNodeUniqueName && !loadBalancerUniqueName) {
|
257779
257809
|
const blockchainNodes = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
|
257780
257810
|
const loadBalancers = await serviceSpinner("load balancer", () => settlemint.loadBalancer.list(applicationUniqueName));
|
257781
|
-
const
|
257811
|
+
const nodeOrLoadbalancer = await blockchainNodeOrLoadBalancerPrompt({
|
257782
257812
|
env: env2,
|
257783
257813
|
nodes: blockchainNodes,
|
257784
257814
|
loadBalancers,
|
257785
257815
|
accept: acceptDefaults,
|
257786
257816
|
isRequired: true
|
257787
257817
|
});
|
257788
|
-
if (!
|
257818
|
+
if (!nodeOrLoadbalancer) {
|
257789
257819
|
return nothingSelectedError("blockchain node");
|
257790
257820
|
}
|
257791
|
-
|
257821
|
+
if (nodeOrLoadbalancer.__typename?.endsWith("LoadBalancer")) {
|
257822
|
+
loadBalancerUniqueName = nodeOrLoadbalancer.uniqueName;
|
257823
|
+
} else {
|
257824
|
+
blockchainNodeUniqueName = nodeOrLoadbalancer.uniqueName;
|
257825
|
+
}
|
257792
257826
|
}
|
257793
257827
|
const result = await showSpinner(() => settlemint.insights.create({
|
257794
257828
|
name: name3,
|
@@ -257901,7 +257935,17 @@ function loadBalancerEvmCreateCommand() {
|
|
257901
257935
|
type: "load balancer",
|
257902
257936
|
subType: "EVM",
|
257903
257937
|
execute: (cmd2, baseAction) => {
|
257904
|
-
addClusterServiceArgs(cmd2).option("--app, --application <application>", "The application unique name to create the load balancer in (defaults to application from env)").option("--blockchain-nodes <blockchainNodes...>", "Blockchain node unique names where the load balancer connects to (must be from the same network)").
|
257938
|
+
addClusterServiceArgs(cmd2).option("--app, --application <application>", "The application unique name to create the load balancer in (defaults to application from env)").option("--blockchain-nodes <blockchainNodes...>", "Blockchain node unique names where the load balancer connects to (must be from the same network)").option("--blockchain-network <blockchainNetwork>", "Blockchain network unique name where the load balancer connects to, can be skipped if the --blockchain-nodes option is used (defaults to network from env)").action(async (name3, {
|
257939
|
+
application,
|
257940
|
+
provider,
|
257941
|
+
region,
|
257942
|
+
size,
|
257943
|
+
type: type4,
|
257944
|
+
blockchainNodes,
|
257945
|
+
blockchainNetwork,
|
257946
|
+
acceptDefaults,
|
257947
|
+
...defaultArgs
|
257948
|
+
}) => {
|
257905
257949
|
return baseAction({
|
257906
257950
|
...defaultArgs,
|
257907
257951
|
acceptDefaults,
|
@@ -257912,11 +257956,12 @@ function loadBalancerEvmCreateCommand() {
|
|
257912
257956
|
if (!applicationUniqueName) {
|
257913
257957
|
return missingApplication();
|
257914
257958
|
}
|
257915
|
-
|
257959
|
+
const applicationBlockchainNodes = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
|
257960
|
+
let networkUniqueName = blockchainNetwork;
|
257916
257961
|
let connectedNodesUniqueNames = blockchainNodes;
|
257917
257962
|
if (!connectedNodesUniqueNames) {
|
257918
257963
|
const networks = await serviceSpinner("blockchain network", () => settlemint.blockchainNetwork.list(applicationUniqueName));
|
257919
|
-
const network = await blockchainNetworkPrompt({
|
257964
|
+
const network = networkUniqueName ? networks.find((network2) => network2.uniqueName === networkUniqueName) : await blockchainNetworkPrompt({
|
257920
257965
|
env: env2,
|
257921
257966
|
networks,
|
257922
257967
|
accept: acceptDefaults,
|
@@ -257926,31 +257971,29 @@ function loadBalancerEvmCreateCommand() {
|
|
257926
257971
|
return nothingSelectedError("blockchain network");
|
257927
257972
|
}
|
257928
257973
|
networkUniqueName = network.uniqueName;
|
257929
|
-
const blockchainNodes2 = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
|
257930
257974
|
const connectedNodes = await blockchainNodePrompt({
|
257931
257975
|
env: env2,
|
257932
|
-
nodes:
|
257976
|
+
nodes: applicationBlockchainNodes.filter((node) => node.blockchainNetwork?.uniqueName === network.uniqueName),
|
257933
257977
|
accept: acceptDefaults,
|
257934
257978
|
promptMessage: "Which blockchain node do you want to connect the load balancer to?",
|
257935
257979
|
allowAll: true
|
257936
257980
|
});
|
257937
|
-
connectedNodesUniqueNames = Array.isArray(connectedNodes) ?
|
257981
|
+
connectedNodesUniqueNames = Array.isArray(connectedNodes) ? applicationBlockchainNodes.map((node) => node.uniqueName) : connectedNodes ? [connectedNodes.uniqueName] : [];
|
257938
257982
|
}
|
257939
257983
|
if (connectedNodesUniqueNames.length === 0) {
|
257940
257984
|
return cancel2("A load balancer must connect to at least one blockchain node");
|
257941
257985
|
}
|
257986
|
+
const selectedBlockchainNodes = applicationBlockchainNodes.filter((node) => connectedNodesUniqueNames.includes(node.uniqueName));
|
257987
|
+
if (selectedBlockchainNodes.length === 0) {
|
257988
|
+
return cancel2(`Blockchain node(s) '${connectedNodesUniqueNames.join(", ")}' are not part of the application '${applicationUniqueName}'`);
|
257989
|
+
}
|
257942
257990
|
if (!networkUniqueName) {
|
257943
|
-
const applicationBlockchainNodes = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
|
257944
|
-
const selectedBlockchainNodes = applicationBlockchainNodes.filter((node) => connectedNodesUniqueNames.includes(node.uniqueName));
|
257945
|
-
if (selectedBlockchainNodes.length === 0) {
|
257946
|
-
return cancel2(`Blockchain node(s) '${connectedNodesUniqueNames.join(", ")}' are not part of the application '${applicationUniqueName}'`);
|
257947
|
-
}
|
257948
|
-
const onTheSameNetwork = selectedBlockchainNodes.every((node) => node.blockchainNetwork?.uniqueName === selectedBlockchainNodes[0].blockchainNetwork?.uniqueName);
|
257949
|
-
if (!onTheSameNetwork) {
|
257950
|
-
return cancel2("Blockchain nodes must be on the same network");
|
257951
|
-
}
|
257952
257991
|
networkUniqueName = selectedBlockchainNodes[0].blockchainNetwork?.uniqueName;
|
257953
257992
|
}
|
257993
|
+
const onTheSameNetwork = selectedBlockchainNodes.every((node) => node.blockchainNetwork?.uniqueName === networkUniqueName);
|
257994
|
+
if (!onTheSameNetwork) {
|
257995
|
+
return cancel2("Blockchain nodes must be on the same network");
|
257996
|
+
}
|
257954
257997
|
const result = await showSpinner(() => settlemint.loadBalancer.create({
|
257955
257998
|
applicationUniqueName,
|
257956
257999
|
name: name3,
|
@@ -257966,7 +258009,8 @@ function loadBalancerEvmCreateCommand() {
|
|
257966
258009
|
mapDefaultEnv: () => {
|
257967
258010
|
return {
|
257968
258011
|
SETTLEMINT_APPLICATION: applicationUniqueName,
|
257969
|
-
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: result.uniqueName
|
258012
|
+
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: result.uniqueName,
|
258013
|
+
...getBlockchainNodeOrLoadBalancerEndpoints(result)
|
257970
258014
|
};
|
257971
258015
|
}
|
257972
258016
|
};
|
@@ -259278,6 +259322,8 @@ function getItemsForServiceType(services, serviceType) {
|
|
259278
259322
|
return services.blockchainNetworks;
|
259279
259323
|
case "blockchain-node":
|
259280
259324
|
return services.blockchainNodes;
|
259325
|
+
case "load-balancer":
|
259326
|
+
return services.loadBalancers;
|
259281
259327
|
default:
|
259282
259328
|
return [];
|
259283
259329
|
}
|
@@ -259742,15 +259788,21 @@ Please select another key or activate this key on the node and try again.`, "war
|
|
259742
259788
|
async function getHardhatConfigData(envConfig) {
|
259743
259789
|
try {
|
259744
259790
|
const { command, args } = await getPackageManagerExecutable();
|
259745
|
-
const output = await executeCommand(command, [
|
259746
|
-
|
259791
|
+
const output = await executeCommand(command, [
|
259792
|
+
...args,
|
259793
|
+
"ts-node",
|
259794
|
+
"-e",
|
259795
|
+
`import hardhat from "hardhat";
|
259796
|
+
console.log(JSON.stringify(hardhat.userConfig));`,
|
259797
|
+
"--transpileOnly"
|
259798
|
+
], {
|
259747
259799
|
env: {
|
259748
259800
|
...process.env,
|
259749
259801
|
...envConfig
|
259750
259802
|
},
|
259751
259803
|
silent: true
|
259752
259804
|
});
|
259753
|
-
const config3 =
|
259805
|
+
const config3 = extractJsonObject(output.join(" "));
|
259754
259806
|
if (isHardhatConfig(config3)) {
|
259755
259807
|
return config3;
|
259756
259808
|
}
|
@@ -260473,4 +260525,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
260473
260525
|
// src/cli.ts
|
260474
260526
|
sdkCliCommand();
|
260475
260527
|
|
260476
|
-
//# debugId=
|
260528
|
+
//# debugId=D617B3E9C7951DC564756E2164756E21
|