@settlemint/sdk-cli 0.9.3-pra4969835 → 0.9.3-pra6477cd0
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 +139 -139
- package/dist/cli.js.map +20 -19
- 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.Ch8O5c1yVR:/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.Ch8O5c1yVR:/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.Ch8O5c1yVR:/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.Ch8O5c1yVR:/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-pra6477cd0",
|
|
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.Ch8O5c1yVR:/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-pra6477cd0",
|
|
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-pra6477cd0",
|
|
256845
|
+
"@settlemint/sdk-utils": "0.9.3-pra6477cd0",
|
|
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) {
|
|
@@ -272922,7 +272939,8 @@ async function servicePrompt({
|
|
|
272922
272939
|
}
|
|
272923
272940
|
|
|
272924
272941
|
// src/commands/connect/blockchain-node.prompt.ts
|
|
272925
|
-
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;
|
|
272926
272944
|
return servicePrompt({
|
|
272927
272945
|
env: env2,
|
|
272928
272946
|
services: nodes,
|
|
@@ -272932,7 +272950,7 @@ async function blockchainNodePrompt(env2, nodes, accept) {
|
|
|
272932
272950
|
return esm_default2({
|
|
272933
272951
|
message: "Which blockchain node do you want to connect to?",
|
|
272934
272952
|
choices: [
|
|
272935
|
-
...
|
|
272953
|
+
...choices.map((node) => ({
|
|
272936
272954
|
name: node.name,
|
|
272937
272955
|
value: node
|
|
272938
272956
|
})),
|
|
@@ -273057,46 +273075,26 @@ async function hdPrivateKeyPrompt(env2, privateKeys, accept) {
|
|
|
273057
273075
|
}
|
|
273058
273076
|
|
|
273059
273077
|
// src/commands/connect/instance.prompt.ts
|
|
273060
|
-
async function instancePrompt(env2, accept
|
|
273061
|
-
const knownInstances = await getInstances();
|
|
273078
|
+
async function instancePrompt(env2, accept) {
|
|
273062
273079
|
const autoAccept = !!accept || is_in_ci_default;
|
|
273063
|
-
const defaultInstance = env2.SETTLEMINT_INSTANCE ??
|
|
273064
|
-
const defaultPossible =
|
|
273080
|
+
const defaultInstance = env2.SETTLEMINT_INSTANCE ?? "https://console.settlemint.com";
|
|
273081
|
+
const defaultPossible = accept && defaultInstance;
|
|
273065
273082
|
if (defaultPossible) {
|
|
273066
273083
|
return defaultInstance;
|
|
273067
273084
|
}
|
|
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
|
|
273085
|
+
return esm_default4({
|
|
273086
|
+
message: "What is the URL of your SettleMint instance?",
|
|
273087
|
+
default: defaultInstance,
|
|
273088
|
+
required: true,
|
|
273089
|
+
validate(value4) {
|
|
273090
|
+
try {
|
|
273091
|
+
validate3(UrlSchema3, value4);
|
|
273092
|
+
return true;
|
|
273093
|
+
} catch (error5) {
|
|
273094
|
+
return "Invalid URL";
|
|
273095
|
+
}
|
|
273096
|
+
},
|
|
273097
|
+
transformer: (value4) => value4.trim()
|
|
273100
273098
|
});
|
|
273101
273099
|
}
|
|
273102
273100
|
|
|
@@ -273221,18 +273219,19 @@ async function servicesSpinner(settlemint, application) {
|
|
|
273221
273219
|
}
|
|
273222
273220
|
|
|
273223
273221
|
// src/commands/connect/thegraph.prompt.ts
|
|
273224
|
-
async function theGraphPrompt(env2, middlewares, accept) {
|
|
273225
|
-
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;
|
|
273226
273225
|
return servicePrompt({
|
|
273227
273226
|
env: env2,
|
|
273228
|
-
services:
|
|
273227
|
+
services: graphMiddlewares,
|
|
273229
273228
|
accept,
|
|
273230
273229
|
envKey: "SETTLEMINT_THEGRAPH",
|
|
273231
273230
|
defaultHandler: async ({ defaultService: defaultMiddleware }) => {
|
|
273232
273231
|
return esm_default2({
|
|
273233
273232
|
message: "Which The Graph instance do you want to connect to?",
|
|
273234
273233
|
choices: [
|
|
273235
|
-
...
|
|
273234
|
+
...choices.map((middleware) => ({
|
|
273236
273235
|
name: middleware.name,
|
|
273237
273236
|
value: middleware
|
|
273238
273237
|
})),
|
|
@@ -273277,21 +273276,18 @@ async function workspacePrompt(env2, workspaces, accept) {
|
|
|
273277
273276
|
|
|
273278
273277
|
// src/commands/connect.ts
|
|
273279
273278
|
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").
|
|
273279
|
+
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
273280
|
intro("Connecting your dApp to SettleMint");
|
|
273282
273281
|
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);
|
|
273282
|
+
const instance = await instancePrompt(env2, acceptDefaults);
|
|
273283
|
+
const personalAccessToken = await getInstanceCredentials(instance);
|
|
273288
273284
|
if (!personalAccessToken) {
|
|
273289
273285
|
return missingPersonalAccessTokenError();
|
|
273290
273286
|
}
|
|
273291
273287
|
const accessToken = personalAccessToken.personalAccessToken;
|
|
273292
273288
|
const settlemint = createSettleMintClient({
|
|
273293
273289
|
accessToken,
|
|
273294
|
-
instance
|
|
273290
|
+
instance
|
|
273295
273291
|
});
|
|
273296
273292
|
const workspaces = await workspaceSpinner(settlemint);
|
|
273297
273293
|
const workspace = await workspacePrompt(env2, workspaces, acceptDefaults);
|
|
@@ -273329,7 +273325,7 @@ function connectCommand() {
|
|
|
273329
273325
|
}
|
|
273330
273326
|
await writeEnvSpinner(!!prod, {
|
|
273331
273327
|
SETTLEMINT_ACCESS_TOKEN: aatToken,
|
|
273332
|
-
SETTLEMINT_INSTANCE:
|
|
273328
|
+
SETTLEMINT_INSTANCE: instance,
|
|
273333
273329
|
SETTLEMINT_WORKSPACE: workspace.uniqueName,
|
|
273334
273330
|
SETTLEMINT_APPLICATION: application.uniqueName,
|
|
273335
273331
|
SETTLEMINT_BLOCKCHAIN_NETWORK: blockchainNode?.blockchainNetwork?.uniqueName,
|
|
@@ -274248,10 +274244,7 @@ function loginCommand() {
|
|
|
274248
274244
|
intro("Login to your SettleMint account");
|
|
274249
274245
|
const autoAccept = !!acceptDefaults || !!tokenStdin;
|
|
274250
274246
|
const env2 = await loadEnv2(false, false);
|
|
274251
|
-
|
|
274252
|
-
validate3(UrlSchema, instance);
|
|
274253
|
-
}
|
|
274254
|
-
const selectedInstance = instance ? sanitizeInstanceUrl(instance) : await instancePrompt(env2, autoAccept, true);
|
|
274247
|
+
const selectedInstance = instance ?? await instancePrompt(env2, autoAccept);
|
|
274255
274248
|
let personalAccessToken = "";
|
|
274256
274249
|
if (tokenStdin) {
|
|
274257
274250
|
if (cmd2.args.length > 0) {
|
|
@@ -274496,8 +274489,9 @@ function getCreateCommand({
|
|
|
274496
274489
|
}
|
|
274497
274490
|
execute2(cmd2, async ({ acceptDefaults, prod, default: isDefault, wait, restartIfTimeout, provider, region }, createFunction) => {
|
|
274498
274491
|
intro(`Creating ${type4} in the SettleMint platform`);
|
|
274492
|
+
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274499
274493
|
const env2 = await loadEnv2(false, !!prod);
|
|
274500
|
-
const instance = await instancePrompt(env2,
|
|
274494
|
+
const instance = await instancePrompt(env2, autoAccept);
|
|
274501
274495
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
274502
274496
|
env: env2,
|
|
274503
274497
|
instance,
|
|
@@ -275923,7 +275917,7 @@ function customDeploymentsUpdateCommand() {
|
|
|
275923
275917
|
const env2 = await loadEnv2(false, !!prod);
|
|
275924
275918
|
const customDeploymentUniqueName = uniqueName ?? env2.SETTLEMINT_CUSTOM_DEPLOYMENT;
|
|
275925
275919
|
if (!customDeploymentUniqueName) {
|
|
275926
|
-
|
|
275920
|
+
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
275921
|
}
|
|
275928
275922
|
const instance = await instancePrompt(env2, true);
|
|
275929
275923
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
@@ -275961,18 +275955,18 @@ function updateCommand() {
|
|
|
275961
275955
|
|
|
275962
275956
|
// src/commands/platform/config.ts
|
|
275963
275957
|
function configCommand() {
|
|
275964
|
-
return new Command("config").alias("c").description("Get platform configuration").option("--prod", "Connect to your production environment").
|
|
275958
|
+
return new Command("config").alias("c").description("Get platform configuration").option("--prod", "Connect to your production environment").action(async ({ prod }) => {
|
|
275965
275959
|
intro("Getting platform configuration");
|
|
275966
275960
|
const env2 = await loadEnv2(false, !!prod);
|
|
275967
|
-
const
|
|
275961
|
+
const instance = await instancePrompt(env2, true);
|
|
275968
275962
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275969
275963
|
env: env2,
|
|
275970
|
-
instance
|
|
275964
|
+
instance,
|
|
275971
275965
|
prefer: "personal"
|
|
275972
275966
|
});
|
|
275973
275967
|
const settlemint = createSettleMintClient({
|
|
275974
275968
|
accessToken,
|
|
275975
|
-
instance
|
|
275969
|
+
instance
|
|
275976
275970
|
});
|
|
275977
275971
|
const platformConfig = await settlemint.platform.config();
|
|
275978
275972
|
note2(`Providers and regions:
|
|
@@ -276233,6 +276227,60 @@ function hardhatDeployLocalCommand() {
|
|
|
276233
276227
|
});
|
|
276234
276228
|
}
|
|
276235
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}). ${getStatusAction(status)}`);
|
|
276233
|
+
}
|
|
276234
|
+
function getStatusAction(status) {
|
|
276235
|
+
if (status === "PAUSED" || status === "AUTO_PAUSED") {
|
|
276236
|
+
return "Please resume the service.";
|
|
276237
|
+
}
|
|
276238
|
+
if (status === "FAILED") {
|
|
276239
|
+
return "Please try restarting the service or contact support.";
|
|
276240
|
+
}
|
|
276241
|
+
return "Please try again later.";
|
|
276242
|
+
}
|
|
276243
|
+
|
|
276244
|
+
// src/commands/smart-contract-set/hardhat/utils/select-target-node.ts
|
|
276245
|
+
async function selectTargetNode({
|
|
276246
|
+
env: env2,
|
|
276247
|
+
blockchainNodeUniqueName,
|
|
276248
|
+
autoAccept,
|
|
276249
|
+
settlemint
|
|
276250
|
+
}) {
|
|
276251
|
+
const nodeUniqueName = blockchainNodeUniqueName ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
|
|
276252
|
+
let node = undefined;
|
|
276253
|
+
if (!nodeUniqueName) {
|
|
276254
|
+
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276255
|
+
return missingApplication();
|
|
276256
|
+
}
|
|
276257
|
+
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276258
|
+
const evmNodes = nodes.filter((node2) => node2.isEvm);
|
|
276259
|
+
if (evmNodes.length === 0) {
|
|
276260
|
+
cancel("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276261
|
+
}
|
|
276262
|
+
const nodesWithPrivateKey = await Promise.all(nodes.map((node2) => settlemint.blockchainNode.read(node2.uniqueName)));
|
|
276263
|
+
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node2) => node2.privateKeys && node2.privateKeys.length > 0);
|
|
276264
|
+
if (nodesWithActivePrivateKey.length === 0) {
|
|
276265
|
+
cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276266
|
+
}
|
|
276267
|
+
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, autoAccept, true);
|
|
276268
|
+
if (!blockchainNode) {
|
|
276269
|
+
return nothingSelectedError("EVM blockchain node");
|
|
276270
|
+
}
|
|
276271
|
+
node = blockchainNode;
|
|
276272
|
+
} else {
|
|
276273
|
+
node = await settlemint.blockchainNode.read(nodeUniqueName);
|
|
276274
|
+
if (!node.isEvm) {
|
|
276275
|
+
cancel("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276276
|
+
}
|
|
276277
|
+
}
|
|
276278
|
+
if (node.status !== "COMPLETED") {
|
|
276279
|
+
serviceNotRunningError("blockchain node", node.status);
|
|
276280
|
+
}
|
|
276281
|
+
return node;
|
|
276282
|
+
}
|
|
276283
|
+
|
|
276236
276284
|
// src/commands/smart-contract-set/prompts/address.prompt.ts
|
|
276237
276285
|
async function addressPrompt({
|
|
276238
276286
|
env: env2,
|
|
@@ -276346,33 +276394,7 @@ function hardhatDeployRemoteCommand() {
|
|
|
276346
276394
|
accessToken,
|
|
276347
276395
|
instance
|
|
276348
276396
|
});
|
|
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
|
-
}
|
|
276397
|
+
const node = await selectTargetNode({ env: env2, blockchainNodeUniqueName, autoAccept, settlemint });
|
|
276376
276398
|
const envConfig = await settlemint.foundry.env(node.uniqueName);
|
|
276377
276399
|
const hardhatConfig = await getHardhatConfigData(envConfig);
|
|
276378
276400
|
if (verify && !hardhatConfig?.etherscan?.apiKey) {
|
|
@@ -276464,33 +276486,8 @@ function hardhatScriptRemoteCommand() {
|
|
|
276464
276486
|
accessToken,
|
|
276465
276487
|
instance
|
|
276466
276488
|
});
|
|
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);
|
|
276489
|
+
const node = await selectTargetNode({ env: env2, blockchainNodeUniqueName, autoAccept, settlemint });
|
|
276490
|
+
const envConfig = await settlemint.foundry.env(node.uniqueName);
|
|
276494
276491
|
const { command, args } = await getPackageManagerExecutable();
|
|
276495
276492
|
await executeCommand(command, [...args, "hardhat", "run", script, "--network", "btp", ...compile ? ["--no-compile"] : []], { env: envConfig });
|
|
276496
276493
|
});
|
|
@@ -276711,7 +276708,7 @@ async function getTheGraphMiddleware({
|
|
|
276711
276708
|
return missingApplication();
|
|
276712
276709
|
}
|
|
276713
276710
|
const middlewares = await settlemintClient.middleware.list(env2.SETTLEMINT_APPLICATION);
|
|
276714
|
-
return theGraphPrompt(env2, middlewares, autoAccept);
|
|
276711
|
+
return theGraphPrompt(env2, middlewares, autoAccept, true);
|
|
276715
276712
|
}
|
|
276716
276713
|
async function getTheGraphNetwork({
|
|
276717
276714
|
theGraphMiddleware,
|
|
@@ -276821,6 +276818,9 @@ function subgraphDeployCommand() {
|
|
|
276821
276818
|
if (!theGraphMiddleware) {
|
|
276822
276819
|
return nothingSelectedError("graph middleware");
|
|
276823
276820
|
}
|
|
276821
|
+
if (theGraphMiddleware.status !== "COMPLETED") {
|
|
276822
|
+
serviceNotRunningError("graph middleware", theGraphMiddleware.status);
|
|
276823
|
+
}
|
|
276824
276824
|
const network = await getTheGraphNetwork({ theGraphMiddleware, env: env2, instance, accessToken });
|
|
276825
276825
|
await subgraphSetup({
|
|
276826
276826
|
network
|
|
@@ -276922,4 +276922,4 @@ function sdkCliCommand(exitOverride = undefined) {
|
|
|
276922
276922
|
ascii();
|
|
276923
276923
|
sdkCliCommand();
|
|
276924
276924
|
|
|
276925
|
-
//# debugId=
|
|
276925
|
+
//# debugId=2C0E492BA21A350164756E2164756E21
|