@settlemint/sdk-cli 2.1.4-pr77f5143c → 2.1.4-pr84ad867d

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,51 +3709,23 @@ var require_decrypt = __commonJS((exports, module) => {
3709
3709
  module.exports = decrypt;
3710
3710
  });
3711
3711
 
3712
- // ../../node_modules/@noble/ciphers/utils.js
3713
- var require_utils3 = __commonJS((exports) => {
3714
- /*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */
3712
+ // ../../node_modules/@noble/ciphers/_assert.js
3713
+ var require__assert = __commonJS((exports) => {
3715
3714
  Object.defineProperty(exports, "__esModule", { value: true });
3716
- exports.wrapCipher = exports.Hash = exports.nextTick = exports.isLE = undefined;
3717
- exports.isBytes = isBytes;
3718
3715
  exports.abool = abool;
3719
- exports.anumber = anumber;
3720
3716
  exports.abytes = abytes;
3721
- exports.ahash = ahash;
3722
3717
  exports.aexists = aexists;
3718
+ exports.ahash = ahash;
3719
+ exports.anumber = anumber;
3723
3720
  exports.aoutput = aoutput;
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
- }
3721
+ exports.isBytes = isBytes;
3753
3722
  function anumber(n) {
3754
3723
  if (!Number.isSafeInteger(n) || n < 0)
3755
3724
  throw new Error("positive integer expected, got " + n);
3756
3725
  }
3726
+ function isBytes(a) {
3727
+ return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
3728
+ }
3757
3729
  function abytes(b, ...lengths) {
3758
3730
  if (!isBytes(b))
3759
3731
  throw new Error("Uint8Array expected");
@@ -3762,7 +3734,7 @@ var require_utils3 = __commonJS((exports) => {
3762
3734
  }
3763
3735
  function ahash(h) {
3764
3736
  if (typeof h !== "function" || typeof h.create !== "function")
3765
- throw new Error("Hash should be wrapped by utils.createHasher");
3737
+ throw new Error("Hash should be wrapped by utils.wrapConstructor");
3766
3738
  anumber(h.outputLen);
3767
3739
  anumber(h.blockLen);
3768
3740
  }
@@ -3779,27 +3751,49 @@ var require_utils3 = __commonJS((exports) => {
3779
3751
  throw new Error("digestInto() expects output buffer of length at least " + min);
3780
3752
  }
3781
3753
  }
3782
- function u8(arr) {
3783
- return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
3784
- }
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);
3754
+ function abool(b) {
3755
+ if (typeof b !== "boolean")
3756
+ throw new Error(`boolean expected, not ${b}`);
3795
3757
  }
3796
- exports.isLE = (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
3797
- var hasHexBuiltin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function")();
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");
3798
3794
  var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
3799
3795
  function bytesToHex(bytes) {
3800
- abytes(bytes);
3801
- if (hasHexBuiltin)
3802
- return bytes.toHex();
3796
+ (0, _assert_js_1.abytes)(bytes);
3803
3797
  let hex = "";
3804
3798
  for (let i = 0;i < bytes.length; i++) {
3805
3799
  hex += hexes[bytes[i]];
@@ -3819,8 +3813,6 @@ var require_utils3 = __commonJS((exports) => {
3819
3813
  function hexToBytes(hex) {
3820
3814
  if (typeof hex !== "string")
3821
3815
  throw new Error("hex string expected, got " + typeof hex);
3822
- if (hasHexBuiltin)
3823
- return Uint8Array.fromHex(hex);
3824
3816
  const hl = hex.length;
3825
3817
  const al = hl / 2;
3826
3818
  if (hl % 2)
@@ -3861,7 +3853,7 @@ var require_utils3 = __commonJS((exports) => {
3861
3853
  function toBytes(data) {
3862
3854
  if (typeof data === "string")
3863
3855
  data = utf8ToBytes(data);
3864
- else if (isBytes(data))
3856
+ else if ((0, _assert_js_1.isBytes)(data))
3865
3857
  data = copyBytes(data);
3866
3858
  else
3867
3859
  throw new Error("Uint8Array expected, got " + typeof data);
@@ -3878,7 +3870,7 @@ var require_utils3 = __commonJS((exports) => {
3878
3870
  let sum = 0;
3879
3871
  for (let i = 0;i < arrays.length; i++) {
3880
3872
  const a = arrays[i];
3881
- abytes(a);
3873
+ (0, _assert_js_1.abytes)(a);
3882
3874
  sum += a.length;
3883
3875
  }
3884
3876
  const res = new Uint8Array(sum);
@@ -3909,28 +3901,26 @@ var require_utils3 = __commonJS((exports) => {
3909
3901
  exports.Hash = Hash;
3910
3902
  var wrapCipher = (params, constructor) => {
3911
3903
  function wrappedCipher(key, ...args) {
3912
- abytes(key);
3913
- if (!exports.isLE)
3914
- throw new Error("Non little-endian hardware is not yet supported");
3904
+ (0, _assert_js_1.abytes)(key);
3915
3905
  if (params.nonceLength !== undefined) {
3916
3906
  const nonce = args[0];
3917
3907
  if (!nonce)
3918
3908
  throw new Error("nonce / iv required");
3919
3909
  if (params.varSizeNonce)
3920
- abytes(nonce);
3910
+ (0, _assert_js_1.abytes)(nonce);
3921
3911
  else
3922
- abytes(nonce, params.nonceLength);
3912
+ (0, _assert_js_1.abytes)(nonce, params.nonceLength);
3923
3913
  }
3924
3914
  const tagl = params.tagLength;
3925
3915
  if (tagl && args[1] !== undefined) {
3926
- abytes(args[1]);
3916
+ (0, _assert_js_1.abytes)(args[1]);
3927
3917
  }
3928
3918
  const cipher = constructor(key, ...args);
3929
3919
  const checkOutput = (fnLength, output) => {
3930
3920
  if (output !== undefined) {
3931
3921
  if (fnLength !== 2)
3932
3922
  throw new Error("cipher output not supported");
3933
- abytes(output);
3923
+ (0, _assert_js_1.abytes)(output);
3934
3924
  }
3935
3925
  };
3936
3926
  let called = false;
@@ -3939,12 +3929,12 @@ var require_utils3 = __commonJS((exports) => {
3939
3929
  if (called)
3940
3930
  throw new Error("cannot encrypt() twice with same key + nonce");
3941
3931
  called = true;
3942
- abytes(data);
3932
+ (0, _assert_js_1.abytes)(data);
3943
3933
  checkOutput(cipher.encrypt.length, output);
3944
3934
  return cipher.encrypt(data, output);
3945
3935
  },
3946
3936
  decrypt(data, output) {
3947
- abytes(data);
3937
+ (0, _assert_js_1.abytes)(data);
3948
3938
  if (tagl && data.length < tagl)
3949
3939
  throw new Error("invalid ciphertext length: smaller than tagLength=" + tagl);
3950
3940
  checkOutput(cipher.decrypt.length, output);
@@ -3978,12 +3968,11 @@ var require_utils3 = __commonJS((exports) => {
3978
3968
  view.setUint32(byteOffset + h, wh, isLE);
3979
3969
  view.setUint32(byteOffset + l, wl, isLE);
3980
3970
  }
3981
- function u64Lengths(dataLength, aadLength, isLE) {
3982
- abool(isLE);
3971
+ function u64Lengths(ciphertext, AAD) {
3983
3972
  const num = new Uint8Array(16);
3984
- const view = createView(num);
3985
- setBigUint64(view, 0, BigInt(aadLength), isLE);
3986
- setBigUint64(view, 8, BigInt(dataLength), isLE);
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);
3987
3976
  return num;
3988
3977
  }
3989
3978
  function isAligned32(bytes) {
@@ -3992,6 +3981,11 @@ var require_utils3 = __commonJS((exports) => {
3992
3981
  function copyBytes(bytes) {
3993
3982
  return Uint8Array.from(bytes);
3994
3983
  }
3984
+ function clean(...arrays) {
3985
+ for (let i = 0;i < arrays.length; i++) {
3986
+ arrays[i].fill(0);
3987
+ }
3988
+ }
3995
3989
  });
3996
3990
 
3997
3991
  // ../../node_modules/eciesjs/dist/consts.js
@@ -4074,13 +4068,14 @@ var require_webcrypto = __commonJS((exports) => {
4074
4068
  exports.getWebcryptoSubtle = getWebcryptoSubtle;
4075
4069
  exports.managedNonce = managedNonce;
4076
4070
  var crypto_1 = require_cryptoNode();
4077
- var utils_ts_1 = require_utils3();
4071
+ var _assert_js_1 = require__assert();
4072
+ var utils_js_1 = require_utils3();
4078
4073
  function randomBytes(bytesLength = 32) {
4079
4074
  if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === "function") {
4080
4075
  return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength));
4081
4076
  }
4082
4077
  if (crypto_1.crypto && typeof crypto_1.crypto.randomBytes === "function") {
4083
- return Uint8Array.from(crypto_1.crypto.randomBytes(bytesLength));
4078
+ return crypto_1.crypto.randomBytes(bytesLength);
4084
4079
  }
4085
4080
  throw new Error("crypto.getRandomValues must be defined");
4086
4081
  }
@@ -4091,12 +4086,12 @@ var require_webcrypto = __commonJS((exports) => {
4091
4086
  }
4092
4087
  function managedNonce(fn) {
4093
4088
  const { nonceLength } = fn;
4094
- (0, utils_ts_1.anumber)(nonceLength);
4089
+ (0, _assert_js_1.anumber)(nonceLength);
4095
4090
  return (key, ...args) => ({
4096
4091
  encrypt(plaintext, ...argsEnc) {
4097
4092
  const nonce = randomBytes(nonceLength);
4098
4093
  const ciphertext = fn(key, nonce, ...args).encrypt(plaintext, ...argsEnc);
4099
- const out = (0, utils_ts_1.concatBytes)(nonce, ciphertext);
4094
+ const out = (0, utils_js_1.concatBytes)(nonce, ciphertext);
4100
4095
  ciphertext.fill(0);
4101
4096
  return out;
4102
4097
  },
@@ -4141,21 +4136,21 @@ var require_webcrypto = __commonJS((exports) => {
4141
4136
  }
4142
4137
  function generate(algo) {
4143
4138
  return (key, nonce, AAD) => {
4144
- (0, utils_ts_1.abytes)(key);
4145
- (0, utils_ts_1.abytes)(nonce);
4139
+ (0, _assert_js_1.abytes)(key);
4140
+ (0, _assert_js_1.abytes)(nonce);
4146
4141
  const keyParams = { name: algo, length: key.length * 8 };
4147
4142
  const cryptParams = getCryptParams(algo, nonce, AAD);
4148
4143
  let consumed = false;
4149
4144
  return {
4150
4145
  encrypt(plaintext) {
4151
- (0, utils_ts_1.abytes)(plaintext);
4146
+ (0, _assert_js_1.abytes)(plaintext);
4152
4147
  if (consumed)
4153
4148
  throw new Error("Cannot encrypt() twice with same key / nonce");
4154
4149
  consumed = true;
4155
4150
  return exports.utils.encrypt(key, keyParams, cryptParams, plaintext);
4156
4151
  },
4157
4152
  decrypt(ciphertext) {
4158
- (0, utils_ts_1.abytes)(ciphertext);
4153
+ (0, _assert_js_1.abytes)(ciphertext);
4159
4154
  return exports.utils.decrypt(key, keyParams, cryptParams, ciphertext);
4160
4155
  }
4161
4156
  };
@@ -4167,7 +4162,7 @@ var require_webcrypto = __commonJS((exports) => {
4167
4162
  });
4168
4163
 
4169
4164
  // ../../node_modules/@noble/hashes/_assert.js
4170
- var require__assert = __commonJS((exports) => {
4165
+ var require__assert2 = __commonJS((exports) => {
4171
4166
  Object.defineProperty(exports, "__esModule", { value: true });
4172
4167
  exports.anumber = anumber;
4173
4168
  exports.abytes = abytes;
@@ -4241,7 +4236,7 @@ var require_utils4 = __commonJS((exports) => {
4241
4236
  exports.wrapXOFConstructorWithOpts = wrapXOFConstructorWithOpts;
4242
4237
  exports.randomBytes = randomBytes;
4243
4238
  var crypto_1 = require_cryptoNode2();
4244
- var _assert_ts_1 = require__assert();
4239
+ var _assert_ts_1 = require__assert2();
4245
4240
  function isBytes(a) {
4246
4241
  return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
4247
4242
  }
@@ -4407,7 +4402,7 @@ var require__md = __commonJS((exports) => {
4407
4402
  exports.setBigUint64 = setBigUint64;
4408
4403
  exports.Chi = Chi;
4409
4404
  exports.Maj = Maj;
4410
- var _assert_ts_1 = require__assert();
4405
+ var _assert_ts_1 = require__assert2();
4411
4406
  var utils_ts_1 = require_utils4();
4412
4407
  function setBigUint64(view, byteOffset, value, isLE) {
4413
4408
  if (typeof view.setBigUint64 === "function")
@@ -6930,7 +6925,7 @@ var require_ed25519 = __commonJS((exports) => {
6930
6925
  var require_hmac = __commonJS((exports) => {
6931
6926
  Object.defineProperty(exports, "__esModule", { value: true });
6932
6927
  exports.hmac = exports.HMAC = undefined;
6933
- var _assert_ts_1 = require__assert();
6928
+ var _assert_ts_1 = require__assert2();
6934
6929
  var utils_ts_1 = require_utils4();
6935
6930
 
6936
6931
  class HMAC extends utils_ts_1.Hash {
@@ -8258,7 +8253,7 @@ var require_hkdf = __commonJS((exports) => {
8258
8253
  exports.hkdf = undefined;
8259
8254
  exports.extract = extract;
8260
8255
  exports.expand = expand;
8261
- var _assert_ts_1 = require__assert();
8256
+ var _assert_ts_1 = require__assert2();
8262
8257
  var hmac_ts_1 = require_hmac();
8263
8258
  var utils_ts_1 = require_utils4();
8264
8259
  function extract(hash, ikm, salt) {
@@ -245345,7 +245340,7 @@ function pruneCurrentEnv(currentEnv, env2) {
245345
245340
  var package_default = {
245346
245341
  name: "@settlemint/sdk-cli",
245347
245342
  description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
245348
- version: "2.1.4-pr77f5143c",
245343
+ version: "2.1.4-pr84ad867d",
245349
245344
  type: "module",
245350
245345
  private: false,
245351
245346
  license: "FSL-1.1-MIT",
@@ -245394,8 +245389,8 @@ var package_default = {
245394
245389
  "@inquirer/input": "4.1.9",
245395
245390
  "@inquirer/password": "4.0.12",
245396
245391
  "@inquirer/select": "4.1.1",
245397
- "@settlemint/sdk-js": "2.1.4-pr77f5143c",
245398
- "@settlemint/sdk-utils": "2.1.4-pr77f5143c",
245392
+ "@settlemint/sdk-js": "2.1.4-pr84ad867d",
245393
+ "@settlemint/sdk-utils": "2.1.4-pr84ad867d",
245399
245394
  "@types/node": "22.14.1",
245400
245395
  "@types/semver": "7.7.0",
245401
245396
  "@types/which": "3.0.4",
@@ -260525,4 +260520,4 @@ async function sdkCliCommand(argv = process.argv) {
260525
260520
  // src/cli.ts
260526
260521
  sdkCliCommand();
260527
260522
 
260528
- //# debugId=2B373E0C09B2899D64756E2164756E21
260523
+ //# debugId=EAB8B7F30E37EDF264756E2164756E21