@settlemint/sdk-cli 0.9.3-prc02a8001 → 0.9.3-prc4848968
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 +187 -114
- package/dist/cli.js.map +26 -23
- 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.L5V2AdvzQF:/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.L5V2AdvzQF:/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.L5V2AdvzQF:/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.L5V2AdvzQF:/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-prc4848968",
|
|
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.L5V2AdvzQF:/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-prc4848968",
|
|
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-prc4848968",
|
|
256845
|
+
"@settlemint/sdk-utils": "0.9.3-prc4848968",
|
|
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);
|
|
@@ -267903,7 +267906,13 @@ export const { client: theGraphClient${nameSuffix}, graphql: theGraphGraphql${na
|
|
|
267903
267906
|
import { writeFile as writeFile4 } from "node:fs/promises";
|
|
267904
267907
|
|
|
267905
267908
|
// src/commands/codegen/test-gql-endpoint.ts
|
|
267906
|
-
async function testGqlEndpoint(
|
|
267909
|
+
async function testGqlEndpoint({
|
|
267910
|
+
accessToken,
|
|
267911
|
+
hasuraAdminSecret,
|
|
267912
|
+
gqlEndpoint,
|
|
267913
|
+
isHasura = false,
|
|
267914
|
+
maxRetries = 3
|
|
267915
|
+
}) {
|
|
267907
267916
|
if (!gqlEndpoint) {
|
|
267908
267917
|
return false;
|
|
267909
267918
|
}
|
|
@@ -268845,12 +268854,29 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
|
268845
268854
|
const name2 = gqlEndpoint.split("/").pop();
|
|
268846
268855
|
return name2 && (!thegraphSubgraphNames || thegraphSubgraphNames.includes(name2));
|
|
268847
268856
|
});
|
|
268848
|
-
const [hasura, portal,
|
|
268849
|
-
testGqlEndpoint(
|
|
268850
|
-
|
|
268851
|
-
|
|
268852
|
-
|
|
268857
|
+
const [hasura, portal, blockscout] = await Promise.all([
|
|
268858
|
+
testGqlEndpoint({
|
|
268859
|
+
accessToken,
|
|
268860
|
+
hasuraAdminSecret: env2.SETTLEMINT_HASURA_ADMIN_SECRET,
|
|
268861
|
+
gqlEndpoint: env2.SETTLEMINT_HASURA_ENDPOINT,
|
|
268862
|
+
isHasura: true
|
|
268863
|
+
}),
|
|
268864
|
+
testGqlEndpoint({
|
|
268865
|
+
accessToken,
|
|
268866
|
+
gqlEndpoint: env2.SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT
|
|
268867
|
+
}),
|
|
268868
|
+
testGqlEndpoint({
|
|
268869
|
+
accessToken,
|
|
268870
|
+
gqlEndpoint: env2.SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT
|
|
268871
|
+
})
|
|
268853
268872
|
]);
|
|
268873
|
+
const thegraph = await Promise.all(theGraphEndpoints.map((endpoint) => {
|
|
268874
|
+
const success = testGqlEndpoint({
|
|
268875
|
+
accessToken,
|
|
268876
|
+
gqlEndpoint: endpoint
|
|
268877
|
+
});
|
|
268878
|
+
return { success, endpoint };
|
|
268879
|
+
}));
|
|
268854
268880
|
if (!tsconfig.config.compilerOptions) {
|
|
268855
268881
|
tsconfig.config.compilerOptions = {};
|
|
268856
268882
|
}
|
|
@@ -268869,7 +268895,7 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
|
268869
268895
|
tadaTurboLocation: "hasura-cache.d.ts"
|
|
268870
268896
|
}
|
|
268871
268897
|
] : [],
|
|
268872
|
-
...thegraph ?
|
|
268898
|
+
...thegraph ? thegraph.filter((endpoint) => endpoint.success).map(({ endpoint }) => {
|
|
268873
268899
|
const name2 = endpoint.split("/").pop();
|
|
268874
268900
|
return {
|
|
268875
268901
|
name: `thegraph-${name2}`,
|
|
@@ -270063,9 +270089,12 @@ async function loadEnvironmentEnv2(validateEnv, prod, path5 = process.cwd()) {
|
|
|
270063
270089
|
return {};
|
|
270064
270090
|
}
|
|
270065
270091
|
}
|
|
270066
|
-
async function projectRoot2() {
|
|
270092
|
+
async function projectRoot2(fallbackToCwd = false) {
|
|
270067
270093
|
const packageJsonPath = await findUp("package.json");
|
|
270068
270094
|
if (!packageJsonPath) {
|
|
270095
|
+
if (fallbackToCwd) {
|
|
270096
|
+
return process.cwd();
|
|
270097
|
+
}
|
|
270069
270098
|
throw new Error("Unable to find project root (no package.json found)");
|
|
270070
270099
|
}
|
|
270071
270100
|
return dirname5(packageJsonPath);
|
|
@@ -270116,7 +270145,7 @@ async function findMonoRepoPackages(projectDir) {
|
|
|
270116
270145
|
}
|
|
270117
270146
|
}
|
|
270118
270147
|
async function writeEnv(prod, env2, secrets) {
|
|
270119
|
-
const projectDir = await projectRoot2();
|
|
270148
|
+
const projectDir = await projectRoot2(true);
|
|
270120
270149
|
if (prod) {
|
|
270121
270150
|
process.env.NODE_ENV = "production";
|
|
270122
270151
|
}
|
|
@@ -270505,7 +270534,7 @@ async function getGraphEndpoint(service, env2) {
|
|
|
270505
270534
|
const isStarterKit = (id) => id.endsWith("-starterkits");
|
|
270506
270535
|
const testEndpoint = service.subgraphs.find(({ graphqlQueryEndpoint }) => !isStarterKit(graphqlQueryEndpoint?.id))?.graphqlQueryEndpoint?.displayValue;
|
|
270507
270536
|
const starterKitEndpoint = service.subgraphs.find(({ graphqlQueryEndpoint }) => isStarterKit(graphqlQueryEndpoint?.id))?.graphqlQueryEndpoint?.displayValue;
|
|
270508
|
-
const hasEndpoint = testEndpoint && env2.SETTLEMINT_ACCESS_TOKEN ? await testGqlEndpoint(env2.SETTLEMINT_ACCESS_TOKEN,
|
|
270537
|
+
const hasEndpoint = testEndpoint && env2.SETTLEMINT_ACCESS_TOKEN ? await testGqlEndpoint({ accessToken: env2.SETTLEMINT_ACCESS_TOKEN, gqlEndpoint: testEndpoint }) : false;
|
|
270509
270538
|
const endpoints = hasEndpoint ? service.subgraphs.map(({ graphqlQueryEndpoint }) => graphqlQueryEndpoint?.displayValue) : starterKitEndpoint ? [starterKitEndpoint] : [];
|
|
270510
270539
|
if (endpoints.length === 0) {
|
|
270511
270540
|
return {};
|
|
@@ -270564,6 +270593,17 @@ function getMinioEndpoints(service) {
|
|
|
270564
270593
|
};
|
|
270565
270594
|
}
|
|
270566
270595
|
|
|
270596
|
+
// src/utils/instance-url-utils.ts
|
|
270597
|
+
function sanitizeInstanceUrl(url) {
|
|
270598
|
+
const instanceUrl = new URL(url);
|
|
270599
|
+
return instanceUrl.origin;
|
|
270600
|
+
}
|
|
270601
|
+
function sanitizeAndValidateInstanceUrl(url) {
|
|
270602
|
+
const sanitizedUrl = sanitizeInstanceUrl(url);
|
|
270603
|
+
validate(UrlSchema, sanitizedUrl);
|
|
270604
|
+
return sanitizedUrl;
|
|
270605
|
+
}
|
|
270606
|
+
|
|
270567
270607
|
// ../utils/dist/runtime.mjs
|
|
270568
270608
|
function ensureServer() {
|
|
270569
270609
|
if (isBrowser) {
|
|
@@ -272910,7 +272950,8 @@ async function servicePrompt({
|
|
|
272910
272950
|
}
|
|
272911
272951
|
|
|
272912
272952
|
// src/commands/connect/blockchain-node.prompt.ts
|
|
272913
|
-
async function blockchainNodePrompt(env2, nodes, accept) {
|
|
272953
|
+
async function blockchainNodePrompt(env2, nodes, accept, filterRunningOnly = false) {
|
|
272954
|
+
const choices = filterRunningOnly ? nodes.filter((node) => node.status === "COMPLETED") : nodes;
|
|
272914
272955
|
return servicePrompt({
|
|
272915
272956
|
env: env2,
|
|
272916
272957
|
services: nodes,
|
|
@@ -272920,7 +272961,7 @@ async function blockchainNodePrompt(env2, nodes, accept) {
|
|
|
272920
272961
|
return esm_default2({
|
|
272921
272962
|
message: "Which blockchain node do you want to connect to?",
|
|
272922
272963
|
choices: [
|
|
272923
|
-
...
|
|
272964
|
+
...choices.map((node) => ({
|
|
272924
272965
|
name: node.name,
|
|
272925
272966
|
value: node
|
|
272926
272967
|
})),
|
|
@@ -273045,26 +273086,46 @@ async function hdPrivateKeyPrompt(env2, privateKeys, accept) {
|
|
|
273045
273086
|
}
|
|
273046
273087
|
|
|
273047
273088
|
// src/commands/connect/instance.prompt.ts
|
|
273048
|
-
async function instancePrompt(env2, accept) {
|
|
273089
|
+
async function instancePrompt(env2, accept, freeTextInput = false) {
|
|
273090
|
+
const knownInstances = await getInstances();
|
|
273049
273091
|
const autoAccept = !!accept || is_in_ci_default;
|
|
273050
|
-
const defaultInstance = env2.SETTLEMINT_INSTANCE ?? "https://console.settlemint.com";
|
|
273051
|
-
const defaultPossible =
|
|
273092
|
+
const defaultInstance = env2.SETTLEMINT_INSTANCE ?? knownInstances[0] ?? "https://console.settlemint.com";
|
|
273093
|
+
const defaultPossible = autoAccept && defaultInstance;
|
|
273052
273094
|
if (defaultPossible) {
|
|
273053
273095
|
return defaultInstance;
|
|
273054
273096
|
}
|
|
273055
|
-
|
|
273056
|
-
|
|
273057
|
-
|
|
273058
|
-
|
|
273059
|
-
|
|
273060
|
-
|
|
273061
|
-
|
|
273062
|
-
|
|
273063
|
-
|
|
273064
|
-
|
|
273065
|
-
|
|
273066
|
-
|
|
273067
|
-
|
|
273097
|
+
if (freeTextInput) {
|
|
273098
|
+
const instance = await esm_default4({
|
|
273099
|
+
message: "What is the URL of your SettleMint instance?",
|
|
273100
|
+
default: defaultInstance,
|
|
273101
|
+
required: true,
|
|
273102
|
+
validate(value4) {
|
|
273103
|
+
try {
|
|
273104
|
+
validate3(UrlSchema3, value4);
|
|
273105
|
+
return true;
|
|
273106
|
+
} catch (error5) {
|
|
273107
|
+
return "Invalid URL";
|
|
273108
|
+
}
|
|
273109
|
+
},
|
|
273110
|
+
transformer: (value4) => value4.trim()
|
|
273111
|
+
});
|
|
273112
|
+
return sanitizeInstanceUrl(instance);
|
|
273113
|
+
}
|
|
273114
|
+
if (knownInstances.length === 0) {
|
|
273115
|
+
cancel2("No instances found. Please run `settlemint login` to configure an instance.");
|
|
273116
|
+
}
|
|
273117
|
+
if (knownInstances.length === 1) {
|
|
273118
|
+
return knownInstances[0];
|
|
273119
|
+
}
|
|
273120
|
+
return esm_default2({
|
|
273121
|
+
message: "What SettleMint instance do you want to connect to?",
|
|
273122
|
+
choices: [
|
|
273123
|
+
...knownInstances.map((instance) => ({
|
|
273124
|
+
name: instance,
|
|
273125
|
+
value: instance
|
|
273126
|
+
}))
|
|
273127
|
+
],
|
|
273128
|
+
default: defaultInstance
|
|
273068
273129
|
});
|
|
273069
273130
|
}
|
|
273070
273131
|
|
|
@@ -273189,18 +273250,19 @@ async function servicesSpinner(settlemint, application) {
|
|
|
273189
273250
|
}
|
|
273190
273251
|
|
|
273191
273252
|
// src/commands/connect/thegraph.prompt.ts
|
|
273192
|
-
async function theGraphPrompt(env2, middlewares, accept) {
|
|
273193
|
-
const
|
|
273253
|
+
async function theGraphPrompt(env2, middlewares, accept, filterRunningOnly = false) {
|
|
273254
|
+
const graphMiddlewares = middlewares.filter((middleware) => middleware.__typename === "HAGraphMiddleware");
|
|
273255
|
+
const choices = filterRunningOnly ? graphMiddlewares.filter((middleware) => middleware.status === "COMPLETED") : graphMiddlewares;
|
|
273194
273256
|
return servicePrompt({
|
|
273195
273257
|
env: env2,
|
|
273196
|
-
services:
|
|
273258
|
+
services: graphMiddlewares,
|
|
273197
273259
|
accept,
|
|
273198
273260
|
envKey: "SETTLEMINT_THEGRAPH",
|
|
273199
273261
|
defaultHandler: async ({ defaultService: defaultMiddleware }) => {
|
|
273200
273262
|
return esm_default2({
|
|
273201
273263
|
message: "Which The Graph instance do you want to connect to?",
|
|
273202
273264
|
choices: [
|
|
273203
|
-
...
|
|
273265
|
+
...choices.map((middleware) => ({
|
|
273204
273266
|
name: middleware.name,
|
|
273205
273267
|
value: middleware
|
|
273206
273268
|
})),
|
|
@@ -273245,18 +273307,18 @@ async function workspacePrompt(env2, workspaces, accept) {
|
|
|
273245
273307
|
|
|
273246
273308
|
// src/commands/connect.ts
|
|
273247
273309
|
function connectCommand() {
|
|
273248
|
-
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 }) => {
|
|
273310
|
+
return new Command("connect").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values").option("-i, --instance <instance>", "The instance to connect to (defaults to the instance in the .env file)").description("Connects your project to your application on SettleMint").action(async ({ acceptDefaults, prod, instance }) => {
|
|
273249
273311
|
intro("Connecting your dApp to SettleMint");
|
|
273250
273312
|
const env2 = await loadEnv2(false, !!prod);
|
|
273251
|
-
const
|
|
273252
|
-
const personalAccessToken = await getInstanceCredentials(
|
|
273313
|
+
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, true);
|
|
273314
|
+
const personalAccessToken = await getInstanceCredentials(selectedInstance);
|
|
273253
273315
|
if (!personalAccessToken) {
|
|
273254
273316
|
return missingPersonalAccessTokenError();
|
|
273255
273317
|
}
|
|
273256
273318
|
const accessToken = personalAccessToken.personalAccessToken;
|
|
273257
273319
|
const settlemint = createSettleMintClient({
|
|
273258
273320
|
accessToken,
|
|
273259
|
-
instance
|
|
273321
|
+
instance: selectedInstance
|
|
273260
273322
|
});
|
|
273261
273323
|
const workspaces = await workspaceSpinner(settlemint);
|
|
273262
273324
|
const workspace = await workspacePrompt(env2, workspaces, acceptDefaults);
|
|
@@ -273294,7 +273356,7 @@ function connectCommand() {
|
|
|
273294
273356
|
}
|
|
273295
273357
|
await writeEnvSpinner(!!prod, {
|
|
273296
273358
|
SETTLEMINT_ACCESS_TOKEN: aatToken,
|
|
273297
|
-
SETTLEMINT_INSTANCE:
|
|
273359
|
+
SETTLEMINT_INSTANCE: selectedInstance,
|
|
273298
273360
|
SETTLEMINT_WORKSPACE: workspace.uniqueName,
|
|
273299
273361
|
SETTLEMINT_APPLICATION: application.uniqueName,
|
|
273300
273362
|
SETTLEMINT_BLOCKCHAIN_NETWORK: blockchainNode?.blockchainNetwork?.uniqueName,
|
|
@@ -273376,9 +273438,12 @@ import { dirname as dirname6 } from "node:path";
|
|
|
273376
273438
|
import { stat as stat8 } from "node:fs/promises";
|
|
273377
273439
|
var import_package_json3 = __toESM(require_lib12(), 1);
|
|
273378
273440
|
var import_package_json4 = __toESM(require_lib12(), 1);
|
|
273379
|
-
async function projectRoot3() {
|
|
273441
|
+
async function projectRoot3(fallbackToCwd = false) {
|
|
273380
273442
|
const packageJsonPath = await findUp("package.json");
|
|
273381
273443
|
if (!packageJsonPath) {
|
|
273444
|
+
if (fallbackToCwd) {
|
|
273445
|
+
return process.cwd();
|
|
273446
|
+
}
|
|
273382
273447
|
throw new Error("Unable to find project root (no package.json found)");
|
|
273383
273448
|
}
|
|
273384
273449
|
return dirname6(packageJsonPath);
|
|
@@ -274210,7 +274275,10 @@ function loginCommand() {
|
|
|
274210
274275
|
intro("Login to your SettleMint account");
|
|
274211
274276
|
const autoAccept = !!acceptDefaults || !!tokenStdin;
|
|
274212
274277
|
const env2 = await loadEnv2(false, false);
|
|
274213
|
-
|
|
274278
|
+
if (instance) {
|
|
274279
|
+
validate3(UrlSchema, instance);
|
|
274280
|
+
}
|
|
274281
|
+
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, autoAccept, true);
|
|
274214
274282
|
let personalAccessToken = "";
|
|
274215
274283
|
if (tokenStdin) {
|
|
274216
274284
|
if (cmd2.args.length > 0) {
|
|
@@ -274455,9 +274523,8 @@ function getCreateCommand({
|
|
|
274455
274523
|
}
|
|
274456
274524
|
execute2(cmd2, async ({ acceptDefaults, prod, default: isDefault, wait, restartIfTimeout, provider, region }, createFunction) => {
|
|
274457
274525
|
intro(`Creating ${type4} in the SettleMint platform`);
|
|
274458
|
-
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274459
274526
|
const env2 = await loadEnv2(false, !!prod);
|
|
274460
|
-
const instance = await instancePrompt(env2,
|
|
274527
|
+
const instance = await instancePrompt(env2, acceptDefaults);
|
|
274461
274528
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
274462
274529
|
env: env2,
|
|
274463
274530
|
instance,
|
|
@@ -274957,7 +275024,7 @@ function blockchainNodeBesuCreateCommand() {
|
|
|
274957
275024
|
if (!network) {
|
|
274958
275025
|
return nothingSelectedError("blockchain network");
|
|
274959
275026
|
}
|
|
274960
|
-
networkUniqueName = network?.
|
|
275027
|
+
networkUniqueName = network?.uniqueName;
|
|
274961
275028
|
}
|
|
274962
275029
|
const result = await settlemint.blockchainNode.create({
|
|
274963
275030
|
applicationUniqueName,
|
|
@@ -274975,7 +275042,7 @@ function blockchainNodeBesuCreateCommand() {
|
|
|
274975
275042
|
mapDefaultEnv: () => {
|
|
274976
275043
|
return {
|
|
274977
275044
|
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
274978
|
-
SETTLEMINT_BLOCKCHAIN_NODE: result.
|
|
275045
|
+
SETTLEMINT_BLOCKCHAIN_NODE: result.uniqueName
|
|
274979
275046
|
};
|
|
274980
275047
|
}
|
|
274981
275048
|
};
|
|
@@ -275883,7 +275950,7 @@ function customDeploymentsUpdateCommand() {
|
|
|
275883
275950
|
const env2 = await loadEnv2(false, !!prod);
|
|
275884
275951
|
const customDeploymentUniqueName = uniqueName ?? env2.SETTLEMINT_CUSTOM_DEPLOYMENT;
|
|
275885
275952
|
if (!customDeploymentUniqueName) {
|
|
275886
|
-
|
|
275953
|
+
cancel("No custom deployment unique name specified. Please provide it either via the --unique-name flag or by setting the SETTLEMINT_CUSTOM_DEPLOYMENT environment variable");
|
|
275887
275954
|
}
|
|
275888
275955
|
const instance = await instancePrompt(env2, true);
|
|
275889
275956
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
@@ -275921,18 +275988,18 @@ function updateCommand() {
|
|
|
275921
275988
|
|
|
275922
275989
|
// src/commands/platform/config.ts
|
|
275923
275990
|
function configCommand() {
|
|
275924
|
-
return new Command("config").alias("c").description("Get platform configuration").option("--prod", "Connect to your production environment").action(async ({ prod }) => {
|
|
275991
|
+
return new Command("config").alias("c").description("Get platform configuration").option("--prod", "Connect to your production environment").option("-i, --instance <instance>", "The instance to connect to (defaults to the instance in the .env file)").action(async ({ prod, instance }) => {
|
|
275925
275992
|
intro("Getting platform configuration");
|
|
275926
275993
|
const env2 = await loadEnv2(false, !!prod);
|
|
275927
|
-
const
|
|
275994
|
+
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, true);
|
|
275928
275995
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275929
275996
|
env: env2,
|
|
275930
|
-
instance,
|
|
275997
|
+
instance: selectedInstance,
|
|
275931
275998
|
prefer: "personal"
|
|
275932
275999
|
});
|
|
275933
276000
|
const settlemint = createSettleMintClient({
|
|
275934
276001
|
accessToken,
|
|
275935
|
-
instance
|
|
276002
|
+
instance: selectedInstance
|
|
275936
276003
|
});
|
|
275937
276004
|
const platformConfig = await settlemint.platform.config();
|
|
275938
276005
|
note2(`Providers and regions:
|
|
@@ -276193,6 +276260,60 @@ function hardhatDeployLocalCommand() {
|
|
|
276193
276260
|
});
|
|
276194
276261
|
}
|
|
276195
276262
|
|
|
276263
|
+
// src/error/service-not-running-error.ts
|
|
276264
|
+
function serviceNotRunningError(service, status) {
|
|
276265
|
+
return cancel2(`The ${service} service is not in a Running state (status: ${status}). ${getStatusAction(status)}`);
|
|
276266
|
+
}
|
|
276267
|
+
function getStatusAction(status) {
|
|
276268
|
+
if (status === "PAUSED" || status === "AUTO_PAUSED") {
|
|
276269
|
+
return "Please resume the service.";
|
|
276270
|
+
}
|
|
276271
|
+
if (status === "FAILED") {
|
|
276272
|
+
return "Please try restarting the service or contact support.";
|
|
276273
|
+
}
|
|
276274
|
+
return "Please try again later.";
|
|
276275
|
+
}
|
|
276276
|
+
|
|
276277
|
+
// src/commands/smart-contract-set/hardhat/utils/select-target-node.ts
|
|
276278
|
+
async function selectTargetNode({
|
|
276279
|
+
env: env2,
|
|
276280
|
+
blockchainNodeUniqueName,
|
|
276281
|
+
autoAccept,
|
|
276282
|
+
settlemint
|
|
276283
|
+
}) {
|
|
276284
|
+
const nodeUniqueName = blockchainNodeUniqueName ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
|
|
276285
|
+
let node = undefined;
|
|
276286
|
+
if (!nodeUniqueName) {
|
|
276287
|
+
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276288
|
+
return missingApplication();
|
|
276289
|
+
}
|
|
276290
|
+
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276291
|
+
const evmNodes = nodes.filter((node2) => node2.isEvm);
|
|
276292
|
+
if (evmNodes.length === 0) {
|
|
276293
|
+
cancel("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276294
|
+
}
|
|
276295
|
+
const nodesWithPrivateKey = await Promise.all(nodes.map((node2) => settlemint.blockchainNode.read(node2.uniqueName)));
|
|
276296
|
+
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node2) => node2.privateKeys && node2.privateKeys.length > 0);
|
|
276297
|
+
if (nodesWithActivePrivateKey.length === 0) {
|
|
276298
|
+
cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276299
|
+
}
|
|
276300
|
+
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, autoAccept, true);
|
|
276301
|
+
if (!blockchainNode) {
|
|
276302
|
+
return nothingSelectedError("EVM blockchain node");
|
|
276303
|
+
}
|
|
276304
|
+
node = blockchainNode;
|
|
276305
|
+
} else {
|
|
276306
|
+
node = await settlemint.blockchainNode.read(nodeUniqueName);
|
|
276307
|
+
if (!node.isEvm) {
|
|
276308
|
+
cancel("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276309
|
+
}
|
|
276310
|
+
}
|
|
276311
|
+
if (node.status !== "COMPLETED") {
|
|
276312
|
+
serviceNotRunningError("blockchain node", node.status);
|
|
276313
|
+
}
|
|
276314
|
+
return node;
|
|
276315
|
+
}
|
|
276316
|
+
|
|
276196
276317
|
// src/commands/smart-contract-set/prompts/address.prompt.ts
|
|
276197
276318
|
async function addressPrompt({
|
|
276198
276319
|
env: env2,
|
|
@@ -276306,33 +276427,7 @@ function hardhatDeployRemoteCommand() {
|
|
|
276306
276427
|
accessToken,
|
|
276307
276428
|
instance
|
|
276308
276429
|
});
|
|
276309
|
-
const
|
|
276310
|
-
let node = undefined;
|
|
276311
|
-
if (!nodeUniqueName) {
|
|
276312
|
-
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276313
|
-
return missingApplication();
|
|
276314
|
-
}
|
|
276315
|
-
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276316
|
-
const evmNodes = nodes.filter((node2) => node2.isEvm);
|
|
276317
|
-
if (evmNodes.length === 0) {
|
|
276318
|
-
cancel("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276319
|
-
}
|
|
276320
|
-
const nodesWithPrivateKey = await Promise.all(nodes.map((node2) => settlemint.blockchainNode.read(node2.uniqueName)));
|
|
276321
|
-
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node2) => node2.privateKeys && node2.privateKeys.length > 0);
|
|
276322
|
-
if (nodesWithActivePrivateKey.length === 0) {
|
|
276323
|
-
cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276324
|
-
}
|
|
276325
|
-
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, acceptDefaults);
|
|
276326
|
-
if (!blockchainNode) {
|
|
276327
|
-
return nothingSelectedError("EVM blockchain node");
|
|
276328
|
-
}
|
|
276329
|
-
node = blockchainNode;
|
|
276330
|
-
} else {
|
|
276331
|
-
node = await settlemint.blockchainNode.read(nodeUniqueName);
|
|
276332
|
-
if (!node.isEvm) {
|
|
276333
|
-
cancel("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276334
|
-
}
|
|
276335
|
-
}
|
|
276430
|
+
const node = await selectTargetNode({ env: env2, blockchainNodeUniqueName, autoAccept, settlemint });
|
|
276336
276431
|
const envConfig = await settlemint.foundry.env(node.uniqueName);
|
|
276337
276432
|
const hardhatConfig = await getHardhatConfigData(envConfig);
|
|
276338
276433
|
if (verify && !hardhatConfig?.etherscan?.apiKey) {
|
|
@@ -276424,33 +276519,8 @@ function hardhatScriptRemoteCommand() {
|
|
|
276424
276519
|
accessToken,
|
|
276425
276520
|
instance
|
|
276426
276521
|
});
|
|
276427
|
-
|
|
276428
|
-
|
|
276429
|
-
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276430
|
-
return missingApplication();
|
|
276431
|
-
}
|
|
276432
|
-
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276433
|
-
const evmNodes = nodes.filter((node) => node.isEvm);
|
|
276434
|
-
if (evmNodes.length === 0) {
|
|
276435
|
-
cancel("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276436
|
-
}
|
|
276437
|
-
const nodesWithPrivateKey = await Promise.all(nodes.map((node) => settlemint.blockchainNode.read(node.uniqueName)));
|
|
276438
|
-
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node) => node.privateKeys && node.privateKeys.length > 0);
|
|
276439
|
-
if (nodesWithActivePrivateKey.length === 0) {
|
|
276440
|
-
cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276441
|
-
}
|
|
276442
|
-
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, acceptDefaults);
|
|
276443
|
-
if (!blockchainNode) {
|
|
276444
|
-
return nothingSelectedError("EVM blockchain node");
|
|
276445
|
-
}
|
|
276446
|
-
nodeUniqueName = blockchainNode.uniqueName;
|
|
276447
|
-
} else {
|
|
276448
|
-
const node = await settlemint.blockchainNode.read(nodeUniqueName);
|
|
276449
|
-
if (!node.isEvm) {
|
|
276450
|
-
cancel("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276451
|
-
}
|
|
276452
|
-
}
|
|
276453
|
-
const envConfig = await settlemint.foundry.env(nodeUniqueName);
|
|
276522
|
+
const node = await selectTargetNode({ env: env2, blockchainNodeUniqueName, autoAccept, settlemint });
|
|
276523
|
+
const envConfig = await settlemint.foundry.env(node.uniqueName);
|
|
276454
276524
|
const { command, args } = await getPackageManagerExecutable();
|
|
276455
276525
|
await executeCommand(command, [...args, "hardhat", "run", script, "--network", "btp", ...compile ? ["--no-compile"] : []], { env: envConfig });
|
|
276456
276526
|
});
|
|
@@ -276671,7 +276741,7 @@ async function getTheGraphMiddleware({
|
|
|
276671
276741
|
return missingApplication();
|
|
276672
276742
|
}
|
|
276673
276743
|
const middlewares = await settlemintClient.middleware.list(env2.SETTLEMINT_APPLICATION);
|
|
276674
|
-
return theGraphPrompt(env2, middlewares, autoAccept);
|
|
276744
|
+
return theGraphPrompt(env2, middlewares, autoAccept, true);
|
|
276675
276745
|
}
|
|
276676
276746
|
async function getTheGraphNetwork({
|
|
276677
276747
|
theGraphMiddleware,
|
|
@@ -276781,6 +276851,9 @@ function subgraphDeployCommand() {
|
|
|
276781
276851
|
if (!theGraphMiddleware) {
|
|
276782
276852
|
return nothingSelectedError("graph middleware");
|
|
276783
276853
|
}
|
|
276854
|
+
if (theGraphMiddleware.status !== "COMPLETED") {
|
|
276855
|
+
serviceNotRunningError("graph middleware", theGraphMiddleware.status);
|
|
276856
|
+
}
|
|
276784
276857
|
const network = await getTheGraphNetwork({ theGraphMiddleware, env: env2, instance, accessToken });
|
|
276785
276858
|
await subgraphSetup({
|
|
276786
276859
|
network
|
|
@@ -276882,4 +276955,4 @@ function sdkCliCommand(exitOverride = undefined) {
|
|
|
276882
276955
|
ascii();
|
|
276883
276956
|
sdkCliCommand();
|
|
276884
276957
|
|
|
276885
|
-
//# debugId=
|
|
276958
|
+
//# debugId=D6D7147FBD149E8F64756E2164756E21
|