@settlemint/sdk-cli 2.1.5 → 2.2.0-main4056a0d4

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 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/_assert.js
3713
- var require__assert = __commonJS((exports) => {
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.anumber = anumber;
3722
+ exports.aexists = aexists;
3720
3723
  exports.aoutput = aoutput;
3721
- exports.isBytes = isBytes;
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.wrapConstructor");
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 abool(b) {
3755
- if (typeof b !== "boolean")
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
- // ../../node_modules/@noble/ciphers/utils.js
3761
- var require_utils3 = __commonJS((exports) => {
3762
- Object.defineProperty(exports, "__esModule", { value: true });
3763
- exports.wrapCipher = exports.Hash = exports.nextTick = exports.isLE = exports.createView = exports.u32 = exports.u8 = undefined;
3764
- exports.bytesToHex = bytesToHex;
3765
- exports.hexToBytes = hexToBytes;
3766
- exports.hexToNumber = hexToNumber;
3767
- exports.bytesToNumberBE = bytesToNumberBE;
3768
- exports.numberToBytesBE = numberToBytesBE;
3769
- exports.utf8ToBytes = utf8ToBytes;
3770
- exports.bytesToUtf8 = bytesToUtf8;
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
- (0, _assert_js_1.abytes)(bytes);
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 ((0, _assert_js_1.isBytes)(data))
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
- (0, _assert_js_1.abytes)(a);
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
- (0, _assert_js_1.abytes)(key);
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
- (0, _assert_js_1.abytes)(nonce);
3920
+ abytes(nonce);
3911
3921
  else
3912
- (0, _assert_js_1.abytes)(nonce, params.nonceLength);
3922
+ abytes(nonce, params.nonceLength);
3913
3923
  }
3914
3924
  const tagl = params.tagLength;
3915
3925
  if (tagl && args[1] !== undefined) {
3916
- (0, _assert_js_1.abytes)(args[1]);
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
- (0, _assert_js_1.abytes)(output);
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
- (0, _assert_js_1.abytes)(data);
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
- (0, _assert_js_1.abytes)(data);
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(ciphertext, AAD) {
3981
+ function u64Lengths(dataLength, aadLength, isLE) {
3982
+ abool(isLE);
3972
3983
  const num = new Uint8Array(16);
3973
- const view = (0, exports.createView)(num);
3974
- setBigUint64(view, 0, BigInt(AAD ? AAD.length : 0), true);
3975
- setBigUint64(view, 8, BigInt(ciphertext.length), true);
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 _assert_js_1 = require__assert();
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, _assert_js_1.anumber)(nonceLength);
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, utils_js_1.concatBytes)(nonce, ciphertext);
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, _assert_js_1.abytes)(key);
4140
- (0, _assert_js_1.abytes)(nonce);
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, _assert_js_1.abytes)(plaintext);
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, _assert_js_1.abytes)(ciphertext);
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 require__assert2 = __commonJS((exports) => {
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 = require__assert2();
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 = require__assert2();
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 = require__assert2();
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 = require__assert2();
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.5",
245348
+ version: "2.2.0-main4056a0d4",
245344
245349
  type: "module",
245345
245350
  private: false,
245346
245351
  license: "FSL-1.1-MIT",
@@ -245389,9 +245394,9 @@ var package_default = {
245389
245394
  "@inquirer/input": "4.1.9",
245390
245395
  "@inquirer/password": "4.0.12",
245391
245396
  "@inquirer/select": "4.2.0",
245392
- "@settlemint/sdk-js": "2.1.5",
245393
- "@settlemint/sdk-utils": "2.1.5",
245394
- "@types/node": "22.15.1",
245397
+ "@settlemint/sdk-js": "2.2.0-main4056a0d4",
245398
+ "@settlemint/sdk-utils": "2.2.0-main4056a0d4",
245399
+ "@types/node": "22.15.3",
245395
245400
  "@types/semver": "7.7.0",
245396
245401
  "@types/which": "3.0.4",
245397
245402
  "get-tsconfig": "4.10.0",
@@ -253197,7 +253202,20 @@ async function blockchainNodeOrLoadBalancerPrompt({
253197
253202
 
253198
253203
  // src/commands/connect.ts
253199
253204
  function connectCommand() {
253200
- return new Command("connect").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values").option("-i, --instance <instance>", "The instance to connect to (defaults to the instance in the .env file)").description("Connects your project to your application on SettleMint").action(async ({ acceptDefaults, prod, instance }) => {
253205
+ return new Command("connect").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values").option("-i, --instance <instance>", "The instance to connect to (defaults to the instance in the .env file)").description("Connects your project to your application on SettleMint").usage(createExamples([
253206
+ {
253207
+ description: "Connect to your environment",
253208
+ command: "settlemint connect"
253209
+ },
253210
+ {
253211
+ description: "Connect to your environment using defaults from the .env file",
253212
+ command: "settlemint connect --accept-defaults"
253213
+ },
253214
+ {
253215
+ description: "Connect to your production environment",
253216
+ command: "settlemint connect --prod"
253217
+ }
253218
+ ])).action(async ({ acceptDefaults, prod, instance }) => {
253201
253219
  intro("Connecting your dApp to SettleMint");
253202
253220
  const env2 = await loadEnv(false, !!prod);
253203
253221
  const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, true);
@@ -256646,7 +256664,20 @@ async function downloadAndExtractNpmPackage({
256646
256664
 
256647
256665
  // src/commands/create.ts
256648
256666
  function createCommand2() {
256649
- return new Command("create").description("Bootstrap your SettleMint project").option("-n, --project-name <name>", "The name for your SettleMint project").option("-t, --template <template>", "The template for your SettleMint project (run `settlemint platform config` to see available templates)").option("-v, --version <version>", "Specify the template version to use (defaults to latest stable version)").option("-i, --instance <instance>", "The instance to connect to").action(async ({ projectName, template, version, instance }) => {
256667
+ return new Command("create").description("Create a new application from a template").option("-n, --project-name <name>", "The name for your SettleMint project").option("-t, --template <template>", "The template for your SettleMint project (run `settlemint platform config` to see available templates)").option("-v, --version <version>", "Specify the template version to use (defaults to latest stable version)").option("-i, --instance <instance>", "The instance to connect to").usage(createExamples([
256668
+ {
256669
+ description: "Create a new application from a template",
256670
+ command: "settlemint create"
256671
+ },
256672
+ {
256673
+ description: "Create a new asset tokenization application",
256674
+ command: "settlemint create --template asset-tokenization"
256675
+ },
256676
+ {
256677
+ description: "Create a new asset tokenization application from a specific version",
256678
+ command: "settlemint create --template asset-tokenization --version 1.0.0"
256679
+ }
256680
+ ])).action(async ({ projectName, template, version, instance }) => {
256650
256681
  intro("Creating a new SettleMint project");
256651
256682
  const env2 = await loadEnv(false, false);
256652
256683
  if (version && !template) {
@@ -256960,7 +256991,16 @@ function loginCommand() {
256960
256991
 
256961
256992
  // src/commands/logout.ts
256962
256993
  function logoutCommand() {
256963
- return new Command("logout").description("Logout from your SettleMint account").option("--all", "Logout from all instances").action(async (options) => {
256994
+ return new Command("logout").description("Logout from your SettleMint account").option("--all", "Logout from all instances").usage(createExamples([
256995
+ {
256996
+ description: "Logout from your SettleMint account",
256997
+ command: "settlemint logout"
256998
+ },
256999
+ {
257000
+ description: "Logout from all instances",
257001
+ command: "settlemint logout --all"
257002
+ }
257003
+ ])).action(async (options) => {
256964
257004
  intro("Logging out from SettleMint");
256965
257005
  const instances = await getInstances();
256966
257006
  if (instances.length === 0) {
@@ -257016,7 +257056,16 @@ async function pincodeVerificationPrompt(verificationChallenges) {
257016
257056
 
257017
257057
  // src/commands/pincode-verification-response.ts
257018
257058
  function pincodeVerificationResponseCommand() {
257019
- return new Command("pincode-verification-response").alias("pvr").description("Get pincode verification response for a blockchain node").requiredOption("--wallet-address <walletAddress>", "The wallet address to get pincode verification response for").option("-i, --instance <instance>", "The instance to connect to (defaults to the instance in the .env file)").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name to get pincode verification response for").action(async ({ instance, blockchainNode, walletAddress }) => {
257059
+ return new Command("pincode-verification-response").alias("pvr").description("Get pincode verification response for a blockchain node").requiredOption("--wallet-address <walletAddress>", "The wallet address to get pincode verification response for").option("-i, --instance <instance>", "The instance to connect to (defaults to the instance in the .env file)").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name to get pincode verification response for").usage(createExamples([
257060
+ {
257061
+ description: "Get pincode verification response for a wallet address",
257062
+ command: "settlemint pincode-verification-response --wallet-address 0x1234567890123456789012345678901234567890"
257063
+ },
257064
+ {
257065
+ description: "Get pincode verification response for a wallet address and connect to a specific blockchain node",
257066
+ command: "settlemint pincode-verification-response --wallet-address 0x1234567890123456789012345678901234567890 --blockchain-node my-blockchain-node"
257067
+ }
257068
+ ])).action(async ({ instance, blockchainNode, walletAddress }) => {
257020
257069
  intro("Generating pincode verification response for wallet address");
257021
257070
  const env2 = await loadEnv(false, false);
257022
257071
  const applicationUniqueName = env2.SETTLEMINT_APPLICATION;
@@ -257885,6 +257934,14 @@ function blockscoutInsightsCreateCommand() {
257885
257934
  {
257886
257935
  description: "Create a Blockscout insights service in a different application",
257887
257936
  command: "platform create insights blockscout my-blockscout --application app-123"
257937
+ },
257938
+ {
257939
+ description: "Create a Blockscout insights service and connect to a specific load balancer",
257940
+ command: "platform create insights blockscout my-blockscout --load-balancer my-load-balancer"
257941
+ },
257942
+ {
257943
+ description: "Create a Blockscout insights service and connect to a specific blockchain node",
257944
+ command: "platform create insights blockscout my-blockscout --blockchain-node my-blockchain-node"
257888
257945
  }
257889
257946
  ]
257890
257947
  });
@@ -258141,6 +258198,14 @@ function graphMiddlewareCreateCommand() {
258141
258198
  {
258142
258199
  description: "Create a graph middleware in a different application",
258143
258200
  command: "platform create middleware graph my-graph --application my-app --blockchain-node node-123"
258201
+ },
258202
+ {
258203
+ description: "Create a graph middleware and connect to a specific load balancer",
258204
+ command: "platform create middleware graph my-graph --load-balancer my-load-balancer"
258205
+ },
258206
+ {
258207
+ description: "Create a graph middleware and connect to a specific blockchain node",
258208
+ command: "platform create middleware graph my-graph --blockchain-node my-blockchain-node"
258144
258209
  }
258145
258210
  ]
258146
258211
  });
@@ -258248,6 +258313,14 @@ function smartContractPortalMiddlewareCreateCommand() {
258248
258313
  {
258249
258314
  description: "Create a smart contract portal middleware in a different application",
258250
258315
  command: "platform create middleware smart-contract-portal my-portal --application my-app --blockchain-node node-123"
258316
+ },
258317
+ {
258318
+ description: "Create a smart contract portal middleware and connect to a specific blockchain node",
258319
+ command: "platform create middleware smart-contract-portal my-portal --blockchain-node my-blockchain-node"
258320
+ },
258321
+ {
258322
+ description: "Create a smart contract portal middleware and connect to a specific load balancer",
258323
+ command: "platform create middleware smart-contract-portal my-portal --load-balancer my-load-balancer"
258251
258324
  }
258252
258325
  ]
258253
258326
  });
@@ -258562,7 +258635,7 @@ function storageCreateCommand() {
258562
258635
 
258563
258636
  // src/commands/platform/create.ts
258564
258637
  function createCommand3() {
258565
- return new Command("create").alias("c").description("Create a resource in the SettleMint platform").addCommand(workspaceCreateCommand()).addCommand(applicationCreateCommand()).addCommand(blockchainNetworkCreateCommand()).addCommand(blockchainNodeCreateCommand()).addCommand(privateKeyCreateCommand()).addCommand(middlewareCreateCommand()).addCommand(storageCreateCommand()).addCommand(integrationToolCreateCommand()).addCommand(insightsCreateCommand()).addCommand(applicationAccessTokenCreateCommand()).addCommand(loadBalancerCreateCommand());
258638
+ return new Command("create").alias("c").description("Create a resource in the SettleMint platform").addCommand(applicationAccessTokenCreateCommand()).addCommand(applicationCreateCommand()).addCommand(blockchainNetworkCreateCommand()).addCommand(blockchainNodeCreateCommand()).addCommand(insightsCreateCommand()).addCommand(integrationToolCreateCommand()).addCommand(loadBalancerCreateCommand()).addCommand(middlewareCreateCommand()).addCommand(privateKeyCreateCommand()).addCommand(storageCreateCommand()).addCommand(workspaceCreateCommand());
258566
258639
  }
258567
258640
 
258568
258641
  // src/prompts/delete-confirmation.prompt.ts
@@ -258682,7 +258755,7 @@ function applicationDeleteCommand() {
258682
258755
 
258683
258756
  // src/commands/platform/delete.ts
258684
258757
  function deleteCommand() {
258685
- return new Command("delete").alias("d").description("Delete a resource in the SettleMint platform").addCommand(workspaceDeleteCommand()).addCommand(applicationDeleteCommand());
258758
+ return new Command("delete").alias("d").description("Delete a resource in the SettleMint platform").addCommand(applicationDeleteCommand()).addCommand(workspaceDeleteCommand());
258686
258759
  }
258687
258760
 
258688
258761
  // src/commands/platform/common/restart-command.ts
@@ -258758,6 +258831,19 @@ function blockchainNetworkRestartCommand() {
258758
258831
  });
258759
258832
  }
258760
258833
 
258834
+ // src/commands/platform/blockchain-node/restart.ts
258835
+ function blockchainNodeRestartCommand() {
258836
+ return getRestartCommand({
258837
+ name: "blockchain-node",
258838
+ type: "blockchain node",
258839
+ alias: "bn",
258840
+ envKey: "SETTLEMINT_BLOCKCHAIN_NODE",
258841
+ restartFunction: async (settlemint, id) => {
258842
+ return settlemint.blockchainNode.restart(id);
258843
+ }
258844
+ });
258845
+ }
258846
+
258761
258847
  // src/commands/platform/custom-deployments/restart.ts
258762
258848
  function customDeploymentRestartCommand() {
258763
258849
  return getRestartCommand({
@@ -258889,13 +258975,22 @@ function storageRestartCommand() {
258889
258975
 
258890
258976
  // src/commands/platform/restart.ts
258891
258977
  function restartCommand() {
258892
- const cmd2 = new Command("restart").description("Restart a resource in the SettleMint platform").addCommand(blockchainNetworkRestartCommand()).addCommand(customDeploymentRestartCommand()).addCommand(insightsRestartCommand()).addCommand(integrationToolRestartCommand()).addCommand(middlewareRestartCommand()).addCommand(storageRestartCommand()).addCommand(loadBalancerRestartCommand());
258978
+ const cmd2 = new Command("restart").description("Restart a resource in the SettleMint platform").addCommand(blockchainNetworkRestartCommand()).addCommand(blockchainNodeRestartCommand()).addCommand(customDeploymentRestartCommand()).addCommand(insightsRestartCommand()).addCommand(integrationToolRestartCommand()).addCommand(loadBalancerRestartCommand()).addCommand(middlewareRestartCommand()).addCommand(storageRestartCommand());
258893
258979
  return cmd2;
258894
258980
  }
258895
258981
 
258896
258982
  // src/commands/platform/custom-deployments/update.ts
258897
258983
  function customDeploymentsUpdateCommand() {
258898
- return new Command("custom-deployment").alias("cd").argument("<tag>", "The tag to update the custom deployment to").option("--unique-name <uniqueName>", "The unique name of the custom deployment to update. If not provided, will use SETTLEMINT_CUSTOM_DEPLOYMENT from env").option("--prod", "Connect to your production environment").option("--wait", "Wait for the custom deployment to be redeployed").description("Update a custom deployment in the SettleMint platform").action(async (tag, { uniqueName, prod, wait }) => {
258984
+ return new Command("custom-deployment").alias("cd").argument("<tag>", "The tag to update the custom deployment to").option("--unique-name <uniqueName>", "The unique name of the custom deployment to update. If not provided, will use SETTLEMINT_CUSTOM_DEPLOYMENT from env").option("--prod", "Connect to your production environment").option("--wait", "Wait for the custom deployment to be redeployed").description("Update a custom deployment in the SettleMint platform").usage(createExamples([
258985
+ {
258986
+ description: "Update a custom deployment",
258987
+ command: "settlemint custom-deployment update v1.0.0"
258988
+ },
258989
+ {
258990
+ description: "Update a custom deployment with a specific unique name",
258991
+ command: "settlemint custom-deployment update v1.0.0 --unique-name my-custom-deployment"
258992
+ }
258993
+ ])).action(async (tag, { uniqueName, prod, wait }) => {
258899
258994
  intro("Updating custom deployment in the SettleMint platform");
258900
258995
  const env2 = await loadEnv(false, !!prod);
258901
258996
  const customDeploymentUniqueName = uniqueName ?? env2.SETTLEMINT_CUSTOM_DEPLOYMENT;
@@ -258994,7 +259089,20 @@ function yamlOutput(data) {
258994
259089
 
258995
259090
  // src/commands/platform/config.ts
258996
259091
  function configCommand() {
258997
- return new Command("config").alias("cfg").description("Get platform configuration").option("--prod", "Connect to your production environment").option("-i, --instance <instance>", "The instance to connect to (defaults to the instance in the .env file)").addOption(new Option("-o, --output <output>", "The output format").choices(["json", "yaml"])).action(async ({ prod, instance, output }) => {
259092
+ return new Command("config").alias("cfg").description("Get platform configuration").option("--prod", "Connect to your production environment").option("-i, --instance <instance>", "The instance to connect to (defaults to the instance in the .env file)").addOption(new Option("-o, --output <output>", "The output format").choices(["json", "yaml"])).usage(createExamples([
259093
+ {
259094
+ description: "Get platform configuration",
259095
+ command: "settlemint config"
259096
+ },
259097
+ {
259098
+ description: "Get platform configuration in JSON format",
259099
+ command: "settlemint config -o json"
259100
+ },
259101
+ {
259102
+ description: "Get platform configuration in YAML format",
259103
+ command: "settlemint config -o yaml"
259104
+ }
259105
+ ])).action(async ({ prod, instance, output }) => {
258998
259106
  intro("Getting platform configuration");
258999
259107
  const env2 = await loadEnv(false, !!prod);
259000
259108
  const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, true);
@@ -259419,12 +259527,12 @@ function workspacesListCommand() {
259419
259527
 
259420
259528
  // src/commands/platform/list.ts
259421
259529
  function listCommand() {
259422
- return new Command("list").alias("ls").description("List resources in the SettleMint platform").addCommand(servicesCommand()).addCommand(workspacesListCommand()).addCommand(applicationsListCommand());
259530
+ return new Command("list").alias("ls").description("List resources in the SettleMint platform").addCommand(applicationsListCommand()).addCommand(servicesCommand()).addCommand(workspacesListCommand());
259423
259531
  }
259424
259532
 
259425
259533
  // src/commands/platform.ts
259426
259534
  function platformCommand() {
259427
- return new Command("platform").description("Manage SettleMint platform resources").addCommand(configCommand()).addCommand(createCommand3()).addCommand(updateCommand()).addCommand(deleteCommand()).addCommand(restartCommand()).addCommand(listCommand());
259535
+ return new Command("platform").description("Manage SettleMint platform resources").addCommand(configCommand()).addCommand(createCommand3()).addCommand(deleteCommand()).addCommand(listCommand()).addCommand(restartCommand()).addCommand(updateCommand());
259428
259536
  }
259429
259537
 
259430
259538
  // src/commands/smart-contract-set/create.ts
@@ -259482,7 +259590,12 @@ async function executeFoundryCommand(command, args) {
259482
259590
 
259483
259591
  // src/commands/smart-contract-set/create.ts
259484
259592
  function createCommand4() {
259485
- return new Command("create").description("Bootstrap your smart contract set").option("-n, --project-name <name>", "The name for your smart contract set project").option("--use-case <useCase>", "Use case for the smart contract set (run `settlemint platform config` to see available use cases)").option("-i, --instance <instance>", "The instance to connect to").action(async ({ projectName, useCase, instance }) => {
259593
+ return new Command("create").description("Bootstrap your smart contract set").option("-n, --project-name <name>", "The name for your smart contract set project").option("--use-case <useCase>", "Use case for the smart contract set (run `settlemint platform config` to see available use cases)").option("-i, --instance <instance>", "The instance to connect to").usage(createExamples([
259594
+ {
259595
+ description: "Create a new solidity-token-erc20 smart contract set",
259596
+ command: "settlemint smart-contract-set create --project-name erc20-contracts --use-case solidity-token-erc20"
259597
+ }
259598
+ ])).action(async ({ projectName, useCase, instance }) => {
259486
259599
  intro("Creating a new smart contract set");
259487
259600
  const env2 = await loadEnv(false, false);
259488
259601
  const name3 = await projectNamePrompt(env2, projectName);
@@ -259977,7 +260090,12 @@ function hardhatNetworkCommand() {
259977
260090
 
259978
260091
  // src/commands/smart-contract-set/hardhat/script/local.ts
259979
260092
  function hardhatScriptLocalCommand() {
259980
- return new Command("local").description("Run a Hardhat script to deploy a contract on the platform or interact with a deployed contract.").requiredOption("-s, --script <script>", 'The script to run with Hardhat , e.g. "scripts/deploy.ts"').option("--no-compile", "Don't compile before running this task").action(async ({ script, compile }) => {
260093
+ return new Command("local").description("Run a Hardhat script on a local development network.").requiredOption("-s, --script <script>", 'The script to run with Hardhat , e.g. "scripts/deploy.ts"').option("--no-compile", "Don't compile before running this task").usage(createExamples([
260094
+ {
260095
+ description: "Run a Hardhat script on a local network",
260096
+ command: "settlemint hardhat script local --script scripts/deploy.ts"
260097
+ }
260098
+ ])).action(async ({ script, compile }) => {
259981
260099
  intro("Running Hardhat script on local network");
259982
260100
  await validateIfRequiredPackagesAreInstalled(["hardhat"]);
259983
260101
  const { command, args } = await getPackageManagerExecutable();
@@ -259996,7 +260114,20 @@ function hardhatScriptLocalCommand() {
259996
260114
 
259997
260115
  // src/commands/smart-contract-set/hardhat/script/remote.ts
259998
260116
  function hardhatScriptRemoteCommand() {
259999
- const cmd2 = new Command("remote").description("Run a Hardhat script to deploy a contract on the platform or interact with a deployed contract.").requiredOption("-s, --script <script>", 'The script to run with Hardhat , e.g. "scripts/deploy.ts"').option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (optional, defaults to the blockchain node in the environment)").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values").option("--no-compile", "Don't compile before running this task");
260117
+ const cmd2 = new Command("remote").description("Run a Hardhat script on a remote network on the platform.").requiredOption("-s, --script <script>", 'The script to run with Hardhat , e.g. "scripts/deploy.ts"').option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (optional, defaults to the blockchain node in the environment)").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values").option("--no-compile", "Don't compile before running this task").usage(createExamples([
260118
+ {
260119
+ description: "Run a Hardhat script on a remote network",
260120
+ command: "settlemint hardhat script remote --script scripts/deploy.ts"
260121
+ },
260122
+ {
260123
+ description: "Run a Hardhat script on a remote network with a specific blockchain node",
260124
+ command: "settlemint hardhat script remote --script scripts/deploy.ts --blockchain-node my-blockchain-node"
260125
+ },
260126
+ {
260127
+ description: "Run a Hardhat script on a remote network without compiling",
260128
+ command: "settlemint hardhat script remote --script scripts/deploy.ts --no-compile"
260129
+ }
260130
+ ]));
260000
260131
  cmd2.action(async ({ script, prod, blockchainNode: blockchainNodeUniqueName, acceptDefaults, compile }) => {
260001
260132
  intro("Running Hardhat script on remote network");
260002
260133
  await validateIfRequiredPackagesAreInstalled(["hardhat"]);
@@ -260211,7 +260342,12 @@ async function getNodeName({
260211
260342
 
260212
260343
  // src/commands/smart-contract-set/subgraph/build.ts
260213
260344
  function subgraphBuildCommand() {
260214
- return new Command("build").description("Build the subgraph").action(async () => {
260345
+ return new Command("build").description("Build the subgraph").usage(createExamples([
260346
+ {
260347
+ description: "Build the subgraph",
260348
+ command: "settlemint subgraph build"
260349
+ }
260350
+ ])).action(async () => {
260215
260351
  intro("Building subgraph");
260216
260352
  await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
260217
260353
  await subgraphSetup({
@@ -260229,7 +260365,12 @@ function subgraphBuildCommand() {
260229
260365
  // src/commands/smart-contract-set/subgraph/codegen.ts
260230
260366
  import { dirname as dirname11 } from "node:path";
260231
260367
  function subgraphCodegenCommand() {
260232
- return new Command("codegen").description("Codegen the subgraph types").action(async () => {
260368
+ return new Command("codegen").description("Codegen the subgraph types").usage(createExamples([
260369
+ {
260370
+ description: "Generate subgraph types",
260371
+ command: "settlemint subgraph codegen"
260372
+ }
260373
+ ])).action(async () => {
260233
260374
  intro("Generating subgraph types");
260234
260375
  await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
260235
260376
  await subgraphSetup({
@@ -260527,15 +260668,15 @@ ${error5.stack}`));
260527
260668
  function registerCommands() {
260528
260669
  const sdkcli = new Command;
260529
260670
  sdkcli.name("settlemint").usage("[command]").description(`CLI for SettleMint (v${package_default.version})`).version(package_default.version, "-v, --version", "Output the current version").helpOption("-h, --help", "Display help for command").allowUnknownOption().showSuggestionAfterError(true).showHelpAfterError().passThroughOptions();
260530
- sdkcli.addCommand(connectCommand());
260531
260671
  sdkcli.addCommand(codegenCommand());
260532
- sdkcli.addCommand(platformCommand());
260533
- sdkcli.addCommand(smartContractSetCommand());
260672
+ sdkcli.addCommand(connectCommand());
260534
260673
  sdkcli.addCommand(createCommand2());
260674
+ sdkcli.addCommand(hasuraCommand());
260535
260675
  sdkcli.addCommand(loginCommand());
260536
260676
  sdkcli.addCommand(logoutCommand());
260537
260677
  sdkcli.addCommand(pincodeVerificationResponseCommand());
260538
- sdkcli.addCommand(hasuraCommand());
260678
+ sdkcli.addCommand(platformCommand());
260679
+ sdkcli.addCommand(smartContractSetCommand());
260539
260680
  return sdkcli;
260540
260681
  }
260541
260682
  async function sdkCliCommand(argv = process.argv) {
@@ -260555,4 +260696,4 @@ async function sdkCliCommand(argv = process.argv) {
260555
260696
  // src/cli.ts
260556
260697
  sdkCliCommand();
260557
260698
 
260558
- //# debugId=42FD06C642869A5B64756E2164756E21
260699
+ //# debugId=06CC4765930EA04364756E2164756E21