@settlemint/sdk-cli 2.4.0-pre590a800 → 2.4.0-pre98cfd17

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
@@ -258129,9 +258129,9 @@ ${formattedErrors}`);
258129
258129
  throw error$37;
258130
258130
  }
258131
258131
  }
258132
- var ApplicationAccessTokenSchema = string$1().regex(/^sm_aat_.+$/);
258133
- var PersonalAccessTokenSchema = string$1().regex(/^sm_pat_.+$/);
258134
- var AccessTokenSchema = string$1().regex(/^(sm_pat_.+|sm_aat_.+)$/);
258132
+ var ApplicationAccessTokenSchema = string$1().regex(/^sm_aat_.*$/);
258133
+ var PersonalAccessTokenSchema = string$1().regex(/^sm_pat_.*$/);
258134
+ var AccessTokenSchema = string$1().regex(/^sm_pat_.*|sm_aat_.*$/);
258135
258135
  function tryParseJson(value, defaultValue = null) {
258136
258136
  try {
258137
258137
  const parsed = JSON.parse(value);
@@ -258139,7 +258139,7 @@ function tryParseJson(value, defaultValue = null) {
258139
258139
  return defaultValue;
258140
258140
  }
258141
258141
  return parsed;
258142
- } catch (_err) {
258142
+ } catch (err) {
258143
258143
  return defaultValue;
258144
258144
  }
258145
258145
  }
@@ -263769,7 +263769,7 @@ async function findMonoRepoPackages(projectDir) {
263769
263769
  }));
263770
263770
  const allPaths = packagePaths.flat();
263771
263771
  return allPaths.length === 0 ? [projectDir] : [monoRepoRoot, ...allPaths];
263772
- } catch (_error) {
263772
+ } catch (error$37) {
263773
263773
  return [projectDir];
263774
263774
  }
263775
263775
  }
@@ -263840,7 +263840,7 @@ function pruneCurrentEnv(currentEnv, env2) {
263840
263840
  var package_default = {
263841
263841
  name: "@settlemint/sdk-cli",
263842
263842
  description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
263843
- version: "2.4.0-pre590a800",
263843
+ version: "2.4.0-pre98cfd17",
263844
263844
  type: "module",
263845
263845
  private: false,
263846
263846
  license: "FSL-1.1-MIT",
@@ -263859,9 +263859,7 @@ var package_default = {
263859
263859
  url: "https://github.com/settlemint/sdk/issues",
263860
263860
  email: "support@settlemint.com"
263861
263861
  },
263862
- files: [
263863
- "dist"
263864
- ],
263862
+ files: ["dist"],
263865
263863
  exports: {
263866
263864
  "./*": {
263867
263865
  types: "./dist/*.d.ts",
@@ -263891,10 +263889,10 @@ var package_default = {
263891
263889
  "@inquirer/input": "4.1.12",
263892
263890
  "@inquirer/password": "4.0.15",
263893
263891
  "@inquirer/select": "4.2.3",
263894
- "@settlemint/sdk-js": "2.4.0-pre590a800",
263895
- "@settlemint/sdk-utils": "2.4.0-pre590a800",
263896
- "@settlemint/sdk-viem": "2.4.0-pre590a800",
263897
- "@types/node": "24.0.7",
263892
+ "@settlemint/sdk-js": "2.4.0-pre98cfd17",
263893
+ "@settlemint/sdk-utils": "2.4.0-pre98cfd17",
263894
+ "@settlemint/sdk-viem": "2.4.0-pre98cfd17",
263895
+ "@types/node": "24.0.3",
263898
263896
  "@types/semver": "7.7.0",
263899
263897
  "@types/which": "3.0.4",
263900
263898
  "get-tsconfig": "4.10.1",
@@ -263963,7 +263961,7 @@ async function telemetry(data) {
263963
263961
  signal: controller.signal
263964
263962
  });
263965
263963
  clearTimeout(timeout);
263966
- } catch (_error) {}
263964
+ } catch (error2) {}
263967
263965
  }
263968
263966
 
263969
263967
  // ../../node_modules/@commander-js/extra-typings/esm.mjs
@@ -276515,9 +276513,9 @@ ${formattedErrors}`);
276515
276513
  throw error$372;
276516
276514
  }
276517
276515
  }
276518
- var ApplicationAccessTokenSchema2 = string$12().regex(/^sm_aat_.+$/);
276519
- var PersonalAccessTokenSchema2 = string$12().regex(/^sm_pat_.+$/);
276520
- var AccessTokenSchema2 = string$12().regex(/^(sm_pat_.+|sm_aat_.+)$/);
276516
+ var ApplicationAccessTokenSchema2 = string$12().regex(/^sm_aat_.*$/);
276517
+ var PersonalAccessTokenSchema2 = string$12().regex(/^sm_pat_.*$/);
276518
+ var AccessTokenSchema2 = string$12().regex(/^sm_pat_.*|sm_aat_.*$/);
276521
276519
  function tryParseJson2(value, defaultValue = null) {
276522
276520
  try {
276523
276521
  const parsed = JSON.parse(value);
@@ -276525,7 +276523,7 @@ function tryParseJson2(value, defaultValue = null) {
276525
276523
  return defaultValue;
276526
276524
  }
276527
276525
  return parsed;
276528
- } catch (_err) {
276526
+ } catch (err) {
276529
276527
  return defaultValue;
276530
276528
  }
276531
276529
  }
@@ -295871,6 +295869,17 @@ async function exists3(path$1) {
295871
295869
  return false;
295872
295870
  }
295873
295871
  }
295872
+ function tryParseJson3(value2, defaultValue = null) {
295873
+ try {
295874
+ const parsed = JSON.parse(value2);
295875
+ if (parsed === undefined || parsed === null) {
295876
+ return defaultValue;
295877
+ }
295878
+ return parsed;
295879
+ } catch (err) {
295880
+ return defaultValue;
295881
+ }
295882
+ }
295874
295883
  var require_balanced_match4 = __commonJS4({ "../../node_modules/balanced-match/index.js"(exports, module) {
295875
295884
  module.exports = balanced$1;
295876
295885
  function balanced$1(a3, b, str) {
@@ -301349,17 +301358,6 @@ var glob3 = Object.assign(glob_3, {
301349
301358
  unescape: unescape4
301350
301359
  });
301351
301360
  glob3.glob = glob3;
301352
- function tryParseJson3(value2, defaultValue = null) {
301353
- try {
301354
- const parsed = JSON.parse(value2);
301355
- if (parsed === undefined || parsed === null) {
301356
- return defaultValue;
301357
- }
301358
- return parsed;
301359
- } catch (_err) {
301360
- return defaultValue;
301361
- }
301362
- }
301363
301361
  async function findMonoRepoRoot2(startDir) {
301364
301362
  const lockFilePath = await findUp([
301365
301363
  "package-lock.json",
@@ -301405,7 +301403,7 @@ function tryParseJson4(value2, defaultValue = null) {
301405
301403
  return defaultValue;
301406
301404
  }
301407
301405
  return parsed;
301408
- } catch (_err) {
301406
+ } catch (err) {
301409
301407
  return defaultValue;
301410
301408
  }
301411
301409
  }
@@ -301433,7 +301431,7 @@ async function readConfig() {
301433
301431
  try {
301434
301432
  const content = await readFile4(CONFIG_FILE, "utf-8");
301435
301433
  return tryParseJson4(content, { instances: {} });
301436
- } catch (_error) {
301434
+ } catch (error41) {
301437
301435
  return { instances: {} };
301438
301436
  }
301439
301437
  }
@@ -320559,7 +320557,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
320559
320557
  try {
320560
320558
  validate2(exports_external.string(), value4);
320561
320559
  return true;
320562
- } catch (_error) {
320560
+ } catch (error45) {
320563
320561
  return "Invalid token name";
320564
320562
  }
320565
320563
  }
@@ -320612,7 +320610,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
320612
320610
  try {
320613
320611
  validate2(ApplicationAccessTokenSchema2, aat);
320614
320612
  return aat;
320615
- } catch (_error) {}
320613
+ } catch (error45) {}
320616
320614
  }
320617
320615
  return esm_default5({
320618
320616
  message: "What is the application access token for your application in SettleMint? (format: sm_aat_...)",
@@ -320620,7 +320618,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
320620
320618
  try {
320621
320619
  validate2(ApplicationAccessTokenSchema2, value4);
320622
320620
  return true;
320623
- } catch (_error) {
320621
+ } catch (error45) {
320624
320622
  return "Invalid application access token, it should start with sm_aat_...";
320625
320623
  }
320626
320624
  }
@@ -321025,7 +321023,7 @@ async function instancePrompt({
321025
321023
  try {
321026
321024
  validate2(UrlSchema2, value4);
321027
321025
  return true;
321028
- } catch (_error) {
321026
+ } catch (error45) {
321029
321027
  return "Invalid URL";
321030
321028
  }
321031
321029
  },
@@ -321109,7 +321107,7 @@ async function serviceUrlPrompt({
321109
321107
  try {
321110
321108
  validate2(UrlSchema2, value4);
321111
321109
  return true;
321112
- } catch (_error) {
321110
+ } catch (error45) {
321113
321111
  return "Invalid URL";
321114
321112
  }
321115
321113
  },
@@ -322053,7 +322051,7 @@ async function projectNamePrompt(env2, argument) {
322053
322051
  try {
322054
322052
  validate2(exports_external.string(), value4);
322055
322053
  return true;
322056
- } catch (_error) {
322054
+ } catch (error45) {
322057
322055
  return "Invalid projectname";
322058
322056
  }
322059
322057
  }
@@ -326041,7 +326039,7 @@ async function personalAccessTokenPrompt(env2, instance, accept) {
326041
326039
  try {
326042
326040
  validate2(PersonalAccessTokenSchema2, value4);
326043
326041
  return true;
326044
- } catch (_error) {
326042
+ } catch (error45) {
326045
326043
  return "Invalid personal access token, it should start with sm_pat_...";
326046
326044
  }
326047
326045
  }
@@ -326122,7 +326120,7 @@ function loginCommand() {
326122
326120
  });
326123
326121
  try {
326124
326122
  await loginSpinner(client);
326125
- } catch (_error) {
326123
+ } catch (error45) {
326126
326124
  cancel2(`Invalid personal access token for instance ${selectedInstance}`);
326127
326125
  }
326128
326126
  await storeCredentials(personalAccessToken, selectedInstance);
@@ -326318,7 +326316,7 @@ async function waitForCompletion({
326318
326316
  } else {
326319
326317
  note(`${capitalizeFirstLetter2(type4)} is not ready yet (status: ${resource.status})`);
326320
326318
  }
326321
- } catch (_error) {
326319
+ } catch (error45) {
326322
326320
  if (spinner2) {
326323
326321
  spinner2.text = `${capitalizeFirstLetter2(type4)} is not ready yet (status: UNKNOWN)`;
326324
326322
  } else {
@@ -326449,8 +326447,8 @@ function getCreateCommand({
326449
326447
  instance
326450
326448
  });
326451
326449
  const platformConfig = await settlemint.platform.config();
326452
- let selectedProvider;
326453
- let selectedRegion;
326450
+ let selectedProvider = undefined;
326451
+ let selectedRegion = undefined;
326454
326452
  if (cmd2.options.some((option) => option.long === "--provider")) {
326455
326453
  selectedProvider = await providerPrompt(platformConfig, provider);
326456
326454
  if (!selectedProvider) {
@@ -327661,7 +327659,7 @@ function privateKeyHsmCreateCommand() {
327661
327659
  return baseAction({
327662
327660
  ...defaultArgs,
327663
327661
  acceptDefaults
327664
- }, async ({ settlemint, env: env2, showSpinner, provider: _provider, region: _region }) => {
327662
+ }, async ({ settlemint, env: env2, showSpinner, provider, region }) => {
327665
327663
  const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
327666
327664
  if (!applicationUniqueName) {
327667
327665
  return missingApplication();
@@ -328561,7 +328559,7 @@ function servicesCommand() {
328561
328559
  if (!applicationUniqueName) {
328562
328560
  return nothingSelectedError("application");
328563
328561
  }
328564
- let effectiveTypes;
328562
+ let effectiveTypes = undefined;
328565
328563
  if (options.type && options.type.length > 0) {
328566
328564
  effectiveTypes = options.type;
328567
328565
  } else if (typeOperands && typeOperands.length > 0) {
@@ -328619,7 +328617,7 @@ async function getServicesAndMapResults({
328619
328617
  const application = await settlemint.application.read(applicationUniqueName);
328620
328618
  const services = await servicesSpinner(settlemint, applicationUniqueName, types4);
328621
328619
  const results = (types4 ?? SERVICE_TYPES).filter((serviceType) => !types4 || types4.includes(serviceType)).map((serviceType) => {
328622
- const [_6, labels] = Object.entries(LABELS_MAP).find(([_key, value4]) => value4.command === serviceType) ?? [
328620
+ const [_6, labels] = Object.entries(LABELS_MAP).find(([key2, value4]) => value4.command === serviceType) ?? [
328623
328621
  null,
328624
328622
  { plural: serviceType }
328625
328623
  ];
@@ -328796,7 +328794,7 @@ var import_which = __toESM(require_lib5(), 1);
328796
328794
  async function executeFoundryCommand(command, args) {
328797
328795
  try {
328798
328796
  await import_which.default(command);
328799
- } catch (_error) {
328797
+ } catch (error45) {
328800
328798
  cancel2("Foundry is not installed. Instructions to install Foundry can be found here: https://book.getfoundry.sh/getting-started/installation");
328801
328799
  }
328802
328800
  return executeCommand(command, args);
@@ -328884,7 +328882,7 @@ function foundryBuildCommand() {
328884
328882
  description: "Build the smart contracts with additional Forge options",
328885
328883
  command: "scs foundry build --optimize --force"
328886
328884
  }
328887
- ])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, _cmd) => {
328885
+ ])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, cmd2) => {
328888
328886
  intro("Building smart contracts using Foundry");
328889
328887
  const forgeOptions = mapPassthroughOptions(options, { args: operands });
328890
328888
  await executeFoundryCommand("forge", ["build", ...forgeOptions]);
@@ -328907,7 +328905,7 @@ function foundryFormatCommand() {
328907
328905
  description: "Format the smart contracts with additional Forge options",
328908
328906
  command: "scs foundry format --check"
328909
328907
  }
328910
- ])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, _cmd) => {
328908
+ ])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, cmd2) => {
328911
328909
  intro("Formatting smart contracts using Foundry");
328912
328910
  const forgeOptions = mapPassthroughOptions(options, { args: operands });
328913
328911
  await executeFoundryCommand("forge", ["fmt", ...forgeOptions]);
@@ -328930,7 +328928,7 @@ function foundryNetworkCommand() {
328930
328928
  description: "Start a development network using Foundry with a specific port",
328931
328929
  command: "scs foundry network --port 3000"
328932
328930
  }
328933
- ])).helpOption(false).option("-h, --help", "Get list of possible anvil options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, _cmd) => {
328931
+ ])).helpOption(false).option("-h, --help", "Get list of possible anvil options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, cmd2) => {
328934
328932
  const anvilOptions = mapPassthroughOptions(options, { args: operands });
328935
328933
  await executeFoundryCommand("anvil", anvilOptions);
328936
328934
  });
@@ -328951,7 +328949,7 @@ function foundryTestCommand() {
328951
328949
  description: "Run a specific test function",
328952
328950
  command: "scs foundry test --match-test testToken"
328953
328951
  }
328954
- ])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, _cmd) => {
328952
+ ])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, cmd2) => {
328955
328953
  intro("Running smart contract tests using Foundry");
328956
328954
  const forgeOptions = mapPassthroughOptions(options, { args: operands });
328957
328955
  await executeFoundryCommand("forge", ["test", ...forgeOptions]);
@@ -328965,7 +328963,7 @@ var validateIfRequiredPackagesAreInstalled = async (packages, cwd2) => {
328965
328963
  try {
328966
328964
  const isInstalled = await isPackageInstalled(pkg, cwd2);
328967
328965
  return { packageName: pkg, isInstalled };
328968
- } catch (_err) {
328966
+ } catch (err) {
328969
328967
  return { packageName: pkg, isInstalled: false };
328970
328968
  }
328971
328969
  }));
@@ -328990,7 +328988,7 @@ function hardhatBuildCommand() {
328990
328988
  description: "Build the smart contracts using additional options to the Hardhat compile command",
328991
328989
  command: "scs hardhat build --concurrency 2"
328992
328990
  }
328993
- ])).helpOption(false).option("-h, --help", "Get list of possible hardhat compile options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, _cmd) => {
328991
+ ])).helpOption(false).option("-h, --help", "Get list of possible hardhat compile options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, cmd2) => {
328994
328992
  intro("Building smart contracts using Hardhat");
328995
328993
  await validateIfRequiredPackagesAreInstalled(["hardhat"]);
328996
328994
  const hardhatOptions = mapPassthroughOptions(options, { args: operands });
@@ -329061,7 +329059,7 @@ async function selectTargetNode({
329061
329059
  settlemint
329062
329060
  }) {
329063
329061
  const nodeUniqueName = blockchainNodeUniqueName ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
329064
- let node;
329062
+ let node = undefined;
329065
329063
  if (!nodeUniqueName) {
329066
329064
  if (!env2.SETTLEMINT_APPLICATION) {
329067
329065
  return missingApplication();
@@ -329285,7 +329283,7 @@ function hardhatDeployRemoteCommand() {
329285
329283
  } else {
329286
329284
  note("Smart contract deployment was cancelled");
329287
329285
  }
329288
- } catch (_error) {
329286
+ } catch (error45) {
329289
329287
  cancel2("The smart contract deployment was unsuccessful. Please check the error details above and try again. You may need to review your contract code or deployment configuration.");
329290
329288
  }
329291
329289
  });
@@ -329315,7 +329313,7 @@ function hardhatNetworkCommand() {
329315
329313
  description: "Start a development network using Hardhat with a specific port",
329316
329314
  command: "scs hardhat network --port 3000"
329317
329315
  }
329318
- ])).helpOption(false).option("-h, --help", "Get list of possible hardhat node options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, _cmd) => {
329316
+ ])).helpOption(false).option("-h, --help", "Get list of possible hardhat node options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, cmd2) => {
329319
329317
  intro("Starting development network using Hardhat");
329320
329318
  await validateIfRequiredPackagesAreInstalled(["hardhat"]);
329321
329319
  const hardhatOptions = mapPassthroughOptions(options, { args: operands });
@@ -329424,7 +329422,7 @@ function hardhatTestCommand() {
329424
329422
  description: "Run a specific test file",
329425
329423
  command: "scs hardhat test test/token.test.ts"
329426
329424
  }
329427
- ])).helpOption(false).option("-h, --help", "Get list of possible hardhat test options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, _cmd) => {
329425
+ ])).helpOption(false).option("-h, --help", "Get list of possible hardhat test options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, cmd2) => {
329428
329426
  intro("Running smart contract tests using Hardhat");
329429
329427
  await validateIfRequiredPackagesAreInstalled(["hardhat"]);
329430
329428
  const hardhatOptions = mapPassthroughOptions(options, { args: operands });
@@ -330092,4 +330090,4 @@ async function sdkCliCommand(argv = process.argv) {
330092
330090
  // src/cli.ts
330093
330091
  sdkCliCommand();
330094
330092
 
330095
- //# debugId=0D9E2D2D722AE18064756E2164756E21
330093
+ //# debugId=42C77CD9A6917CDB64756E2164756E21