@settlemint/sdk-cli 0.9.2 → 0.9.3-main60569eea
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 +260 -228
- package/dist/cli.js.map +29 -26
- 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.Ks5097XiXd:/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.Ks5097XiXd:/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.Ks5097XiXd:/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.Ks5097XiXd:/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-main60569eea",
|
|
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.Ks5097XiXd:/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-main60569eea",
|
|
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-main60569eea",
|
|
256845
|
+
"@settlemint/sdk-utils": "0.9.3-main60569eea",
|
|
256846
256846
|
"get-tsconfig": "4.8.1",
|
|
256847
256847
|
giget: "1.2.3"
|
|
256848
256848
|
},
|
|
@@ -257103,9 +257103,12 @@ async function findUp(name, options = {}) {
|
|
|
257103
257103
|
|
|
257104
257104
|
// ../utils/dist/filesystem.mjs
|
|
257105
257105
|
import { stat } from "node:fs/promises";
|
|
257106
|
-
async function projectRoot() {
|
|
257106
|
+
async function projectRoot(fallbackToCwd = false) {
|
|
257107
257107
|
const packageJsonPath = await findUp("package.json");
|
|
257108
257108
|
if (!packageJsonPath) {
|
|
257109
|
+
if (fallbackToCwd) {
|
|
257110
|
+
return process.cwd();
|
|
257111
|
+
}
|
|
257109
257112
|
throw new Error("Unable to find project root (no package.json found)");
|
|
257110
257113
|
}
|
|
257111
257114
|
return dirname(packageJsonPath);
|
|
@@ -270060,9 +270063,12 @@ async function loadEnvironmentEnv2(validateEnv, prod, path5 = process.cwd()) {
|
|
|
270060
270063
|
return {};
|
|
270061
270064
|
}
|
|
270062
270065
|
}
|
|
270063
|
-
async function projectRoot2() {
|
|
270066
|
+
async function projectRoot2(fallbackToCwd = false) {
|
|
270064
270067
|
const packageJsonPath = await findUp("package.json");
|
|
270065
270068
|
if (!packageJsonPath) {
|
|
270069
|
+
if (fallbackToCwd) {
|
|
270070
|
+
return process.cwd();
|
|
270071
|
+
}
|
|
270066
270072
|
throw new Error("Unable to find project root (no package.json found)");
|
|
270067
270073
|
}
|
|
270068
270074
|
return dirname5(packageJsonPath);
|
|
@@ -270113,7 +270119,7 @@ async function findMonoRepoPackages(projectDir) {
|
|
|
270113
270119
|
}
|
|
270114
270120
|
}
|
|
270115
270121
|
async function writeEnv(prod, env2, secrets) {
|
|
270116
|
-
const projectDir = await projectRoot2();
|
|
270122
|
+
const projectDir = await projectRoot2(true);
|
|
270117
270123
|
if (prod) {
|
|
270118
270124
|
process.env.NODE_ENV = "production";
|
|
270119
270125
|
}
|
|
@@ -272346,6 +272352,42 @@ var middlewareRestart = (gqlClient) => async (middlewareUniqueName) => {
|
|
|
272346
272352
|
});
|
|
272347
272353
|
return middleware;
|
|
272348
272354
|
};
|
|
272355
|
+
var getPlatformConfigQuery = graphql(`
|
|
272356
|
+
query platformConfig {
|
|
272357
|
+
config {
|
|
272358
|
+
smartContractSets {
|
|
272359
|
+
id
|
|
272360
|
+
sets {
|
|
272361
|
+
id
|
|
272362
|
+
name
|
|
272363
|
+
featureflagged
|
|
272364
|
+
image {
|
|
272365
|
+
repository
|
|
272366
|
+
tag
|
|
272367
|
+
registry
|
|
272368
|
+
}
|
|
272369
|
+
}
|
|
272370
|
+
}
|
|
272371
|
+
deploymentEngineTargets {
|
|
272372
|
+
id
|
|
272373
|
+
name
|
|
272374
|
+
disabled
|
|
272375
|
+
clusters {
|
|
272376
|
+
id
|
|
272377
|
+
name
|
|
272378
|
+
disabled
|
|
272379
|
+
}
|
|
272380
|
+
}
|
|
272381
|
+
preDeployedContracts
|
|
272382
|
+
}
|
|
272383
|
+
}
|
|
272384
|
+
`, []);
|
|
272385
|
+
var getPlatformConfig = (gqlClient) => {
|
|
272386
|
+
return async () => {
|
|
272387
|
+
const { config: config4 } = await gqlClient.request(getPlatformConfigQuery);
|
|
272388
|
+
return config4;
|
|
272389
|
+
};
|
|
272390
|
+
};
|
|
272349
272391
|
var PrivateKeyFragment = graphql(`
|
|
272350
272392
|
fragment PrivateKey on PrivateKey {
|
|
272351
272393
|
__typename
|
|
@@ -272545,6 +272587,9 @@ function createSettleMintClient(options) {
|
|
|
272545
272587
|
},
|
|
272546
272588
|
applicationAccessToken: {
|
|
272547
272589
|
create: applicationAccessTokenCreate(gqlClient)
|
|
272590
|
+
},
|
|
272591
|
+
platform: {
|
|
272592
|
+
config: getPlatformConfig(gqlClient)
|
|
272548
272593
|
}
|
|
272549
272594
|
};
|
|
272550
272595
|
}
|
|
@@ -273301,9 +273346,12 @@ import { dirname as dirname6 } from "node:path";
|
|
|
273301
273346
|
import { stat as stat8 } from "node:fs/promises";
|
|
273302
273347
|
var import_package_json3 = __toESM(require_lib12(), 1);
|
|
273303
273348
|
var import_package_json4 = __toESM(require_lib12(), 1);
|
|
273304
|
-
async function projectRoot3() {
|
|
273349
|
+
async function projectRoot3(fallbackToCwd = false) {
|
|
273305
273350
|
const packageJsonPath = await findUp("package.json");
|
|
273306
273351
|
if (!packageJsonPath) {
|
|
273352
|
+
if (fallbackToCwd) {
|
|
273353
|
+
return process.cwd();
|
|
273354
|
+
}
|
|
273307
273355
|
throw new Error("Unable to find project root (no package.json found)");
|
|
273308
273356
|
}
|
|
273309
273357
|
return dirname6(packageJsonPath);
|
|
@@ -274212,7 +274260,7 @@ function logoutCommand() {
|
|
|
274212
274260
|
|
|
274213
274261
|
// src/commands/platform/common/cluster-service.args.ts
|
|
274214
274262
|
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"));
|
|
274263
|
+
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
274264
|
}
|
|
274217
274265
|
|
|
274218
274266
|
// src/utils/parse-number.ts
|
|
@@ -274245,7 +274293,7 @@ async function waitForCompletion({
|
|
|
274245
274293
|
restartIfTimeout = false
|
|
274246
274294
|
}) {
|
|
274247
274295
|
const serviceType = SETTLEMINT_CLIENT_MAP[type4];
|
|
274248
|
-
if (serviceType === "workspace" || serviceType === "application" || serviceType === "foundry" || serviceType === "applicationAccessToken") {
|
|
274296
|
+
if (serviceType === "workspace" || serviceType === "application" || serviceType === "foundry" || serviceType === "applicationAccessToken" || serviceType === "platform") {
|
|
274249
274297
|
return true;
|
|
274250
274298
|
}
|
|
274251
274299
|
const service = settlemint[serviceType];
|
|
@@ -274307,6 +274355,63 @@ function sanitizeCommandName(name2) {
|
|
|
274307
274355
|
return name2.split(" ").join("-").toLowerCase();
|
|
274308
274356
|
}
|
|
274309
274357
|
|
|
274358
|
+
// src/commands/platform/prompts/provider.prompt.ts
|
|
274359
|
+
async function providerPrompt(platformConfig, argument) {
|
|
274360
|
+
const possibleProviders = platformConfig.deploymentEngineTargets.filter((target) => !target.disabled);
|
|
274361
|
+
if (possibleProviders.length === 0) {
|
|
274362
|
+
cancel2("No providers found");
|
|
274363
|
+
}
|
|
274364
|
+
if (argument) {
|
|
274365
|
+
const selectedProvider = possibleProviders.find((target) => target.id === argument);
|
|
274366
|
+
if (!selectedProvider) {
|
|
274367
|
+
cancel2(`No provider found with id '${argument}'. Possible providers: '${possibleProviders.map((target) => target.id).sort().join(", ")}'`);
|
|
274368
|
+
}
|
|
274369
|
+
return selectedProvider;
|
|
274370
|
+
}
|
|
274371
|
+
if (possibleProviders.length === 1) {
|
|
274372
|
+
return possibleProviders[0];
|
|
274373
|
+
}
|
|
274374
|
+
const provider = await esm_default2({
|
|
274375
|
+
message: "Which provider do you want to use?",
|
|
274376
|
+
choices: platformConfig.deploymentEngineTargets.map((target) => ({
|
|
274377
|
+
name: target.name,
|
|
274378
|
+
value: target.id
|
|
274379
|
+
})).sort((a8, b4) => a8.name.localeCompare(b4.name))
|
|
274380
|
+
});
|
|
274381
|
+
return platformConfig.deploymentEngineTargets.find((target) => target.id === provider);
|
|
274382
|
+
}
|
|
274383
|
+
|
|
274384
|
+
// src/commands/platform/utils/cluster-region.ts
|
|
274385
|
+
function getRegionId(regionId) {
|
|
274386
|
+
return regionId.split("-")[1];
|
|
274387
|
+
}
|
|
274388
|
+
|
|
274389
|
+
// src/commands/platform/prompts/region.prompt.ts
|
|
274390
|
+
async function regionPrompt(provider, argument) {
|
|
274391
|
+
const possibleRegions = provider.clusters.filter((cluster) => !cluster.disabled).map((cluster) => ({ ...cluster, id: getRegionId(cluster.id) }));
|
|
274392
|
+
if (possibleRegions.length === 0) {
|
|
274393
|
+
cancel2("No regions found");
|
|
274394
|
+
}
|
|
274395
|
+
if (argument) {
|
|
274396
|
+
const selectedRegion = possibleRegions.find((cluster) => cluster.id === argument);
|
|
274397
|
+
if (!selectedRegion) {
|
|
274398
|
+
cancel2(`No region found with id '${argument}'. Possible regions: '${possibleRegions.map((cluster) => cluster.id).sort().join(", ")}'`);
|
|
274399
|
+
}
|
|
274400
|
+
return selectedRegion;
|
|
274401
|
+
}
|
|
274402
|
+
if (possibleRegions.length === 1) {
|
|
274403
|
+
return possibleRegions[0];
|
|
274404
|
+
}
|
|
274405
|
+
const region = await esm_default2({
|
|
274406
|
+
message: "Which region do you want to use?",
|
|
274407
|
+
choices: provider.clusters.map((cluster) => ({
|
|
274408
|
+
name: cluster.name,
|
|
274409
|
+
value: cluster.id
|
|
274410
|
+
})).sort((a8, b4) => a8.name.localeCompare(b4.name))
|
|
274411
|
+
});
|
|
274412
|
+
return provider.clusters.find((cluster) => cluster.id === region);
|
|
274413
|
+
}
|
|
274414
|
+
|
|
274310
274415
|
// src/commands/platform/common/create-command.ts
|
|
274311
274416
|
function getCreateCommand({
|
|
274312
274417
|
name: name2,
|
|
@@ -274321,7 +274426,7 @@ function getCreateCommand({
|
|
|
274321
274426
|
if (requiresDeployment) {
|
|
274322
274427
|
cmd2.option("-w, --wait", "Wait until deployed").option("-r, --restart-if-timeout", "Restart if wait time is exceeded");
|
|
274323
274428
|
}
|
|
274324
|
-
execute2(cmd2, async ({ acceptDefaults, prod, default: isDefault, wait, restartIfTimeout }, createFunction) => {
|
|
274429
|
+
execute2(cmd2, async ({ acceptDefaults, prod, default: isDefault, wait, restartIfTimeout, provider, region }, createFunction) => {
|
|
274325
274430
|
intro(`Creating ${type4} in the SettleMint platform`);
|
|
274326
274431
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274327
274432
|
const env2 = await loadEnv2(false, !!prod);
|
|
@@ -274335,6 +274440,17 @@ function getCreateCommand({
|
|
|
274335
274440
|
accessToken,
|
|
274336
274441
|
instance
|
|
274337
274442
|
});
|
|
274443
|
+
const platformConfig = await settlemint.platform.config();
|
|
274444
|
+
if (requiresDeployment) {
|
|
274445
|
+
const selectedProvider = await providerPrompt(platformConfig, provider);
|
|
274446
|
+
if (!selectedProvider) {
|
|
274447
|
+
cancel("No provider selected. Please select a provider to continue.");
|
|
274448
|
+
}
|
|
274449
|
+
const selectedRegion = await regionPrompt(selectedProvider, region);
|
|
274450
|
+
if (!selectedRegion) {
|
|
274451
|
+
cancel("No region selected. Please select a region to continue.");
|
|
274452
|
+
}
|
|
274453
|
+
}
|
|
274338
274454
|
const { result, waitFor, mapDefaultEnv } = await spinner({
|
|
274339
274455
|
startMessage: `Creating ${type4}`,
|
|
274340
274456
|
task: async () => {
|
|
@@ -274402,7 +274518,11 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274402
274518
|
type: type4,
|
|
274403
274519
|
...defaultArgs
|
|
274404
274520
|
}) => {
|
|
274405
|
-
return baseAction(
|
|
274521
|
+
return baseAction({
|
|
274522
|
+
...defaultArgs,
|
|
274523
|
+
provider,
|
|
274524
|
+
region
|
|
274525
|
+
}, async (settlemint, env2) => {
|
|
274406
274526
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274407
274527
|
const result = await settlemint.blockchainNetwork.create({
|
|
274408
274528
|
name: name2,
|
|
@@ -274774,7 +274894,12 @@ function blockchainNodeBesuCreateCommand() {
|
|
|
274774
274894
|
acceptDefaults,
|
|
274775
274895
|
...defaultArgs
|
|
274776
274896
|
}) => {
|
|
274777
|
-
return baseAction(
|
|
274897
|
+
return baseAction({
|
|
274898
|
+
...defaultArgs,
|
|
274899
|
+
acceptDefaults,
|
|
274900
|
+
provider,
|
|
274901
|
+
region
|
|
274902
|
+
}, async (settlemint, env2) => {
|
|
274778
274903
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274779
274904
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274780
274905
|
if (!applicationUniqueName) {
|
|
@@ -274842,7 +274967,11 @@ function blockscoutInsightsCreateCommand() {
|
|
|
274842
274967
|
alias: "bs",
|
|
274843
274968
|
execute: (cmd2, baseAction) => {
|
|
274844
274969
|
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(
|
|
274970
|
+
return baseAction({
|
|
274971
|
+
...defaultArgs,
|
|
274972
|
+
provider,
|
|
274973
|
+
region
|
|
274974
|
+
}, async (settlemint, env2) => {
|
|
274846
274975
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274847
274976
|
const blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
274848
274977
|
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
|
|
@@ -274898,7 +275027,11 @@ function hasuraIntegrationCreateCommand() {
|
|
|
274898
275027
|
alias: "ha",
|
|
274899
275028
|
execute: (cmd2, baseAction) => {
|
|
274900
275029
|
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
274901
|
-
return baseAction(
|
|
275030
|
+
return baseAction({
|
|
275031
|
+
...defaultArgs,
|
|
275032
|
+
provider,
|
|
275033
|
+
region
|
|
275034
|
+
}, async (settlemint, env2) => {
|
|
274902
275035
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274903
275036
|
const result = await settlemint.integrationTool.create({
|
|
274904
275037
|
name: name2,
|
|
@@ -274950,7 +275083,11 @@ function graphMiddlewareCreateCommand() {
|
|
|
274950
275083
|
alias: "gr",
|
|
274951
275084
|
execute: (cmd2, baseAction) => {
|
|
274952
275085
|
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(
|
|
275086
|
+
return baseAction({
|
|
275087
|
+
...defaultArgs,
|
|
275088
|
+
provider,
|
|
275089
|
+
region
|
|
275090
|
+
}, async (settlemint, env2) => {
|
|
274954
275091
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274955
275092
|
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
274956
275093
|
const result = await settlemint.middleware.create({
|
|
@@ -274998,16 +275135,7 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
274998
275135
|
type: "middleware",
|
|
274999
275136
|
alias: "scp",
|
|
275000
275137
|
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, {
|
|
275138
|
+
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
275139
|
application,
|
|
275012
275140
|
blockchainNode,
|
|
275013
275141
|
loadBalancer,
|
|
@@ -275019,7 +275147,11 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275019
275147
|
abis,
|
|
275020
275148
|
...defaultArgs
|
|
275021
275149
|
}) => {
|
|
275022
|
-
return baseAction(
|
|
275150
|
+
return baseAction({
|
|
275151
|
+
...defaultArgs,
|
|
275152
|
+
provider,
|
|
275153
|
+
region
|
|
275154
|
+
}, async (settlemint, env2) => {
|
|
275023
275155
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275024
275156
|
const blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275025
275157
|
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
|
|
@@ -275037,6 +275169,13 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275037
275169
|
cancel2(`Failed to read or parse ABI file: ${error5.message}`);
|
|
275038
275170
|
}
|
|
275039
275171
|
}
|
|
275172
|
+
if (includePredeployedAbis && includePredeployedAbis.length > 0) {
|
|
275173
|
+
const platformConfig = await settlemint.platform.config();
|
|
275174
|
+
const invalidPredeployedAbis = includePredeployedAbis.filter((abi) => !platformConfig.preDeployedContracts.some((contract) => contract === abi));
|
|
275175
|
+
if (invalidPredeployedAbis.length > 0) {
|
|
275176
|
+
cancel2(`Invalid pre-deployed abis: '${invalidPredeployedAbis.join(", ")}'. Possible values: '${platformConfig.preDeployedContracts.sort().join(", ")}'`);
|
|
275177
|
+
}
|
|
275178
|
+
}
|
|
275040
275179
|
const result = await settlemint.middleware.create({
|
|
275041
275180
|
name: name2,
|
|
275042
275181
|
applicationUniqueName,
|
|
@@ -275089,7 +275228,11 @@ function privateKeyHdCreateCommand() {
|
|
|
275089
275228
|
alias: "hd",
|
|
275090
275229
|
execute: (cmd2, baseAction) => {
|
|
275091
275230
|
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(
|
|
275231
|
+
return baseAction({
|
|
275232
|
+
...defaultArgs,
|
|
275233
|
+
provider,
|
|
275234
|
+
region
|
|
275235
|
+
}, async (settlemint, env2) => {
|
|
275093
275236
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275094
275237
|
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275095
275238
|
const result = await settlemint.privateKey.create({
|
|
@@ -275139,7 +275282,11 @@ function privateKeyHsmCreateCommand() {
|
|
|
275139
275282
|
alias: "hd",
|
|
275140
275283
|
execute: (cmd2, baseAction) => {
|
|
275141
275284
|
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(
|
|
275285
|
+
return baseAction({
|
|
275286
|
+
...defaultArgs,
|
|
275287
|
+
provider,
|
|
275288
|
+
region
|
|
275289
|
+
}, async (settlemint, env2) => {
|
|
275143
275290
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275144
275291
|
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275145
275292
|
const result = await settlemint.privateKey.create({
|
|
@@ -275188,7 +275335,11 @@ function ipfsStorageCreateCommand() {
|
|
|
275188
275335
|
alias: "ip",
|
|
275189
275336
|
execute: (cmd2, baseAction) => {
|
|
275190
275337
|
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275191
|
-
return baseAction(
|
|
275338
|
+
return baseAction({
|
|
275339
|
+
...defaultArgs,
|
|
275340
|
+
provider,
|
|
275341
|
+
region
|
|
275342
|
+
}, async (settlemint, env2) => {
|
|
275192
275343
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275193
275344
|
const result = await settlemint.storage.create({
|
|
275194
275345
|
name: name2,
|
|
@@ -275233,7 +275384,11 @@ function minioStorageCreateCommand() {
|
|
|
275233
275384
|
alias: "m",
|
|
275234
275385
|
execute: (cmd2, baseAction) => {
|
|
275235
275386
|
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275236
|
-
return baseAction(
|
|
275387
|
+
return baseAction({
|
|
275388
|
+
...defaultArgs,
|
|
275389
|
+
provider,
|
|
275390
|
+
region
|
|
275391
|
+
}, async (settlemint, env2) => {
|
|
275237
275392
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275238
275393
|
const result = await settlemint.storage.create({
|
|
275239
275394
|
name: name2,
|
|
@@ -275651,211 +275806,96 @@ function updateCommand() {
|
|
|
275651
275806
|
return new Command("update").alias("u").description("Update a resource in the SettleMint platform").addCommand(customDeploymentsUpdateCommand());
|
|
275652
275807
|
}
|
|
275653
275808
|
|
|
275809
|
+
// src/commands/platform/config.ts
|
|
275810
|
+
function configCommand() {
|
|
275811
|
+
return new Command("config").alias("c").description("Get platform configuration").option("--prod", "Connect to your production environment").action(async ({ prod }) => {
|
|
275812
|
+
intro("Getting platform configuration");
|
|
275813
|
+
const env2 = await loadEnv2(false, !!prod);
|
|
275814
|
+
const instance = await instancePrompt(env2, true);
|
|
275815
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275816
|
+
env: env2,
|
|
275817
|
+
instance,
|
|
275818
|
+
prefer: "personal"
|
|
275819
|
+
});
|
|
275820
|
+
const settlemint = createSettleMintClient({
|
|
275821
|
+
accessToken,
|
|
275822
|
+
instance
|
|
275823
|
+
});
|
|
275824
|
+
const platformConfig = await settlemint.platform.config();
|
|
275825
|
+
note2(`Providers and regions:
|
|
275826
|
+
${platformConfig.deploymentEngineTargets.filter((provider) => !provider.disabled).map((provider) => `• ${provider.id}
|
|
275827
|
+
${provider.clusters.filter((cluster) => !cluster.disabled).map((region) => `• ${getRegionId(region.id)}`).sort().join(`
|
|
275828
|
+
`)}`).sort().join(`
|
|
275829
|
+
`)}`);
|
|
275830
|
+
note2(`Use cases (Smart Contract Sets):
|
|
275831
|
+
• ${platformConfig.smartContractSets.sets.filter((useCase) => !useCase.featureflagged).map((useCase) => useCase.id).sort().join(`
|
|
275832
|
+
• `)}`);
|
|
275833
|
+
note2(`Pre-deployed abis (Smart Contract Portal):
|
|
275834
|
+
• ${platformConfig.preDeployedContracts.sort().join(`
|
|
275835
|
+
• `)}`);
|
|
275836
|
+
outro("Platform configuration retrieved");
|
|
275837
|
+
});
|
|
275838
|
+
}
|
|
275839
|
+
|
|
275654
275840
|
// src/commands/platform.ts
|
|
275655
275841
|
function platformCommand() {
|
|
275656
|
-
return new Command("platform").description("Manage SettleMint platform resources").addCommand(createCommand3()).addCommand(updateCommand()).addCommand(deleteCommand()).addCommand(restartCommand());
|
|
275842
|
+
return new Command("platform").description("Manage SettleMint platform resources").addCommand(configCommand()).addCommand(createCommand3()).addCommand(updateCommand()).addCommand(deleteCommand()).addCommand(restartCommand());
|
|
275657
275843
|
}
|
|
275658
275844
|
|
|
275659
275845
|
// src/commands/smart-contract-set/create.ts
|
|
275660
275846
|
import { rmdir } from "node:fs/promises";
|
|
275661
275847
|
import { join as join8 } from "node:path";
|
|
275662
275848
|
|
|
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
275849
|
// src/commands/smart-contract-set/prompts/use-case.prompt.ts
|
|
275833
|
-
async function useCasePrompt(argument) {
|
|
275834
|
-
if (
|
|
275850
|
+
async function useCasePrompt(platformConfig, argument) {
|
|
275851
|
+
if (platformConfig.smartContractSets.sets.length === 0) {
|
|
275835
275852
|
cancel2("No use cases found");
|
|
275836
275853
|
}
|
|
275854
|
+
const useCasesNotFeatureFlagged = platformConfig.smartContractSets.sets.filter((set) => !set.featureflagged);
|
|
275837
275855
|
if (argument) {
|
|
275838
|
-
|
|
275839
|
-
|
|
275856
|
+
const selectedUseCase = platformConfig.smartContractSets.sets.find((set) => set.id === argument);
|
|
275857
|
+
if (!selectedUseCase) {
|
|
275858
|
+
cancel2(`No use case found with id '${argument}'. Possible use cases: '${useCasesNotFeatureFlagged.map((set) => set.id).sort().join(", ")}'`);
|
|
275840
275859
|
}
|
|
275841
|
-
return
|
|
275860
|
+
return selectedUseCase;
|
|
275861
|
+
}
|
|
275862
|
+
if (useCasesNotFeatureFlagged.length === 0) {
|
|
275863
|
+
cancel2("No use cases found");
|
|
275864
|
+
}
|
|
275865
|
+
if (useCasesNotFeatureFlagged.length === 1) {
|
|
275866
|
+
return useCasesNotFeatureFlagged[0];
|
|
275842
275867
|
}
|
|
275843
275868
|
const useCase = await esm_default2({
|
|
275844
275869
|
message: "Which use case do you want to use?",
|
|
275845
|
-
choices:
|
|
275846
|
-
name: useCase2,
|
|
275847
|
-
value: useCase2
|
|
275848
|
-
}))
|
|
275870
|
+
choices: useCasesNotFeatureFlagged.map((useCase2) => ({
|
|
275871
|
+
name: useCase2.name,
|
|
275872
|
+
value: useCase2.id
|
|
275873
|
+
})).sort((a8, b4) => a8.name.localeCompare(b4.name))
|
|
275849
275874
|
});
|
|
275850
|
-
return useCase;
|
|
275875
|
+
return platformConfig.smartContractSets.sets.find((set) => set.id === useCase);
|
|
275851
275876
|
}
|
|
275852
275877
|
|
|
275853
275878
|
// src/commands/smart-contract-set/create.ts
|
|
275854
275879
|
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").
|
|
275880
|
+
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
275881
|
intro("Creating a new smart contract set");
|
|
275857
275882
|
const env2 = await loadEnv2(false, !!prod);
|
|
275858
275883
|
const name2 = await namePrompt(env2, projectName);
|
|
275884
|
+
const instance = await instancePrompt(env2, true);
|
|
275885
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275886
|
+
env: env2,
|
|
275887
|
+
instance,
|
|
275888
|
+
prefer: "personal"
|
|
275889
|
+
});
|
|
275890
|
+
const settlemint = createSettleMintClient({
|
|
275891
|
+
accessToken,
|
|
275892
|
+
instance
|
|
275893
|
+
});
|
|
275894
|
+
const platformConfig = await settlemint.platform.config();
|
|
275895
|
+
const selectedUseCase = await useCasePrompt(platformConfig, useCase);
|
|
275896
|
+
if (!selectedUseCase) {
|
|
275897
|
+
cancel("No use case selected. Please select a use case to continue.");
|
|
275898
|
+
}
|
|
275859
275899
|
const targetDir = formatTargetDir(name2);
|
|
275860
275900
|
const projectDir = join8(process.cwd(), targetDir);
|
|
275861
275901
|
if (await exists2(projectDir) && !await isEmpty(projectDir)) {
|
|
@@ -275868,24 +275908,16 @@ function createCommand4() {
|
|
|
275868
275908
|
}
|
|
275869
275909
|
await rmdir(projectDir, { recursive: true });
|
|
275870
275910
|
}
|
|
275871
|
-
const selectedUseCase = await useCasePrompt(useCase);
|
|
275872
|
-
if (!selectedUseCase) {
|
|
275873
|
-
cancel("No use case selected. Please select a use case to continue.");
|
|
275874
|
-
}
|
|
275875
275911
|
await spinner({
|
|
275876
275912
|
startMessage: "Scaffolding the smart contract set",
|
|
275877
275913
|
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
275914
|
await executeCommand("forge", [
|
|
275883
275915
|
"init",
|
|
275884
275916
|
name2,
|
|
275885
275917
|
"--template",
|
|
275886
|
-
|
|
275918
|
+
selectedUseCase.image.repository,
|
|
275887
275919
|
"--branch",
|
|
275888
|
-
`v${
|
|
275920
|
+
`v${selectedUseCase.image.tag}`
|
|
275889
275921
|
]);
|
|
275890
275922
|
await setName(name2, projectDir);
|
|
275891
275923
|
},
|
|
@@ -276714,4 +276746,4 @@ function sdkCliCommand(exitOverride = undefined) {
|
|
|
276714
276746
|
ascii();
|
|
276715
276747
|
sdkCliCommand();
|
|
276716
276748
|
|
|
276717
|
-
//# debugId=
|
|
276749
|
+
//# debugId=A97C376CB78E2CC864756E2164756E21
|