@settlemint/sdk-cli 1.1.11-main56875e3c → 1.1.11-maincb4e74b4
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 +84 -66
- package/dist/cli.js.map +6 -6
- package/package.json +4 -4
package/dist/cli.js
CHANGED
@@ -266997,7 +266997,7 @@ function pruneCurrentEnv(currentEnv, env2) {
|
|
266997
266997
|
var package_default = {
|
266998
266998
|
name: "@settlemint/sdk-cli",
|
266999
266999
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
267000
|
-
version: "1.1.11-
|
267000
|
+
version: "1.1.11-maincb4e74b4",
|
267001
267001
|
type: "module",
|
267002
267002
|
private: false,
|
267003
267003
|
license: "FSL-1.1-MIT",
|
@@ -267045,9 +267045,9 @@ var package_default = {
|
|
267045
267045
|
"@inquirer/input": "4.1.6",
|
267046
267046
|
"@inquirer/password": "4.0.9",
|
267047
267047
|
"@inquirer/select": "4.0.9",
|
267048
|
-
"@settlemint/sdk-js": "1.1.11-
|
267049
|
-
"@settlemint/sdk-utils": "1.1.11-
|
267050
|
-
"@types/node": "22.13.
|
267048
|
+
"@settlemint/sdk-js": "1.1.11-maincb4e74b4",
|
267049
|
+
"@settlemint/sdk-utils": "1.1.11-maincb4e74b4",
|
267050
|
+
"@types/node": "22.13.8",
|
267051
267051
|
"@types/semver": "7.5.8",
|
267052
267052
|
"@types/which": "3.0.4",
|
267053
267053
|
"get-tsconfig": "4.10.0",
|
@@ -279849,6 +279849,38 @@ function getStatusAction(status) {
|
|
279849
279849
|
return "Please try again later.";
|
279850
279850
|
}
|
279851
279851
|
|
279852
|
+
// src/prompts/smart-contract-set/address.prompt.ts
|
279853
|
+
async function addressPrompt({
|
279854
|
+
env: env2,
|
279855
|
+
accept,
|
279856
|
+
prod,
|
279857
|
+
node,
|
279858
|
+
hardhatConfig
|
279859
|
+
}) {
|
279860
|
+
const possiblePrivateKeys = node.privateKeys?.filter((privateKey) => validPrivateKey(privateKey)) ?? [];
|
279861
|
+
const defaultAddress = hardhatConfig.networks?.btp?.from ?? possiblePrivateKeys[0]?.address;
|
279862
|
+
const defaultPossible = accept && defaultAddress;
|
279863
|
+
if (defaultPossible) {
|
279864
|
+
if (possiblePrivateKeys.some((privateKey) => privateKey.address?.toLowerCase() === defaultAddress?.toLowerCase())) {
|
279865
|
+
return defaultAddress;
|
279866
|
+
}
|
279867
|
+
note(`Private key with address '${defaultAddress}' is not activated on the node '${node.uniqueName}'.
|
279868
|
+
Please select another key or activate this key on the node and try again.`, "warn");
|
279869
|
+
}
|
279870
|
+
const address = await esm_default2({
|
279871
|
+
message: "Which private key do you want to deploy from?",
|
279872
|
+
choices: possiblePrivateKeys.map(({ address: address2, name: name2 }) => ({
|
279873
|
+
name: name2,
|
279874
|
+
value: address2
|
279875
|
+
})),
|
279876
|
+
default: defaultAddress ?? possiblePrivateKeys[0]?.address
|
279877
|
+
});
|
279878
|
+
return address;
|
279879
|
+
}
|
279880
|
+
function validPrivateKey(privateKey) {
|
279881
|
+
return privateKey.privateKeyType !== "HD_ECDSA_P256";
|
279882
|
+
}
|
279883
|
+
|
279852
279884
|
// src/commands/smart-contract-set/hardhat/utils/select-target-node.ts
|
279853
279885
|
async function selectTargetNode({
|
279854
279886
|
env: env2,
|
@@ -279863,18 +279895,10 @@ async function selectTargetNode({
|
|
279863
279895
|
return missingApplication();
|
279864
279896
|
}
|
279865
279897
|
const nodes = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION));
|
279866
|
-
const
|
279867
|
-
if (evmNodes.length === 0) {
|
279868
|
-
cancel2("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
279869
|
-
}
|
279870
|
-
const nodesWithPrivateKey = await Promise.all(nodes.map((node2) => settlemint.blockchainNode.read(node2.uniqueName)));
|
279871
|
-
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node2) => node2.privateKeys && node2.privateKeys.length > 0);
|
279872
|
-
if (nodesWithActivePrivateKey.length === 0) {
|
279873
|
-
cancel2("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
279874
|
-
}
|
279898
|
+
const validNodes = nodes.filter((node2) => validateNode(node2, false));
|
279875
279899
|
const blockchainNode = await blockchainNodePrompt({
|
279876
279900
|
env: env2,
|
279877
|
-
nodes:
|
279901
|
+
nodes: validNodes,
|
279878
279902
|
accept: autoAccept,
|
279879
279903
|
isRequired: true,
|
279880
279904
|
promptMessage: "Which blockchain node do you want to connect to? (Only nodes with private keys activated are shown)",
|
@@ -279886,47 +279910,31 @@ async function selectTargetNode({
|
|
279886
279910
|
node = blockchainNode;
|
279887
279911
|
} else {
|
279888
279912
|
node = await settlemint.blockchainNode.read(nodeUniqueName);
|
279889
|
-
if (!node.isEvm) {
|
279890
|
-
cancel2(`The specified blockchain node '${nodeUniqueName}' is not an EVM blockchain node. Please specify an EVM blockchain node to continue.`);
|
279891
|
-
}
|
279892
|
-
}
|
279893
|
-
if (node.status !== "COMPLETED") {
|
279894
|
-
serviceNotRunningError("blockchain node", node.status);
|
279895
279913
|
}
|
279914
|
+
validateNode(node);
|
279896
279915
|
note(`\uD83D\uDD17 Connected to blockchain node '${node.uniqueName}'`);
|
279897
279916
|
return node;
|
279898
279917
|
}
|
279899
|
-
|
279900
|
-
|
279901
|
-
|
279902
|
-
|
279903
|
-
|
279904
|
-
|
279905
|
-
node,
|
279906
|
-
hardhatConfig
|
279907
|
-
}) {
|
279908
|
-
const possiblePrivateKeys = node.privateKeys?.filter((privateKey) => privateKey.privateKeyType !== "HD_ECDSA_P256") ?? [];
|
279909
|
-
const defaultAddress = hardhatConfig.networks?.btp?.from ?? possiblePrivateKeys[0]?.address;
|
279910
|
-
const defaultPossible = accept && defaultAddress;
|
279911
|
-
if (!node.privateKeys || node.privateKeys.length === 0) {
|
279912
|
-
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.`);
|
279918
|
+
function validateNode(node, cancelOnError = true) {
|
279919
|
+
if (!node.isEvm) {
|
279920
|
+
if (cancelOnError) {
|
279921
|
+
cancel2(`The specified blockchain node '${node.uniqueName}' is not an EVM blockchain node. Please specify an EVM blockchain node to continue.`);
|
279922
|
+
}
|
279923
|
+
return false;
|
279913
279924
|
}
|
279914
|
-
if (
|
279915
|
-
if (
|
279916
|
-
|
279925
|
+
if (node.privateKeys?.filter((privateKey) => validPrivateKey(privateKey)).length === 0) {
|
279926
|
+
if (cancelOnError) {
|
279927
|
+
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.`);
|
279917
279928
|
}
|
279918
|
-
|
279919
|
-
Please select another key or activate this key on the node and try again.`, "warn");
|
279929
|
+
return false;
|
279920
279930
|
}
|
279921
|
-
|
279922
|
-
|
279923
|
-
|
279924
|
-
|
279925
|
-
|
279926
|
-
|
279927
|
-
|
279928
|
-
});
|
279929
|
-
return address;
|
279931
|
+
if (node.status !== "COMPLETED") {
|
279932
|
+
if (cancelOnError) {
|
279933
|
+
serviceNotRunningError("blockchain node", node.status);
|
279934
|
+
}
|
279935
|
+
return false;
|
279936
|
+
}
|
279937
|
+
return true;
|
279930
279938
|
}
|
279931
279939
|
|
279932
279940
|
// src/utils/smart-contract-set/hardhat-config.ts
|
@@ -280024,23 +280032,33 @@ function hardhatDeployRemoteCommand() {
|
|
280024
280032
|
return nothingSelectedError("private key");
|
280025
280033
|
}
|
280026
280034
|
const { command, args } = await getPackageManagerExecutable();
|
280027
|
-
|
280028
|
-
|
280029
|
-
|
280030
|
-
|
280031
|
-
|
280032
|
-
|
280033
|
-
|
280034
|
-
|
280035
|
-
|
280036
|
-
|
280037
|
-
|
280038
|
-
|
280039
|
-
|
280040
|
-
|
280041
|
-
|
280042
|
-
|
280043
|
-
|
280035
|
+
try {
|
280036
|
+
const output = await executeCommand(command, [
|
280037
|
+
...args,
|
280038
|
+
"hardhat",
|
280039
|
+
"ignition",
|
280040
|
+
"deploy",
|
280041
|
+
...reset2 ? ["--reset"] : [],
|
280042
|
+
...verify ? ["--verify"] : [],
|
280043
|
+
...deploymentId ? ["--deployment-id", deploymentId] : [],
|
280044
|
+
...parameters ? ["--parameters", parameters] : [],
|
280045
|
+
...strategy ? ["--strategy", strategy] : [],
|
280046
|
+
"--network",
|
280047
|
+
"btp",
|
280048
|
+
"--default-sender",
|
280049
|
+
address,
|
280050
|
+
module ?? "ignition/modules/main.ts"
|
280051
|
+
].filter(Boolean), { env: envConfig });
|
280052
|
+
const outputStr = output.join(`
|
280053
|
+
`);
|
280054
|
+
if (!outputStr.includes("Deploy cancelled")) {
|
280055
|
+
outro("Smart contracts deployed successfully to remote network");
|
280056
|
+
} else {
|
280057
|
+
note("Smart contract deployment was cancelled");
|
280058
|
+
}
|
280059
|
+
} catch (error5) {
|
280060
|
+
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.");
|
280061
|
+
}
|
280044
280062
|
});
|
280045
280063
|
return cmd2;
|
280046
280064
|
}
|
@@ -280671,4 +280689,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
280671
280689
|
// src/cli.ts
|
280672
280690
|
sdkCliCommand();
|
280673
280691
|
|
280674
|
-
//# debugId=
|
280692
|
+
//# debugId=70E3292087FED20764756E2164756E21
|