@settlemint/sdk-cli 0.9.2 → 0.9.3
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 +1 -1
- package/dist/cli.js +247 -224
- package/dist/cli.js.map +27 -24
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -19613,7 +19613,7 @@ var require_lib4 = __commonJS((exports, module) => {
|
|
|
19613
19613
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
19614
19614
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
19615
19615
|
var getPathInfo = (cmd, {
|
|
19616
|
-
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
19616
|
+
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.HGvmcg7Ztz:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
|
|
19617
19617
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
19618
19618
|
delimiter: optDelimiter = delimiter
|
|
19619
19619
|
}) => {
|
|
@@ -19817,7 +19817,7 @@ var require_lib5 = __commonJS((exports, module) => {
|
|
|
19817
19817
|
let pathToInitial;
|
|
19818
19818
|
try {
|
|
19819
19819
|
pathToInitial = which.sync(initialCmd, {
|
|
19820
|
-
path: options.env && findInObject(options.env, "PATH") || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
19820
|
+
path: options.env && findInObject(options.env, "PATH") || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.HGvmcg7Ztz:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
|
|
19821
19821
|
pathext: options.env && findInObject(options.env, "PATHEXT") || process.env.PATHEXT
|
|
19822
19822
|
}).toLowerCase();
|
|
19823
19823
|
} catch (err) {
|
|
@@ -20534,7 +20534,7 @@ var require_lib6 = __commonJS((exports, module) => {
|
|
|
20534
20534
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
20535
20535
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
20536
20536
|
var getPathInfo = (cmd, {
|
|
20537
|
-
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
20537
|
+
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.HGvmcg7Ztz:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
|
|
20538
20538
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
20539
20539
|
delimiter: optDelimiter = delimiter
|
|
20540
20540
|
}) => {
|
|
@@ -223327,7 +223327,7 @@ ${Bt.cyan(Yt)}
|
|
|
223327
223327
|
code: "ENOENT"
|
|
223328
223328
|
}), getPathInfo = (e9, t7) => {
|
|
223329
223329
|
var r6 = t7.colon || or;
|
|
223330
|
-
var i6 = e9.match(/\//) || nr && e9.match(/\\/) ? [""] : [...nr ? [process.cwd()] : [], ...(t7.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
223330
|
+
var i6 = e9.match(/\//) || nr && e9.match(/\\/) ? [""] : [...nr ? [process.cwd()] : [], ...(t7.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.HGvmcg7Ztz:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(r6)];
|
|
223331
223331
|
var n6 = nr ? t7.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
223332
223332
|
var a5 = nr ? n6.split(r6) : [""];
|
|
223333
223333
|
if (nr) {
|
|
@@ -226464,7 +226464,7 @@ ${whileRunning(e9)}`;
|
|
|
226464
226464
|
};
|
|
226465
226465
|
ni = Object.assign(async function _main() {
|
|
226466
226466
|
var e9 = new Cli({
|
|
226467
|
-
binaryVersion: "0.9.
|
|
226467
|
+
binaryVersion: "0.9.3",
|
|
226468
226468
|
binaryLabel: "gql.tada CLI",
|
|
226469
226469
|
binaryName: "gql.tada"
|
|
226470
226470
|
});
|
|
@@ -234964,7 +234964,7 @@ var require_which2 = __commonJS((exports, module) => {
|
|
|
234964
234964
|
const colon = opt2.colon || COLON;
|
|
234965
234965
|
const pathEnv = cmd2.match(/\//) || isWindows2 && cmd2.match(/\\/) ? [""] : [
|
|
234966
234966
|
...isWindows2 ? [process.cwd()] : [],
|
|
234967
|
-
...(opt2.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
234967
|
+
...(opt2.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.HGvmcg7Ztz:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(colon)
|
|
234968
234968
|
];
|
|
234969
234969
|
const pathExtExe = isWindows2 ? opt2.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
234970
234970
|
const pathExt = isWindows2 ? pathExtExe.split(colon) : [""];
|
|
@@ -256788,7 +256788,7 @@ ${error.stack}`));
|
|
|
256788
256788
|
var package_default = {
|
|
256789
256789
|
name: "@settlemint/sdk-cli",
|
|
256790
256790
|
description: "SettleMint SDK, integrate SettleMint into your application with ease.",
|
|
256791
|
-
version: "0.9.
|
|
256791
|
+
version: "0.9.3",
|
|
256792
256792
|
type: "module",
|
|
256793
256793
|
private: false,
|
|
256794
256794
|
license: "FSL-1.1-MIT",
|
|
@@ -256841,8 +256841,8 @@ var package_default = {
|
|
|
256841
256841
|
"@inquirer/input": "4.1.1",
|
|
256842
256842
|
"@inquirer/password": "4.0.4",
|
|
256843
256843
|
"@inquirer/select": "4.0.4",
|
|
256844
|
-
"@settlemint/sdk-js": "0.9.
|
|
256845
|
-
"@settlemint/sdk-utils": "0.9.
|
|
256844
|
+
"@settlemint/sdk-js": "0.9.3",
|
|
256845
|
+
"@settlemint/sdk-utils": "0.9.3",
|
|
256846
256846
|
"get-tsconfig": "4.8.1",
|
|
256847
256847
|
giget: "1.2.3"
|
|
256848
256848
|
},
|
|
@@ -272346,6 +272346,42 @@ var middlewareRestart = (gqlClient) => async (middlewareUniqueName) => {
|
|
|
272346
272346
|
});
|
|
272347
272347
|
return middleware;
|
|
272348
272348
|
};
|
|
272349
|
+
var getPlatformConfigQuery = graphql(`
|
|
272350
|
+
query platformConfig {
|
|
272351
|
+
config {
|
|
272352
|
+
smartContractSets {
|
|
272353
|
+
id
|
|
272354
|
+
sets {
|
|
272355
|
+
id
|
|
272356
|
+
name
|
|
272357
|
+
featureflagged
|
|
272358
|
+
image {
|
|
272359
|
+
repository
|
|
272360
|
+
tag
|
|
272361
|
+
registry
|
|
272362
|
+
}
|
|
272363
|
+
}
|
|
272364
|
+
}
|
|
272365
|
+
deploymentEngineTargets {
|
|
272366
|
+
id
|
|
272367
|
+
name
|
|
272368
|
+
disabled
|
|
272369
|
+
clusters {
|
|
272370
|
+
id
|
|
272371
|
+
name
|
|
272372
|
+
disabled
|
|
272373
|
+
}
|
|
272374
|
+
}
|
|
272375
|
+
preDeployedContracts
|
|
272376
|
+
}
|
|
272377
|
+
}
|
|
272378
|
+
`, []);
|
|
272379
|
+
var getPlatformConfig = (gqlClient) => {
|
|
272380
|
+
return async () => {
|
|
272381
|
+
const { config: config4 } = await gqlClient.request(getPlatformConfigQuery);
|
|
272382
|
+
return config4;
|
|
272383
|
+
};
|
|
272384
|
+
};
|
|
272349
272385
|
var PrivateKeyFragment = graphql(`
|
|
272350
272386
|
fragment PrivateKey on PrivateKey {
|
|
272351
272387
|
__typename
|
|
@@ -272545,6 +272581,9 @@ function createSettleMintClient(options) {
|
|
|
272545
272581
|
},
|
|
272546
272582
|
applicationAccessToken: {
|
|
272547
272583
|
create: applicationAccessTokenCreate(gqlClient)
|
|
272584
|
+
},
|
|
272585
|
+
platform: {
|
|
272586
|
+
config: getPlatformConfig(gqlClient)
|
|
272548
272587
|
}
|
|
272549
272588
|
};
|
|
272550
272589
|
}
|
|
@@ -274212,7 +274251,7 @@ function logoutCommand() {
|
|
|
274212
274251
|
|
|
274213
274252
|
// src/commands/platform/common/cluster-service.args.ts
|
|
274214
274253
|
function addClusterServiceArgs(cmd2) {
|
|
274215
|
-
return cmd2.requiredOption("--provider <provider>", "Network provider").requiredOption("--region <region>", "Deployment region").addOption(new Option("--size <size>", "Network size").choices(["CUSTOM", "LARGE", "MEDIUM", "SMALL"]).argParser((value4) => value4).default("SMALL")).addOption(new Option("--type <type>", "Network type").choices(["DEDICATED", "SHARED"]).argParser((value4) => value4).default("SHARED"));
|
|
274254
|
+
return cmd2.requiredOption("--provider <provider>", "Network provider (run `settlemint platform config` to see available providers)").requiredOption("--region <region>", "Deployment region (run `settlemint platform config` to see available regions)").addOption(new Option("--size <size>", "Network size").choices(["CUSTOM", "LARGE", "MEDIUM", "SMALL"]).argParser((value4) => value4).default("SMALL")).addOption(new Option("--type <type>", "Network type").choices(["DEDICATED", "SHARED"]).argParser((value4) => value4).default("SHARED"));
|
|
274216
274255
|
}
|
|
274217
274256
|
|
|
274218
274257
|
// src/utils/parse-number.ts
|
|
@@ -274245,7 +274284,7 @@ async function waitForCompletion({
|
|
|
274245
274284
|
restartIfTimeout = false
|
|
274246
274285
|
}) {
|
|
274247
274286
|
const serviceType = SETTLEMINT_CLIENT_MAP[type4];
|
|
274248
|
-
if (serviceType === "workspace" || serviceType === "application" || serviceType === "foundry" || serviceType === "applicationAccessToken") {
|
|
274287
|
+
if (serviceType === "workspace" || serviceType === "application" || serviceType === "foundry" || serviceType === "applicationAccessToken" || serviceType === "platform") {
|
|
274249
274288
|
return true;
|
|
274250
274289
|
}
|
|
274251
274290
|
const service = settlemint[serviceType];
|
|
@@ -274307,6 +274346,63 @@ function sanitizeCommandName(name2) {
|
|
|
274307
274346
|
return name2.split(" ").join("-").toLowerCase();
|
|
274308
274347
|
}
|
|
274309
274348
|
|
|
274349
|
+
// src/commands/platform/prompts/provider.prompt.ts
|
|
274350
|
+
async function providerPrompt(platformConfig, argument) {
|
|
274351
|
+
const possibleProviders = platformConfig.deploymentEngineTargets.filter((target) => !target.disabled);
|
|
274352
|
+
if (possibleProviders.length === 0) {
|
|
274353
|
+
cancel2("No providers found");
|
|
274354
|
+
}
|
|
274355
|
+
if (argument) {
|
|
274356
|
+
const selectedProvider = possibleProviders.find((target) => target.id === argument);
|
|
274357
|
+
if (!selectedProvider) {
|
|
274358
|
+
cancel2(`No provider found with id '${argument}'. Possible providers: '${possibleProviders.map((target) => target.id).sort().join(", ")}'`);
|
|
274359
|
+
}
|
|
274360
|
+
return selectedProvider;
|
|
274361
|
+
}
|
|
274362
|
+
if (possibleProviders.length === 1) {
|
|
274363
|
+
return possibleProviders[0];
|
|
274364
|
+
}
|
|
274365
|
+
const provider = await esm_default2({
|
|
274366
|
+
message: "Which provider do you want to use?",
|
|
274367
|
+
choices: platformConfig.deploymentEngineTargets.map((target) => ({
|
|
274368
|
+
name: target.name,
|
|
274369
|
+
value: target.id
|
|
274370
|
+
})).sort((a8, b4) => a8.name.localeCompare(b4.name))
|
|
274371
|
+
});
|
|
274372
|
+
return platformConfig.deploymentEngineTargets.find((target) => target.id === provider);
|
|
274373
|
+
}
|
|
274374
|
+
|
|
274375
|
+
// src/commands/platform/utils/cluster-region.ts
|
|
274376
|
+
function getRegionId(regionId) {
|
|
274377
|
+
return regionId.split("-")[1];
|
|
274378
|
+
}
|
|
274379
|
+
|
|
274380
|
+
// src/commands/platform/prompts/region.prompt.ts
|
|
274381
|
+
async function regionPrompt(provider, argument) {
|
|
274382
|
+
const possibleRegions = provider.clusters.filter((cluster) => !cluster.disabled).map((cluster) => ({ ...cluster, id: getRegionId(cluster.id) }));
|
|
274383
|
+
if (possibleRegions.length === 0) {
|
|
274384
|
+
cancel2("No regions found");
|
|
274385
|
+
}
|
|
274386
|
+
if (argument) {
|
|
274387
|
+
const selectedRegion = possibleRegions.find((cluster) => cluster.id === argument);
|
|
274388
|
+
if (!selectedRegion) {
|
|
274389
|
+
cancel2(`No region found with id '${argument}'. Possible regions: '${possibleRegions.map((cluster) => cluster.id).sort().join(", ")}'`);
|
|
274390
|
+
}
|
|
274391
|
+
return selectedRegion;
|
|
274392
|
+
}
|
|
274393
|
+
if (possibleRegions.length === 1) {
|
|
274394
|
+
return possibleRegions[0];
|
|
274395
|
+
}
|
|
274396
|
+
const region = await esm_default2({
|
|
274397
|
+
message: "Which region do you want to use?",
|
|
274398
|
+
choices: provider.clusters.map((cluster) => ({
|
|
274399
|
+
name: cluster.name,
|
|
274400
|
+
value: cluster.id
|
|
274401
|
+
})).sort((a8, b4) => a8.name.localeCompare(b4.name))
|
|
274402
|
+
});
|
|
274403
|
+
return provider.clusters.find((cluster) => cluster.id === region);
|
|
274404
|
+
}
|
|
274405
|
+
|
|
274310
274406
|
// src/commands/platform/common/create-command.ts
|
|
274311
274407
|
function getCreateCommand({
|
|
274312
274408
|
name: name2,
|
|
@@ -274321,7 +274417,7 @@ function getCreateCommand({
|
|
|
274321
274417
|
if (requiresDeployment) {
|
|
274322
274418
|
cmd2.option("-w, --wait", "Wait until deployed").option("-r, --restart-if-timeout", "Restart if wait time is exceeded");
|
|
274323
274419
|
}
|
|
274324
|
-
execute2(cmd2, async ({ acceptDefaults, prod, default: isDefault, wait, restartIfTimeout }, createFunction) => {
|
|
274420
|
+
execute2(cmd2, async ({ acceptDefaults, prod, default: isDefault, wait, restartIfTimeout, provider, region }, createFunction) => {
|
|
274325
274421
|
intro(`Creating ${type4} in the SettleMint platform`);
|
|
274326
274422
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274327
274423
|
const env2 = await loadEnv2(false, !!prod);
|
|
@@ -274335,6 +274431,17 @@ function getCreateCommand({
|
|
|
274335
274431
|
accessToken,
|
|
274336
274432
|
instance
|
|
274337
274433
|
});
|
|
274434
|
+
const platformConfig = await settlemint.platform.config();
|
|
274435
|
+
if (requiresDeployment) {
|
|
274436
|
+
const selectedProvider = await providerPrompt(platformConfig, provider);
|
|
274437
|
+
if (!selectedProvider) {
|
|
274438
|
+
cancel("No provider selected. Please select a provider to continue.");
|
|
274439
|
+
}
|
|
274440
|
+
const selectedRegion = await regionPrompt(selectedProvider, region);
|
|
274441
|
+
if (!selectedRegion) {
|
|
274442
|
+
cancel("No region selected. Please select a region to continue.");
|
|
274443
|
+
}
|
|
274444
|
+
}
|
|
274338
274445
|
const { result, waitFor, mapDefaultEnv } = await spinner({
|
|
274339
274446
|
startMessage: `Creating ${type4}`,
|
|
274340
274447
|
task: async () => {
|
|
@@ -274402,7 +274509,11 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274402
274509
|
type: type4,
|
|
274403
274510
|
...defaultArgs
|
|
274404
274511
|
}) => {
|
|
274405
|
-
return baseAction(
|
|
274512
|
+
return baseAction({
|
|
274513
|
+
...defaultArgs,
|
|
274514
|
+
provider,
|
|
274515
|
+
region
|
|
274516
|
+
}, async (settlemint, env2) => {
|
|
274406
274517
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274407
274518
|
const result = await settlemint.blockchainNetwork.create({
|
|
274408
274519
|
name: name2,
|
|
@@ -274774,7 +274885,12 @@ function blockchainNodeBesuCreateCommand() {
|
|
|
274774
274885
|
acceptDefaults,
|
|
274775
274886
|
...defaultArgs
|
|
274776
274887
|
}) => {
|
|
274777
|
-
return baseAction(
|
|
274888
|
+
return baseAction({
|
|
274889
|
+
...defaultArgs,
|
|
274890
|
+
acceptDefaults,
|
|
274891
|
+
provider,
|
|
274892
|
+
region
|
|
274893
|
+
}, async (settlemint, env2) => {
|
|
274778
274894
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274779
274895
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274780
274896
|
if (!applicationUniqueName) {
|
|
@@ -274842,7 +274958,11 @@ function blockscoutInsightsCreateCommand() {
|
|
|
274842
274958
|
alias: "bs",
|
|
274843
274959
|
execute: (cmd2, baseAction) => {
|
|
274844
274960
|
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--load-balancer <loadBalancer>", "Load Balancer unique name (mutually exclusive with blockchain-node)").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (mutually exclusive with load-balancer)").action(async (name2, { application, provider, region, size, type: type4, blockchainNode, loadBalancer, ...defaultArgs }) => {
|
|
274845
|
-
return baseAction(
|
|
274961
|
+
return baseAction({
|
|
274962
|
+
...defaultArgs,
|
|
274963
|
+
provider,
|
|
274964
|
+
region
|
|
274965
|
+
}, async (settlemint, env2) => {
|
|
274846
274966
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274847
274967
|
const blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
274848
274968
|
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
|
|
@@ -274898,7 +275018,11 @@ function hasuraIntegrationCreateCommand() {
|
|
|
274898
275018
|
alias: "ha",
|
|
274899
275019
|
execute: (cmd2, baseAction) => {
|
|
274900
275020
|
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
274901
|
-
return baseAction(
|
|
275021
|
+
return baseAction({
|
|
275022
|
+
...defaultArgs,
|
|
275023
|
+
provider,
|
|
275024
|
+
region
|
|
275025
|
+
}, async (settlemint, env2) => {
|
|
274902
275026
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274903
275027
|
const result = await settlemint.integrationTool.create({
|
|
274904
275028
|
name: name2,
|
|
@@ -274950,7 +275074,11 @@ function graphMiddlewareCreateCommand() {
|
|
|
274950
275074
|
alias: "gr",
|
|
274951
275075
|
execute: (cmd2, baseAction) => {
|
|
274952
275076
|
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
274953
|
-
return baseAction(
|
|
275077
|
+
return baseAction({
|
|
275078
|
+
...defaultArgs,
|
|
275079
|
+
provider,
|
|
275080
|
+
region
|
|
275081
|
+
}, async (settlemint, env2) => {
|
|
274954
275082
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274955
275083
|
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
274956
275084
|
const result = await settlemint.middleware.create({
|
|
@@ -274998,16 +275126,7 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
274998
275126
|
type: "middleware",
|
|
274999
275127
|
alias: "scp",
|
|
275000
275128
|
execute: (cmd2, baseAction) => {
|
|
275001
|
-
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--load-balancer <loadBalancer>", "Load Balancer unique name (mutually exclusive with blockchain-node)").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (mutually exclusive with load-balancer)").option("--abis <abis...>", "Path to abi file(s)").
|
|
275002
|
-
"Bond",
|
|
275003
|
-
"BondFactory",
|
|
275004
|
-
"CryptoCurrency",
|
|
275005
|
-
"CryptoCurrencyFactory",
|
|
275006
|
-
"Equity",
|
|
275007
|
-
"EquityFactory",
|
|
275008
|
-
"StableCoin",
|
|
275009
|
-
"StableCoinFactory"
|
|
275010
|
-
])).action(async (name2, {
|
|
275129
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--load-balancer <loadBalancer>", "Load Balancer unique name (mutually exclusive with blockchain-node)").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (mutually exclusive with load-balancer)").option("--abis <abis...>", "Path to abi file(s)").option("--include-predeployed-abis <includePredeployedAbis...>", "Include pre-deployed abis (run `settlemint platform config` to see available pre-deployed abis)").action(async (name2, {
|
|
275011
275130
|
application,
|
|
275012
275131
|
blockchainNode,
|
|
275013
275132
|
loadBalancer,
|
|
@@ -275019,7 +275138,11 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275019
275138
|
abis,
|
|
275020
275139
|
...defaultArgs
|
|
275021
275140
|
}) => {
|
|
275022
|
-
return baseAction(
|
|
275141
|
+
return baseAction({
|
|
275142
|
+
...defaultArgs,
|
|
275143
|
+
provider,
|
|
275144
|
+
region
|
|
275145
|
+
}, async (settlemint, env2) => {
|
|
275023
275146
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275024
275147
|
const blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275025
275148
|
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
|
|
@@ -275037,6 +275160,13 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275037
275160
|
cancel2(`Failed to read or parse ABI file: ${error5.message}`);
|
|
275038
275161
|
}
|
|
275039
275162
|
}
|
|
275163
|
+
if (includePredeployedAbis && includePredeployedAbis.length > 0) {
|
|
275164
|
+
const platformConfig = await settlemint.platform.config();
|
|
275165
|
+
const invalidPredeployedAbis = includePredeployedAbis.filter((abi) => !platformConfig.preDeployedContracts.some((contract) => contract === abi));
|
|
275166
|
+
if (invalidPredeployedAbis.length > 0) {
|
|
275167
|
+
cancel2(`Invalid pre-deployed abis: '${invalidPredeployedAbis.join(", ")}'. Possible values: '${platformConfig.preDeployedContracts.sort().join(", ")}'`);
|
|
275168
|
+
}
|
|
275169
|
+
}
|
|
275040
275170
|
const result = await settlemint.middleware.create({
|
|
275041
275171
|
name: name2,
|
|
275042
275172
|
applicationUniqueName,
|
|
@@ -275089,7 +275219,11 @@ function privateKeyHdCreateCommand() {
|
|
|
275089
275219
|
alias: "hd",
|
|
275090
275220
|
execute: (cmd2, baseAction) => {
|
|
275091
275221
|
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275092
|
-
return baseAction(
|
|
275222
|
+
return baseAction({
|
|
275223
|
+
...defaultArgs,
|
|
275224
|
+
provider,
|
|
275225
|
+
region
|
|
275226
|
+
}, async (settlemint, env2) => {
|
|
275093
275227
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275094
275228
|
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275095
275229
|
const result = await settlemint.privateKey.create({
|
|
@@ -275139,7 +275273,11 @@ function privateKeyHsmCreateCommand() {
|
|
|
275139
275273
|
alias: "hd",
|
|
275140
275274
|
execute: (cmd2, baseAction) => {
|
|
275141
275275
|
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275142
|
-
return baseAction(
|
|
275276
|
+
return baseAction({
|
|
275277
|
+
...defaultArgs,
|
|
275278
|
+
provider,
|
|
275279
|
+
region
|
|
275280
|
+
}, async (settlemint, env2) => {
|
|
275143
275281
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275144
275282
|
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275145
275283
|
const result = await settlemint.privateKey.create({
|
|
@@ -275188,7 +275326,11 @@ function ipfsStorageCreateCommand() {
|
|
|
275188
275326
|
alias: "ip",
|
|
275189
275327
|
execute: (cmd2, baseAction) => {
|
|
275190
275328
|
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275191
|
-
return baseAction(
|
|
275329
|
+
return baseAction({
|
|
275330
|
+
...defaultArgs,
|
|
275331
|
+
provider,
|
|
275332
|
+
region
|
|
275333
|
+
}, async (settlemint, env2) => {
|
|
275192
275334
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275193
275335
|
const result = await settlemint.storage.create({
|
|
275194
275336
|
name: name2,
|
|
@@ -275233,7 +275375,11 @@ function minioStorageCreateCommand() {
|
|
|
275233
275375
|
alias: "m",
|
|
275234
275376
|
execute: (cmd2, baseAction) => {
|
|
275235
275377
|
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275236
|
-
return baseAction(
|
|
275378
|
+
return baseAction({
|
|
275379
|
+
...defaultArgs,
|
|
275380
|
+
provider,
|
|
275381
|
+
region
|
|
275382
|
+
}, async (settlemint, env2) => {
|
|
275237
275383
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275238
275384
|
const result = await settlemint.storage.create({
|
|
275239
275385
|
name: name2,
|
|
@@ -275651,211 +275797,96 @@ function updateCommand() {
|
|
|
275651
275797
|
return new Command("update").alias("u").description("Update a resource in the SettleMint platform").addCommand(customDeploymentsUpdateCommand());
|
|
275652
275798
|
}
|
|
275653
275799
|
|
|
275800
|
+
// src/commands/platform/config.ts
|
|
275801
|
+
function configCommand() {
|
|
275802
|
+
return new Command("config").alias("c").description("Get platform configuration").option("--prod", "Connect to your production environment").action(async ({ prod }) => {
|
|
275803
|
+
intro("Getting platform configuration");
|
|
275804
|
+
const env2 = await loadEnv2(false, !!prod);
|
|
275805
|
+
const instance = await instancePrompt(env2, true);
|
|
275806
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275807
|
+
env: env2,
|
|
275808
|
+
instance,
|
|
275809
|
+
prefer: "personal"
|
|
275810
|
+
});
|
|
275811
|
+
const settlemint = createSettleMintClient({
|
|
275812
|
+
accessToken,
|
|
275813
|
+
instance
|
|
275814
|
+
});
|
|
275815
|
+
const platformConfig = await settlemint.platform.config();
|
|
275816
|
+
note2(`Providers and regions:
|
|
275817
|
+
${platformConfig.deploymentEngineTargets.filter((provider) => !provider.disabled).map((provider) => `• ${provider.id}
|
|
275818
|
+
${provider.clusters.filter((cluster) => !cluster.disabled).map((region) => `• ${getRegionId(region.id)}`).sort().join(`
|
|
275819
|
+
`)}`).sort().join(`
|
|
275820
|
+
`)}`);
|
|
275821
|
+
note2(`Use cases (Smart Contract Sets):
|
|
275822
|
+
• ${platformConfig.smartContractSets.sets.filter((useCase) => !useCase.featureflagged).map((useCase) => useCase.id).sort().join(`
|
|
275823
|
+
• `)}`);
|
|
275824
|
+
note2(`Pre-deployed abis (Smart Contract Portal):
|
|
275825
|
+
• ${platformConfig.preDeployedContracts.sort().join(`
|
|
275826
|
+
• `)}`);
|
|
275827
|
+
outro("Platform configuration retrieved");
|
|
275828
|
+
});
|
|
275829
|
+
}
|
|
275830
|
+
|
|
275654
275831
|
// src/commands/platform.ts
|
|
275655
275832
|
function platformCommand() {
|
|
275656
|
-
return new Command("platform").description("Manage SettleMint platform resources").addCommand(createCommand3()).addCommand(updateCommand()).addCommand(deleteCommand()).addCommand(restartCommand());
|
|
275833
|
+
return new Command("platform").description("Manage SettleMint platform resources").addCommand(configCommand()).addCommand(createCommand3()).addCommand(updateCommand()).addCommand(deleteCommand()).addCommand(restartCommand());
|
|
275657
275834
|
}
|
|
275658
275835
|
|
|
275659
275836
|
// src/commands/smart-contract-set/create.ts
|
|
275660
275837
|
import { rmdir } from "node:fs/promises";
|
|
275661
275838
|
import { join as join8 } from "node:path";
|
|
275662
275839
|
|
|
275663
|
-
// src/constants/smart-contract-sets.ts
|
|
275664
|
-
var SMART_CONTRACT_SET_DETAILS = [
|
|
275665
|
-
{
|
|
275666
|
-
id: "solidity-empty",
|
|
275667
|
-
name: "Empty",
|
|
275668
|
-
image: {
|
|
275669
|
-
registry: "ghcr.io",
|
|
275670
|
-
repository: "settlemint/solidity-empty",
|
|
275671
|
-
tag: "7.7.7"
|
|
275672
|
-
}
|
|
275673
|
-
},
|
|
275674
|
-
{
|
|
275675
|
-
id: "solidity-token-erc20",
|
|
275676
|
-
name: "ERC20 token",
|
|
275677
|
-
image: {
|
|
275678
|
-
registry: "ghcr.io",
|
|
275679
|
-
repository: "settlemint/solidity-token-erc20",
|
|
275680
|
-
tag: "7.7.7"
|
|
275681
|
-
}
|
|
275682
|
-
},
|
|
275683
|
-
{
|
|
275684
|
-
id: "solidity-token-erc1155",
|
|
275685
|
-
name: "ERC1155 token",
|
|
275686
|
-
image: {
|
|
275687
|
-
registry: "ghcr.io",
|
|
275688
|
-
repository: "settlemint/solidity-token-erc1155",
|
|
275689
|
-
tag: "7.7.7"
|
|
275690
|
-
}
|
|
275691
|
-
},
|
|
275692
|
-
{
|
|
275693
|
-
id: "solidity-token-erc20-metatx",
|
|
275694
|
-
name: "ERC20 token with MetaTx",
|
|
275695
|
-
image: {
|
|
275696
|
-
registry: "ghcr.io",
|
|
275697
|
-
repository: "settlemint/solidity-token-erc20-metatx",
|
|
275698
|
-
tag: "7.7.7"
|
|
275699
|
-
}
|
|
275700
|
-
},
|
|
275701
|
-
{
|
|
275702
|
-
id: "solidity-supplychain",
|
|
275703
|
-
name: "Supplychain",
|
|
275704
|
-
image: {
|
|
275705
|
-
registry: "ghcr.io",
|
|
275706
|
-
repository: "settlemint/solidity-supplychain",
|
|
275707
|
-
tag: "7.7.7"
|
|
275708
|
-
}
|
|
275709
|
-
},
|
|
275710
|
-
{
|
|
275711
|
-
id: "chaincode-ts-empty",
|
|
275712
|
-
name: "Empty typescript",
|
|
275713
|
-
image: {
|
|
275714
|
-
registry: "ghcr.io",
|
|
275715
|
-
repository: "settlemint/chaincode-typescript-empty",
|
|
275716
|
-
tag: "7.0.13"
|
|
275717
|
-
}
|
|
275718
|
-
},
|
|
275719
|
-
{
|
|
275720
|
-
id: "chaincode-ts-empty-pdc",
|
|
275721
|
-
name: "Empty typescript with PDC",
|
|
275722
|
-
image: {
|
|
275723
|
-
registry: "ghcr.io",
|
|
275724
|
-
repository: "settlemint/chaincode-typescript-empty-pdc",
|
|
275725
|
-
tag: "7.0.1"
|
|
275726
|
-
}
|
|
275727
|
-
},
|
|
275728
|
-
{
|
|
275729
|
-
id: "chaincode-go-empty",
|
|
275730
|
-
name: "Empty go",
|
|
275731
|
-
image: {
|
|
275732
|
-
registry: "ghcr.io",
|
|
275733
|
-
repository: "settlemint/chaincode-go-empty",
|
|
275734
|
-
tag: "7.0.5"
|
|
275735
|
-
}
|
|
275736
|
-
},
|
|
275737
|
-
{
|
|
275738
|
-
id: "solidity-statemachine",
|
|
275739
|
-
name: "State Machine",
|
|
275740
|
-
image: {
|
|
275741
|
-
registry: "ghcr.io",
|
|
275742
|
-
repository: "settlemint/solidity-statemachine",
|
|
275743
|
-
tag: "7.7.7"
|
|
275744
|
-
}
|
|
275745
|
-
},
|
|
275746
|
-
{
|
|
275747
|
-
id: "solidity-token-erc20-crowdsale",
|
|
275748
|
-
name: "ERC20 token with crowdsale mechanism",
|
|
275749
|
-
image: {
|
|
275750
|
-
registry: "ghcr.io",
|
|
275751
|
-
repository: "settlemint/solidity-token-erc20-crowdsale",
|
|
275752
|
-
tag: "7.7.7"
|
|
275753
|
-
}
|
|
275754
|
-
},
|
|
275755
|
-
{
|
|
275756
|
-
id: "solidity-token-erc721",
|
|
275757
|
-
name: "ERC721",
|
|
275758
|
-
image: {
|
|
275759
|
-
registry: "ghcr.io",
|
|
275760
|
-
repository: "settlemint/solidity-token-erc721",
|
|
275761
|
-
tag: "7.7.7"
|
|
275762
|
-
}
|
|
275763
|
-
},
|
|
275764
|
-
{
|
|
275765
|
-
id: "solidity-token-erc721a",
|
|
275766
|
-
name: "ERC721a",
|
|
275767
|
-
image: {
|
|
275768
|
-
registry: "ghcr.io",
|
|
275769
|
-
repository: "settlemint/solidity-token-erc721a",
|
|
275770
|
-
tag: "7.7.7"
|
|
275771
|
-
}
|
|
275772
|
-
},
|
|
275773
|
-
{
|
|
275774
|
-
id: "solidity-token-erc721-generative-art",
|
|
275775
|
-
name: "ERC721 Generative Art",
|
|
275776
|
-
image: {
|
|
275777
|
-
registry: "ghcr.io",
|
|
275778
|
-
repository: "settlemint/solidity-token-erc721-generative-art",
|
|
275779
|
-
tag: "7.7.7"
|
|
275780
|
-
}
|
|
275781
|
-
},
|
|
275782
|
-
{
|
|
275783
|
-
id: "solidity-token-soulbound",
|
|
275784
|
-
name: "Soulbound Token",
|
|
275785
|
-
image: {
|
|
275786
|
-
registry: "ghcr.io",
|
|
275787
|
-
repository: "settlemint/solidity-token-soulbound",
|
|
275788
|
-
tag: "7.7.7"
|
|
275789
|
-
}
|
|
275790
|
-
},
|
|
275791
|
-
{
|
|
275792
|
-
id: "solidity-diamond-bond",
|
|
275793
|
-
name: "Diamond bond",
|
|
275794
|
-
image: {
|
|
275795
|
-
registry: "ghcr.io",
|
|
275796
|
-
repository: "settlemint/solidity-diamond-bond",
|
|
275797
|
-
tag: "7.7.7"
|
|
275798
|
-
}
|
|
275799
|
-
},
|
|
275800
|
-
{
|
|
275801
|
-
id: "solidity-attestation-service",
|
|
275802
|
-
name: "Attestation Service",
|
|
275803
|
-
image: {
|
|
275804
|
-
registry: "ghcr.io",
|
|
275805
|
-
repository: "settlemint/solidity-attestation-service",
|
|
275806
|
-
tag: "7.7.7"
|
|
275807
|
-
}
|
|
275808
|
-
},
|
|
275809
|
-
{
|
|
275810
|
-
id: "solidity-zeto",
|
|
275811
|
-
name: "Zeto",
|
|
275812
|
-
featureflagged: true,
|
|
275813
|
-
image: {
|
|
275814
|
-
registry: "ghcr.io",
|
|
275815
|
-
repository: "settlemint/solidity-zeto",
|
|
275816
|
-
tag: "7.7.7"
|
|
275817
|
-
}
|
|
275818
|
-
},
|
|
275819
|
-
{
|
|
275820
|
-
id: "solidity-starterkit",
|
|
275821
|
-
name: "Starterkit",
|
|
275822
|
-
featureflagged: true,
|
|
275823
|
-
image: {
|
|
275824
|
-
registry: "ghcr.io",
|
|
275825
|
-
repository: "settlemint/solidity-predeployed",
|
|
275826
|
-
tag: "7.7.7"
|
|
275827
|
-
}
|
|
275828
|
-
}
|
|
275829
|
-
];
|
|
275830
|
-
var SMART_CONTRACT_SETS = SMART_CONTRACT_SET_DETAILS.map((set) => set.id);
|
|
275831
|
-
|
|
275832
275840
|
// src/commands/smart-contract-set/prompts/use-case.prompt.ts
|
|
275833
|
-
async function useCasePrompt(argument) {
|
|
275834
|
-
if (
|
|
275841
|
+
async function useCasePrompt(platformConfig, argument) {
|
|
275842
|
+
if (platformConfig.smartContractSets.sets.length === 0) {
|
|
275835
275843
|
cancel2("No use cases found");
|
|
275836
275844
|
}
|
|
275845
|
+
const useCasesNotFeatureFlagged = platformConfig.smartContractSets.sets.filter((set) => !set.featureflagged);
|
|
275837
275846
|
if (argument) {
|
|
275838
|
-
|
|
275839
|
-
|
|
275847
|
+
const selectedUseCase = platformConfig.smartContractSets.sets.find((set) => set.id === argument);
|
|
275848
|
+
if (!selectedUseCase) {
|
|
275849
|
+
cancel2(`No use case found with id '${argument}'. Possible use cases: '${useCasesNotFeatureFlagged.map((set) => set.id).sort().join(", ")}'`);
|
|
275840
275850
|
}
|
|
275841
|
-
return
|
|
275851
|
+
return selectedUseCase;
|
|
275852
|
+
}
|
|
275853
|
+
if (useCasesNotFeatureFlagged.length === 0) {
|
|
275854
|
+
cancel2("No use cases found");
|
|
275855
|
+
}
|
|
275856
|
+
if (useCasesNotFeatureFlagged.length === 1) {
|
|
275857
|
+
return useCasesNotFeatureFlagged[0];
|
|
275842
275858
|
}
|
|
275843
275859
|
const useCase = await esm_default2({
|
|
275844
275860
|
message: "Which use case do you want to use?",
|
|
275845
|
-
choices:
|
|
275846
|
-
name: useCase2,
|
|
275847
|
-
value: useCase2
|
|
275848
|
-
}))
|
|
275861
|
+
choices: useCasesNotFeatureFlagged.map((useCase2) => ({
|
|
275862
|
+
name: useCase2.name,
|
|
275863
|
+
value: useCase2.id
|
|
275864
|
+
})).sort((a8, b4) => a8.name.localeCompare(b4.name))
|
|
275849
275865
|
});
|
|
275850
|
-
return useCase;
|
|
275866
|
+
return platformConfig.smartContractSets.sets.find((set) => set.id === useCase);
|
|
275851
275867
|
}
|
|
275852
275868
|
|
|
275853
275869
|
// src/commands/smart-contract-set/create.ts
|
|
275854
275870
|
function createCommand4() {
|
|
275855
|
-
return new Command("create").description("Bootstrap your smart contract set").option("-n, --project-name <name>", "The name for your smart contract set project").
|
|
275871
|
+
return new Command("create").description("Bootstrap your smart contract set").option("-n, --project-name <name>", "The name for your smart contract set project").option("--use-case <useCase>", "Use case for the smart contract set (run `settlemint platform config` to see available use cases)").option("--prod", "Connect to your production environment").action(async ({ projectName, useCase, prod }) => {
|
|
275856
275872
|
intro("Creating a new smart contract set");
|
|
275857
275873
|
const env2 = await loadEnv2(false, !!prod);
|
|
275858
275874
|
const name2 = await namePrompt(env2, projectName);
|
|
275875
|
+
const instance = await instancePrompt(env2, true);
|
|
275876
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275877
|
+
env: env2,
|
|
275878
|
+
instance,
|
|
275879
|
+
prefer: "personal"
|
|
275880
|
+
});
|
|
275881
|
+
const settlemint = createSettleMintClient({
|
|
275882
|
+
accessToken,
|
|
275883
|
+
instance
|
|
275884
|
+
});
|
|
275885
|
+
const platformConfig = await settlemint.platform.config();
|
|
275886
|
+
const selectedUseCase = await useCasePrompt(platformConfig, useCase);
|
|
275887
|
+
if (!selectedUseCase) {
|
|
275888
|
+
cancel("No use case selected. Please select a use case to continue.");
|
|
275889
|
+
}
|
|
275859
275890
|
const targetDir = formatTargetDir(name2);
|
|
275860
275891
|
const projectDir = join8(process.cwd(), targetDir);
|
|
275861
275892
|
if (await exists2(projectDir) && !await isEmpty(projectDir)) {
|
|
@@ -275868,24 +275899,16 @@ function createCommand4() {
|
|
|
275868
275899
|
}
|
|
275869
275900
|
await rmdir(projectDir, { recursive: true });
|
|
275870
275901
|
}
|
|
275871
|
-
const selectedUseCase = await useCasePrompt(useCase);
|
|
275872
|
-
if (!selectedUseCase) {
|
|
275873
|
-
cancel("No use case selected. Please select a use case to continue.");
|
|
275874
|
-
}
|
|
275875
275902
|
await spinner({
|
|
275876
275903
|
startMessage: "Scaffolding the smart contract set",
|
|
275877
275904
|
task: async () => {
|
|
275878
|
-
const smartContractSet = SMART_CONTRACT_SET_DETAILS.find((set) => set.id === selectedUseCase);
|
|
275879
|
-
if (!smartContractSet) {
|
|
275880
|
-
throw new Error(`No smart contract set found for use case ${selectedUseCase}`);
|
|
275881
|
-
}
|
|
275882
275905
|
await executeCommand("forge", [
|
|
275883
275906
|
"init",
|
|
275884
275907
|
name2,
|
|
275885
275908
|
"--template",
|
|
275886
|
-
|
|
275909
|
+
selectedUseCase.image.repository,
|
|
275887
275910
|
"--branch",
|
|
275888
|
-
`v${
|
|
275911
|
+
`v${selectedUseCase.image.tag}`
|
|
275889
275912
|
]);
|
|
275890
275913
|
await setName(name2, projectDir);
|
|
275891
275914
|
},
|
|
@@ -276714,4 +276737,4 @@ function sdkCliCommand(exitOverride = undefined) {
|
|
|
276714
276737
|
ascii();
|
|
276715
276738
|
sdkCliCommand();
|
|
276716
276739
|
|
|
276717
|
-
//# debugId=
|
|
276740
|
+
//# debugId=CC8E8C9DA3E788F064756E2164756E21
|