@settlemint/sdk-cli 1.1.5-pr9ee04c7b → 1.1.5-prb9e82a24

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.
Files changed (3) hide show
  1. package/dist/cli.js +11 -103
  2. package/dist/cli.js.map +21 -22
  3. package/package.json +3 -3
package/dist/cli.js CHANGED
@@ -274462,7 +274462,7 @@ function pruneCurrentEnv(currentEnv, env2) {
274462
274462
  var package_default = {
274463
274463
  name: "@settlemint/sdk-cli",
274464
274464
  description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
274465
- version: "1.1.5-pr9ee04c7b",
274465
+ version: "1.1.5-prb9e82a24",
274466
274466
  type: "module",
274467
274467
  private: false,
274468
274468
  license: "FSL-1.1-MIT",
@@ -274510,8 +274510,8 @@ var package_default = {
274510
274510
  "@inquirer/input": "4.1.5",
274511
274511
  "@inquirer/password": "4.0.8",
274512
274512
  "@inquirer/select": "4.0.8",
274513
- "@settlemint/sdk-js": "1.1.5-pr9ee04c7b",
274514
- "@settlemint/sdk-utils": "1.1.5-pr9ee04c7b",
274513
+ "@settlemint/sdk-js": "1.1.5-prb9e82a24",
274514
+ "@settlemint/sdk-utils": "1.1.5-prb9e82a24",
274515
274515
  "@types/node": "22.13.1",
274516
274516
  "@types/semver": "7.5.8",
274517
274517
  "@types/which": "3.0.4",
@@ -275760,11 +275760,6 @@ var outro = (msg) => {
275760
275760
  console.log("");
275761
275761
  };
275762
275762
  var SpinnerError = class extends Error {
275763
- constructor(message, originalError) {
275764
- super(message);
275765
- this.originalError = originalError;
275766
- this.name = "SpinnerError";
275767
- }
275768
275763
  };
275769
275764
  var spinner = async (options) => {
275770
275765
  const handleError = (error) => {
@@ -275772,7 +275767,7 @@ var spinner = async (options) => {
275772
275767
  note(redBright(`${errorMessage}
275773
275768
 
275774
275769
  ${error.stack}`));
275775
- throw new SpinnerError(errorMessage, error);
275770
+ throw new SpinnerError(errorMessage);
275776
275771
  };
275777
275772
  if (is_in_ci_default) {
275778
275773
  try {
@@ -279778,7 +279773,6 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
279778
279773
  const tadaConfig = {
279779
279774
  name: "gql.tada/ts-plugin",
279780
279775
  trackFieldUsage: false,
279781
- shouldCheckForColocatedFragments: false,
279782
279776
  schemas: [
279783
279777
  ...hasura ? [
279784
279778
  {
@@ -282428,8 +282422,7 @@ async function waitForCompletion({
282428
282422
  try {
282429
282423
  return await showSpinner();
282430
282424
  } catch (error5) {
282431
- const isTimeoutError = error5 instanceof SpinnerError && error5.originalError instanceof TimeoutError;
282432
- if (restartIfTimeout && isTimeoutError) {
282425
+ if (restartIfTimeout && error5 instanceof TimeoutError) {
282433
282426
  note(`Restarting ${capitalizeFirstLetter2(type4)}`);
282434
282427
  await service.restart(uniqueName);
282435
282428
  return showSpinner();
@@ -284683,10 +284676,8 @@ function foundryBuildCommand() {
284683
284676
  command: "scs foundry build --optimize --force"
284684
284677
  }
284685
284678
  ])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
284686
- intro("Building smart contracts using Foundry");
284687
284679
  const forgeOptions = mapPassthroughOptions(passThroughOptions, cmd2);
284688
284680
  await executeFoundryCommand("forge", ["build", ...forgeOptions]);
284689
- outro("Smart contracts built successfully");
284690
284681
  });
284691
284682
  }
284692
284683
 
@@ -284706,10 +284697,9 @@ function foundryFormatCommand() {
284706
284697
  command: "scs foundry format --check"
284707
284698
  }
284708
284699
  ])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
284709
- intro("Formatting smart contracts using Foundry");
284710
284700
  const forgeOptions = mapPassthroughOptions(passThroughOptions, cmd2);
284711
284701
  await executeFoundryCommand("forge", ["fmt", ...forgeOptions]);
284712
- outro("Smart contracts formatted successfully");
284702
+ note("Smart contract set formatted successfully!");
284713
284703
  });
284714
284704
  }
284715
284705
 
@@ -284750,10 +284740,8 @@ function foundryTestCommand() {
284750
284740
  command: "scs foundry test --match-test testToken"
284751
284741
  }
284752
284742
  ])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
284753
- intro("Running smart contract tests using Foundry");
284754
284743
  const forgeOptions = mapPassthroughOptions(passThroughOptions, cmd2);
284755
284744
  await executeFoundryCommand("forge", ["test", ...forgeOptions]);
284756
- outro("Smart contract tests completed");
284757
284745
  });
284758
284746
  }
284759
284747
 
@@ -284789,12 +284777,10 @@ function hardhatBuildCommand() {
284789
284777
  command: "scs hardhat build --concurrency 2"
284790
284778
  }
284791
284779
  ])).helpOption(false).option("-h, --help", "Get list of possible hardhat compile options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
284792
- intro("Building smart contracts using Hardhat");
284793
284780
  await validateIfRequiredPackagesAreInstalled(["hardhat"]);
284794
284781
  const hardhatOptions = mapPassthroughOptions(passThroughOptions, cmd2);
284795
284782
  const { command, args } = await getPackageManagerExecutable();
284796
284783
  await executeCommand(command, [...args, "hardhat", "compile", ...hardhatOptions]);
284797
- outro("Smart contracts built successfully");
284798
284784
  });
284799
284785
  }
284800
284786
 
@@ -284818,7 +284804,6 @@ function hardhatDeployLocalCommand() {
284818
284804
  command: "scs hardhat deploy local --verify"
284819
284805
  }
284820
284806
  ])).option("-m, --module <ignitionmodule>", 'The module to deploy with Ignition, defaults to "ignition/modules/main.ts"').option("-r, --reset", "Wipes the existing deployment state before deploying").option("-v, --verify", "Verify the deployment on Etherscan").action(async ({ module, reset: reset2, verify }) => {
284821
- intro("Deploying smart contracts to local network using Hardhat/Ignition");
284822
284807
  await validateIfRequiredPackagesAreInstalled(["hardhat"]);
284823
284808
  const { command, args } = await getPackageManagerExecutable();
284824
284809
  await executeCommand(command, [
@@ -284832,7 +284817,6 @@ function hardhatDeployLocalCommand() {
284832
284817
  "localhost",
284833
284818
  module ?? "ignition/modules/main.ts"
284834
284819
  ].filter(Boolean));
284835
- outro("Smart contracts deployed successfully to local network");
284836
284820
  });
284837
284821
  }
284838
284822
 
@@ -284997,7 +284981,6 @@ function hardhatDeployRemoteCommand() {
284997
284981
  acceptDefaults,
284998
284982
  blockchainNode: blockchainNodeUniqueName
284999
284983
  }) => {
285000
- intro("Deploying smart contracts to remote network using Hardhat/Ignition");
285001
284984
  await validateIfRequiredPackagesAreInstalled(["hardhat"]);
285002
284985
  const autoAccept = !!acceptDefaults || is_in_ci_default;
285003
284986
  const env2 = await loadEnv(false, !!prod);
@@ -285041,7 +285024,6 @@ function hardhatDeployRemoteCommand() {
285041
285024
  address,
285042
285025
  module ?? "ignition/modules/main.ts"
285043
285026
  ].filter(Boolean), { env: envConfig });
285044
- outro("Smart contracts deployed successfully to remote network");
285045
285027
  });
285046
285028
  return cmd2;
285047
285029
  }
@@ -285070,19 +285052,16 @@ function hardhatNetworkCommand() {
285070
285052
  command: "scs hardhat network --port 3000"
285071
285053
  }
285072
285054
  ])).helpOption(false).option("-h, --help", "Get list of possible hardhat node options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
285073
- intro("Starting development network using Hardhat");
285074
285055
  await validateIfRequiredPackagesAreInstalled(["hardhat"]);
285075
285056
  const hardhatOptions = mapPassthroughOptions(passThroughOptions, cmd2);
285076
285057
  const { command, args } = await getPackageManagerExecutable();
285077
285058
  await executeCommand(command, [...args, "hardhat", "node", ...hardhatOptions]);
285078
- outro("Development network started successfully");
285079
285059
  });
285080
285060
  }
285081
285061
 
285082
285062
  // src/commands/smart-contract-set/hardhat/script/local.ts
285083
285063
  function hardhatScriptLocalCommand() {
285084
285064
  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 }) => {
285085
- intro("Running Hardhat script on local network");
285086
285065
  await validateIfRequiredPackagesAreInstalled(["hardhat"]);
285087
285066
  const { command, args } = await getPackageManagerExecutable();
285088
285067
  await executeCommand(command, [
@@ -285094,7 +285073,6 @@ function hardhatScriptLocalCommand() {
285094
285073
  "localhost",
285095
285074
  ...compile ? ["--no-compile"] : []
285096
285075
  ]);
285097
- outro("Script execution completed successfully");
285098
285076
  });
285099
285077
  }
285100
285078
 
@@ -285102,7 +285080,6 @@ function hardhatScriptLocalCommand() {
285102
285080
  function hardhatScriptRemoteCommand() {
285103
285081
  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");
285104
285082
  cmd2.action(async ({ script, prod, blockchainNode: blockchainNodeUniqueName, acceptDefaults, compile }) => {
285105
- intro("Running Hardhat script on remote network");
285106
285083
  await validateIfRequiredPackagesAreInstalled(["hardhat"]);
285107
285084
  const autoAccept = !!acceptDefaults || is_in_ci_default;
285108
285085
  const env2 = await loadEnv(false, !!prod);
@@ -285120,7 +285097,6 @@ function hardhatScriptRemoteCommand() {
285120
285097
  const envConfig = await settlemint.foundry.env(node.uniqueName);
285121
285098
  const { command, args } = await getPackageManagerExecutable();
285122
285099
  await executeCommand(command, [...args, "hardhat", "run", script, "--network", "btp", ...compile ? ["--no-compile"] : []], { env: envConfig });
285123
- outro("Script execution completed successfully");
285124
285100
  });
285125
285101
  return cmd2;
285126
285102
  }
@@ -285153,12 +285129,10 @@ function hardhatTestCommand() {
285153
285129
  command: "scs hardhat test test/token.test.ts"
285154
285130
  }
285155
285131
  ])).helpOption(false).option("-h, --help", "Get list of possible hardhat test options").passThroughOptions().allowUnknownOption().action(async (options, cmd2) => {
285156
- intro("Running smart contract tests using Hardhat");
285157
285132
  await validateIfRequiredPackagesAreInstalled(["hardhat"]);
285158
285133
  const hardhatOptions = mapPassthroughOptions(options, cmd2);
285159
285134
  const { command, args } = await getPackageManagerExecutable();
285160
285135
  await executeCommand(command, [...args, "hardhat", "test", ...hardhatOptions]);
285161
- outro("Smart contract tests completed");
285162
285136
  });
285163
285137
  }
285164
285138
 
@@ -285327,7 +285301,6 @@ async function getNodeName({
285327
285301
  // src/commands/smart-contract-set/subgraph/build.ts
285328
285302
  function subgraphBuildCommand() {
285329
285303
  return new Command("build").description("Build the subgraph").action(async () => {
285330
- intro("Building subgraph");
285331
285304
  await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
285332
285305
  await subgraphSetup({
285333
285306
  network: SETTLEMINT_NETWORK
@@ -285337,7 +285310,6 @@ function subgraphBuildCommand() {
285337
285310
  const cwd2 = dirname10(subgraphYamlFile);
285338
285311
  await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], { cwd: cwd2 });
285339
285312
  await executeCommand(command, [...args, "graph", "build", subgraphYamlFile], { cwd: cwd2 });
285340
- outro("Subgraph built successfully");
285341
285313
  });
285342
285314
  }
285343
285315
 
@@ -285345,7 +285317,6 @@ function subgraphBuildCommand() {
285345
285317
  import { dirname as dirname11 } from "node:path";
285346
285318
  function subgraphCodegenCommand() {
285347
285319
  return new Command("codegen").description("Codegen the subgraph types").action(async () => {
285348
- intro("Generating subgraph types");
285349
285320
  await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
285350
285321
  await subgraphSetup({
285351
285322
  network: SETTLEMINT_NETWORK
@@ -285355,7 +285326,6 @@ function subgraphCodegenCommand() {
285355
285326
  await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], {
285356
285327
  cwd: dirname11(subgraphYamlFile)
285357
285328
  });
285358
- outro("Subgraph types generated successfully");
285359
285329
  });
285360
285330
  }
285361
285331
 
@@ -285406,7 +285376,6 @@ function subgraphDeployCommand() {
285406
285376
  command: "scs subgraph deploy my-subgraph"
285407
285377
  }
285408
285378
  ])).option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").argument("[subgraph-name]", "The name of the subgraph to deploy (defaults to value in .env if not provided)").action(async (subgraphName, { prod, acceptDefaults }) => {
285409
- intro("Deploying subgraph");
285410
285379
  await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
285411
285380
  const autoAccept = !!acceptDefaults || is_in_ci_default;
285412
285381
  const env2 = await loadEnv(false, !!prod);
@@ -285475,7 +285444,6 @@ function subgraphDeployCommand() {
285475
285444
  SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
285476
285445
  ...graphEndpoints
285477
285446
  });
285478
- outro(`Subgraph ${graphName} deployed successfully`);
285479
285447
  });
285480
285448
  }
285481
285449
  async function updateSpecVersion(specVersion) {
@@ -285484,55 +285452,6 @@ async function updateSpecVersion(specVersion) {
285484
285452
  await updateSubgraphYamlConfig(yamlConfig);
285485
285453
  }
285486
285454
 
285487
- // src/commands/smart-contract-set/subgraph/remove.ts
285488
- import { dirname as dirname13 } from "node:path";
285489
- function subgraphRemoveCommand() {
285490
- return new Command("remove").description("Remove a subgraph").usage(createExamples([
285491
- {
285492
- description: "Remove a subgraph",
285493
- command: "scs subgraph remove my-subgraph"
285494
- }
285495
- ])).option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").option("-f, --force", "Force remove the subgraph without confirmation").argument("<subgraph-name>", "The name of the subgraph to remove").action(async (subgraphName, { prod, acceptDefaults, force }) => {
285496
- intro("Removing subgraph");
285497
- await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
285498
- if (!force) {
285499
- await deleteConfirmationPrompt(`the subgraph ${subgraphName}`);
285500
- }
285501
- const autoAccept = !!acceptDefaults || is_in_ci_default;
285502
- const env2 = await loadEnv(false, !!prod);
285503
- const instance = await instancePrompt(env2, true);
285504
- const accessToken = await getApplicationOrPersonalAccessToken({
285505
- env: env2,
285506
- instance,
285507
- prefer: "application"
285508
- });
285509
- const theGraphMiddleware = await getTheGraphMiddleware({ env: env2, instance, accessToken, autoAccept });
285510
- if (!theGraphMiddleware) {
285511
- return nothingSelectedError("graph middleware");
285512
- }
285513
- if (theGraphMiddleware.status !== "COMPLETED") {
285514
- serviceNotRunningError("graph middleware", theGraphMiddleware.status);
285515
- }
285516
- const subgraphYamlFile = await getSubgraphYamlFile();
285517
- const cwd2 = dirname13(subgraphYamlFile);
285518
- const { command, args } = await getPackageManagerExecutable();
285519
- const middlewareAdminUrl = new URL(`/${encodeURIComponent(accessToken)}/admin`, theGraphMiddleware.serviceUrl).toString();
285520
- await executeCommand(command, [...args, "graph", "remove", "--node", middlewareAdminUrl, subgraphName]);
285521
- const settlemintClient = createSettleMintClient({
285522
- accessToken,
285523
- instance
285524
- });
285525
- const middleware = await settlemintClient.middleware.read(theGraphMiddleware.uniqueName);
285526
- const graphEndpoints = await getGraphEndpoint(settlemintClient, middleware);
285527
- await writeEnvSpinner(!!prod, {
285528
- ...env2,
285529
- SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
285530
- ...graphEndpoints
285531
- });
285532
- outro(`Subgraph ${subgraphName} removed successfully`);
285533
- });
285534
- }
285535
-
285536
285455
  // src/commands/smart-contract.set.ts
285537
285456
  function smartContractSetCommand() {
285538
285457
  const foundry = new Command("foundry").alias("f").description("Foundry commands for building and testing smart contracts");
@@ -285550,7 +285469,6 @@ function smartContractSetCommand() {
285550
285469
  subgraph.addCommand(subgraphBuildCommand());
285551
285470
  subgraph.addCommand(subgraphCodegenCommand());
285552
285471
  subgraph.addCommand(subgraphDeployCommand());
285553
- subgraph.addCommand(subgraphRemoveCommand());
285554
285472
  return new Command("smart-contract-set").alias("scs").description("Manage smart contract sets and subgraphs").addCommand(createCommand4()).addCommand(foundry).addCommand(hardhat).addCommand(subgraph);
285555
285473
  }
285556
285474
 
@@ -285608,22 +285526,12 @@ function addHooksToCommand(cmd2, rootCmd, argv) {
285608
285526
  addHooksToCommand(subcmd, rootCmd, argv);
285609
285527
  }
285610
285528
  }
285611
- var ERRORS_TO_IGNORE = [ExitPromptError, AbortPromptError, ValidationError, CancelPromptError];
285612
- var ERROR_CODES_TO_IGNORE = [
285613
- "commander.help",
285614
- "commander.missingArgument",
285615
- "commander.optionMissingArgument",
285616
- "commander.missingMandatoryOptionValue",
285617
- "commander.conflictingOption",
285618
- "commander.unknownOption",
285619
- "commander.excessArguments",
285620
- "commander.unknownCommand"
285621
- ];
285622
285529
  async function onError(sdkcli, argv, error5) {
285623
- if (ERRORS_TO_IGNORE.some((errorToIgnore) => error5 instanceof errorToIgnore)) {
285530
+ const errorsToIgnore = [ExitPromptError, AbortPromptError, ValidationError, CancelPromptError];
285531
+ if (errorsToIgnore.some((errorToIgnore) => error5 instanceof errorToIgnore)) {
285624
285532
  process.exit(0);
285625
285533
  }
285626
- if (error5 instanceof CommanderError && (error5.exitCode === 0 || ERROR_CODES_TO_IGNORE.includes(error5.code))) {
285534
+ if (error5 instanceof CommanderError && (error5.exitCode === 0 || error5.code === "commander.help")) {
285627
285535
  process.exit(error5.exitCode);
285628
285536
  }
285629
285537
  if (!(error5 instanceof CancelError2 || error5 instanceof SpinnerError)) {
@@ -285644,7 +285552,7 @@ ${error5.stack}`));
285644
285552
  }
285645
285553
  function registerCommands() {
285646
285554
  const sdkcli = new Command;
285647
- 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();
285555
+ 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();
285648
285556
  sdkcli.addCommand(connectCommand());
285649
285557
  sdkcli.addCommand(codegenCommand());
285650
285558
  sdkcli.addCommand(platformCommand());
@@ -285672,4 +285580,4 @@ async function sdkCliCommand(argv = process.argv) {
285672
285580
  // src/cli.ts
285673
285581
  sdkCliCommand();
285674
285582
 
285675
- //# debugId=8C4F74735566A4ED64756E2164756E21
285583
+ //# debugId=6B07B96C8DE1C9BA64756E2164756E21