@settlemint/sdk-cli 1.1.5-prb9c6d3fd → 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.
- package/dist/cli.js +11 -102
- package/dist/cli.js.map +20 -21
- 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-
|
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-
|
274514
|
-
"@settlemint/sdk-utils": "1.1.5-
|
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
|
275770
|
+
throw new SpinnerError(errorMessage);
|
275776
275771
|
};
|
275777
275772
|
if (is_in_ci_default) {
|
275778
275773
|
try {
|
@@ -282427,8 +282422,7 @@ async function waitForCompletion({
|
|
282427
282422
|
try {
|
282428
282423
|
return await showSpinner();
|
282429
282424
|
} catch (error5) {
|
282430
|
-
|
282431
|
-
if (restartIfTimeout && isTimeoutError) {
|
282425
|
+
if (restartIfTimeout && error5 instanceof TimeoutError) {
|
282432
282426
|
note(`Restarting ${capitalizeFirstLetter2(type4)}`);
|
282433
282427
|
await service.restart(uniqueName);
|
282434
282428
|
return showSpinner();
|
@@ -284682,10 +284676,8 @@ function foundryBuildCommand() {
|
|
284682
284676
|
command: "scs foundry build --optimize --force"
|
284683
284677
|
}
|
284684
284678
|
])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
|
284685
|
-
intro("Building smart contracts using Foundry");
|
284686
284679
|
const forgeOptions = mapPassthroughOptions(passThroughOptions, cmd2);
|
284687
284680
|
await executeFoundryCommand("forge", ["build", ...forgeOptions]);
|
284688
|
-
outro("Smart contracts built successfully");
|
284689
284681
|
});
|
284690
284682
|
}
|
284691
284683
|
|
@@ -284705,10 +284697,9 @@ function foundryFormatCommand() {
|
|
284705
284697
|
command: "scs foundry format --check"
|
284706
284698
|
}
|
284707
284699
|
])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
|
284708
|
-
intro("Formatting smart contracts using Foundry");
|
284709
284700
|
const forgeOptions = mapPassthroughOptions(passThroughOptions, cmd2);
|
284710
284701
|
await executeFoundryCommand("forge", ["fmt", ...forgeOptions]);
|
284711
|
-
|
284702
|
+
note("Smart contract set formatted successfully!");
|
284712
284703
|
});
|
284713
284704
|
}
|
284714
284705
|
|
@@ -284749,10 +284740,8 @@ function foundryTestCommand() {
|
|
284749
284740
|
command: "scs foundry test --match-test testToken"
|
284750
284741
|
}
|
284751
284742
|
])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
|
284752
|
-
intro("Running smart contract tests using Foundry");
|
284753
284743
|
const forgeOptions = mapPassthroughOptions(passThroughOptions, cmd2);
|
284754
284744
|
await executeFoundryCommand("forge", ["test", ...forgeOptions]);
|
284755
|
-
outro("Smart contract tests completed");
|
284756
284745
|
});
|
284757
284746
|
}
|
284758
284747
|
|
@@ -284788,12 +284777,10 @@ function hardhatBuildCommand() {
|
|
284788
284777
|
command: "scs hardhat build --concurrency 2"
|
284789
284778
|
}
|
284790
284779
|
])).helpOption(false).option("-h, --help", "Get list of possible hardhat compile options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
|
284791
|
-
intro("Building smart contracts using Hardhat");
|
284792
284780
|
await validateIfRequiredPackagesAreInstalled(["hardhat"]);
|
284793
284781
|
const hardhatOptions = mapPassthroughOptions(passThroughOptions, cmd2);
|
284794
284782
|
const { command, args } = await getPackageManagerExecutable();
|
284795
284783
|
await executeCommand(command, [...args, "hardhat", "compile", ...hardhatOptions]);
|
284796
|
-
outro("Smart contracts built successfully");
|
284797
284784
|
});
|
284798
284785
|
}
|
284799
284786
|
|
@@ -284817,7 +284804,6 @@ function hardhatDeployLocalCommand() {
|
|
284817
284804
|
command: "scs hardhat deploy local --verify"
|
284818
284805
|
}
|
284819
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 }) => {
|
284820
|
-
intro("Deploying smart contracts to local network using Hardhat/Ignition");
|
284821
284807
|
await validateIfRequiredPackagesAreInstalled(["hardhat"]);
|
284822
284808
|
const { command, args } = await getPackageManagerExecutable();
|
284823
284809
|
await executeCommand(command, [
|
@@ -284831,7 +284817,6 @@ function hardhatDeployLocalCommand() {
|
|
284831
284817
|
"localhost",
|
284832
284818
|
module ?? "ignition/modules/main.ts"
|
284833
284819
|
].filter(Boolean));
|
284834
|
-
outro("Smart contracts deployed successfully to local network");
|
284835
284820
|
});
|
284836
284821
|
}
|
284837
284822
|
|
@@ -284996,7 +284981,6 @@ function hardhatDeployRemoteCommand() {
|
|
284996
284981
|
acceptDefaults,
|
284997
284982
|
blockchainNode: blockchainNodeUniqueName
|
284998
284983
|
}) => {
|
284999
|
-
intro("Deploying smart contracts to remote network using Hardhat/Ignition");
|
285000
284984
|
await validateIfRequiredPackagesAreInstalled(["hardhat"]);
|
285001
284985
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
285002
284986
|
const env2 = await loadEnv(false, !!prod);
|
@@ -285040,7 +285024,6 @@ function hardhatDeployRemoteCommand() {
|
|
285040
285024
|
address,
|
285041
285025
|
module ?? "ignition/modules/main.ts"
|
285042
285026
|
].filter(Boolean), { env: envConfig });
|
285043
|
-
outro("Smart contracts deployed successfully to remote network");
|
285044
285027
|
});
|
285045
285028
|
return cmd2;
|
285046
285029
|
}
|
@@ -285069,19 +285052,16 @@ function hardhatNetworkCommand() {
|
|
285069
285052
|
command: "scs hardhat network --port 3000"
|
285070
285053
|
}
|
285071
285054
|
])).helpOption(false).option("-h, --help", "Get list of possible hardhat node options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
|
285072
|
-
intro("Starting development network using Hardhat");
|
285073
285055
|
await validateIfRequiredPackagesAreInstalled(["hardhat"]);
|
285074
285056
|
const hardhatOptions = mapPassthroughOptions(passThroughOptions, cmd2);
|
285075
285057
|
const { command, args } = await getPackageManagerExecutable();
|
285076
285058
|
await executeCommand(command, [...args, "hardhat", "node", ...hardhatOptions]);
|
285077
|
-
outro("Development network started successfully");
|
285078
285059
|
});
|
285079
285060
|
}
|
285080
285061
|
|
285081
285062
|
// src/commands/smart-contract-set/hardhat/script/local.ts
|
285082
285063
|
function hardhatScriptLocalCommand() {
|
285083
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 }) => {
|
285084
|
-
intro("Running Hardhat script on local network");
|
285085
285065
|
await validateIfRequiredPackagesAreInstalled(["hardhat"]);
|
285086
285066
|
const { command, args } = await getPackageManagerExecutable();
|
285087
285067
|
await executeCommand(command, [
|
@@ -285093,7 +285073,6 @@ function hardhatScriptLocalCommand() {
|
|
285093
285073
|
"localhost",
|
285094
285074
|
...compile ? ["--no-compile"] : []
|
285095
285075
|
]);
|
285096
|
-
outro("Script execution completed successfully");
|
285097
285076
|
});
|
285098
285077
|
}
|
285099
285078
|
|
@@ -285101,7 +285080,6 @@ function hardhatScriptLocalCommand() {
|
|
285101
285080
|
function hardhatScriptRemoteCommand() {
|
285102
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");
|
285103
285082
|
cmd2.action(async ({ script, prod, blockchainNode: blockchainNodeUniqueName, acceptDefaults, compile }) => {
|
285104
|
-
intro("Running Hardhat script on remote network");
|
285105
285083
|
await validateIfRequiredPackagesAreInstalled(["hardhat"]);
|
285106
285084
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
285107
285085
|
const env2 = await loadEnv(false, !!prod);
|
@@ -285119,7 +285097,6 @@ function hardhatScriptRemoteCommand() {
|
|
285119
285097
|
const envConfig = await settlemint.foundry.env(node.uniqueName);
|
285120
285098
|
const { command, args } = await getPackageManagerExecutable();
|
285121
285099
|
await executeCommand(command, [...args, "hardhat", "run", script, "--network", "btp", ...compile ? ["--no-compile"] : []], { env: envConfig });
|
285122
|
-
outro("Script execution completed successfully");
|
285123
285100
|
});
|
285124
285101
|
return cmd2;
|
285125
285102
|
}
|
@@ -285152,12 +285129,10 @@ function hardhatTestCommand() {
|
|
285152
285129
|
command: "scs hardhat test test/token.test.ts"
|
285153
285130
|
}
|
285154
285131
|
])).helpOption(false).option("-h, --help", "Get list of possible hardhat test options").passThroughOptions().allowUnknownOption().action(async (options, cmd2) => {
|
285155
|
-
intro("Running smart contract tests using Hardhat");
|
285156
285132
|
await validateIfRequiredPackagesAreInstalled(["hardhat"]);
|
285157
285133
|
const hardhatOptions = mapPassthroughOptions(options, cmd2);
|
285158
285134
|
const { command, args } = await getPackageManagerExecutable();
|
285159
285135
|
await executeCommand(command, [...args, "hardhat", "test", ...hardhatOptions]);
|
285160
|
-
outro("Smart contract tests completed");
|
285161
285136
|
});
|
285162
285137
|
}
|
285163
285138
|
|
@@ -285326,7 +285301,6 @@ async function getNodeName({
|
|
285326
285301
|
// src/commands/smart-contract-set/subgraph/build.ts
|
285327
285302
|
function subgraphBuildCommand() {
|
285328
285303
|
return new Command("build").description("Build the subgraph").action(async () => {
|
285329
|
-
intro("Building subgraph");
|
285330
285304
|
await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
|
285331
285305
|
await subgraphSetup({
|
285332
285306
|
network: SETTLEMINT_NETWORK
|
@@ -285336,7 +285310,6 @@ function subgraphBuildCommand() {
|
|
285336
285310
|
const cwd2 = dirname10(subgraphYamlFile);
|
285337
285311
|
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], { cwd: cwd2 });
|
285338
285312
|
await executeCommand(command, [...args, "graph", "build", subgraphYamlFile], { cwd: cwd2 });
|
285339
|
-
outro("Subgraph built successfully");
|
285340
285313
|
});
|
285341
285314
|
}
|
285342
285315
|
|
@@ -285344,7 +285317,6 @@ function subgraphBuildCommand() {
|
|
285344
285317
|
import { dirname as dirname11 } from "node:path";
|
285345
285318
|
function subgraphCodegenCommand() {
|
285346
285319
|
return new Command("codegen").description("Codegen the subgraph types").action(async () => {
|
285347
|
-
intro("Generating subgraph types");
|
285348
285320
|
await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
|
285349
285321
|
await subgraphSetup({
|
285350
285322
|
network: SETTLEMINT_NETWORK
|
@@ -285354,7 +285326,6 @@ function subgraphCodegenCommand() {
|
|
285354
285326
|
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], {
|
285355
285327
|
cwd: dirname11(subgraphYamlFile)
|
285356
285328
|
});
|
285357
|
-
outro("Subgraph types generated successfully");
|
285358
285329
|
});
|
285359
285330
|
}
|
285360
285331
|
|
@@ -285405,7 +285376,6 @@ function subgraphDeployCommand() {
|
|
285405
285376
|
command: "scs subgraph deploy my-subgraph"
|
285406
285377
|
}
|
285407
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 }) => {
|
285408
|
-
intro("Deploying subgraph");
|
285409
285379
|
await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
|
285410
285380
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
285411
285381
|
const env2 = await loadEnv(false, !!prod);
|
@@ -285474,7 +285444,6 @@ function subgraphDeployCommand() {
|
|
285474
285444
|
SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
|
285475
285445
|
...graphEndpoints
|
285476
285446
|
});
|
285477
|
-
outro(`Subgraph ${graphName} deployed successfully`);
|
285478
285447
|
});
|
285479
285448
|
}
|
285480
285449
|
async function updateSpecVersion(specVersion) {
|
@@ -285483,55 +285452,6 @@ async function updateSpecVersion(specVersion) {
|
|
285483
285452
|
await updateSubgraphYamlConfig(yamlConfig);
|
285484
285453
|
}
|
285485
285454
|
|
285486
|
-
// src/commands/smart-contract-set/subgraph/remove.ts
|
285487
|
-
import { dirname as dirname13 } from "node:path";
|
285488
|
-
function subgraphRemoveCommand() {
|
285489
|
-
return new Command("remove").description("Remove a subgraph").usage(createExamples([
|
285490
|
-
{
|
285491
|
-
description: "Remove a subgraph",
|
285492
|
-
command: "scs subgraph remove my-subgraph"
|
285493
|
-
}
|
285494
|
-
])).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 }) => {
|
285495
|
-
intro("Removing subgraph");
|
285496
|
-
await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
|
285497
|
-
if (!force) {
|
285498
|
-
await deleteConfirmationPrompt(`the subgraph ${subgraphName}`);
|
285499
|
-
}
|
285500
|
-
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
285501
|
-
const env2 = await loadEnv(false, !!prod);
|
285502
|
-
const instance = await instancePrompt(env2, true);
|
285503
|
-
const accessToken = await getApplicationOrPersonalAccessToken({
|
285504
|
-
env: env2,
|
285505
|
-
instance,
|
285506
|
-
prefer: "application"
|
285507
|
-
});
|
285508
|
-
const theGraphMiddleware = await getTheGraphMiddleware({ env: env2, instance, accessToken, autoAccept });
|
285509
|
-
if (!theGraphMiddleware) {
|
285510
|
-
return nothingSelectedError("graph middleware");
|
285511
|
-
}
|
285512
|
-
if (theGraphMiddleware.status !== "COMPLETED") {
|
285513
|
-
serviceNotRunningError("graph middleware", theGraphMiddleware.status);
|
285514
|
-
}
|
285515
|
-
const subgraphYamlFile = await getSubgraphYamlFile();
|
285516
|
-
const cwd2 = dirname13(subgraphYamlFile);
|
285517
|
-
const { command, args } = await getPackageManagerExecutable();
|
285518
|
-
const middlewareAdminUrl = new URL(`/${encodeURIComponent(accessToken)}/admin`, theGraphMiddleware.serviceUrl).toString();
|
285519
|
-
await executeCommand(command, [...args, "graph", "remove", "--node", middlewareAdminUrl, subgraphName]);
|
285520
|
-
const settlemintClient = createSettleMintClient({
|
285521
|
-
accessToken,
|
285522
|
-
instance
|
285523
|
-
});
|
285524
|
-
const middleware = await settlemintClient.middleware.read(theGraphMiddleware.uniqueName);
|
285525
|
-
const graphEndpoints = await getGraphEndpoint(settlemintClient, middleware);
|
285526
|
-
await writeEnvSpinner(!!prod, {
|
285527
|
-
...env2,
|
285528
|
-
SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
|
285529
|
-
...graphEndpoints
|
285530
|
-
});
|
285531
|
-
outro(`Subgraph ${subgraphName} removed successfully`);
|
285532
|
-
});
|
285533
|
-
}
|
285534
|
-
|
285535
285455
|
// src/commands/smart-contract.set.ts
|
285536
285456
|
function smartContractSetCommand() {
|
285537
285457
|
const foundry = new Command("foundry").alias("f").description("Foundry commands for building and testing smart contracts");
|
@@ -285549,7 +285469,6 @@ function smartContractSetCommand() {
|
|
285549
285469
|
subgraph.addCommand(subgraphBuildCommand());
|
285550
285470
|
subgraph.addCommand(subgraphCodegenCommand());
|
285551
285471
|
subgraph.addCommand(subgraphDeployCommand());
|
285552
|
-
subgraph.addCommand(subgraphRemoveCommand());
|
285553
285472
|
return new Command("smart-contract-set").alias("scs").description("Manage smart contract sets and subgraphs").addCommand(createCommand4()).addCommand(foundry).addCommand(hardhat).addCommand(subgraph);
|
285554
285473
|
}
|
285555
285474
|
|
@@ -285607,22 +285526,12 @@ function addHooksToCommand(cmd2, rootCmd, argv) {
|
|
285607
285526
|
addHooksToCommand(subcmd, rootCmd, argv);
|
285608
285527
|
}
|
285609
285528
|
}
|
285610
|
-
var ERRORS_TO_IGNORE = [ExitPromptError, AbortPromptError, ValidationError, CancelPromptError];
|
285611
|
-
var ERROR_CODES_TO_IGNORE = [
|
285612
|
-
"commander.help",
|
285613
|
-
"commander.missingArgument",
|
285614
|
-
"commander.optionMissingArgument",
|
285615
|
-
"commander.missingMandatoryOptionValue",
|
285616
|
-
"commander.conflictingOption",
|
285617
|
-
"commander.unknownOption",
|
285618
|
-
"commander.excessArguments",
|
285619
|
-
"commander.unknownCommand"
|
285620
|
-
];
|
285621
285529
|
async function onError(sdkcli, argv, error5) {
|
285622
|
-
|
285530
|
+
const errorsToIgnore = [ExitPromptError, AbortPromptError, ValidationError, CancelPromptError];
|
285531
|
+
if (errorsToIgnore.some((errorToIgnore) => error5 instanceof errorToIgnore)) {
|
285623
285532
|
process.exit(0);
|
285624
285533
|
}
|
285625
|
-
if (error5 instanceof CommanderError && (error5.exitCode === 0 ||
|
285534
|
+
if (error5 instanceof CommanderError && (error5.exitCode === 0 || error5.code === "commander.help")) {
|
285626
285535
|
process.exit(error5.exitCode);
|
285627
285536
|
}
|
285628
285537
|
if (!(error5 instanceof CancelError2 || error5 instanceof SpinnerError)) {
|
@@ -285643,7 +285552,7 @@ ${error5.stack}`));
|
|
285643
285552
|
}
|
285644
285553
|
function registerCommands() {
|
285645
285554
|
const sdkcli = new Command;
|
285646
|
-
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()
|
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();
|
285647
285556
|
sdkcli.addCommand(connectCommand());
|
285648
285557
|
sdkcli.addCommand(codegenCommand());
|
285649
285558
|
sdkcli.addCommand(platformCommand());
|
@@ -285671,4 +285580,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
285671
285580
|
// src/cli.ts
|
285672
285581
|
sdkCliCommand();
|
285673
285582
|
|
285674
|
-
//# debugId=
|
285583
|
+
//# debugId=6B07B96C8DE1C9BA64756E2164756E21
|