@settlemint/sdk-cli 2.1.4-pr66a97677 → 2.1.4-pr86a1f4ed

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
@@ -245278,7 +245278,7 @@ function pruneCurrentEnv(currentEnv, env2) {
245278
245278
  var package_default = {
245279
245279
  name: "@settlemint/sdk-cli",
245280
245280
  description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
245281
- version: "2.1.4-pr66a97677",
245281
+ version: "2.1.4-pr86a1f4ed",
245282
245282
  type: "module",
245283
245283
  private: false,
245284
245284
  license: "FSL-1.1-MIT",
@@ -245327,8 +245327,8 @@ var package_default = {
245327
245327
  "@inquirer/input": "4.1.9",
245328
245328
  "@inquirer/password": "4.0.12",
245329
245329
  "@inquirer/select": "4.1.1",
245330
- "@settlemint/sdk-js": "2.1.4-pr66a97677",
245331
- "@settlemint/sdk-utils": "2.1.4-pr66a97677",
245330
+ "@settlemint/sdk-js": "2.1.4-pr86a1f4ed",
245331
+ "@settlemint/sdk-utils": "2.1.4-pr86a1f4ed",
245332
245332
  "@types/node": "22.14.1",
245333
245333
  "@types/semver": "7.7.0",
245334
245334
  "@types/which": "3.0.4",
@@ -252319,6 +252319,17 @@ async function servicePrompt({
252319
252319
  });
252320
252320
  }
252321
252321
 
252322
+ // src/utils/cluster-service.ts
252323
+ function isValidPrivateKey(privateKey) {
252324
+ return privateKey.privateKeyType !== "HD_ECDSA_P256";
252325
+ }
252326
+ function hasValidPrivateKey(service) {
252327
+ return (service.privateKeys ?? []).some(isValidPrivateKey);
252328
+ }
252329
+ function isRunning(service) {
252330
+ return service === undefined || service?.status === "COMPLETED";
252331
+ }
252332
+
252322
252333
  // src/prompts/cluster-service/blockchain-node.prompt.ts
252323
252334
  async function blockchainNodePrompt({
252324
252335
  env: env2,
@@ -252338,12 +252349,12 @@ async function blockchainNodePrompt({
252338
252349
  isRequired,
252339
252350
  defaultHandler: async ({ defaultService: defaultNode, choices }) => {
252340
252351
  const filteredChoices = filterRunningOnly ? choices.filter(({ value: node }) => {
252341
- return Array.isArray(node) ? true : node === undefined || node?.status === "COMPLETED";
252352
+ return Array.isArray(node) ? true : isRunning(node);
252342
252353
  }).map((item) => {
252343
252354
  if (Array.isArray(item.value)) {
252344
252355
  return {
252345
252356
  ...item,
252346
- value: item.value.filter((n6) => n6 === undefined || n6.status === "COMPLETED")
252357
+ value: item.value.filter(isRunning)
252347
252358
  };
252348
252359
  }
252349
252360
  return item;
@@ -252844,7 +252855,7 @@ async function blockchainNodeOrLoadBalancerPrompt({
252844
252855
  }) {
252845
252856
  return servicePrompt({
252846
252857
  env: env2,
252847
- services: [...nodes, ...loadBalancers],
252858
+ services: [...loadBalancers, ...nodes],
252848
252859
  accept,
252849
252860
  envKey: "SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER",
252850
252861
  isRequired,
@@ -252894,7 +252905,7 @@ function connectCommand() {
252894
252905
  env: env2,
252895
252906
  nodes: nodesWithPrivateKey,
252896
252907
  accept: acceptDefaults,
252897
- promptMessage: "Which blockchain node do you want to SEND unsigned transactions from?"
252908
+ promptMessage: "Which blockchain node do you want to use for sending transactions?"
252898
252909
  });
252899
252910
  const nodesWithoutPrivateKey = blockchainNodes.filter((node) => node && ("privateKeys" in node) ? !Array.isArray(node?.privateKeys) || node?.privateKeys?.length === 0 : true);
252900
252911
  const loadBalancerOrBlockchainNode = await blockchainNodeOrLoadBalancerPrompt({
@@ -252902,7 +252913,7 @@ function connectCommand() {
252902
252913
  nodes: nodesWithoutPrivateKey,
252903
252914
  loadBalancers,
252904
252915
  accept: acceptDefaults,
252905
- promptMessage: "Which blockchain node or load balancer do you want to READ/WRITE from/to? Transactions should be signed before sending to this node or load balancer"
252916
+ promptMessage: "Which blockchain node or load balancer do you want to use for read operations?"
252906
252917
  });
252907
252918
  const hasura = await hasuraPrompt({
252908
252919
  env: env2,
@@ -252968,12 +252979,12 @@ function connectCommand() {
252968
252979
  uniqueName: blockchainNode.blockchainNetwork?.uniqueName
252969
252980
  },
252970
252981
  blockchainNode && {
252971
- type: "Blockchain Node",
252982
+ type: "Blockchain Node (with private key, use for sending transactions)",
252972
252983
  name: blockchainNode.name,
252973
252984
  uniqueName: blockchainNode.uniqueName
252974
252985
  },
252975
252986
  loadBalancerOrBlockchainNode && {
252976
- type: "Blockchain Node or Load Balancer (signed transactions only)",
252987
+ type: "Blockchain Node or Load Balancer (without private key, use for read operations)",
252977
252988
  name: loadBalancerOrBlockchainNode.name,
252978
252989
  uniqueName: loadBalancerOrBlockchainNode.uniqueName
252979
252990
  },
@@ -257811,25 +257822,19 @@ function smartContractPortalMiddlewareCreateCommand() {
257811
257822
  return missingApplication();
257812
257823
  }
257813
257824
  let blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
257814
- let loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER;
257825
+ const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER;
257815
257826
  if (!blockchainNodeUniqueName && !loadBalancerUniqueName) {
257816
257827
  const blockchainNodes = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
257817
- const loadBalancers = await serviceSpinner("load balancer", () => settlemint.loadBalancer.list(applicationUniqueName));
257818
- const nodeOrLoadbalancer = await blockchainNodeOrLoadBalancerPrompt({
257828
+ const node = await blockchainNodePrompt({
257819
257829
  env: env2,
257820
- nodes: blockchainNodes,
257821
- loadBalancers,
257830
+ nodes: blockchainNodes.filter(hasValidPrivateKey),
257822
257831
  accept: acceptDefaults,
257823
257832
  isRequired: true
257824
257833
  });
257825
- if (!nodeOrLoadbalancer) {
257826
- return nothingSelectedError("blockchain node or load balancer");
257827
- }
257828
- if (nodeOrLoadbalancer.__typename?.endsWith("LoadBalancer")) {
257829
- loadBalancerUniqueName = nodeOrLoadbalancer.uniqueName;
257830
- } else {
257831
- blockchainNodeUniqueName = nodeOrLoadbalancer.uniqueName;
257834
+ if (!node) {
257835
+ return nothingSelectedError("blockchain node");
257832
257836
  }
257837
+ blockchainNodeUniqueName = node.uniqueName;
257833
257838
  }
257834
257839
  const parsedAbis = [];
257835
257840
  if (abis && abis.length > 0) {
@@ -259362,11 +259367,6 @@ function getStatusAction(status) {
259362
259367
  return "Please try again later.";
259363
259368
  }
259364
259369
 
259365
- // src/utils/blockchain-node.ts
259366
- function validPrivateKey(privateKey) {
259367
- return privateKey.privateKeyType !== "HD_ECDSA_P256";
259368
- }
259369
-
259370
259370
  // src/commands/smart-contract-set/hardhat/utils/select-target-node.ts
259371
259371
  async function selectTargetNode({
259372
259372
  env: env2,
@@ -259412,7 +259412,7 @@ function validateNode(node, cancelOnError = true) {
259412
259412
  }
259413
259413
  return false;
259414
259414
  }
259415
- if (node.privateKeys?.filter((privateKey) => validPrivateKey(privateKey)).length === 0) {
259415
+ if (!hasValidPrivateKey(node)) {
259416
259416
  if (cancelOnError) {
259417
259417
  cancel2(`The specified blockchain node '${node.uniqueName}' does not have an ECDSA P256 or HSM ECDSA P256 private key activated. Please activate an ECDSA P256 or HSM ECDSA P256 private key on your node and try again.`);
259418
259418
  }
@@ -259433,7 +259433,7 @@ async function addressPrompt({
259433
259433
  node,
259434
259434
  hardhatConfig
259435
259435
  }) {
259436
- const possiblePrivateKeys = node.privateKeys?.filter((privateKey) => validPrivateKey(privateKey)) ?? [];
259436
+ const possiblePrivateKeys = node.privateKeys?.filter(isValidPrivateKey) ?? [];
259437
259437
  const defaultAddress = hardhatConfig.networks?.btp?.from ?? possiblePrivateKeys[0]?.address;
259438
259438
  const defaultPossible = accept && defaultAddress;
259439
259439
  if (defaultPossible) {
@@ -260189,4 +260189,4 @@ async function sdkCliCommand(argv = process.argv) {
260189
260189
  // src/cli.ts
260190
260190
  sdkCliCommand();
260191
260191
 
260192
- //# debugId=D101F2647E41002564756E2164756E21
260192
+ //# debugId=C55F9514E9EDA97B64756E2164756E21