@settlemint/sdk-cli 0.9.3-prc02a8001 → 0.9.3-preee54144
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 +116 -85
- package/dist/cli.js.map +19 -17
- 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.tFhGcSvIWa:/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.tFhGcSvIWa:/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.tFhGcSvIWa:/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.tFhGcSvIWa:/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-preee54144",
|
|
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.tFhGcSvIWa:/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-preee54144",
|
|
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-preee54144",
|
|
256845
|
+
"@settlemint/sdk-utils": "0.9.3-preee54144",
|
|
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 {};
|
|
@@ -272910,7 +272939,8 @@ async function servicePrompt({
|
|
|
272910
272939
|
}
|
|
272911
272940
|
|
|
272912
272941
|
// src/commands/connect/blockchain-node.prompt.ts
|
|
272913
|
-
async function blockchainNodePrompt(env2, nodes, accept) {
|
|
272942
|
+
async function blockchainNodePrompt(env2, nodes, accept, filterRunningOnly = false) {
|
|
272943
|
+
const choices = filterRunningOnly ? nodes.filter((node) => node.status === "COMPLETED") : nodes;
|
|
272914
272944
|
return servicePrompt({
|
|
272915
272945
|
env: env2,
|
|
272916
272946
|
services: nodes,
|
|
@@ -272920,7 +272950,7 @@ async function blockchainNodePrompt(env2, nodes, accept) {
|
|
|
272920
272950
|
return esm_default2({
|
|
272921
272951
|
message: "Which blockchain node do you want to connect to?",
|
|
272922
272952
|
choices: [
|
|
272923
|
-
...
|
|
272953
|
+
...choices.map((node) => ({
|
|
272924
272954
|
name: node.name,
|
|
272925
272955
|
value: node
|
|
272926
272956
|
})),
|
|
@@ -273189,18 +273219,19 @@ async function servicesSpinner(settlemint, application) {
|
|
|
273189
273219
|
}
|
|
273190
273220
|
|
|
273191
273221
|
// src/commands/connect/thegraph.prompt.ts
|
|
273192
|
-
async function theGraphPrompt(env2, middlewares, accept) {
|
|
273193
|
-
const
|
|
273222
|
+
async function theGraphPrompt(env2, middlewares, accept, filterRunningOnly = false) {
|
|
273223
|
+
const graphMiddlewares = middlewares.filter((middleware) => middleware.__typename === "HAGraphMiddleware");
|
|
273224
|
+
const choices = filterRunningOnly ? graphMiddlewares.filter((middleware) => middleware.status === "COMPLETED") : graphMiddlewares;
|
|
273194
273225
|
return servicePrompt({
|
|
273195
273226
|
env: env2,
|
|
273196
|
-
services:
|
|
273227
|
+
services: graphMiddlewares,
|
|
273197
273228
|
accept,
|
|
273198
273229
|
envKey: "SETTLEMINT_THEGRAPH",
|
|
273199
273230
|
defaultHandler: async ({ defaultService: defaultMiddleware }) => {
|
|
273200
273231
|
return esm_default2({
|
|
273201
273232
|
message: "Which The Graph instance do you want to connect to?",
|
|
273202
273233
|
choices: [
|
|
273203
|
-
...
|
|
273234
|
+
...choices.map((middleware) => ({
|
|
273204
273235
|
name: middleware.name,
|
|
273205
273236
|
value: middleware
|
|
273206
273237
|
})),
|
|
@@ -273376,9 +273407,12 @@ import { dirname as dirname6 } from "node:path";
|
|
|
273376
273407
|
import { stat as stat8 } from "node:fs/promises";
|
|
273377
273408
|
var import_package_json3 = __toESM(require_lib12(), 1);
|
|
273378
273409
|
var import_package_json4 = __toESM(require_lib12(), 1);
|
|
273379
|
-
async function projectRoot3() {
|
|
273410
|
+
async function projectRoot3(fallbackToCwd = false) {
|
|
273380
273411
|
const packageJsonPath = await findUp("package.json");
|
|
273381
273412
|
if (!packageJsonPath) {
|
|
273413
|
+
if (fallbackToCwd) {
|
|
273414
|
+
return process.cwd();
|
|
273415
|
+
}
|
|
273382
273416
|
throw new Error("Unable to find project root (no package.json found)");
|
|
273383
273417
|
}
|
|
273384
273418
|
return dirname6(packageJsonPath);
|
|
@@ -274957,7 +274991,7 @@ function blockchainNodeBesuCreateCommand() {
|
|
|
274957
274991
|
if (!network) {
|
|
274958
274992
|
return nothingSelectedError("blockchain network");
|
|
274959
274993
|
}
|
|
274960
|
-
networkUniqueName = network?.
|
|
274994
|
+
networkUniqueName = network?.uniqueName;
|
|
274961
274995
|
}
|
|
274962
274996
|
const result = await settlemint.blockchainNode.create({
|
|
274963
274997
|
applicationUniqueName,
|
|
@@ -274975,7 +275009,7 @@ function blockchainNodeBesuCreateCommand() {
|
|
|
274975
275009
|
mapDefaultEnv: () => {
|
|
274976
275010
|
return {
|
|
274977
275011
|
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
274978
|
-
SETTLEMINT_BLOCKCHAIN_NODE: result.
|
|
275012
|
+
SETTLEMINT_BLOCKCHAIN_NODE: result.uniqueName
|
|
274979
275013
|
};
|
|
274980
275014
|
}
|
|
274981
275015
|
};
|
|
@@ -276193,6 +276227,51 @@ function hardhatDeployLocalCommand() {
|
|
|
276193
276227
|
});
|
|
276194
276228
|
}
|
|
276195
276229
|
|
|
276230
|
+
// src/error/service-not-running-error.ts
|
|
276231
|
+
function serviceNotRunningError(service, status) {
|
|
276232
|
+
return cancel2(`The ${service} service is not in a Running state (status: ${status}).`);
|
|
276233
|
+
}
|
|
276234
|
+
|
|
276235
|
+
// src/commands/smart-contract-set/hardhat/utils/select-target-node.ts
|
|
276236
|
+
async function selectTargetNode({
|
|
276237
|
+
env: env2,
|
|
276238
|
+
blockchainNodeUniqueName,
|
|
276239
|
+
autoAccept,
|
|
276240
|
+
settlemint
|
|
276241
|
+
}) {
|
|
276242
|
+
const nodeUniqueName = blockchainNodeUniqueName ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
|
|
276243
|
+
let node = undefined;
|
|
276244
|
+
if (!nodeUniqueName) {
|
|
276245
|
+
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276246
|
+
return missingApplication();
|
|
276247
|
+
}
|
|
276248
|
+
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276249
|
+
const evmNodes = nodes.filter((node2) => node2.isEvm);
|
|
276250
|
+
if (evmNodes.length === 0) {
|
|
276251
|
+
cancel("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276252
|
+
}
|
|
276253
|
+
const nodesWithPrivateKey = await Promise.all(nodes.map((node2) => settlemint.blockchainNode.read(node2.uniqueName)));
|
|
276254
|
+
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node2) => node2.privateKeys && node2.privateKeys.length > 0);
|
|
276255
|
+
if (nodesWithActivePrivateKey.length === 0) {
|
|
276256
|
+
cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276257
|
+
}
|
|
276258
|
+
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, autoAccept, true);
|
|
276259
|
+
if (!blockchainNode) {
|
|
276260
|
+
return nothingSelectedError("EVM blockchain node");
|
|
276261
|
+
}
|
|
276262
|
+
node = blockchainNode;
|
|
276263
|
+
} else {
|
|
276264
|
+
node = await settlemint.blockchainNode.read(nodeUniqueName);
|
|
276265
|
+
if (!node.isEvm) {
|
|
276266
|
+
cancel("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276267
|
+
}
|
|
276268
|
+
}
|
|
276269
|
+
if (node.status !== "COMPLETED") {
|
|
276270
|
+
serviceNotRunningError("blockchain node", node.status);
|
|
276271
|
+
}
|
|
276272
|
+
return node;
|
|
276273
|
+
}
|
|
276274
|
+
|
|
276196
276275
|
// src/commands/smart-contract-set/prompts/address.prompt.ts
|
|
276197
276276
|
async function addressPrompt({
|
|
276198
276277
|
env: env2,
|
|
@@ -276306,33 +276385,7 @@ function hardhatDeployRemoteCommand() {
|
|
|
276306
276385
|
accessToken,
|
|
276307
276386
|
instance
|
|
276308
276387
|
});
|
|
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
|
-
}
|
|
276388
|
+
const node = await selectTargetNode({ env: env2, blockchainNodeUniqueName, autoAccept, settlemint });
|
|
276336
276389
|
const envConfig = await settlemint.foundry.env(node.uniqueName);
|
|
276337
276390
|
const hardhatConfig = await getHardhatConfigData(envConfig);
|
|
276338
276391
|
if (verify && !hardhatConfig?.etherscan?.apiKey) {
|
|
@@ -276424,33 +276477,8 @@ function hardhatScriptRemoteCommand() {
|
|
|
276424
276477
|
accessToken,
|
|
276425
276478
|
instance
|
|
276426
276479
|
});
|
|
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);
|
|
276480
|
+
const node = await selectTargetNode({ env: env2, blockchainNodeUniqueName, autoAccept, settlemint });
|
|
276481
|
+
const envConfig = await settlemint.foundry.env(node.uniqueName);
|
|
276454
276482
|
const { command, args } = await getPackageManagerExecutable();
|
|
276455
276483
|
await executeCommand(command, [...args, "hardhat", "run", script, "--network", "btp", ...compile ? ["--no-compile"] : []], { env: envConfig });
|
|
276456
276484
|
});
|
|
@@ -276671,7 +276699,7 @@ async function getTheGraphMiddleware({
|
|
|
276671
276699
|
return missingApplication();
|
|
276672
276700
|
}
|
|
276673
276701
|
const middlewares = await settlemintClient.middleware.list(env2.SETTLEMINT_APPLICATION);
|
|
276674
|
-
return theGraphPrompt(env2, middlewares, autoAccept);
|
|
276702
|
+
return theGraphPrompt(env2, middlewares, autoAccept, true);
|
|
276675
276703
|
}
|
|
276676
276704
|
async function getTheGraphNetwork({
|
|
276677
276705
|
theGraphMiddleware,
|
|
@@ -276781,6 +276809,9 @@ function subgraphDeployCommand() {
|
|
|
276781
276809
|
if (!theGraphMiddleware) {
|
|
276782
276810
|
return nothingSelectedError("graph middleware");
|
|
276783
276811
|
}
|
|
276812
|
+
if (theGraphMiddleware.status !== "COMPLETED") {
|
|
276813
|
+
serviceNotRunningError("graph middleware", theGraphMiddleware.status);
|
|
276814
|
+
}
|
|
276784
276815
|
const network = await getTheGraphNetwork({ theGraphMiddleware, env: env2, instance, accessToken });
|
|
276785
276816
|
await subgraphSetup({
|
|
276786
276817
|
network
|
|
@@ -276882,4 +276913,4 @@ function sdkCliCommand(exitOverride = undefined) {
|
|
|
276882
276913
|
ascii();
|
|
276883
276914
|
sdkCliCommand();
|
|
276884
276915
|
|
|
276885
|
-
//# debugId=
|
|
276916
|
+
//# debugId=27DF416C54F54E6964756E2164756E21
|