@settlemint/sdk-cli 1.0.9-pr04907cb7 → 1.0.9-pr21ce78d4

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
@@ -268710,7 +268710,9 @@ var DotEnvSchema = z.object({
268710
268710
  SETTLEMINT_BLOCKSCOUT: UniqueNameSchema.optional(),
268711
268711
  SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT: UrlSchema.optional(),
268712
268712
  SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT: UrlSchema.optional(),
268713
- SETTLEMINT_NEW_PROJECT_NAME: z.string().optional()
268713
+ SETTLEMINT_NEW_PROJECT_NAME: z.string().optional(),
268714
+ SETTLEMINT_SMART_CONTRACT_ADDRESS: z.string().optional(),
268715
+ SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID: z.string().optional()
268714
268716
  });
268715
268717
  var DotEnvSchemaPartial = DotEnvSchema.partial();
268716
268718
  var IdSchema = z.union([
@@ -268944,9 +268946,6 @@ var cancel2 = (msg) => {
268944
268946
  throw new CancelError2(msg);
268945
268947
  };
268946
268948
  async function executeCommand(command, args, options) {
268947
- console.log("command", command);
268948
- console.log("args", args);
268949
- console.log("options", options);
268950
268949
  const child = spawn(command, args, { env: { ...process.env, ...options?.env } });
268951
268950
  process.stdin.pipe(child.stdin);
268952
268951
  const output = [];
@@ -269058,7 +269057,7 @@ function table(title, data) {
269058
269057
  var package_default = {
269059
269058
  name: "@settlemint/sdk-cli",
269060
269059
  description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
269061
- version: "1.0.9-pr04907cb7",
269060
+ version: "1.0.9-pr21ce78d4",
269062
269061
  type: "module",
269063
269062
  private: false,
269064
269063
  license: "FSL-1.1-MIT",
@@ -269107,13 +269106,13 @@ var package_default = {
269107
269106
  semver: "7.6.3",
269108
269107
  slugify: "1.6.6",
269109
269108
  yoctocolors: "2.1.1",
269110
- "@commander-js/extra-typings": "13.1.0",
269109
+ "@commander-js/extra-typings": "13.0.0",
269111
269110
  "@inquirer/confirm": "5.1.3",
269112
269111
  "@inquirer/input": "4.1.3",
269113
269112
  "@inquirer/password": "4.0.6",
269114
269113
  "@inquirer/select": "4.0.6",
269115
- "@settlemint/sdk-js": "1.0.9-pr04907cb7",
269116
- "@settlemint/sdk-utils": "1.0.9-pr04907cb7",
269114
+ "@settlemint/sdk-js": "1.0.9-pr21ce78d4",
269115
+ "@settlemint/sdk-utils": "1.0.9-pr21ce78d4",
269117
269116
  "get-tsconfig": "4.10.0",
269118
269117
  giget: "1.2.3",
269119
269118
  yaml: "2.7.0"
@@ -272391,7 +272390,9 @@ var DotEnvSchema2 = z.object({
272391
272390
  SETTLEMINT_BLOCKSCOUT: UniqueNameSchema2.optional(),
272392
272391
  SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT: UrlSchema2.optional(),
272393
272392
  SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT: UrlSchema2.optional(),
272394
- SETTLEMINT_NEW_PROJECT_NAME: z.string().optional()
272393
+ SETTLEMINT_NEW_PROJECT_NAME: z.string().optional(),
272394
+ SETTLEMINT_SMART_CONTRACT_ADDRESS: z.string().optional(),
272395
+ SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID: z.string().optional()
272395
272396
  });
272396
272397
  var DotEnvSchemaPartial2 = DotEnvSchema2.partial();
272397
272398
  var IdSchema2 = z.union([
@@ -272980,7 +272981,9 @@ async function writeEnvSpinner(prod, env2) {
272980
272981
  SETTLEMINT_BLOCKSCOUT: env2.SETTLEMINT_BLOCKSCOUT,
272981
272982
  SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT: env2.SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT,
272982
272983
  SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT: env2.SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT,
272983
- SETTLEMINT_NEW_PROJECT_NAME: env2.SETTLEMINT_NEW_PROJECT_NAME
272984
+ SETTLEMINT_NEW_PROJECT_NAME: env2.SETTLEMINT_NEW_PROJECT_NAME,
272985
+ SETTLEMINT_SMART_CONTRACT_ADDRESS: env2.SETTLEMINT_SMART_CONTRACT_ADDRESS,
272986
+ SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID: env2.SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID
272984
272987
  };
272985
272988
  await writeEnv({
272986
272989
  prod,
@@ -278725,13 +278728,13 @@ async function addressPrompt({
278725
278728
  hardhatConfig
278726
278729
  }) {
278727
278730
  const possiblePrivateKeys = node.privateKeys?.filter((privateKey) => privateKey.privateKeyType !== "HD_ECDSA_P256") ?? [];
278728
- const defaultAddress = hardhatConfig.networks?.btp?.from ?? possiblePrivateKeys[0]?.address;
278731
+ const defaultAddress = env2.SETTLEMINT_SMART_CONTRACT_ADDRESS ?? hardhatConfig.networks?.btp?.from ?? possiblePrivateKeys[0]?.address;
278729
278732
  const defaultPossible = accept && defaultAddress;
278730
278733
  if (!node.privateKeys || node.privateKeys.length === 0) {
278731
278734
  cancel2(`No ECDSA P256 or HSM ECDSA P256 private key is activated on the node '${node.uniqueName}'. Please activate a private key on this node or specify a different node.`);
278732
278735
  }
278733
278736
  if (defaultPossible) {
278734
- if (possiblePrivateKeys.some((privateKey) => privateKey.address?.toLowerCase() === defaultAddress?.toLowerCase())) {
278737
+ if (node.privateKeys.some((privateKey) => privateKey.address?.toLowerCase() === defaultAddress?.toLowerCase())) {
278735
278738
  return defaultAddress;
278736
278739
  }
278737
278740
  note(`Private key with address '${defaultAddress}' not activated on the node '${node.uniqueName}'.
@@ -278745,6 +278748,12 @@ Please select another key or activate this key on the node and try again.`, "war
278745
278748
  })),
278746
278749
  default: defaultAddress ?? possiblePrivateKeys[0]?.address
278747
278750
  });
278751
+ if (address && address !== env2.SETTLEMINT_SMART_CONTRACT_ADDRESS) {
278752
+ await writeEnvSpinner(!!prod, {
278753
+ ...env2,
278754
+ SETTLEMINT_SMART_CONTRACT_ADDRESS: address
278755
+ });
278756
+ }
278748
278757
  return address;
278749
278758
  }
278750
278759
 
@@ -278833,10 +278842,7 @@ function hardhatDeployRemoteCommand() {
278833
278842
  if (verify && !hardhatConfig?.etherscan?.apiKey) {
278834
278843
  cancel2("It is not possible to verify the deployment on this network unless you supply an Etherscan API key in the hardhat.config.ts file");
278835
278844
  }
278836
- let address = defaultSender ?? null;
278837
- if (!defaultSender) {
278838
- address = await addressPrompt({ env: env2, accept: autoAccept, prod, node, hardhatConfig });
278839
- }
278845
+ const address = await addressPrompt({ env: env2, accept: autoAccept, prod, node, hardhatConfig });
278840
278846
  if (!address) {
278841
278847
  return nothingSelectedError("private key");
278842
278848
  }
@@ -278849,12 +278855,11 @@ function hardhatDeployRemoteCommand() {
278849
278855
  ...reset2 ? ["--reset"] : [],
278850
278856
  ...verify ? ["--verify"] : [],
278851
278857
  ...deploymentId ? ["--deployment-id", deploymentId] : [],
278858
+ ...defaultSender ? ["--default-sender", defaultSender] : [],
278852
278859
  ...parameters ? ["--parameters", parameters] : [],
278853
278860
  ...strategy ? ["--strategy", strategy] : [],
278854
278861
  "--network",
278855
278862
  "btp",
278856
- "--default-sender",
278857
- address,
278858
278863
  module ?? "ignition/modules/main.ts"
278859
278864
  ].filter(Boolean), { env: envConfig });
278860
278865
  });
@@ -279391,4 +279396,4 @@ async function sdkCliCommand(argv = process.argv) {
279391
279396
  // src/cli.ts
279392
279397
  sdkCliCommand();
279393
279398
 
279394
- //# debugId=DE9BD636077CEC6764756E2164756E21
279399
+ //# debugId=C00EFE19A8D3BCE564756E2164756E21