@settlemint/sdk-cli 0.9.3-pra4969835 → 0.9.3-pra4fec5b2
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 +121 -132
- package/dist/cli.js.map +17 -16
- 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.lOFcHmcS2W:/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.lOFcHmcS2W:/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.lOFcHmcS2W:/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.lOFcHmcS2W:/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-pra4fec5b2",
|
|
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.lOFcHmcS2W:/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-pra4fec5b2",
|
|
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-pra4fec5b2",
|
|
256845
|
+
"@settlemint/sdk-utils": "0.9.3-pra4fec5b2",
|
|
256846
256846
|
"get-tsconfig": "4.8.1",
|
|
256847
256847
|
giget: "1.2.3"
|
|
256848
256848
|
},
|
|
@@ -267906,7 +267906,13 @@ export const { client: theGraphClient${nameSuffix}, graphql: theGraphGraphql${na
|
|
|
267906
267906
|
import { writeFile as writeFile4 } from "node:fs/promises";
|
|
267907
267907
|
|
|
267908
267908
|
// src/commands/codegen/test-gql-endpoint.ts
|
|
267909
|
-
async function testGqlEndpoint(
|
|
267909
|
+
async function testGqlEndpoint({
|
|
267910
|
+
accessToken,
|
|
267911
|
+
hasuraAdminSecret,
|
|
267912
|
+
gqlEndpoint,
|
|
267913
|
+
isHasura = false,
|
|
267914
|
+
maxRetries = 3
|
|
267915
|
+
}) {
|
|
267910
267916
|
if (!gqlEndpoint) {
|
|
267911
267917
|
return false;
|
|
267912
267918
|
}
|
|
@@ -268848,12 +268854,29 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
|
268848
268854
|
const name2 = gqlEndpoint.split("/").pop();
|
|
268849
268855
|
return name2 && (!thegraphSubgraphNames || thegraphSubgraphNames.includes(name2));
|
|
268850
268856
|
});
|
|
268851
|
-
const [hasura, portal,
|
|
268852
|
-
testGqlEndpoint(
|
|
268853
|
-
|
|
268854
|
-
|
|
268855
|
-
|
|
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
|
+
})
|
|
268856
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
|
+
}));
|
|
268857
268880
|
if (!tsconfig.config.compilerOptions) {
|
|
268858
268881
|
tsconfig.config.compilerOptions = {};
|
|
268859
268882
|
}
|
|
@@ -268872,7 +268895,7 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
|
268872
268895
|
tadaTurboLocation: "hasura-cache.d.ts"
|
|
268873
268896
|
}
|
|
268874
268897
|
] : [],
|
|
268875
|
-
...thegraph ?
|
|
268898
|
+
...thegraph ? thegraph.filter((endpoint) => endpoint.success).map(({ endpoint }) => {
|
|
268876
268899
|
const name2 = endpoint.split("/").pop();
|
|
268877
268900
|
return {
|
|
268878
268901
|
name: `thegraph-${name2}`,
|
|
@@ -270511,7 +270534,7 @@ async function getGraphEndpoint(service, env2) {
|
|
|
270511
270534
|
const isStarterKit = (id) => id.endsWith("-starterkits");
|
|
270512
270535
|
const testEndpoint = service.subgraphs.find(({ graphqlQueryEndpoint }) => !isStarterKit(graphqlQueryEndpoint?.id))?.graphqlQueryEndpoint?.displayValue;
|
|
270513
270536
|
const starterKitEndpoint = service.subgraphs.find(({ graphqlQueryEndpoint }) => isStarterKit(graphqlQueryEndpoint?.id))?.graphqlQueryEndpoint?.displayValue;
|
|
270514
|
-
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;
|
|
270515
270538
|
const endpoints = hasEndpoint ? service.subgraphs.map(({ graphqlQueryEndpoint }) => graphqlQueryEndpoint?.displayValue) : starterKitEndpoint ? [starterKitEndpoint] : [];
|
|
270516
270539
|
if (endpoints.length === 0) {
|
|
270517
270540
|
return {};
|
|
@@ -270570,12 +270593,6 @@ function getMinioEndpoints(service) {
|
|
|
270570
270593
|
};
|
|
270571
270594
|
}
|
|
270572
270595
|
|
|
270573
|
-
// src/utils/sanitize-instance-url.ts
|
|
270574
|
-
function sanitizeInstanceUrl(url) {
|
|
270575
|
-
const instanceUrl = new URL(url);
|
|
270576
|
-
return instanceUrl.origin;
|
|
270577
|
-
}
|
|
270578
|
-
|
|
270579
270596
|
// ../utils/dist/runtime.mjs
|
|
270580
270597
|
function ensureServer() {
|
|
270581
270598
|
if (isBrowser) {
|
|
@@ -273057,46 +273074,26 @@ async function hdPrivateKeyPrompt(env2, privateKeys, accept) {
|
|
|
273057
273074
|
}
|
|
273058
273075
|
|
|
273059
273076
|
// src/commands/connect/instance.prompt.ts
|
|
273060
|
-
async function instancePrompt(env2, accept
|
|
273061
|
-
const knownInstances = await getInstances();
|
|
273077
|
+
async function instancePrompt(env2, accept) {
|
|
273062
273078
|
const autoAccept = !!accept || is_in_ci_default;
|
|
273063
|
-
const defaultInstance = env2.SETTLEMINT_INSTANCE ??
|
|
273064
|
-
const defaultPossible =
|
|
273079
|
+
const defaultInstance = env2.SETTLEMINT_INSTANCE ?? "https://console.settlemint.com";
|
|
273080
|
+
const defaultPossible = accept && defaultInstance;
|
|
273065
273081
|
if (defaultPossible) {
|
|
273066
273082
|
return defaultInstance;
|
|
273067
273083
|
}
|
|
273068
|
-
|
|
273069
|
-
|
|
273070
|
-
|
|
273071
|
-
|
|
273072
|
-
|
|
273073
|
-
|
|
273074
|
-
|
|
273075
|
-
|
|
273076
|
-
|
|
273077
|
-
|
|
273078
|
-
|
|
273079
|
-
|
|
273080
|
-
|
|
273081
|
-
transformer: (value4) => value4.trim()
|
|
273082
|
-
});
|
|
273083
|
-
return sanitizeInstanceUrl(instance);
|
|
273084
|
-
}
|
|
273085
|
-
if (knownInstances.length === 0) {
|
|
273086
|
-
cancel2("No instances found. Please run `settlemint login` to configure an instance.");
|
|
273087
|
-
}
|
|
273088
|
-
if (knownInstances.length === 1) {
|
|
273089
|
-
return knownInstances[0];
|
|
273090
|
-
}
|
|
273091
|
-
return esm_default2({
|
|
273092
|
-
message: "What SettleMint instance do you want to connect to?",
|
|
273093
|
-
choices: [
|
|
273094
|
-
...knownInstances.map((instance) => ({
|
|
273095
|
-
name: instance,
|
|
273096
|
-
value: instance
|
|
273097
|
-
}))
|
|
273098
|
-
],
|
|
273099
|
-
default: defaultInstance
|
|
273084
|
+
return esm_default4({
|
|
273085
|
+
message: "What is the URL of your SettleMint instance?",
|
|
273086
|
+
default: defaultInstance,
|
|
273087
|
+
required: true,
|
|
273088
|
+
validate(value4) {
|
|
273089
|
+
try {
|
|
273090
|
+
validate3(UrlSchema3, value4);
|
|
273091
|
+
return true;
|
|
273092
|
+
} catch (error5) {
|
|
273093
|
+
return "Invalid URL";
|
|
273094
|
+
}
|
|
273095
|
+
},
|
|
273096
|
+
transformer: (value4) => value4.trim()
|
|
273100
273097
|
});
|
|
273101
273098
|
}
|
|
273102
273099
|
|
|
@@ -273277,21 +273274,18 @@ async function workspacePrompt(env2, workspaces, accept) {
|
|
|
273277
273274
|
|
|
273278
273275
|
// src/commands/connect.ts
|
|
273279
273276
|
function connectCommand() {
|
|
273280
|
-
return new Command("connect").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values").
|
|
273277
|
+
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 }) => {
|
|
273281
273278
|
intro("Connecting your dApp to SettleMint");
|
|
273282
273279
|
const env2 = await loadEnv2(false, !!prod);
|
|
273283
|
-
|
|
273284
|
-
|
|
273285
|
-
}
|
|
273286
|
-
const selectedInstance = instance ? sanitizeInstanceUrl(instance) : await instancePrompt(env2, true);
|
|
273287
|
-
const personalAccessToken = await getInstanceCredentials(selectedInstance);
|
|
273280
|
+
const instance = await instancePrompt(env2, acceptDefaults);
|
|
273281
|
+
const personalAccessToken = await getInstanceCredentials(instance);
|
|
273288
273282
|
if (!personalAccessToken) {
|
|
273289
273283
|
return missingPersonalAccessTokenError();
|
|
273290
273284
|
}
|
|
273291
273285
|
const accessToken = personalAccessToken.personalAccessToken;
|
|
273292
273286
|
const settlemint = createSettleMintClient({
|
|
273293
273287
|
accessToken,
|
|
273294
|
-
instance
|
|
273288
|
+
instance
|
|
273295
273289
|
});
|
|
273296
273290
|
const workspaces = await workspaceSpinner(settlemint);
|
|
273297
273291
|
const workspace = await workspacePrompt(env2, workspaces, acceptDefaults);
|
|
@@ -273329,7 +273323,7 @@ function connectCommand() {
|
|
|
273329
273323
|
}
|
|
273330
273324
|
await writeEnvSpinner(!!prod, {
|
|
273331
273325
|
SETTLEMINT_ACCESS_TOKEN: aatToken,
|
|
273332
|
-
SETTLEMINT_INSTANCE:
|
|
273326
|
+
SETTLEMINT_INSTANCE: instance,
|
|
273333
273327
|
SETTLEMINT_WORKSPACE: workspace.uniqueName,
|
|
273334
273328
|
SETTLEMINT_APPLICATION: application.uniqueName,
|
|
273335
273329
|
SETTLEMINT_BLOCKCHAIN_NETWORK: blockchainNode?.blockchainNetwork?.uniqueName,
|
|
@@ -274248,10 +274242,7 @@ function loginCommand() {
|
|
|
274248
274242
|
intro("Login to your SettleMint account");
|
|
274249
274243
|
const autoAccept = !!acceptDefaults || !!tokenStdin;
|
|
274250
274244
|
const env2 = await loadEnv2(false, false);
|
|
274251
|
-
|
|
274252
|
-
validate3(UrlSchema, instance);
|
|
274253
|
-
}
|
|
274254
|
-
const selectedInstance = instance ? sanitizeInstanceUrl(instance) : await instancePrompt(env2, autoAccept, true);
|
|
274245
|
+
const selectedInstance = instance ?? await instancePrompt(env2, autoAccept);
|
|
274255
274246
|
let personalAccessToken = "";
|
|
274256
274247
|
if (tokenStdin) {
|
|
274257
274248
|
if (cmd2.args.length > 0) {
|
|
@@ -274496,8 +274487,9 @@ function getCreateCommand({
|
|
|
274496
274487
|
}
|
|
274497
274488
|
execute2(cmd2, async ({ acceptDefaults, prod, default: isDefault, wait, restartIfTimeout, provider, region }, createFunction) => {
|
|
274498
274489
|
intro(`Creating ${type4} in the SettleMint platform`);
|
|
274490
|
+
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274499
274491
|
const env2 = await loadEnv2(false, !!prod);
|
|
274500
|
-
const instance = await instancePrompt(env2,
|
|
274492
|
+
const instance = await instancePrompt(env2, autoAccept);
|
|
274501
274493
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
274502
274494
|
env: env2,
|
|
274503
274495
|
instance,
|
|
@@ -275923,7 +275915,7 @@ function customDeploymentsUpdateCommand() {
|
|
|
275923
275915
|
const env2 = await loadEnv2(false, !!prod);
|
|
275924
275916
|
const customDeploymentUniqueName = uniqueName ?? env2.SETTLEMINT_CUSTOM_DEPLOYMENT;
|
|
275925
275917
|
if (!customDeploymentUniqueName) {
|
|
275926
|
-
|
|
275918
|
+
throw new Error("No custom deployment unique name specified. Please provide it either via the --unique-name flag or by setting the SETTLEMINT_CUSTOM_DEPLOYMENT environment variable");
|
|
275927
275919
|
}
|
|
275928
275920
|
const instance = await instancePrompt(env2, true);
|
|
275929
275921
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
@@ -275961,18 +275953,18 @@ function updateCommand() {
|
|
|
275961
275953
|
|
|
275962
275954
|
// src/commands/platform/config.ts
|
|
275963
275955
|
function configCommand() {
|
|
275964
|
-
return new Command("config").alias("c").description("Get platform configuration").option("--prod", "Connect to your production environment").
|
|
275956
|
+
return new Command("config").alias("c").description("Get platform configuration").option("--prod", "Connect to your production environment").action(async ({ prod }) => {
|
|
275965
275957
|
intro("Getting platform configuration");
|
|
275966
275958
|
const env2 = await loadEnv2(false, !!prod);
|
|
275967
|
-
const
|
|
275959
|
+
const instance = await instancePrompt(env2, true);
|
|
275968
275960
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275969
275961
|
env: env2,
|
|
275970
|
-
instance
|
|
275962
|
+
instance,
|
|
275971
275963
|
prefer: "personal"
|
|
275972
275964
|
});
|
|
275973
275965
|
const settlemint = createSettleMintClient({
|
|
275974
275966
|
accessToken,
|
|
275975
|
-
instance
|
|
275967
|
+
instance
|
|
275976
275968
|
});
|
|
275977
275969
|
const platformConfig = await settlemint.platform.config();
|
|
275978
275970
|
note2(`Providers and regions:
|
|
@@ -276233,6 +276225,51 @@ function hardhatDeployLocalCommand() {
|
|
|
276233
276225
|
});
|
|
276234
276226
|
}
|
|
276235
276227
|
|
|
276228
|
+
// src/error/service-not-running-error.ts
|
|
276229
|
+
function serviceNotRunningError(service, status) {
|
|
276230
|
+
return cancel2(`The ${service} service is not in a Running state (status: ${status}).`);
|
|
276231
|
+
}
|
|
276232
|
+
|
|
276233
|
+
// src/commands/smart-contract-set/hardhat/utils/select-target-node.ts
|
|
276234
|
+
async function selectTargetNode({
|
|
276235
|
+
env: env2,
|
|
276236
|
+
blockchainNodeUniqueName,
|
|
276237
|
+
autoAccept,
|
|
276238
|
+
settlemint
|
|
276239
|
+
}) {
|
|
276240
|
+
const nodeUniqueName = blockchainNodeUniqueName ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
|
|
276241
|
+
let node = undefined;
|
|
276242
|
+
if (!nodeUniqueName) {
|
|
276243
|
+
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276244
|
+
return missingApplication();
|
|
276245
|
+
}
|
|
276246
|
+
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276247
|
+
const evmNodes = nodes.filter((node2) => node2.isEvm);
|
|
276248
|
+
if (evmNodes.length === 0) {
|
|
276249
|
+
cancel("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276250
|
+
}
|
|
276251
|
+
const nodesWithPrivateKey = await Promise.all(nodes.map((node2) => settlemint.blockchainNode.read(node2.uniqueName)));
|
|
276252
|
+
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node2) => node2.privateKeys && node2.privateKeys.length > 0);
|
|
276253
|
+
if (nodesWithActivePrivateKey.length === 0) {
|
|
276254
|
+
cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276255
|
+
}
|
|
276256
|
+
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, autoAccept);
|
|
276257
|
+
if (!blockchainNode) {
|
|
276258
|
+
return nothingSelectedError("EVM blockchain node");
|
|
276259
|
+
}
|
|
276260
|
+
node = blockchainNode;
|
|
276261
|
+
} else {
|
|
276262
|
+
node = await settlemint.blockchainNode.read(nodeUniqueName);
|
|
276263
|
+
if (!node.isEvm) {
|
|
276264
|
+
cancel("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276265
|
+
}
|
|
276266
|
+
}
|
|
276267
|
+
if (node.status !== "COMPLETED") {
|
|
276268
|
+
serviceNotRunningError("blockchain node", node.status);
|
|
276269
|
+
}
|
|
276270
|
+
return node;
|
|
276271
|
+
}
|
|
276272
|
+
|
|
276236
276273
|
// src/commands/smart-contract-set/prompts/address.prompt.ts
|
|
276237
276274
|
async function addressPrompt({
|
|
276238
276275
|
env: env2,
|
|
@@ -276346,33 +276383,7 @@ function hardhatDeployRemoteCommand() {
|
|
|
276346
276383
|
accessToken,
|
|
276347
276384
|
instance
|
|
276348
276385
|
});
|
|
276349
|
-
const
|
|
276350
|
-
let node = undefined;
|
|
276351
|
-
if (!nodeUniqueName) {
|
|
276352
|
-
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276353
|
-
return missingApplication();
|
|
276354
|
-
}
|
|
276355
|
-
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276356
|
-
const evmNodes = nodes.filter((node2) => node2.isEvm);
|
|
276357
|
-
if (evmNodes.length === 0) {
|
|
276358
|
-
cancel("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276359
|
-
}
|
|
276360
|
-
const nodesWithPrivateKey = await Promise.all(nodes.map((node2) => settlemint.blockchainNode.read(node2.uniqueName)));
|
|
276361
|
-
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node2) => node2.privateKeys && node2.privateKeys.length > 0);
|
|
276362
|
-
if (nodesWithActivePrivateKey.length === 0) {
|
|
276363
|
-
cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276364
|
-
}
|
|
276365
|
-
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, acceptDefaults);
|
|
276366
|
-
if (!blockchainNode) {
|
|
276367
|
-
return nothingSelectedError("EVM blockchain node");
|
|
276368
|
-
}
|
|
276369
|
-
node = blockchainNode;
|
|
276370
|
-
} else {
|
|
276371
|
-
node = await settlemint.blockchainNode.read(nodeUniqueName);
|
|
276372
|
-
if (!node.isEvm) {
|
|
276373
|
-
cancel("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276374
|
-
}
|
|
276375
|
-
}
|
|
276386
|
+
const node = await selectTargetNode({ env: env2, blockchainNodeUniqueName, autoAccept, settlemint });
|
|
276376
276387
|
const envConfig = await settlemint.foundry.env(node.uniqueName);
|
|
276377
276388
|
const hardhatConfig = await getHardhatConfigData(envConfig);
|
|
276378
276389
|
if (verify && !hardhatConfig?.etherscan?.apiKey) {
|
|
@@ -276464,33 +276475,8 @@ function hardhatScriptRemoteCommand() {
|
|
|
276464
276475
|
accessToken,
|
|
276465
276476
|
instance
|
|
276466
276477
|
});
|
|
276467
|
-
|
|
276468
|
-
|
|
276469
|
-
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276470
|
-
return missingApplication();
|
|
276471
|
-
}
|
|
276472
|
-
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276473
|
-
const evmNodes = nodes.filter((node) => node.isEvm);
|
|
276474
|
-
if (evmNodes.length === 0) {
|
|
276475
|
-
cancel("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276476
|
-
}
|
|
276477
|
-
const nodesWithPrivateKey = await Promise.all(nodes.map((node) => settlemint.blockchainNode.read(node.uniqueName)));
|
|
276478
|
-
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node) => node.privateKeys && node.privateKeys.length > 0);
|
|
276479
|
-
if (nodesWithActivePrivateKey.length === 0) {
|
|
276480
|
-
cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276481
|
-
}
|
|
276482
|
-
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, acceptDefaults);
|
|
276483
|
-
if (!blockchainNode) {
|
|
276484
|
-
return nothingSelectedError("EVM blockchain node");
|
|
276485
|
-
}
|
|
276486
|
-
nodeUniqueName = blockchainNode.uniqueName;
|
|
276487
|
-
} else {
|
|
276488
|
-
const node = await settlemint.blockchainNode.read(nodeUniqueName);
|
|
276489
|
-
if (!node.isEvm) {
|
|
276490
|
-
cancel("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276491
|
-
}
|
|
276492
|
-
}
|
|
276493
|
-
const envConfig = await settlemint.foundry.env(nodeUniqueName);
|
|
276478
|
+
const node = await selectTargetNode({ env: env2, blockchainNodeUniqueName, autoAccept, settlemint });
|
|
276479
|
+
const envConfig = await settlemint.foundry.env(node.uniqueName);
|
|
276494
276480
|
const { command, args } = await getPackageManagerExecutable();
|
|
276495
276481
|
await executeCommand(command, [...args, "hardhat", "run", script, "--network", "btp", ...compile ? ["--no-compile"] : []], { env: envConfig });
|
|
276496
276482
|
});
|
|
@@ -276821,6 +276807,9 @@ function subgraphDeployCommand() {
|
|
|
276821
276807
|
if (!theGraphMiddleware) {
|
|
276822
276808
|
return nothingSelectedError("graph middleware");
|
|
276823
276809
|
}
|
|
276810
|
+
if (theGraphMiddleware.status !== "COMPLETED") {
|
|
276811
|
+
serviceNotRunningError("graph middleware", theGraphMiddleware.status);
|
|
276812
|
+
}
|
|
276824
276813
|
const network = await getTheGraphNetwork({ theGraphMiddleware, env: env2, instance, accessToken });
|
|
276825
276814
|
await subgraphSetup({
|
|
276826
276815
|
network
|
|
@@ -276922,4 +276911,4 @@ function sdkCliCommand(exitOverride = undefined) {
|
|
|
276922
276911
|
ascii();
|
|
276923
276912
|
sdkCliCommand();
|
|
276924
276913
|
|
|
276925
|
-
//# debugId=
|
|
276914
|
+
//# debugId=F67DDBAC5564958464756E2164756E21
|