@settlemint/sdk-cli 0.9.3-pr6423a294 → 0.9.3-pr79efb0e3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +429 -284
- package/dist/cli.js.map +42 -40
- 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.0vjsRGUO4n:/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.0vjsRGUO4n:/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.0vjsRGUO4n:/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.0vjsRGUO4n:/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.3-
|
|
226467
|
+
binaryVersion: "0.9.3-pr79efb0e3",
|
|
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.0vjsRGUO4n:/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.3-
|
|
256791
|
+
version: "0.9.3-pr79efb0e3",
|
|
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.3-
|
|
256845
|
-
"@settlemint/sdk-utils": "0.9.3-
|
|
256844
|
+
"@settlemint/sdk-js": "0.9.3-pr79efb0e3",
|
|
256845
|
+
"@settlemint/sdk-utils": "0.9.3-pr79efb0e3",
|
|
256846
256846
|
"get-tsconfig": "4.8.1",
|
|
256847
256847
|
giget: "1.2.3"
|
|
256848
256848
|
},
|
|
@@ -257143,6 +257143,9 @@ function missingAccessTokenError(personalAccessTokenExists) {
|
|
|
257143
257143
|
function missingPersonalAccessTokenError() {
|
|
257144
257144
|
return cancel("No personal access token found for instance, please run `settlemint login` to login to your instance");
|
|
257145
257145
|
}
|
|
257146
|
+
function missingApplication() {
|
|
257147
|
+
return cancel("No application configured, please run `settlemint connect` to connect to your application");
|
|
257148
|
+
}
|
|
257146
257149
|
|
|
257147
257150
|
// src/utils/config.ts
|
|
257148
257151
|
import { mkdir as mkdir2, readFile, writeFile as writeFile2 } from "node:fs/promises";
|
|
@@ -272756,8 +272759,9 @@ var esm_default5 = createPrompt((config4, done) => {
|
|
|
272756
272759
|
|
|
272757
272760
|
// src/commands/connect/aat.prompt.ts
|
|
272758
272761
|
async function applicationAccessTokenPrompt(env2, application, settlemint, accept) {
|
|
272762
|
+
const autoAccept = !!accept || is_in_ci_default;
|
|
272759
272763
|
const defaultAccessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
272760
|
-
const defaultPossible =
|
|
272764
|
+
const defaultPossible = autoAccept && defaultAccessToken;
|
|
272761
272765
|
if (defaultPossible || is_in_ci_default) {
|
|
272762
272766
|
return defaultAccessToken;
|
|
272763
272767
|
}
|
|
@@ -272852,16 +272856,25 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
|
|
|
272852
272856
|
});
|
|
272853
272857
|
}
|
|
272854
272858
|
|
|
272859
|
+
// src/error/nothing-selected-error.ts
|
|
272860
|
+
function nothingSelectedError(type4) {
|
|
272861
|
+
return cancel2(`No ${type4} selected. Please select a ${type4} to continue.`);
|
|
272862
|
+
}
|
|
272863
|
+
|
|
272855
272864
|
// src/commands/connect/application.prompt.ts
|
|
272856
272865
|
async function applicationPrompt(env2, applications, accept) {
|
|
272866
|
+
const autoAccept = !!accept || is_in_ci_default;
|
|
272857
272867
|
const defaultApplication = applications.find((application2) => application2.uniqueName === env2.SETTLEMINT_APPLICATION);
|
|
272858
|
-
const defaultPossible =
|
|
272868
|
+
const defaultPossible = autoAccept && defaultApplication;
|
|
272859
272869
|
if (defaultPossible) {
|
|
272860
272870
|
return defaultApplication;
|
|
272861
272871
|
}
|
|
272862
272872
|
if (applications.length === 0) {
|
|
272863
272873
|
cancel("No applications found");
|
|
272864
272874
|
}
|
|
272875
|
+
if (is_in_ci_default) {
|
|
272876
|
+
nothingSelectedError("application");
|
|
272877
|
+
}
|
|
272865
272878
|
const application = await esm_default2({
|
|
272866
272879
|
message: "Which application do you want to connect to?",
|
|
272867
272880
|
choices: applications.map((applications2) => ({
|
|
@@ -272876,146 +272889,170 @@ async function applicationPrompt(env2, applications, accept) {
|
|
|
272876
272889
|
return application;
|
|
272877
272890
|
}
|
|
272878
272891
|
|
|
272879
|
-
// src/commands/connect/
|
|
272880
|
-
async function
|
|
272881
|
-
|
|
272892
|
+
// src/commands/connect/service.prompt.ts
|
|
272893
|
+
async function servicePrompt({
|
|
272894
|
+
env: env2,
|
|
272895
|
+
services,
|
|
272896
|
+
accept,
|
|
272897
|
+
envKey,
|
|
272898
|
+
defaultHandler,
|
|
272899
|
+
isCi = is_in_ci_default
|
|
272900
|
+
}) {
|
|
272901
|
+
if (services.length === 0) {
|
|
272882
272902
|
return;
|
|
272883
272903
|
}
|
|
272884
|
-
const
|
|
272885
|
-
const
|
|
272886
|
-
if (
|
|
272887
|
-
return
|
|
272904
|
+
const selectedService = services.find((service) => service.uniqueName === env2[envKey]);
|
|
272905
|
+
const autoAccept = isCi || accept;
|
|
272906
|
+
if (autoAccept && selectedService) {
|
|
272907
|
+
return selectedService;
|
|
272888
272908
|
}
|
|
272889
|
-
|
|
272890
|
-
|
|
272891
|
-
|
|
272892
|
-
|
|
272893
|
-
|
|
272894
|
-
|
|
272895
|
-
|
|
272896
|
-
|
|
272897
|
-
|
|
272898
|
-
|
|
272899
|
-
|
|
272900
|
-
|
|
272901
|
-
|
|
272909
|
+
if (isCi) {
|
|
272910
|
+
return;
|
|
272911
|
+
}
|
|
272912
|
+
if (services.length === 1) {
|
|
272913
|
+
return services[0];
|
|
272914
|
+
}
|
|
272915
|
+
return defaultHandler({ defaultService: selectedService });
|
|
272916
|
+
}
|
|
272917
|
+
|
|
272918
|
+
// src/commands/connect/blockchain-node.prompt.ts
|
|
272919
|
+
async function blockchainNodePrompt(env2, nodes, accept) {
|
|
272920
|
+
return servicePrompt({
|
|
272921
|
+
env: env2,
|
|
272922
|
+
services: nodes,
|
|
272923
|
+
accept,
|
|
272924
|
+
envKey: "SETTLEMINT_BLOCKCHAIN_NODE",
|
|
272925
|
+
defaultHandler: async ({ defaultService: defaultNode }) => {
|
|
272926
|
+
return esm_default2({
|
|
272927
|
+
message: "Which blockchain node do you want to connect to?",
|
|
272928
|
+
choices: [
|
|
272929
|
+
...nodes.map((node) => ({
|
|
272930
|
+
name: node.name,
|
|
272931
|
+
value: node
|
|
272932
|
+
})),
|
|
272933
|
+
{
|
|
272934
|
+
name: "None",
|
|
272935
|
+
value: undefined
|
|
272936
|
+
}
|
|
272937
|
+
],
|
|
272938
|
+
default: defaultNode
|
|
272939
|
+
});
|
|
272940
|
+
}
|
|
272902
272941
|
});
|
|
272903
|
-
return node;
|
|
272904
272942
|
}
|
|
272905
272943
|
|
|
272906
272944
|
// src/commands/connect/blockscout.prompt.ts
|
|
272907
272945
|
async function blockscoutPrompt(env2, insights, accept) {
|
|
272908
272946
|
const possible = insights.filter((insight) => insight.insightsCategory === "BLOCKCHAIN_EXPLORER");
|
|
272909
|
-
|
|
272910
|
-
|
|
272911
|
-
|
|
272912
|
-
|
|
272913
|
-
|
|
272914
|
-
|
|
272915
|
-
|
|
272916
|
-
|
|
272917
|
-
|
|
272918
|
-
|
|
272919
|
-
|
|
272920
|
-
|
|
272921
|
-
|
|
272922
|
-
|
|
272923
|
-
|
|
272924
|
-
|
|
272925
|
-
|
|
272926
|
-
|
|
272927
|
-
|
|
272928
|
-
|
|
272929
|
-
|
|
272947
|
+
return servicePrompt({
|
|
272948
|
+
env: env2,
|
|
272949
|
+
services: possible,
|
|
272950
|
+
accept,
|
|
272951
|
+
envKey: "SETTLEMINT_BLOCKSCOUT",
|
|
272952
|
+
defaultHandler: async ({ defaultService: defaultBlockscout }) => {
|
|
272953
|
+
return esm_default2({
|
|
272954
|
+
message: "Which blockscout instance do you want to connect to?",
|
|
272955
|
+
choices: [
|
|
272956
|
+
...possible.map((insight) => ({
|
|
272957
|
+
name: insight.name,
|
|
272958
|
+
value: insight
|
|
272959
|
+
})),
|
|
272960
|
+
{
|
|
272961
|
+
name: "None",
|
|
272962
|
+
value: undefined
|
|
272963
|
+
}
|
|
272964
|
+
],
|
|
272965
|
+
default: defaultBlockscout
|
|
272966
|
+
});
|
|
272967
|
+
}
|
|
272930
272968
|
});
|
|
272931
|
-
return blockscout;
|
|
272932
272969
|
}
|
|
272933
272970
|
|
|
272934
272971
|
// src/commands/connect/custom-deployment.prompt.ts
|
|
272935
272972
|
async function customDeploymentPrompt(env2, customDeployments, accept) {
|
|
272936
|
-
|
|
272937
|
-
|
|
272938
|
-
|
|
272939
|
-
|
|
272940
|
-
|
|
272941
|
-
|
|
272942
|
-
|
|
272943
|
-
|
|
272944
|
-
|
|
272945
|
-
|
|
272946
|
-
|
|
272947
|
-
|
|
272948
|
-
|
|
272949
|
-
|
|
272950
|
-
|
|
272951
|
-
|
|
272952
|
-
|
|
272953
|
-
|
|
272954
|
-
|
|
272955
|
-
|
|
272956
|
-
|
|
272973
|
+
return servicePrompt({
|
|
272974
|
+
env: env2,
|
|
272975
|
+
services: customDeployments,
|
|
272976
|
+
accept,
|
|
272977
|
+
envKey: "SETTLEMINT_CUSTOM_DEPLOYMENT",
|
|
272978
|
+
defaultHandler: async ({
|
|
272979
|
+
defaultService: defaultCustomDeployment
|
|
272980
|
+
}) => {
|
|
272981
|
+
return esm_default2({
|
|
272982
|
+
message: "Which Custom Deployment do you want to connect to?",
|
|
272983
|
+
choices: [
|
|
272984
|
+
...customDeployments.map((customDeployment) => ({
|
|
272985
|
+
name: customDeployment.name,
|
|
272986
|
+
value: customDeployment
|
|
272987
|
+
})),
|
|
272988
|
+
{
|
|
272989
|
+
name: "None",
|
|
272990
|
+
value: undefined
|
|
272991
|
+
}
|
|
272992
|
+
],
|
|
272993
|
+
default: defaultCustomDeployment
|
|
272994
|
+
});
|
|
272995
|
+
}
|
|
272957
272996
|
});
|
|
272958
|
-
return middleware;
|
|
272959
272997
|
}
|
|
272960
272998
|
|
|
272961
272999
|
// src/commands/connect/hasura.prompt.ts
|
|
272962
273000
|
async function hasuraPrompt(env2, integrations, accept) {
|
|
272963
273001
|
const possible = integrations.filter((integration) => integration.integrationType === "HASURA");
|
|
272964
|
-
|
|
272965
|
-
|
|
272966
|
-
|
|
272967
|
-
|
|
272968
|
-
|
|
272969
|
-
|
|
272970
|
-
|
|
272971
|
-
|
|
272972
|
-
|
|
272973
|
-
|
|
272974
|
-
|
|
272975
|
-
|
|
272976
|
-
|
|
272977
|
-
|
|
272978
|
-
|
|
272979
|
-
|
|
272980
|
-
|
|
272981
|
-
|
|
272982
|
-
|
|
272983
|
-
|
|
272984
|
-
|
|
273002
|
+
return servicePrompt({
|
|
273003
|
+
env: env2,
|
|
273004
|
+
services: possible,
|
|
273005
|
+
accept,
|
|
273006
|
+
envKey: "SETTLEMINT_HASURA",
|
|
273007
|
+
defaultHandler: async ({ defaultService: defaultHasura }) => {
|
|
273008
|
+
return esm_default2({
|
|
273009
|
+
message: "Which Hasura instance do you want to connect to?",
|
|
273010
|
+
choices: [
|
|
273011
|
+
...possible.map((integration) => ({
|
|
273012
|
+
name: integration.name,
|
|
273013
|
+
value: integration
|
|
273014
|
+
})),
|
|
273015
|
+
{
|
|
273016
|
+
name: "None",
|
|
273017
|
+
value: undefined
|
|
273018
|
+
}
|
|
273019
|
+
],
|
|
273020
|
+
default: defaultHasura
|
|
273021
|
+
});
|
|
273022
|
+
}
|
|
272985
273023
|
});
|
|
272986
|
-
return hasura;
|
|
272987
273024
|
}
|
|
272988
273025
|
|
|
272989
273026
|
// src/commands/connect/hd-private-keys.prompt.ts
|
|
272990
273027
|
async function hdPrivateKeyPrompt(env2, privateKeys, accept) {
|
|
272991
|
-
const possible = privateKeys.filter((
|
|
272992
|
-
|
|
272993
|
-
|
|
272994
|
-
|
|
272995
|
-
|
|
272996
|
-
|
|
272997
|
-
|
|
272998
|
-
|
|
272999
|
-
|
|
273000
|
-
|
|
273001
|
-
|
|
273002
|
-
|
|
273003
|
-
|
|
273004
|
-
|
|
273005
|
-
|
|
273006
|
-
|
|
273007
|
-
|
|
273008
|
-
|
|
273009
|
-
|
|
273010
|
-
|
|
273011
|
-
|
|
273012
|
-
|
|
273028
|
+
const possible = privateKeys.filter((privateKey) => privateKey.privateKeyType === "HD_ECDSA_P256");
|
|
273029
|
+
return servicePrompt({
|
|
273030
|
+
env: env2,
|
|
273031
|
+
services: possible,
|
|
273032
|
+
accept,
|
|
273033
|
+
envKey: "SETTLEMINT_HD_PRIVATE_KEY",
|
|
273034
|
+
defaultHandler: async ({ defaultService: defaultPrivateKey }) => {
|
|
273035
|
+
return esm_default2({
|
|
273036
|
+
message: "Which HD Private Key do you want to use?",
|
|
273037
|
+
choices: [
|
|
273038
|
+
...possible.map((privateKey) => ({
|
|
273039
|
+
name: privateKey.name,
|
|
273040
|
+
value: privateKey
|
|
273041
|
+
})),
|
|
273042
|
+
{
|
|
273043
|
+
name: "None",
|
|
273044
|
+
value: undefined
|
|
273045
|
+
}
|
|
273046
|
+
],
|
|
273047
|
+
default: defaultPrivateKey
|
|
273048
|
+
});
|
|
273049
|
+
}
|
|
273013
273050
|
});
|
|
273014
|
-
return privateKey;
|
|
273015
273051
|
}
|
|
273016
273052
|
|
|
273017
273053
|
// src/commands/connect/instance.prompt.ts
|
|
273018
273054
|
async function instancePrompt(env2, accept) {
|
|
273055
|
+
const autoAccept = !!accept || is_in_ci_default;
|
|
273019
273056
|
const defaultInstance = env2.SETTLEMINT_INSTANCE ?? "https://console.settlemint.com";
|
|
273020
273057
|
const defaultPossible = accept && defaultInstance;
|
|
273021
273058
|
if (defaultPossible) {
|
|
@@ -273040,85 +273077,82 @@ async function instancePrompt(env2, accept) {
|
|
|
273040
273077
|
// src/commands/connect/ipfs.prompt.ts
|
|
273041
273078
|
async function ipfsPrompt(env2, storages, accept) {
|
|
273042
273079
|
const possible = storages.filter((storage) => storage.storageProtocol === "IPFS");
|
|
273043
|
-
|
|
273044
|
-
|
|
273045
|
-
|
|
273046
|
-
|
|
273047
|
-
|
|
273048
|
-
|
|
273049
|
-
|
|
273050
|
-
|
|
273051
|
-
|
|
273052
|
-
|
|
273053
|
-
|
|
273054
|
-
|
|
273055
|
-
|
|
273056
|
-
|
|
273057
|
-
|
|
273058
|
-
|
|
273059
|
-
|
|
273060
|
-
|
|
273061
|
-
|
|
273062
|
-
|
|
273063
|
-
|
|
273080
|
+
return servicePrompt({
|
|
273081
|
+
env: env2,
|
|
273082
|
+
services: possible,
|
|
273083
|
+
accept,
|
|
273084
|
+
envKey: "SETTLEMINT_IPFS",
|
|
273085
|
+
defaultHandler: async ({ defaultService: defaultStorage }) => {
|
|
273086
|
+
return esm_default2({
|
|
273087
|
+
message: "Which IPFS instance do you want to connect to?",
|
|
273088
|
+
choices: [
|
|
273089
|
+
...possible.map((storage) => ({
|
|
273090
|
+
name: storage.name,
|
|
273091
|
+
value: storage
|
|
273092
|
+
})),
|
|
273093
|
+
{
|
|
273094
|
+
name: "None",
|
|
273095
|
+
value: undefined
|
|
273096
|
+
}
|
|
273097
|
+
],
|
|
273098
|
+
default: defaultStorage
|
|
273099
|
+
});
|
|
273100
|
+
}
|
|
273064
273101
|
});
|
|
273065
|
-
return minio;
|
|
273066
273102
|
}
|
|
273067
273103
|
|
|
273068
273104
|
// src/commands/connect/minio.prompt.ts
|
|
273069
273105
|
async function minioPrompt(env2, storages, accept) {
|
|
273070
273106
|
const possible = storages.filter((storage) => storage.storageProtocol === "MINIO");
|
|
273071
|
-
|
|
273072
|
-
|
|
273073
|
-
|
|
273074
|
-
|
|
273075
|
-
|
|
273076
|
-
|
|
273077
|
-
|
|
273078
|
-
|
|
273079
|
-
|
|
273080
|
-
|
|
273081
|
-
|
|
273082
|
-
|
|
273083
|
-
|
|
273084
|
-
|
|
273085
|
-
|
|
273086
|
-
|
|
273087
|
-
|
|
273088
|
-
|
|
273089
|
-
|
|
273090
|
-
|
|
273091
|
-
|
|
273107
|
+
return servicePrompt({
|
|
273108
|
+
env: env2,
|
|
273109
|
+
services: possible,
|
|
273110
|
+
accept,
|
|
273111
|
+
envKey: "SETTLEMINT_MINIO",
|
|
273112
|
+
defaultHandler: async ({ defaultService: defaultStorage }) => {
|
|
273113
|
+
return esm_default2({
|
|
273114
|
+
message: "Which MinIO instance do you want to connect to?",
|
|
273115
|
+
choices: [
|
|
273116
|
+
...possible.map((storage) => ({
|
|
273117
|
+
name: storage.name,
|
|
273118
|
+
value: storage
|
|
273119
|
+
})),
|
|
273120
|
+
{
|
|
273121
|
+
name: "None",
|
|
273122
|
+
value: undefined
|
|
273123
|
+
}
|
|
273124
|
+
],
|
|
273125
|
+
default: defaultStorage
|
|
273126
|
+
});
|
|
273127
|
+
}
|
|
273092
273128
|
});
|
|
273093
|
-
return minio;
|
|
273094
273129
|
}
|
|
273095
273130
|
|
|
273096
273131
|
// src/commands/connect/portal.prompt.ts
|
|
273097
273132
|
async function portalPrompt(env2, middlewares, accept) {
|
|
273098
|
-
const possible = middlewares.filter((
|
|
273099
|
-
|
|
273100
|
-
|
|
273101
|
-
|
|
273102
|
-
|
|
273103
|
-
|
|
273104
|
-
|
|
273105
|
-
|
|
273106
|
-
|
|
273107
|
-
|
|
273108
|
-
|
|
273109
|
-
|
|
273110
|
-
|
|
273111
|
-
|
|
273112
|
-
|
|
273113
|
-
|
|
273114
|
-
|
|
273115
|
-
|
|
273116
|
-
|
|
273117
|
-
|
|
273118
|
-
|
|
273119
|
-
|
|
273133
|
+
const possible = middlewares.filter((middleware) => middleware.interface === "SMART_CONTRACT_PORTAL");
|
|
273134
|
+
return servicePrompt({
|
|
273135
|
+
env: env2,
|
|
273136
|
+
services: possible,
|
|
273137
|
+
accept,
|
|
273138
|
+
envKey: "SETTLEMINT_PORTAL",
|
|
273139
|
+
defaultHandler: async ({ defaultService: defaultMiddleware }) => {
|
|
273140
|
+
return esm_default2({
|
|
273141
|
+
message: "Which Smart Contract Portal instance do you want to connect to?",
|
|
273142
|
+
choices: [
|
|
273143
|
+
...possible.map((middleware) => ({
|
|
273144
|
+
name: middleware.name,
|
|
273145
|
+
value: middleware
|
|
273146
|
+
})),
|
|
273147
|
+
{
|
|
273148
|
+
name: "None",
|
|
273149
|
+
value: undefined
|
|
273150
|
+
}
|
|
273151
|
+
],
|
|
273152
|
+
default: defaultMiddleware
|
|
273153
|
+
});
|
|
273154
|
+
}
|
|
273120
273155
|
});
|
|
273121
|
-
return middleware;
|
|
273122
273156
|
}
|
|
273123
273157
|
|
|
273124
273158
|
// src/commands/connect/services.spinner.ts
|
|
@@ -273162,42 +273196,45 @@ async function servicesSpinner(settlemint, application) {
|
|
|
273162
273196
|
|
|
273163
273197
|
// src/commands/connect/thegraph.prompt.ts
|
|
273164
273198
|
async function theGraphPrompt(env2, middlewares, accept) {
|
|
273165
|
-
const possible = middlewares.filter((
|
|
273166
|
-
|
|
273167
|
-
|
|
273168
|
-
|
|
273169
|
-
|
|
273170
|
-
|
|
273171
|
-
|
|
273172
|
-
|
|
273173
|
-
|
|
273174
|
-
|
|
273175
|
-
|
|
273176
|
-
|
|
273177
|
-
|
|
273178
|
-
|
|
273179
|
-
|
|
273180
|
-
|
|
273181
|
-
|
|
273182
|
-
|
|
273183
|
-
|
|
273184
|
-
|
|
273185
|
-
|
|
273186
|
-
|
|
273199
|
+
const possible = middlewares.filter((middleware) => middleware.__typename === "HAGraphMiddleware");
|
|
273200
|
+
return servicePrompt({
|
|
273201
|
+
env: env2,
|
|
273202
|
+
services: possible,
|
|
273203
|
+
accept,
|
|
273204
|
+
envKey: "SETTLEMINT_THEGRAPH",
|
|
273205
|
+
defaultHandler: async ({ defaultService: defaultMiddleware }) => {
|
|
273206
|
+
return esm_default2({
|
|
273207
|
+
message: "Which The Graph instance do you want to connect to?",
|
|
273208
|
+
choices: [
|
|
273209
|
+
...possible.map((middleware) => ({
|
|
273210
|
+
name: middleware.name,
|
|
273211
|
+
value: middleware
|
|
273212
|
+
})),
|
|
273213
|
+
{
|
|
273214
|
+
name: "None",
|
|
273215
|
+
value: undefined
|
|
273216
|
+
}
|
|
273217
|
+
],
|
|
273218
|
+
default: defaultMiddleware
|
|
273219
|
+
});
|
|
273220
|
+
}
|
|
273187
273221
|
});
|
|
273188
|
-
return middleware;
|
|
273189
273222
|
}
|
|
273190
273223
|
|
|
273191
273224
|
// src/commands/connect/workspace.prompt.ts
|
|
273192
273225
|
async function workspacePrompt(env2, workspaces, accept) {
|
|
273226
|
+
const autoAccept = !!accept || is_in_ci_default;
|
|
273193
273227
|
const defaultWorkspace = workspaces.find((workspace2) => workspace2.uniqueName === env2.SETTLEMINT_WORKSPACE);
|
|
273194
|
-
const defaultPossible =
|
|
273228
|
+
const defaultPossible = autoAccept && defaultWorkspace;
|
|
273195
273229
|
if (defaultPossible) {
|
|
273196
273230
|
return defaultWorkspace;
|
|
273197
273231
|
}
|
|
273198
273232
|
if (workspaces.length === 0) {
|
|
273199
273233
|
cancel2("No workspaces found");
|
|
273200
273234
|
}
|
|
273235
|
+
if (is_in_ci_default) {
|
|
273236
|
+
nothingSelectedError("workspace");
|
|
273237
|
+
}
|
|
273201
273238
|
const workspace = await esm_default2({
|
|
273202
273239
|
message: "Which workspace do you want to connect to?",
|
|
273203
273240
|
choices: workspaces.map((workspace2) => ({
|
|
@@ -273216,9 +273253,8 @@ async function workspacePrompt(env2, workspaces, accept) {
|
|
|
273216
273253
|
function connectCommand() {
|
|
273217
273254
|
return new Command("connect").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values").description("Connects your project to your application on SettleMint").action(async ({ acceptDefaults, prod }) => {
|
|
273218
273255
|
intro("Connecting your dApp to SettleMint");
|
|
273219
|
-
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
273220
273256
|
const env2 = await loadEnv2(false, !!prod);
|
|
273221
|
-
const instance = await instancePrompt(env2,
|
|
273257
|
+
const instance = await instancePrompt(env2, acceptDefaults);
|
|
273222
273258
|
const personalAccessToken = await getInstanceCredentials(instance);
|
|
273223
273259
|
if (!personalAccessToken) {
|
|
273224
273260
|
return missingPersonalAccessTokenError();
|
|
@@ -273229,20 +273265,20 @@ function connectCommand() {
|
|
|
273229
273265
|
instance
|
|
273230
273266
|
});
|
|
273231
273267
|
const workspaces = await workspaceSpinner(settlemint);
|
|
273232
|
-
const workspace = await workspacePrompt(env2, workspaces,
|
|
273233
|
-
const application = await applicationPrompt(env2, workspace?.applications ?? [],
|
|
273234
|
-
const aatToken = await applicationAccessTokenPrompt(env2, application, settlemint,
|
|
273268
|
+
const workspace = await workspacePrompt(env2, workspaces, acceptDefaults);
|
|
273269
|
+
const application = await applicationPrompt(env2, workspace?.applications ?? [], acceptDefaults);
|
|
273270
|
+
const aatToken = await applicationAccessTokenPrompt(env2, application, settlemint, acceptDefaults);
|
|
273235
273271
|
const { middleware, integrationTool, storage, privateKey, insights, customDeployment, blockchainNodes } = await servicesSpinner(settlemint, application);
|
|
273236
|
-
const blockchainNode = await blockchainNodePrompt(env2, blockchainNodes,
|
|
273237
|
-
const hasura = await hasuraPrompt(env2, integrationTool,
|
|
273238
|
-
const thegraph = await theGraphPrompt(env2, middleware,
|
|
273239
|
-
const portal = await portalPrompt(env2, middleware,
|
|
273240
|
-
const ipfs = await ipfsPrompt(env2, storage,
|
|
273241
|
-
const minio = await minioPrompt(env2, storage,
|
|
273242
|
-
const hdPrivateKey = await hdPrivateKeyPrompt(env2, privateKey,
|
|
273243
|
-
const cDeployment = await customDeploymentPrompt(env2, customDeployment,
|
|
273244
|
-
const blockscout = await blockscoutPrompt(env2, insights,
|
|
273245
|
-
if (
|
|
273272
|
+
const blockchainNode = await blockchainNodePrompt(env2, blockchainNodes, acceptDefaults);
|
|
273273
|
+
const hasura = await hasuraPrompt(env2, integrationTool, acceptDefaults);
|
|
273274
|
+
const thegraph = await theGraphPrompt(env2, middleware, acceptDefaults);
|
|
273275
|
+
const portal = await portalPrompt(env2, middleware, acceptDefaults);
|
|
273276
|
+
const ipfs = await ipfsPrompt(env2, storage, acceptDefaults);
|
|
273277
|
+
const minio = await minioPrompt(env2, storage, acceptDefaults);
|
|
273278
|
+
const hdPrivateKey = await hdPrivateKeyPrompt(env2, privateKey, acceptDefaults);
|
|
273279
|
+
const cDeployment = await customDeploymentPrompt(env2, customDeployment, acceptDefaults);
|
|
273280
|
+
const blockscout = await blockscoutPrompt(env2, insights, acceptDefaults);
|
|
273281
|
+
if (acceptDefaults) {
|
|
273246
273282
|
const selectedServices = [
|
|
273247
273283
|
`Workspace: ${workspace.name}`,
|
|
273248
273284
|
`Application: ${application.name}`,
|
|
@@ -274112,7 +274148,7 @@ function createCommand2() {
|
|
|
274112
274148
|
}
|
|
274113
274149
|
const selectedTemplate = await templatePrompt(templates, template);
|
|
274114
274150
|
if (!selectedTemplate) {
|
|
274115
|
-
|
|
274151
|
+
return nothingSelectedError("template");
|
|
274116
274152
|
}
|
|
274117
274153
|
await spinner({
|
|
274118
274154
|
startMessage: "Scaffolding the project",
|
|
@@ -274444,11 +274480,11 @@ function getCreateCommand({
|
|
|
274444
274480
|
if (requiresDeployment) {
|
|
274445
274481
|
const selectedProvider = await providerPrompt(platformConfig, provider);
|
|
274446
274482
|
if (!selectedProvider) {
|
|
274447
|
-
|
|
274483
|
+
return nothingSelectedError("provider");
|
|
274448
274484
|
}
|
|
274449
274485
|
const selectedRegion = await regionPrompt(selectedProvider, region);
|
|
274450
274486
|
if (!selectedRegion) {
|
|
274451
|
-
|
|
274487
|
+
return nothingSelectedError("region");
|
|
274452
274488
|
}
|
|
274453
274489
|
}
|
|
274454
274490
|
const { result, waitFor, mapDefaultEnv } = await spinner({
|
|
@@ -274524,6 +274560,9 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274524
274560
|
region
|
|
274525
274561
|
}, async (settlemint, env2) => {
|
|
274526
274562
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274563
|
+
if (!applicationUniqueName) {
|
|
274564
|
+
return missingApplication();
|
|
274565
|
+
}
|
|
274527
274566
|
const result = await settlemint.blockchainNetwork.create({
|
|
274528
274567
|
name: name2,
|
|
274529
274568
|
applicationUniqueName,
|
|
@@ -274731,6 +274770,9 @@ function applicationAccessTokenCreateCommand() {
|
|
|
274731
274770
|
cmd2.option("-a, --application <application>", "The application unique name to create the application access token for (defaults to application from env)").addOption(new Option("-v, --validity-period <period>", "The validity period for the token").choices(["DAYS_7", "DAYS_30", "DAYS_60", "DAYS_90", "NONE"]).default("DAYS_7")).action(async (name2, { application, validityPeriod, ...defaultArgs }) => {
|
|
274732
274771
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274733
274772
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274773
|
+
if (!applicationUniqueName) {
|
|
274774
|
+
return missingApplication();
|
|
274775
|
+
}
|
|
274734
274776
|
const aatToken = await settlemint.applicationAccessToken.create({
|
|
274735
274777
|
applicationUniqueName,
|
|
274736
274778
|
name: name2,
|
|
@@ -274783,6 +274825,7 @@ function applicationAccessTokenCreateCommand() {
|
|
|
274783
274825
|
uniqueName: ""
|
|
274784
274826
|
},
|
|
274785
274827
|
mapDefaultEnv: () => ({
|
|
274828
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
274786
274829
|
SETTLEMINT_ACCESS_TOKEN: aatToken
|
|
274787
274830
|
})
|
|
274788
274831
|
};
|
|
@@ -274814,11 +274857,23 @@ function applicationCreateCommand() {
|
|
|
274814
274857
|
type: "application",
|
|
274815
274858
|
alias: "a",
|
|
274816
274859
|
execute: (cmd2, baseAction) => {
|
|
274817
|
-
cmd2.option("-w, --workspace <workspace>", "The workspace unique name to create the application in (defaults to workspace from env)").action(async (name2, { workspace, ...defaultArgs }) => {
|
|
274818
|
-
return baseAction(
|
|
274860
|
+
cmd2.option("-w, --workspace <workspace>", "The workspace unique name to create the application in (defaults to workspace from env)").action(async (name2, { workspace, acceptDefaults, ...defaultArgs }) => {
|
|
274861
|
+
return baseAction({
|
|
274862
|
+
...defaultArgs,
|
|
274863
|
+
acceptDefaults
|
|
274864
|
+
}, async (settlemint, env2) => {
|
|
274865
|
+
let workspaceUniqueName = workspace;
|
|
274866
|
+
if (!workspaceUniqueName) {
|
|
274867
|
+
const workspaces = await settlemint.workspace.list();
|
|
274868
|
+
const workspace2 = await workspacePrompt(env2, workspaces, acceptDefaults);
|
|
274869
|
+
if (!workspace2) {
|
|
274870
|
+
return nothingSelectedError("workspace");
|
|
274871
|
+
}
|
|
274872
|
+
workspaceUniqueName = workspace2.uniqueName;
|
|
274873
|
+
}
|
|
274819
274874
|
const result = await settlemint.application.create({
|
|
274820
274875
|
name: name2,
|
|
274821
|
-
workspaceUniqueName
|
|
274876
|
+
workspaceUniqueName
|
|
274822
274877
|
});
|
|
274823
274878
|
return {
|
|
274824
274879
|
result,
|
|
@@ -274851,27 +274906,27 @@ function applicationCreateCommand() {
|
|
|
274851
274906
|
|
|
274852
274907
|
// src/commands/connect/blockchain-network.prompt.ts
|
|
274853
274908
|
async function blockchainNetworkPrompt(env2, networks, accept) {
|
|
274854
|
-
|
|
274855
|
-
|
|
274856
|
-
|
|
274857
|
-
|
|
274858
|
-
|
|
274859
|
-
|
|
274860
|
-
|
|
274861
|
-
|
|
274862
|
-
|
|
274863
|
-
|
|
274864
|
-
|
|
274865
|
-
|
|
274866
|
-
|
|
274867
|
-
|
|
274868
|
-
|
|
274869
|
-
|
|
274870
|
-
|
|
274871
|
-
|
|
274872
|
-
|
|
274873
|
-
|
|
274874
|
-
|
|
274909
|
+
return servicePrompt({
|
|
274910
|
+
env: env2,
|
|
274911
|
+
services: networks,
|
|
274912
|
+
accept,
|
|
274913
|
+
envKey: "SETTLEMINT_BLOCKCHAIN_NETWORK",
|
|
274914
|
+
defaultHandler: async ({ defaultService: defaultNetwork }) => {
|
|
274915
|
+
return esm_default2({
|
|
274916
|
+
message: "Which blockchain network do you want to connect to?",
|
|
274917
|
+
choices: [
|
|
274918
|
+
...networks.map((network) => ({
|
|
274919
|
+
name: network.name,
|
|
274920
|
+
value: network
|
|
274921
|
+
})),
|
|
274922
|
+
{
|
|
274923
|
+
name: "None",
|
|
274924
|
+
value: undefined
|
|
274925
|
+
}
|
|
274926
|
+
],
|
|
274927
|
+
default: defaultNetwork
|
|
274928
|
+
});
|
|
274929
|
+
}
|
|
274875
274930
|
});
|
|
274876
274931
|
}
|
|
274877
274932
|
|
|
@@ -274900,19 +274955,18 @@ function blockchainNodeBesuCreateCommand() {
|
|
|
274900
274955
|
provider,
|
|
274901
274956
|
region
|
|
274902
274957
|
}, async (settlemint, env2) => {
|
|
274903
|
-
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274904
274958
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274905
274959
|
if (!applicationUniqueName) {
|
|
274906
|
-
|
|
274960
|
+
return missingApplication();
|
|
274907
274961
|
}
|
|
274908
|
-
let networkUniqueName = blockchainNetwork
|
|
274962
|
+
let networkUniqueName = blockchainNetwork;
|
|
274909
274963
|
if (!networkUniqueName) {
|
|
274910
274964
|
const networks = await settlemint.blockchainNetwork.list(applicationUniqueName);
|
|
274911
|
-
const network = await blockchainNetworkPrompt(env2, networks, acceptDefaults
|
|
274965
|
+
const network = await blockchainNetworkPrompt(env2, networks, acceptDefaults);
|
|
274912
274966
|
if (!network) {
|
|
274913
|
-
|
|
274967
|
+
return nothingSelectedError("blockchain network");
|
|
274914
274968
|
}
|
|
274915
|
-
networkUniqueName = network?.
|
|
274969
|
+
networkUniqueName = network?.uniqueName;
|
|
274916
274970
|
}
|
|
274917
274971
|
const result = await settlemint.blockchainNode.create({
|
|
274918
274972
|
applicationUniqueName,
|
|
@@ -274930,7 +274984,7 @@ function blockchainNodeBesuCreateCommand() {
|
|
|
274930
274984
|
mapDefaultEnv: () => {
|
|
274931
274985
|
return {
|
|
274932
274986
|
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
274933
|
-
SETTLEMINT_BLOCKCHAIN_NODE: result.
|
|
274987
|
+
SETTLEMINT_BLOCKCHAIN_NODE: result.uniqueName
|
|
274934
274988
|
};
|
|
274935
274989
|
}
|
|
274936
274990
|
};
|
|
@@ -274966,15 +275020,27 @@ function blockscoutInsightsCreateCommand() {
|
|
|
274966
275020
|
type: "insights",
|
|
274967
275021
|
alias: "bs",
|
|
274968
275022
|
execute: (cmd2, baseAction) => {
|
|
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 }) => {
|
|
275023
|
+
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, acceptDefaults, ...defaultArgs }) => {
|
|
274970
275024
|
return baseAction({
|
|
274971
275025
|
...defaultArgs,
|
|
275026
|
+
acceptDefaults,
|
|
274972
275027
|
provider,
|
|
274973
275028
|
region
|
|
274974
275029
|
}, async (settlemint, env2) => {
|
|
274975
275030
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274976
|
-
|
|
275031
|
+
if (!applicationUniqueName) {
|
|
275032
|
+
return missingApplication();
|
|
275033
|
+
}
|
|
275034
|
+
let blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
274977
275035
|
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
|
|
275036
|
+
if (!blockchainNodeUniqueName && !loadBalancerUniqueName) {
|
|
275037
|
+
const blockchainNodes = await settlemint.blockchainNode.list(applicationUniqueName);
|
|
275038
|
+
const node = await blockchainNodePrompt(env2, blockchainNodes, acceptDefaults);
|
|
275039
|
+
if (!node) {
|
|
275040
|
+
return nothingSelectedError("blockchain node");
|
|
275041
|
+
}
|
|
275042
|
+
blockchainNodeUniqueName = node.uniqueName;
|
|
275043
|
+
}
|
|
274978
275044
|
const result = await settlemint.insights.create({
|
|
274979
275045
|
name: name2,
|
|
274980
275046
|
applicationUniqueName,
|
|
@@ -275033,6 +275099,9 @@ function hasuraIntegrationCreateCommand() {
|
|
|
275033
275099
|
region
|
|
275034
275100
|
}, async (settlemint, env2) => {
|
|
275035
275101
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275102
|
+
if (!applicationUniqueName) {
|
|
275103
|
+
return missingApplication();
|
|
275104
|
+
}
|
|
275036
275105
|
const result = await settlemint.integrationTool.create({
|
|
275037
275106
|
name: name2,
|
|
275038
275107
|
applicationUniqueName,
|
|
@@ -275082,14 +275151,26 @@ function graphMiddlewareCreateCommand() {
|
|
|
275082
275151
|
type: "middleware",
|
|
275083
275152
|
alias: "gr",
|
|
275084
275153
|
execute: (cmd2, baseAction) => {
|
|
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 }) => {
|
|
275154
|
+
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, acceptDefaults, ...defaultArgs }) => {
|
|
275086
275155
|
return baseAction({
|
|
275087
275156
|
...defaultArgs,
|
|
275157
|
+
acceptDefaults,
|
|
275088
275158
|
provider,
|
|
275089
275159
|
region
|
|
275090
275160
|
}, async (settlemint, env2) => {
|
|
275091
275161
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275092
|
-
|
|
275162
|
+
if (!applicationUniqueName) {
|
|
275163
|
+
return missingApplication();
|
|
275164
|
+
}
|
|
275165
|
+
let blockchainNodeUniqueName = blockchainNode;
|
|
275166
|
+
if (!blockchainNodeUniqueName) {
|
|
275167
|
+
const blockchainNodes = await settlemint.blockchainNode.list(applicationUniqueName);
|
|
275168
|
+
const node = await blockchainNodePrompt(env2, blockchainNodes, acceptDefaults);
|
|
275169
|
+
if (!node) {
|
|
275170
|
+
return nothingSelectedError("blockchain node");
|
|
275171
|
+
}
|
|
275172
|
+
blockchainNodeUniqueName = node.uniqueName;
|
|
275173
|
+
}
|
|
275093
275174
|
const result = await settlemint.middleware.create({
|
|
275094
275175
|
name: name2,
|
|
275095
275176
|
applicationUniqueName,
|
|
@@ -275145,16 +275226,29 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275145
275226
|
type: type4,
|
|
275146
275227
|
includePredeployedAbis,
|
|
275147
275228
|
abis,
|
|
275229
|
+
acceptDefaults,
|
|
275148
275230
|
...defaultArgs
|
|
275149
275231
|
}) => {
|
|
275150
275232
|
return baseAction({
|
|
275151
275233
|
...defaultArgs,
|
|
275234
|
+
acceptDefaults,
|
|
275152
275235
|
provider,
|
|
275153
275236
|
region
|
|
275154
275237
|
}, async (settlemint, env2) => {
|
|
275155
275238
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275156
|
-
|
|
275239
|
+
if (!applicationUniqueName) {
|
|
275240
|
+
return missingApplication();
|
|
275241
|
+
}
|
|
275242
|
+
let blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275157
275243
|
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
|
|
275244
|
+
if (!blockchainNodeUniqueName && !loadBalancerUniqueName) {
|
|
275245
|
+
const blockchainNodes = await settlemint.blockchainNode.list(applicationUniqueName);
|
|
275246
|
+
const node = await blockchainNodePrompt(env2, blockchainNodes, acceptDefaults);
|
|
275247
|
+
if (!node) {
|
|
275248
|
+
return nothingSelectedError("blockchain node");
|
|
275249
|
+
}
|
|
275250
|
+
blockchainNodeUniqueName = node.uniqueName;
|
|
275251
|
+
}
|
|
275158
275252
|
const parsedAbis = [];
|
|
275159
275253
|
if (abis && abis.length > 0) {
|
|
275160
275254
|
try {
|
|
@@ -275227,14 +275321,26 @@ function privateKeyHdCreateCommand() {
|
|
|
275227
275321
|
type: "private key",
|
|
275228
275322
|
alias: "hd",
|
|
275229
275323
|
execute: (cmd2, baseAction) => {
|
|
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 }) => {
|
|
275324
|
+
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, acceptDefaults, ...defaultArgs }) => {
|
|
275231
275325
|
return baseAction({
|
|
275232
275326
|
...defaultArgs,
|
|
275327
|
+
acceptDefaults,
|
|
275233
275328
|
provider,
|
|
275234
275329
|
region
|
|
275235
275330
|
}, async (settlemint, env2) => {
|
|
275236
275331
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275237
|
-
|
|
275332
|
+
if (!applicationUniqueName) {
|
|
275333
|
+
return missingApplication();
|
|
275334
|
+
}
|
|
275335
|
+
let blockchainNodeUniqueName = blockchainNode;
|
|
275336
|
+
if (!blockchainNodeUniqueName) {
|
|
275337
|
+
const blockchainNodes = await settlemint.blockchainNode.list(applicationUniqueName);
|
|
275338
|
+
const node = await blockchainNodePrompt(env2, blockchainNodes, acceptDefaults);
|
|
275339
|
+
if (!node) {
|
|
275340
|
+
return nothingSelectedError("blockchain node");
|
|
275341
|
+
}
|
|
275342
|
+
blockchainNodeUniqueName = node.uniqueName;
|
|
275343
|
+
}
|
|
275238
275344
|
const result = await settlemint.privateKey.create({
|
|
275239
275345
|
name: name2,
|
|
275240
275346
|
applicationUniqueName,
|
|
@@ -275281,14 +275387,26 @@ function privateKeyHsmCreateCommand() {
|
|
|
275281
275387
|
type: "private key",
|
|
275282
275388
|
alias: "hd",
|
|
275283
275389
|
execute: (cmd2, baseAction) => {
|
|
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 }) => {
|
|
275390
|
+
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, acceptDefaults, ...defaultArgs }) => {
|
|
275285
275391
|
return baseAction({
|
|
275286
275392
|
...defaultArgs,
|
|
275393
|
+
acceptDefaults,
|
|
275287
275394
|
provider,
|
|
275288
275395
|
region
|
|
275289
275396
|
}, async (settlemint, env2) => {
|
|
275290
275397
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275291
|
-
|
|
275398
|
+
if (!applicationUniqueName) {
|
|
275399
|
+
return missingApplication();
|
|
275400
|
+
}
|
|
275401
|
+
let blockchainNodeUniqueName = blockchainNode;
|
|
275402
|
+
if (!blockchainNodeUniqueName) {
|
|
275403
|
+
const blockchainNodes = await settlemint.blockchainNode.list(applicationUniqueName);
|
|
275404
|
+
const node = await blockchainNodePrompt(env2, blockchainNodes, acceptDefaults);
|
|
275405
|
+
if (!node) {
|
|
275406
|
+
return nothingSelectedError("blockchain node");
|
|
275407
|
+
}
|
|
275408
|
+
blockchainNodeUniqueName = node.uniqueName;
|
|
275409
|
+
}
|
|
275292
275410
|
const result = await settlemint.privateKey.create({
|
|
275293
275411
|
name: name2,
|
|
275294
275412
|
applicationUniqueName,
|
|
@@ -275341,6 +275459,9 @@ function ipfsStorageCreateCommand() {
|
|
|
275341
275459
|
region
|
|
275342
275460
|
}, async (settlemint, env2) => {
|
|
275343
275461
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275462
|
+
if (!applicationUniqueName) {
|
|
275463
|
+
return missingApplication();
|
|
275464
|
+
}
|
|
275344
275465
|
const result = await settlemint.storage.create({
|
|
275345
275466
|
name: name2,
|
|
275346
275467
|
applicationUniqueName,
|
|
@@ -275390,6 +275511,9 @@ function minioStorageCreateCommand() {
|
|
|
275390
275511
|
region
|
|
275391
275512
|
}, async (settlemint, env2) => {
|
|
275392
275513
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275514
|
+
if (!applicationUniqueName) {
|
|
275515
|
+
return missingApplication();
|
|
275516
|
+
}
|
|
275393
275517
|
const result = await settlemint.storage.create({
|
|
275394
275518
|
name: name2,
|
|
275395
275519
|
applicationUniqueName,
|
|
@@ -275483,9 +275607,8 @@ function getDeleteCommand({
|
|
|
275483
275607
|
if (!force) {
|
|
275484
275608
|
await deleteConfirmationPrompt(`this ${type4}`);
|
|
275485
275609
|
}
|
|
275486
|
-
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
275487
275610
|
const env2 = await loadEnv2(false, !!prod);
|
|
275488
|
-
const instance = await instancePrompt(env2,
|
|
275611
|
+
const instance = await instancePrompt(env2, acceptDefaults);
|
|
275489
275612
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275490
275613
|
env: env2,
|
|
275491
275614
|
instance,
|
|
@@ -275578,9 +275701,8 @@ function getRestartCommand({
|
|
|
275578
275701
|
}
|
|
275579
275702
|
])).argument("<unique-name>", `The unique name of the ${type4}, use 'default' to restart the default one from your .env file`).option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").option("-w, --wait", "Wait until restarted").action(async (uniqueName, { acceptDefaults, prod, wait }) => {
|
|
275580
275703
|
intro(`Restarting ${type4} in the SettleMint platform`);
|
|
275581
|
-
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
275582
275704
|
const env2 = await loadEnv2(false, !!prod);
|
|
275583
|
-
const instance = await instancePrompt(env2,
|
|
275705
|
+
const instance = await instancePrompt(env2, acceptDefaults);
|
|
275584
275706
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275585
275707
|
env: env2,
|
|
275586
275708
|
instance,
|
|
@@ -275894,7 +276016,7 @@ function createCommand4() {
|
|
|
275894
276016
|
const platformConfig = await settlemint.platform.config();
|
|
275895
276017
|
const selectedUseCase = await useCasePrompt(platformConfig, useCase);
|
|
275896
276018
|
if (!selectedUseCase) {
|
|
275897
|
-
|
|
276019
|
+
return nothingSelectedError("use case");
|
|
275898
276020
|
}
|
|
275899
276021
|
const targetDir = formatTargetDir(name2);
|
|
275900
276022
|
const projectDir = join8(process.cwd(), targetDir);
|
|
@@ -276196,6 +276318,9 @@ function hardhatDeployRemoteCommand() {
|
|
|
276196
276318
|
const nodeUniqueName = blockchainNodeUniqueName ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
|
|
276197
276319
|
let node = undefined;
|
|
276198
276320
|
if (!nodeUniqueName) {
|
|
276321
|
+
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276322
|
+
return missingApplication();
|
|
276323
|
+
}
|
|
276199
276324
|
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276200
276325
|
const evmNodes = nodes.filter((node2) => node2.isEvm);
|
|
276201
276326
|
if (evmNodes.length === 0) {
|
|
@@ -276206,9 +276331,9 @@ function hardhatDeployRemoteCommand() {
|
|
|
276206
276331
|
if (nodesWithActivePrivateKey.length === 0) {
|
|
276207
276332
|
cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276208
276333
|
}
|
|
276209
|
-
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey,
|
|
276334
|
+
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, acceptDefaults);
|
|
276210
276335
|
if (!blockchainNode) {
|
|
276211
|
-
|
|
276336
|
+
return nothingSelectedError("EVM blockchain node");
|
|
276212
276337
|
}
|
|
276213
276338
|
node = blockchainNode;
|
|
276214
276339
|
} else {
|
|
@@ -276224,7 +276349,7 @@ function hardhatDeployRemoteCommand() {
|
|
|
276224
276349
|
}
|
|
276225
276350
|
const address = await addressPrompt({ env: env2, accept: autoAccept, prod, node, hardhatConfig });
|
|
276226
276351
|
if (!address) {
|
|
276227
|
-
|
|
276352
|
+
return nothingSelectedError("private key");
|
|
276228
276353
|
}
|
|
276229
276354
|
const { command, args } = await getPackageManagerExecutable();
|
|
276230
276355
|
await executeCommand(command, [
|
|
@@ -276308,14 +276433,31 @@ function hardhatScriptRemoteCommand() {
|
|
|
276308
276433
|
accessToken,
|
|
276309
276434
|
instance
|
|
276310
276435
|
});
|
|
276311
|
-
let nodeUniqueName = blockchainNodeUniqueName;
|
|
276436
|
+
let nodeUniqueName = blockchainNodeUniqueName ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
|
|
276312
276437
|
if (!nodeUniqueName) {
|
|
276313
|
-
|
|
276314
|
-
|
|
276438
|
+
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276439
|
+
return missingApplication();
|
|
276440
|
+
}
|
|
276441
|
+
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276442
|
+
const evmNodes = nodes.filter((node) => node.isEvm);
|
|
276443
|
+
if (evmNodes.length === 0) {
|
|
276444
|
+
cancel("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276445
|
+
}
|
|
276446
|
+
const nodesWithPrivateKey = await Promise.all(nodes.map((node) => settlemint.blockchainNode.read(node.uniqueName)));
|
|
276447
|
+
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node) => node.privateKeys && node.privateKeys.length > 0);
|
|
276448
|
+
if (nodesWithActivePrivateKey.length === 0) {
|
|
276449
|
+
cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276450
|
+
}
|
|
276451
|
+
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, acceptDefaults);
|
|
276315
276452
|
if (!blockchainNode) {
|
|
276316
|
-
|
|
276453
|
+
return nothingSelectedError("EVM blockchain node");
|
|
276317
276454
|
}
|
|
276318
276455
|
nodeUniqueName = blockchainNode.uniqueName;
|
|
276456
|
+
} else {
|
|
276457
|
+
const node = await settlemint.blockchainNode.read(nodeUniqueName);
|
|
276458
|
+
if (!node.isEvm) {
|
|
276459
|
+
cancel("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276460
|
+
}
|
|
276319
276461
|
}
|
|
276320
276462
|
const envConfig = await settlemint.foundry.env(nodeUniqueName);
|
|
276321
276463
|
const { command, args } = await getPackageManagerExecutable();
|
|
@@ -276534,6 +276676,9 @@ async function getTheGraphMiddleware({
|
|
|
276534
276676
|
return defaultTheGraphMiddleware;
|
|
276535
276677
|
}
|
|
276536
276678
|
}
|
|
276679
|
+
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276680
|
+
return missingApplication();
|
|
276681
|
+
}
|
|
276537
276682
|
const middlewares = await settlemintClient.middleware.list(env2.SETTLEMINT_APPLICATION);
|
|
276538
276683
|
return theGraphPrompt(env2, middlewares, autoAccept);
|
|
276539
276684
|
}
|
|
@@ -276643,7 +276788,7 @@ function subgraphDeployCommand() {
|
|
|
276643
276788
|
});
|
|
276644
276789
|
const theGraphMiddleware = await getTheGraphMiddleware({ env: env2, instance, accessToken, autoAccept });
|
|
276645
276790
|
if (!theGraphMiddleware) {
|
|
276646
|
-
|
|
276791
|
+
return nothingSelectedError("graph middleware");
|
|
276647
276792
|
}
|
|
276648
276793
|
const network = await getTheGraphNetwork({ theGraphMiddleware, env: env2, instance, accessToken });
|
|
276649
276794
|
await subgraphSetup({
|
|
@@ -276746,4 +276891,4 @@ function sdkCliCommand(exitOverride = undefined) {
|
|
|
276746
276891
|
ascii();
|
|
276747
276892
|
sdkCliCommand();
|
|
276748
276893
|
|
|
276749
|
-
//# debugId=
|
|
276894
|
+
//# debugId=511923E9B1FE059C64756E2164756E21
|