@settlemint/sdk-cli 0.9.1 → 0.9.2-pr4b1bd07d
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 +251 -223
- 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.SC5WTOm6kq:/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.SC5WTOm6kq:/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.SC5WTOm6kq:/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.SC5WTOm6kq:/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.2-pr4b1bd07d",
|
|
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.SC5WTOm6kq:/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.2-pr4b1bd07d",
|
|
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.2-pr4b1bd07d",
|
|
256845
|
+
"@settlemint/sdk-utils": "0.9.2-pr4b1bd07d",
|
|
256846
256846
|
"get-tsconfig": "4.8.1",
|
|
256847
256847
|
giget: "1.2.3"
|
|
256848
256848
|
},
|
|
@@ -272346,6 +272346,37 @@ 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
|
+
}
|
|
272359
|
+
}
|
|
272360
|
+
deploymentEngineTargets {
|
|
272361
|
+
id
|
|
272362
|
+
name
|
|
272363
|
+
disabled
|
|
272364
|
+
clusters {
|
|
272365
|
+
id
|
|
272366
|
+
name
|
|
272367
|
+
disabled
|
|
272368
|
+
}
|
|
272369
|
+
}
|
|
272370
|
+
preDeployedContracts
|
|
272371
|
+
}
|
|
272372
|
+
}
|
|
272373
|
+
`, []);
|
|
272374
|
+
var getPlatformConfig = (gqlClient) => {
|
|
272375
|
+
return async () => {
|
|
272376
|
+
const { config: config4 } = await gqlClient.request(getPlatformConfigQuery);
|
|
272377
|
+
return config4;
|
|
272378
|
+
};
|
|
272379
|
+
};
|
|
272349
272380
|
var PrivateKeyFragment = graphql(`
|
|
272350
272381
|
fragment PrivateKey on PrivateKey {
|
|
272351
272382
|
__typename
|
|
@@ -272545,6 +272576,9 @@ function createSettleMintClient(options) {
|
|
|
272545
272576
|
},
|
|
272546
272577
|
applicationAccessToken: {
|
|
272547
272578
|
create: applicationAccessTokenCreate(gqlClient)
|
|
272579
|
+
},
|
|
272580
|
+
platform: {
|
|
272581
|
+
config: getPlatformConfig(gqlClient)
|
|
272548
272582
|
}
|
|
272549
272583
|
};
|
|
272550
272584
|
}
|
|
@@ -274212,7 +274246,7 @@ function logoutCommand() {
|
|
|
274212
274246
|
|
|
274213
274247
|
// src/commands/platform/common/cluster-service.args.ts
|
|
274214
274248
|
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"));
|
|
274249
|
+
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
274250
|
}
|
|
274217
274251
|
|
|
274218
274252
|
// src/utils/parse-number.ts
|
|
@@ -274245,7 +274279,7 @@ async function waitForCompletion({
|
|
|
274245
274279
|
restartIfTimeout = false
|
|
274246
274280
|
}) {
|
|
274247
274281
|
const serviceType = SETTLEMINT_CLIENT_MAP[type4];
|
|
274248
|
-
if (serviceType === "workspace" || serviceType === "application" || serviceType === "foundry" || serviceType === "applicationAccessToken") {
|
|
274282
|
+
if (serviceType === "workspace" || serviceType === "application" || serviceType === "foundry" || serviceType === "applicationAccessToken" || serviceType === "platform") {
|
|
274249
274283
|
return true;
|
|
274250
274284
|
}
|
|
274251
274285
|
const service = settlemint[serviceType];
|
|
@@ -274307,6 +274341,63 @@ function sanitizeCommandName(name2) {
|
|
|
274307
274341
|
return name2.split(" ").join("-").toLowerCase();
|
|
274308
274342
|
}
|
|
274309
274343
|
|
|
274344
|
+
// src/commands/platform/prompts/provider.prompt.ts
|
|
274345
|
+
async function providerPrompt(platformConfig, argument) {
|
|
274346
|
+
const possibleProviders = platformConfig.deploymentEngineTargets.filter((target) => !target.disabled);
|
|
274347
|
+
if (possibleProviders.length === 0) {
|
|
274348
|
+
cancel2("No providers found");
|
|
274349
|
+
}
|
|
274350
|
+
if (argument) {
|
|
274351
|
+
const selectedProvider = platformConfig.deploymentEngineTargets.find((target) => target.id === argument);
|
|
274352
|
+
if (!selectedProvider) {
|
|
274353
|
+
cancel2(`No provider found with id '${argument}'. Possible providers: '${possibleProviders.map((target) => target.id).sort().join(", ")}'`);
|
|
274354
|
+
}
|
|
274355
|
+
return selectedProvider;
|
|
274356
|
+
}
|
|
274357
|
+
if (possibleProviders.length === 1) {
|
|
274358
|
+
return possibleProviders[0];
|
|
274359
|
+
}
|
|
274360
|
+
const provider = await esm_default2({
|
|
274361
|
+
message: "Which provider do you want to use?",
|
|
274362
|
+
choices: platformConfig.deploymentEngineTargets.map((target) => ({
|
|
274363
|
+
name: target.name,
|
|
274364
|
+
value: target.id
|
|
274365
|
+
}))
|
|
274366
|
+
});
|
|
274367
|
+
return platformConfig.deploymentEngineTargets.find((target) => target.id === provider);
|
|
274368
|
+
}
|
|
274369
|
+
|
|
274370
|
+
// src/commands/platform/utils/cluster-region.ts
|
|
274371
|
+
function getRegionId(regionId) {
|
|
274372
|
+
return regionId.split("-")[1];
|
|
274373
|
+
}
|
|
274374
|
+
|
|
274375
|
+
// src/commands/platform/prompts/region.prompt.ts
|
|
274376
|
+
async function regionPrompt(provider, argument) {
|
|
274377
|
+
const possibleRegions = provider.clusters.filter((cluster) => !cluster.disabled).map((cluster) => ({ ...cluster, id: getRegionId(cluster.id) }));
|
|
274378
|
+
if (possibleRegions.length === 0) {
|
|
274379
|
+
cancel2("No regions found");
|
|
274380
|
+
}
|
|
274381
|
+
if (argument) {
|
|
274382
|
+
const selectedRegion = possibleRegions.find((cluster) => cluster.id === argument);
|
|
274383
|
+
if (!selectedRegion) {
|
|
274384
|
+
cancel2(`No region found with id '${argument}'. Possible regions: '${possibleRegions.map((cluster) => cluster.id).sort().join(", ")}'`);
|
|
274385
|
+
}
|
|
274386
|
+
return selectedRegion;
|
|
274387
|
+
}
|
|
274388
|
+
if (possibleRegions.length === 1) {
|
|
274389
|
+
return possibleRegions[0];
|
|
274390
|
+
}
|
|
274391
|
+
const region = await esm_default2({
|
|
274392
|
+
message: "Which region do you want to use?",
|
|
274393
|
+
choices: provider.clusters.map((cluster) => ({
|
|
274394
|
+
name: cluster.name,
|
|
274395
|
+
value: cluster.id
|
|
274396
|
+
}))
|
|
274397
|
+
});
|
|
274398
|
+
return provider.clusters.find((cluster) => cluster.id === region);
|
|
274399
|
+
}
|
|
274400
|
+
|
|
274310
274401
|
// src/commands/platform/common/create-command.ts
|
|
274311
274402
|
function getCreateCommand({
|
|
274312
274403
|
name: name2,
|
|
@@ -274321,7 +274412,7 @@ function getCreateCommand({
|
|
|
274321
274412
|
if (requiresDeployment) {
|
|
274322
274413
|
cmd2.option("-w, --wait", "Wait until deployed").option("-r, --restart-if-timeout", "Restart if wait time is exceeded");
|
|
274323
274414
|
}
|
|
274324
|
-
execute2(cmd2, async ({ acceptDefaults, prod, default: isDefault, wait, restartIfTimeout }, createFunction) => {
|
|
274415
|
+
execute2(cmd2, async ({ acceptDefaults, prod, default: isDefault, wait, restartIfTimeout, provider, region }, createFunction) => {
|
|
274325
274416
|
intro(`Creating ${type4} in the SettleMint platform`);
|
|
274326
274417
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274327
274418
|
const env2 = await loadEnv2(false, !!prod);
|
|
@@ -274335,6 +274426,17 @@ function getCreateCommand({
|
|
|
274335
274426
|
accessToken,
|
|
274336
274427
|
instance
|
|
274337
274428
|
});
|
|
274429
|
+
const platformConfig = await settlemint.platform.config();
|
|
274430
|
+
if (requiresDeployment) {
|
|
274431
|
+
const selectedProvider = await providerPrompt(platformConfig, provider);
|
|
274432
|
+
if (!selectedProvider) {
|
|
274433
|
+
cancel("No provider selected. Please select a provider to continue.");
|
|
274434
|
+
}
|
|
274435
|
+
const selectedRegion = await regionPrompt(selectedProvider, region);
|
|
274436
|
+
if (!selectedRegion) {
|
|
274437
|
+
cancel("No region selected. Please select a region to continue.");
|
|
274438
|
+
}
|
|
274439
|
+
}
|
|
274338
274440
|
const { result, waitFor, mapDefaultEnv } = await spinner({
|
|
274339
274441
|
startMessage: `Creating ${type4}`,
|
|
274340
274442
|
task: async () => {
|
|
@@ -274402,7 +274504,11 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274402
274504
|
type: type4,
|
|
274403
274505
|
...defaultArgs
|
|
274404
274506
|
}) => {
|
|
274405
|
-
return baseAction(
|
|
274507
|
+
return baseAction({
|
|
274508
|
+
...defaultArgs,
|
|
274509
|
+
provider,
|
|
274510
|
+
region
|
|
274511
|
+
}, async (settlemint, env2) => {
|
|
274406
274512
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274407
274513
|
const result = await settlemint.blockchainNetwork.create({
|
|
274408
274514
|
name: name2,
|
|
@@ -274774,7 +274880,12 @@ function blockchainNodeBesuCreateCommand() {
|
|
|
274774
274880
|
acceptDefaults,
|
|
274775
274881
|
...defaultArgs
|
|
274776
274882
|
}) => {
|
|
274777
|
-
return baseAction(
|
|
274883
|
+
return baseAction({
|
|
274884
|
+
...defaultArgs,
|
|
274885
|
+
acceptDefaults,
|
|
274886
|
+
provider,
|
|
274887
|
+
region
|
|
274888
|
+
}, async (settlemint, env2) => {
|
|
274778
274889
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274779
274890
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274780
274891
|
if (!applicationUniqueName) {
|
|
@@ -274842,7 +274953,11 @@ function blockscoutInsightsCreateCommand() {
|
|
|
274842
274953
|
alias: "bs",
|
|
274843
274954
|
execute: (cmd2, baseAction) => {
|
|
274844
274955
|
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(
|
|
274956
|
+
return baseAction({
|
|
274957
|
+
...defaultArgs,
|
|
274958
|
+
provider,
|
|
274959
|
+
region
|
|
274960
|
+
}, async (settlemint, env2) => {
|
|
274846
274961
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274847
274962
|
const blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
274848
274963
|
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
|
|
@@ -274898,7 +275013,11 @@ function hasuraIntegrationCreateCommand() {
|
|
|
274898
275013
|
alias: "ha",
|
|
274899
275014
|
execute: (cmd2, baseAction) => {
|
|
274900
275015
|
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
274901
|
-
return baseAction(
|
|
275016
|
+
return baseAction({
|
|
275017
|
+
...defaultArgs,
|
|
275018
|
+
provider,
|
|
275019
|
+
region
|
|
275020
|
+
}, async (settlemint, env2) => {
|
|
274902
275021
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274903
275022
|
const result = await settlemint.integrationTool.create({
|
|
274904
275023
|
name: name2,
|
|
@@ -274950,7 +275069,11 @@ function graphMiddlewareCreateCommand() {
|
|
|
274950
275069
|
alias: "gr",
|
|
274951
275070
|
execute: (cmd2, baseAction) => {
|
|
274952
275071
|
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(
|
|
275072
|
+
return baseAction({
|
|
275073
|
+
...defaultArgs,
|
|
275074
|
+
provider,
|
|
275075
|
+
region
|
|
275076
|
+
}, async (settlemint, env2) => {
|
|
274954
275077
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274955
275078
|
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
274956
275079
|
const result = await settlemint.middleware.create({
|
|
@@ -274998,16 +275121,7 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
274998
275121
|
type: "middleware",
|
|
274999
275122
|
alias: "scp",
|
|
275000
275123
|
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, {
|
|
275124
|
+
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
275125
|
application,
|
|
275012
275126
|
blockchainNode,
|
|
275013
275127
|
loadBalancer,
|
|
@@ -275019,7 +275133,11 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275019
275133
|
abis,
|
|
275020
275134
|
...defaultArgs
|
|
275021
275135
|
}) => {
|
|
275022
|
-
return baseAction(
|
|
275136
|
+
return baseAction({
|
|
275137
|
+
...defaultArgs,
|
|
275138
|
+
provider,
|
|
275139
|
+
region
|
|
275140
|
+
}, async (settlemint, env2) => {
|
|
275023
275141
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275024
275142
|
const blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275025
275143
|
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
|
|
@@ -275037,6 +275155,23 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275037
275155
|
cancel2(`Failed to read or parse ABI file: ${error5.message}`);
|
|
275038
275156
|
}
|
|
275039
275157
|
}
|
|
275158
|
+
if (includePredeployedAbis && includePredeployedAbis.length > 0) {
|
|
275159
|
+
const instance = await instancePrompt(env2, true);
|
|
275160
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275161
|
+
env: env2,
|
|
275162
|
+
instance,
|
|
275163
|
+
prefer: "personal"
|
|
275164
|
+
});
|
|
275165
|
+
const settlemint2 = createSettleMintClient({
|
|
275166
|
+
accessToken,
|
|
275167
|
+
instance
|
|
275168
|
+
});
|
|
275169
|
+
const platformConfig = await settlemint2.platform.config();
|
|
275170
|
+
const invalidPredeployedAbis = includePredeployedAbis.filter((abi) => !platformConfig.preDeployedContracts.some((contract) => contract === abi));
|
|
275171
|
+
if (invalidPredeployedAbis.length > 0) {
|
|
275172
|
+
cancel2(`Invalid pre-deployed abis: '${invalidPredeployedAbis.join(", ")}'. Possible values: '${platformConfig.preDeployedContracts.sort().join(", ")}'`);
|
|
275173
|
+
}
|
|
275174
|
+
}
|
|
275040
275175
|
const result = await settlemint.middleware.create({
|
|
275041
275176
|
name: name2,
|
|
275042
275177
|
applicationUniqueName,
|
|
@@ -275089,7 +275224,11 @@ function privateKeyHdCreateCommand() {
|
|
|
275089
275224
|
alias: "hd",
|
|
275090
275225
|
execute: (cmd2, baseAction) => {
|
|
275091
275226
|
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(
|
|
275227
|
+
return baseAction({
|
|
275228
|
+
...defaultArgs,
|
|
275229
|
+
provider,
|
|
275230
|
+
region
|
|
275231
|
+
}, async (settlemint, env2) => {
|
|
275093
275232
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275094
275233
|
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275095
275234
|
const result = await settlemint.privateKey.create({
|
|
@@ -275139,7 +275278,11 @@ function privateKeyHsmCreateCommand() {
|
|
|
275139
275278
|
alias: "hd",
|
|
275140
275279
|
execute: (cmd2, baseAction) => {
|
|
275141
275280
|
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(
|
|
275281
|
+
return baseAction({
|
|
275282
|
+
...defaultArgs,
|
|
275283
|
+
provider,
|
|
275284
|
+
region
|
|
275285
|
+
}, async (settlemint, env2) => {
|
|
275143
275286
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275144
275287
|
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275145
275288
|
const result = await settlemint.privateKey.create({
|
|
@@ -275188,7 +275331,11 @@ function ipfsStorageCreateCommand() {
|
|
|
275188
275331
|
alias: "ip",
|
|
275189
275332
|
execute: (cmd2, baseAction) => {
|
|
275190
275333
|
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275191
|
-
return baseAction(
|
|
275334
|
+
return baseAction({
|
|
275335
|
+
...defaultArgs,
|
|
275336
|
+
provider,
|
|
275337
|
+
region
|
|
275338
|
+
}, async (settlemint, env2) => {
|
|
275192
275339
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275193
275340
|
const result = await settlemint.storage.create({
|
|
275194
275341
|
name: name2,
|
|
@@ -275233,7 +275380,11 @@ function minioStorageCreateCommand() {
|
|
|
275233
275380
|
alias: "m",
|
|
275234
275381
|
execute: (cmd2, baseAction) => {
|
|
275235
275382
|
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275236
|
-
return baseAction(
|
|
275383
|
+
return baseAction({
|
|
275384
|
+
...defaultArgs,
|
|
275385
|
+
provider,
|
|
275386
|
+
region
|
|
275387
|
+
}, async (settlemint, env2) => {
|
|
275237
275388
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275238
275389
|
const result = await settlemint.storage.create({
|
|
275239
275390
|
name: name2,
|
|
@@ -275651,211 +275802,96 @@ function updateCommand() {
|
|
|
275651
275802
|
return new Command("update").alias("u").description("Update a resource in the SettleMint platform").addCommand(customDeploymentsUpdateCommand());
|
|
275652
275803
|
}
|
|
275653
275804
|
|
|
275805
|
+
// src/commands/platform/config.ts
|
|
275806
|
+
function configCommand() {
|
|
275807
|
+
return new Command("config").alias("c").description("Get platform configuration").option("--prod", "Connect to your production environment").action(async ({ prod }) => {
|
|
275808
|
+
intro("Getting platform configuration");
|
|
275809
|
+
const env2 = await loadEnv2(false, !!prod);
|
|
275810
|
+
const instance = await instancePrompt(env2, true);
|
|
275811
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275812
|
+
env: env2,
|
|
275813
|
+
instance,
|
|
275814
|
+
prefer: "personal"
|
|
275815
|
+
});
|
|
275816
|
+
const settlemint = createSettleMintClient({
|
|
275817
|
+
accessToken,
|
|
275818
|
+
instance
|
|
275819
|
+
});
|
|
275820
|
+
const platformConfig = await settlemint.platform.config();
|
|
275821
|
+
note2(`Providers and regions:
|
|
275822
|
+
${platformConfig.deploymentEngineTargets.filter((provider) => !provider.disabled).map((provider) => `• ${provider.id}
|
|
275823
|
+
${provider.clusters.filter((cluster) => !cluster.disabled).map((region) => `• ${getRegionId(region.id)}`).sort().join(`
|
|
275824
|
+
`)}`).sort().join(`
|
|
275825
|
+
`)}`);
|
|
275826
|
+
note2(`Use cases (Smart Contract Sets):
|
|
275827
|
+
• ${platformConfig.smartContractSets.sets.filter((useCase) => !useCase.featureflagged).map((useCase) => useCase.id).sort().join(`
|
|
275828
|
+
• `)}`);
|
|
275829
|
+
note2(`Pre-deployed abis (Smart Contract Portal):
|
|
275830
|
+
• ${platformConfig.preDeployedContracts.sort().join(`
|
|
275831
|
+
• `)}`);
|
|
275832
|
+
outro("Platform configuration retrieved");
|
|
275833
|
+
});
|
|
275834
|
+
}
|
|
275835
|
+
|
|
275654
275836
|
// src/commands/platform.ts
|
|
275655
275837
|
function platformCommand() {
|
|
275656
|
-
return new Command("platform").description("Manage SettleMint platform resources").addCommand(createCommand3()).addCommand(updateCommand()).addCommand(deleteCommand()).addCommand(restartCommand());
|
|
275838
|
+
return new Command("platform").description("Manage SettleMint platform resources").addCommand(configCommand()).addCommand(createCommand3()).addCommand(updateCommand()).addCommand(deleteCommand()).addCommand(restartCommand());
|
|
275657
275839
|
}
|
|
275658
275840
|
|
|
275659
275841
|
// src/commands/smart-contract-set/create.ts
|
|
275660
275842
|
import { rmdir } from "node:fs/promises";
|
|
275661
275843
|
import { join as join8 } from "node:path";
|
|
275662
275844
|
|
|
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
275845
|
// src/commands/smart-contract-set/prompts/use-case.prompt.ts
|
|
275833
|
-
async function useCasePrompt(argument) {
|
|
275834
|
-
if (
|
|
275846
|
+
async function useCasePrompt(platformConfig, argument) {
|
|
275847
|
+
if (platformConfig.smartContractSets.sets.length === 0) {
|
|
275835
275848
|
cancel2("No use cases found");
|
|
275836
275849
|
}
|
|
275850
|
+
const useCasesNotFeatureFlagged = platformConfig.smartContractSets.sets.filter((set) => !set.featureflagged);
|
|
275837
275851
|
if (argument) {
|
|
275838
|
-
|
|
275839
|
-
|
|
275852
|
+
const selectedUseCase = platformConfig.smartContractSets.sets.find((set) => set.id === argument);
|
|
275853
|
+
if (!selectedUseCase) {
|
|
275854
|
+
cancel2(`No use case found with id '${argument}'. Possible use cases: '${useCasesNotFeatureFlagged.map((set) => set.id).sort().join(", ")}'`);
|
|
275840
275855
|
}
|
|
275841
|
-
return
|
|
275856
|
+
return selectedUseCase;
|
|
275857
|
+
}
|
|
275858
|
+
if (useCasesNotFeatureFlagged.length === 0) {
|
|
275859
|
+
cancel2("No use cases found");
|
|
275860
|
+
}
|
|
275861
|
+
if (useCasesNotFeatureFlagged.length === 1) {
|
|
275862
|
+
return useCasesNotFeatureFlagged[0];
|
|
275842
275863
|
}
|
|
275843
275864
|
const useCase = await esm_default2({
|
|
275844
275865
|
message: "Which use case do you want to use?",
|
|
275845
|
-
choices:
|
|
275846
|
-
name: useCase2,
|
|
275847
|
-
value: useCase2
|
|
275866
|
+
choices: useCasesNotFeatureFlagged.map((useCase2) => ({
|
|
275867
|
+
name: useCase2.name,
|
|
275868
|
+
value: useCase2.id
|
|
275848
275869
|
}))
|
|
275849
275870
|
});
|
|
275850
|
-
return useCase;
|
|
275871
|
+
return platformConfig.smartContractSets.sets.find((set) => set.id === useCase);
|
|
275851
275872
|
}
|
|
275852
275873
|
|
|
275853
275874
|
// src/commands/smart-contract-set/create.ts
|
|
275854
275875
|
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").
|
|
275876
|
+
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
275877
|
intro("Creating a new smart contract set");
|
|
275857
275878
|
const env2 = await loadEnv2(false, !!prod);
|
|
275858
275879
|
const name2 = await namePrompt(env2, projectName);
|
|
275880
|
+
const instance = await instancePrompt(env2, true);
|
|
275881
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275882
|
+
env: env2,
|
|
275883
|
+
instance,
|
|
275884
|
+
prefer: "personal"
|
|
275885
|
+
});
|
|
275886
|
+
const settlemint = createSettleMintClient({
|
|
275887
|
+
accessToken,
|
|
275888
|
+
instance
|
|
275889
|
+
});
|
|
275890
|
+
const platformConfig = await settlemint.platform.config();
|
|
275891
|
+
const selectedUseCase = await useCasePrompt(platformConfig, useCase);
|
|
275892
|
+
if (!selectedUseCase) {
|
|
275893
|
+
cancel("No use case selected. Please select a use case to continue.");
|
|
275894
|
+
}
|
|
275859
275895
|
const targetDir = formatTargetDir(name2);
|
|
275860
275896
|
const projectDir = join8(process.cwd(), targetDir);
|
|
275861
275897
|
if (await exists2(projectDir) && !await isEmpty(projectDir)) {
|
|
@@ -275868,24 +275904,16 @@ function createCommand4() {
|
|
|
275868
275904
|
}
|
|
275869
275905
|
await rmdir(projectDir, { recursive: true });
|
|
275870
275906
|
}
|
|
275871
|
-
const selectedUseCase = await useCasePrompt(useCase);
|
|
275872
|
-
if (!selectedUseCase) {
|
|
275873
|
-
cancel("No use case selected. Please select a use case to continue.");
|
|
275874
|
-
}
|
|
275875
275907
|
await spinner({
|
|
275876
275908
|
startMessage: "Scaffolding the smart contract set",
|
|
275877
275909
|
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
275910
|
await executeCommand("forge", [
|
|
275883
275911
|
"init",
|
|
275884
275912
|
name2,
|
|
275885
275913
|
"--template",
|
|
275886
|
-
|
|
275914
|
+
selectedUseCase.name,
|
|
275887
275915
|
"--branch",
|
|
275888
|
-
`v${
|
|
275916
|
+
`v${selectedUseCase.name}`
|
|
275889
275917
|
]);
|
|
275890
275918
|
await setName(name2, projectDir);
|
|
275891
275919
|
},
|
|
@@ -276714,4 +276742,4 @@ function sdkCliCommand(exitOverride = undefined) {
|
|
|
276714
276742
|
ascii();
|
|
276715
276743
|
sdkCliCommand();
|
|
276716
276744
|
|
|
276717
|
-
//# debugId=
|
|
276745
|
+
//# debugId=9EF23BB62C30F0EE64756E2164756E21
|