@settlemint/sdk-cli 1.1.5-prea5e656a → 1.1.6-main96dd22e0

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/README.md CHANGED
@@ -249,7 +249,7 @@ settlemint scs subgraph deploy --accept-defaults <subgraph-name>
249
249
 
250
250
  ## API Reference
251
251
 
252
- See the [documentation](https://github.com/settlemint/sdk/tree/v1.1.5/sdk/cli/docs/settlemint.md) for available commands.
252
+ See the [documentation](https://github.com/settlemint/sdk/tree/v1.1.6/sdk/cli/docs/settlemint.md) for available commands.
253
253
 
254
254
  ## Contributing
255
255
 
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-prea5e656a",
274465
+ version: "1.1.6-main96dd22e0",
274466
274466
  type: "module",
274467
274467
  private: false,
274468
274468
  license: "FSL-1.1-MIT",
@@ -274510,9 +274510,9 @@ 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-prea5e656a",
274514
- "@settlemint/sdk-utils": "1.1.5-prea5e656a",
274515
- "@types/node": "22.13.1",
274513
+ "@settlemint/sdk-js": "1.1.6-main96dd22e0",
274514
+ "@settlemint/sdk-utils": "1.1.6-main96dd22e0",
274515
+ "@types/node": "22.13.4",
274516
274516
  "@types/semver": "7.5.8",
274517
274517
  "@types/which": "3.0.4",
274518
274518
  "get-tsconfig": "4.10.0",
@@ -279778,6 +279778,7 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
279778
279778
  const tadaConfig = {
279779
279779
  name: "gql.tada/ts-plugin",
279780
279780
  trackFieldUsage: false,
279781
+ shouldCheckForColocatedFragments: false,
279781
279782
  schemas: [
279782
279783
  ...hasura ? [
279783
279784
  {
@@ -284682,8 +284683,10 @@ function foundryBuildCommand() {
284682
284683
  command: "scs foundry build --optimize --force"
284683
284684
  }
284684
284685
  ])).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");
284685
284687
  const forgeOptions = mapPassthroughOptions(passThroughOptions, cmd2);
284686
284688
  await executeFoundryCommand("forge", ["build", ...forgeOptions]);
284689
+ outro("Smart contracts built successfully");
284687
284690
  });
284688
284691
  }
284689
284692
 
@@ -284703,9 +284706,10 @@ function foundryFormatCommand() {
284703
284706
  command: "scs foundry format --check"
284704
284707
  }
284705
284708
  ])).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");
284706
284710
  const forgeOptions = mapPassthroughOptions(passThroughOptions, cmd2);
284707
284711
  await executeFoundryCommand("forge", ["fmt", ...forgeOptions]);
284708
- note("Smart contract set formatted successfully!");
284712
+ outro("Smart contracts formatted successfully");
284709
284713
  });
284710
284714
  }
284711
284715
 
@@ -284746,8 +284750,10 @@ function foundryTestCommand() {
284746
284750
  command: "scs foundry test --match-test testToken"
284747
284751
  }
284748
284752
  ])).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");
284749
284754
  const forgeOptions = mapPassthroughOptions(passThroughOptions, cmd2);
284750
284755
  await executeFoundryCommand("forge", ["test", ...forgeOptions]);
284756
+ outro("Smart contract tests completed");
284751
284757
  });
284752
284758
  }
284753
284759
 
@@ -284783,10 +284789,12 @@ function hardhatBuildCommand() {
284783
284789
  command: "scs hardhat build --concurrency 2"
284784
284790
  }
284785
284791
  ])).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");
284786
284793
  await validateIfRequiredPackagesAreInstalled(["hardhat"]);
284787
284794
  const hardhatOptions = mapPassthroughOptions(passThroughOptions, cmd2);
284788
284795
  const { command, args } = await getPackageManagerExecutable();
284789
284796
  await executeCommand(command, [...args, "hardhat", "compile", ...hardhatOptions]);
284797
+ outro("Smart contracts built successfully");
284790
284798
  });
284791
284799
  }
284792
284800
 
@@ -284809,7 +284817,8 @@ function hardhatDeployLocalCommand() {
284809
284817
  description: "Deploy and verify contracts on Etherscan",
284810
284818
  command: "scs hardhat deploy local --verify"
284811
284819
  }
284812
- ])).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 }) => {
284820
+ ])).option("-m, --module <ignitionmodule>", 'The module to deploy with Ignition, defaults to "ignition/modules/main.ts"').option("--deployment-id <deploymentId>", "Set the id of the deployment").option("-r, --reset", "Wipes the existing deployment state before deploying").option("-v, --verify", "Verify the deployment on Etherscan").action(async ({ module, reset: reset2, verify, deploymentId }) => {
284821
+ intro("Deploying smart contracts to local network using Hardhat/Ignition");
284813
284822
  await validateIfRequiredPackagesAreInstalled(["hardhat"]);
284814
284823
  const { command, args } = await getPackageManagerExecutable();
284815
284824
  await executeCommand(command, [
@@ -284819,10 +284828,12 @@ function hardhatDeployLocalCommand() {
284819
284828
  "deploy",
284820
284829
  ...reset2 ? ["--reset"] : [],
284821
284830
  ...verify ? ["--verify"] : [],
284831
+ ...deploymentId ? ["--deployment-id", deploymentId] : [],
284822
284832
  "--network",
284823
284833
  "localhost",
284824
284834
  module ?? "ignition/modules/main.ts"
284825
284835
  ].filter(Boolean));
284836
+ outro("Smart contracts deployed successfully to local network");
284826
284837
  });
284827
284838
  }
284828
284839
 
@@ -284987,6 +284998,7 @@ function hardhatDeployRemoteCommand() {
284987
284998
  acceptDefaults,
284988
284999
  blockchainNode: blockchainNodeUniqueName
284989
285000
  }) => {
285001
+ intro("Deploying smart contracts to remote network using Hardhat/Ignition");
284990
285002
  await validateIfRequiredPackagesAreInstalled(["hardhat"]);
284991
285003
  const autoAccept = !!acceptDefaults || is_in_ci_default;
284992
285004
  const env2 = await loadEnv(false, !!prod);
@@ -285030,6 +285042,7 @@ function hardhatDeployRemoteCommand() {
285030
285042
  address,
285031
285043
  module ?? "ignition/modules/main.ts"
285032
285044
  ].filter(Boolean), { env: envConfig });
285045
+ outro("Smart contracts deployed successfully to remote network");
285033
285046
  });
285034
285047
  return cmd2;
285035
285048
  }
@@ -285058,16 +285071,19 @@ function hardhatNetworkCommand() {
285058
285071
  command: "scs hardhat network --port 3000"
285059
285072
  }
285060
285073
  ])).helpOption(false).option("-h, --help", "Get list of possible hardhat node options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
285074
+ intro("Starting development network using Hardhat");
285061
285075
  await validateIfRequiredPackagesAreInstalled(["hardhat"]);
285062
285076
  const hardhatOptions = mapPassthroughOptions(passThroughOptions, cmd2);
285063
285077
  const { command, args } = await getPackageManagerExecutable();
285064
285078
  await executeCommand(command, [...args, "hardhat", "node", ...hardhatOptions]);
285079
+ outro("Development network started successfully");
285065
285080
  });
285066
285081
  }
285067
285082
 
285068
285083
  // src/commands/smart-contract-set/hardhat/script/local.ts
285069
285084
  function hardhatScriptLocalCommand() {
285070
285085
  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 }) => {
285086
+ intro("Running Hardhat script on local network");
285071
285087
  await validateIfRequiredPackagesAreInstalled(["hardhat"]);
285072
285088
  const { command, args } = await getPackageManagerExecutable();
285073
285089
  await executeCommand(command, [
@@ -285079,6 +285095,7 @@ function hardhatScriptLocalCommand() {
285079
285095
  "localhost",
285080
285096
  ...compile ? ["--no-compile"] : []
285081
285097
  ]);
285098
+ outro("Script execution completed successfully");
285082
285099
  });
285083
285100
  }
285084
285101
 
@@ -285086,6 +285103,7 @@ function hardhatScriptLocalCommand() {
285086
285103
  function hardhatScriptRemoteCommand() {
285087
285104
  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");
285088
285105
  cmd2.action(async ({ script, prod, blockchainNode: blockchainNodeUniqueName, acceptDefaults, compile }) => {
285106
+ intro("Running Hardhat script on remote network");
285089
285107
  await validateIfRequiredPackagesAreInstalled(["hardhat"]);
285090
285108
  const autoAccept = !!acceptDefaults || is_in_ci_default;
285091
285109
  const env2 = await loadEnv(false, !!prod);
@@ -285103,6 +285121,7 @@ function hardhatScriptRemoteCommand() {
285103
285121
  const envConfig = await settlemint.foundry.env(node.uniqueName);
285104
285122
  const { command, args } = await getPackageManagerExecutable();
285105
285123
  await executeCommand(command, [...args, "hardhat", "run", script, "--network", "btp", ...compile ? ["--no-compile"] : []], { env: envConfig });
285124
+ outro("Script execution completed successfully");
285106
285125
  });
285107
285126
  return cmd2;
285108
285127
  }
@@ -285135,10 +285154,12 @@ function hardhatTestCommand() {
285135
285154
  command: "scs hardhat test test/token.test.ts"
285136
285155
  }
285137
285156
  ])).helpOption(false).option("-h, --help", "Get list of possible hardhat test options").passThroughOptions().allowUnknownOption().action(async (options, cmd2) => {
285157
+ intro("Running smart contract tests using Hardhat");
285138
285158
  await validateIfRequiredPackagesAreInstalled(["hardhat"]);
285139
285159
  const hardhatOptions = mapPassthroughOptions(options, cmd2);
285140
285160
  const { command, args } = await getPackageManagerExecutable();
285141
285161
  await executeCommand(command, [...args, "hardhat", "test", ...hardhatOptions]);
285162
+ outro("Smart contract tests completed");
285142
285163
  });
285143
285164
  }
285144
285165
 
@@ -285307,6 +285328,7 @@ async function getNodeName({
285307
285328
  // src/commands/smart-contract-set/subgraph/build.ts
285308
285329
  function subgraphBuildCommand() {
285309
285330
  return new Command("build").description("Build the subgraph").action(async () => {
285331
+ intro("Building subgraph");
285310
285332
  await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
285311
285333
  await subgraphSetup({
285312
285334
  network: SETTLEMINT_NETWORK
@@ -285316,6 +285338,7 @@ function subgraphBuildCommand() {
285316
285338
  const cwd2 = dirname10(subgraphYamlFile);
285317
285339
  await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], { cwd: cwd2 });
285318
285340
  await executeCommand(command, [...args, "graph", "build", subgraphYamlFile], { cwd: cwd2 });
285341
+ outro("Subgraph built successfully");
285319
285342
  });
285320
285343
  }
285321
285344
 
@@ -285323,6 +285346,7 @@ function subgraphBuildCommand() {
285323
285346
  import { dirname as dirname11 } from "node:path";
285324
285347
  function subgraphCodegenCommand() {
285325
285348
  return new Command("codegen").description("Codegen the subgraph types").action(async () => {
285349
+ intro("Generating subgraph types");
285326
285350
  await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
285327
285351
  await subgraphSetup({
285328
285352
  network: SETTLEMINT_NETWORK
@@ -285332,6 +285356,7 @@ function subgraphCodegenCommand() {
285332
285356
  await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], {
285333
285357
  cwd: dirname11(subgraphYamlFile)
285334
285358
  });
285359
+ outro("Subgraph types generated successfully");
285335
285360
  });
285336
285361
  }
285337
285362
 
@@ -285382,6 +285407,7 @@ function subgraphDeployCommand() {
285382
285407
  command: "scs subgraph deploy my-subgraph"
285383
285408
  }
285384
285409
  ])).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 }) => {
285410
+ intro("Deploying subgraph");
285385
285411
  await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
285386
285412
  const autoAccept = !!acceptDefaults || is_in_ci_default;
285387
285413
  const env2 = await loadEnv(false, !!prod);
@@ -285450,6 +285476,7 @@ function subgraphDeployCommand() {
285450
285476
  SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
285451
285477
  ...graphEndpoints
285452
285478
  });
285479
+ outro(`Subgraph ${graphName} deployed successfully`);
285453
285480
  });
285454
285481
  }
285455
285482
  async function updateSpecVersion(specVersion) {
@@ -285458,6 +285485,55 @@ async function updateSpecVersion(specVersion) {
285458
285485
  await updateSubgraphYamlConfig(yamlConfig);
285459
285486
  }
285460
285487
 
285488
+ // src/commands/smart-contract-set/subgraph/remove.ts
285489
+ import { dirname as dirname13 } from "node:path";
285490
+ function subgraphRemoveCommand() {
285491
+ return new Command("remove").description("Remove a subgraph").usage(createExamples([
285492
+ {
285493
+ description: "Remove a subgraph",
285494
+ command: "scs subgraph remove my-subgraph"
285495
+ }
285496
+ ])).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 }) => {
285497
+ intro("Removing subgraph");
285498
+ await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
285499
+ if (!force) {
285500
+ await deleteConfirmationPrompt(`the subgraph ${subgraphName}`);
285501
+ }
285502
+ const autoAccept = !!acceptDefaults || is_in_ci_default;
285503
+ const env2 = await loadEnv(false, !!prod);
285504
+ const instance = await instancePrompt(env2, true);
285505
+ const accessToken = await getApplicationOrPersonalAccessToken({
285506
+ env: env2,
285507
+ instance,
285508
+ prefer: "application"
285509
+ });
285510
+ const theGraphMiddleware = await getTheGraphMiddleware({ env: env2, instance, accessToken, autoAccept });
285511
+ if (!theGraphMiddleware) {
285512
+ return nothingSelectedError("graph middleware");
285513
+ }
285514
+ if (theGraphMiddleware.status !== "COMPLETED") {
285515
+ serviceNotRunningError("graph middleware", theGraphMiddleware.status);
285516
+ }
285517
+ const subgraphYamlFile = await getSubgraphYamlFile();
285518
+ const cwd2 = dirname13(subgraphYamlFile);
285519
+ const { command, args } = await getPackageManagerExecutable();
285520
+ const middlewareAdminUrl = new URL(`/${encodeURIComponent(accessToken)}/admin`, theGraphMiddleware.serviceUrl).toString();
285521
+ await executeCommand(command, [...args, "graph", "remove", "--node", middlewareAdminUrl, subgraphName]);
285522
+ const settlemintClient = createSettleMintClient({
285523
+ accessToken,
285524
+ instance
285525
+ });
285526
+ const middleware = await settlemintClient.middleware.read(theGraphMiddleware.uniqueName);
285527
+ const graphEndpoints = await getGraphEndpoint(settlemintClient, middleware);
285528
+ await writeEnvSpinner(!!prod, {
285529
+ ...env2,
285530
+ SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
285531
+ ...graphEndpoints
285532
+ });
285533
+ outro(`Subgraph ${subgraphName} removed successfully`);
285534
+ });
285535
+ }
285536
+
285461
285537
  // src/commands/smart-contract.set.ts
285462
285538
  function smartContractSetCommand() {
285463
285539
  const foundry = new Command("foundry").alias("f").description("Foundry commands for building and testing smart contracts");
@@ -285475,6 +285551,7 @@ function smartContractSetCommand() {
285475
285551
  subgraph.addCommand(subgraphBuildCommand());
285476
285552
  subgraph.addCommand(subgraphCodegenCommand());
285477
285553
  subgraph.addCommand(subgraphDeployCommand());
285554
+ subgraph.addCommand(subgraphRemoveCommand());
285478
285555
  return new Command("smart-contract-set").alias("scs").description("Manage smart contract sets and subgraphs").addCommand(createCommand4()).addCommand(foundry).addCommand(hardhat).addCommand(subgraph);
285479
285556
  }
285480
285557
 
@@ -285532,12 +285609,22 @@ function addHooksToCommand(cmd2, rootCmd, argv) {
285532
285609
  addHooksToCommand(subcmd, rootCmd, argv);
285533
285610
  }
285534
285611
  }
285612
+ var ERRORS_TO_IGNORE = [ExitPromptError, AbortPromptError, ValidationError, CancelPromptError];
285613
+ var ERROR_CODES_TO_IGNORE = [
285614
+ "commander.help",
285615
+ "commander.missingArgument",
285616
+ "commander.optionMissingArgument",
285617
+ "commander.missingMandatoryOptionValue",
285618
+ "commander.conflictingOption",
285619
+ "commander.unknownOption",
285620
+ "commander.excessArguments",
285621
+ "commander.unknownCommand"
285622
+ ];
285535
285623
  async function onError(sdkcli, argv, error5) {
285536
- const errorsToIgnore = [ExitPromptError, AbortPromptError, ValidationError, CancelPromptError];
285537
- if (errorsToIgnore.some((errorToIgnore) => error5 instanceof errorToIgnore)) {
285624
+ if (ERRORS_TO_IGNORE.some((errorToIgnore) => error5 instanceof errorToIgnore)) {
285538
285625
  process.exit(0);
285539
285626
  }
285540
- if (error5 instanceof CommanderError && (error5.exitCode === 0 || error5.code === "commander.help")) {
285627
+ if (error5 instanceof CommanderError && (error5.exitCode === 0 || ERROR_CODES_TO_IGNORE.includes(error5.code))) {
285541
285628
  process.exit(error5.exitCode);
285542
285629
  }
285543
285630
  if (!(error5 instanceof CancelError2 || error5 instanceof SpinnerError)) {
@@ -285586,4 +285673,4 @@ async function sdkCliCommand(argv = process.argv) {
285586
285673
  // src/cli.ts
285587
285674
  sdkCliCommand();
285588
285675
 
285589
- //# debugId=31FDDC3AB7EE53E364756E2164756E21
285676
+ //# debugId=CCFFFD96B2D903CD64756E2164756E21