@settlemint/sdk-cli 2.3.2-pra61423f8 → 2.3.2-prc0433625
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 +25 -17
- package/dist/cli.js.map +14 -13
- package/package.json +3 -3
package/dist/cli.js
CHANGED
@@ -254078,7 +254078,7 @@ function pruneCurrentEnv(currentEnv, env2) {
|
|
254078
254078
|
var package_default = {
|
254079
254079
|
name: "@settlemint/sdk-cli",
|
254080
254080
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
254081
|
-
version: "2.3.2-
|
254081
|
+
version: "2.3.2-prc0433625",
|
254082
254082
|
type: "module",
|
254083
254083
|
private: false,
|
254084
254084
|
license: "FSL-1.1-MIT",
|
@@ -254127,8 +254127,8 @@ var package_default = {
|
|
254127
254127
|
"@inquirer/input": "4.1.10",
|
254128
254128
|
"@inquirer/password": "4.0.13",
|
254129
254129
|
"@inquirer/select": "4.2.1",
|
254130
|
-
"@settlemint/sdk-js": "2.3.2-
|
254131
|
-
"@settlemint/sdk-utils": "2.3.2-
|
254130
|
+
"@settlemint/sdk-js": "2.3.2-prc0433625",
|
254131
|
+
"@settlemint/sdk-utils": "2.3.2-prc0433625",
|
254132
254132
|
"@types/node": "22.15.21",
|
254133
254133
|
"@types/semver": "7.7.0",
|
254134
254134
|
"@types/which": "3.0.4",
|
@@ -259016,7 +259016,7 @@ export const { client: hasuraClient, graphql: hasuraGraphql } = createHasuraClie
|
|
259016
259016
|
};
|
259017
259017
|
}>({
|
259018
259018
|
instance: process.env.SETTLEMINT_HASURA_ENDPOINT!,
|
259019
|
-
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN
|
259019
|
+
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,
|
259020
259020
|
adminSecret: process.env.SETTLEMINT_HASURA_ADMIN_SECRET!,
|
259021
259021
|
}, {
|
259022
259022
|
fetch: requestLogger(logger, "hasura", fetch) as typeof fetch,
|
@@ -259074,14 +259074,14 @@ export const { client: portalClient, graphql: portalGraphql } = createPortalClie
|
|
259074
259074
|
};
|
259075
259075
|
}>({
|
259076
259076
|
instance: process.env.SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT!,
|
259077
|
-
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN
|
259077
|
+
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,
|
259078
259078
|
}, {
|
259079
259079
|
fetch: requestLogger(logger, "portal", fetch) as typeof fetch,
|
259080
259080
|
});
|
259081
259081
|
|
259082
259082
|
export const getPortalWebsocketClient = getWebsocketClient({
|
259083
259083
|
portalGraphqlEndpoint: process.env.SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT!,
|
259084
|
-
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN
|
259084
|
+
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,
|
259085
259085
|
});
|
259086
259086
|
`;
|
259087
259087
|
await writeTemplate(template, "/lib/settlemint", "portal.ts");
|
@@ -259096,6 +259096,11 @@ function getVariableName(name3) {
|
|
259096
259096
|
return name3.split(/[^a-zA-Z0-9]/g).map((word2, index) => (index === 0 ? word2.charAt(0).toLowerCase() : word2.charAt(0).toUpperCase()) + word2.slice(1)).join("");
|
259097
259097
|
}
|
259098
259098
|
|
259099
|
+
// src/utils/subgraph/subgraph-name.ts
|
259100
|
+
function getSubgraphName(endpoint) {
|
259101
|
+
return endpoint.split("/").pop();
|
259102
|
+
}
|
259103
|
+
|
259099
259104
|
// src/commands/codegen/codegen-the-graph.ts
|
259100
259105
|
var PACKAGE_NAME3 = "@settlemint/sdk-thegraph";
|
259101
259106
|
async function codegenTheGraph(env2, subgraphNames) {
|
@@ -259116,7 +259121,7 @@ async function codegenTheGraph(env2, subgraphNames) {
|
|
259116
259121
|
"import { createLogger, requestLogger, type LogLevel } from '@settlemint/sdk-utils/logging';"
|
259117
259122
|
];
|
259118
259123
|
const toGenerate = gqlEndpoints.filter((gqlEndpoint) => {
|
259119
|
-
const name3 = gqlEndpoint
|
259124
|
+
const name3 = getSubgraphName(gqlEndpoint);
|
259120
259125
|
if (!name3) {
|
259121
259126
|
return false;
|
259122
259127
|
}
|
@@ -259130,7 +259135,7 @@ async function codegenTheGraph(env2, subgraphNames) {
|
|
259130
259135
|
});
|
259131
259136
|
template.push("", "const logger = createLogger({ level: process.env.SETTLEMINT_LOG_LEVEL as LogLevel });");
|
259132
259137
|
for (const gqlEndpoint of toGenerate) {
|
259133
|
-
const name3 = gqlEndpoint
|
259138
|
+
const name3 = getSubgraphName(gqlEndpoint);
|
259134
259139
|
const introspectionVariable = getVariableName(`${name3}Introspection`);
|
259135
259140
|
note(`Generating TheGraph subgraph ${name3}`);
|
259136
259141
|
await generateSchema({
|
@@ -259159,7 +259164,7 @@ export const { client: ${graphqlClientVariable}, graphql: ${graphqlVariable} } =
|
|
259159
259164
|
};
|
259160
259165
|
}>({
|
259161
259166
|
instances: JSON.parse(process.env.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS || '[]'),
|
259162
|
-
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN
|
259167
|
+
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,
|
259163
259168
|
subgraphName: "${name3}",
|
259164
259169
|
cache: "force-cache",
|
259165
259170
|
}, {
|
@@ -259169,7 +259174,7 @@ export const { client: ${graphqlClientVariable}, graphql: ${graphqlVariable} } =
|
|
259169
259174
|
}
|
259170
259175
|
if (env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH) {
|
259171
259176
|
const isDefaulSubgraphGenerated = toGenerate.some((gqlEndpoint) => {
|
259172
|
-
const name3 = gqlEndpoint
|
259177
|
+
const name3 = getSubgraphName(gqlEndpoint);
|
259173
259178
|
return name3 === env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH;
|
259174
259179
|
});
|
259175
259180
|
if (isDefaulSubgraphGenerated) {
|
@@ -260149,7 +260154,7 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
260149
260154
|
};
|
260150
260155
|
}
|
260151
260156
|
const theGraphEndpoints = (env2.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS ?? []).filter((gqlEndpoint) => {
|
260152
|
-
const name3 = gqlEndpoint
|
260157
|
+
const name3 = getSubgraphName(gqlEndpoint);
|
260153
260158
|
return name3 && (!thegraphSubgraphNames || thegraphSubgraphNames.includes(name3));
|
260154
260159
|
});
|
260155
260160
|
const [hasura, portal, blockscout] = await Promise.all([
|
@@ -260195,7 +260200,7 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
260195
260200
|
}
|
260196
260201
|
] : [],
|
260197
260202
|
...thegraph.filter((endpoint) => endpoint.success).map(({ endpoint }) => {
|
260198
|
-
const name3 = endpoint
|
260203
|
+
const name3 = getSubgraphName(endpoint);
|
260199
260204
|
return {
|
260200
260205
|
name: `thegraph-${name3}`,
|
260201
260206
|
schema: `the-graph-schema-${name3}.graphql`,
|
@@ -260497,7 +260502,7 @@ async function subgraphPrompt({
|
|
260497
260502
|
isCi = is_in_ci_default
|
260498
260503
|
}) {
|
260499
260504
|
const autoAccept = isCi || !!accept;
|
260500
|
-
const subgraphNames = env2.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS?.map(
|
260505
|
+
const subgraphNames = env2.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS?.map(getSubgraphName).filter(Boolean) ?? [];
|
260501
260506
|
if (autoAccept) {
|
260502
260507
|
if (allowAll) {
|
260503
260508
|
return subgraphNames;
|
@@ -260745,7 +260750,7 @@ export const { client: blockscoutClient, graphql: blockscoutGraphql } = createBl
|
|
260745
260750
|
};
|
260746
260751
|
}>({
|
260747
260752
|
instance: process.env.SETTLEMINT_BLOCKSCOUT_ENDPOINT!,
|
260748
|
-
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN
|
260753
|
+
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,
|
260749
260754
|
}, {
|
260750
260755
|
fetch: requestLogger(logger, "blockscout", fetch) as typeof fetch,
|
260751
260756
|
});
|
@@ -260772,7 +260777,7 @@ async function codegenIpfs(env2) {
|
|
260772
260777
|
|
260773
260778
|
export const { client } = createServerIpfsClient({
|
260774
260779
|
instance: process.env.SETTLEMINT_IPFS_API_ENDPOINT!,
|
260775
|
-
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN
|
260780
|
+
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,
|
260776
260781
|
});`;
|
260777
260782
|
await writeTemplate(clientTemplate, "/lib/settlemint", "ipfs.ts");
|
260778
260783
|
const projectDir = await projectRoot3();
|
@@ -260837,6 +260842,7 @@ async function codegenViem(env2) {
|
|
260837
260842
|
* The public client. Use this if you need to read from the blockchain.
|
260838
260843
|
*/
|
260839
260844
|
export const publicClient = getPublicClient({
|
260845
|
+
accessToken: process.env.SETTLEMINT_BLOCKCHAIN_ACCESS_TOKEN,
|
260840
260846
|
chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,
|
260841
260847
|
chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,
|
260842
260848
|
rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,
|
@@ -260848,6 +260854,7 @@ export const publicClient = getPublicClient({
|
|
260848
260854
|
* The wallet client. Use this if you need to write to the blockchain.
|
260849
260855
|
*/
|
260850
260856
|
export const walletClient = getWalletClient({
|
260857
|
+
accessToken: process.env.SETTLEMINT_BLOCKCHAIN_ACCESS_TOKEN,
|
260851
260858
|
chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,
|
260852
260859
|
chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,
|
260853
260860
|
rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT!,
|
@@ -260858,6 +260865,7 @@ export const walletClient = getWalletClient({
|
|
260858
260865
|
* HD wallets require a challenge response to be sent with the request.
|
260859
260866
|
*/
|
260860
260867
|
export const hdWalletClient = getWalletClient({
|
260868
|
+
accessToken: process.env.SETTLEMINT_BLOCKCHAIN_ACCESS_TOKEN,
|
260861
260869
|
chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,
|
260862
260870
|
chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,
|
260863
260871
|
rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT!,
|
@@ -261695,7 +261703,7 @@ async function getGraphEnv(settlemint, service, graphName) {
|
|
261695
261703
|
})
|
261696
261704
|
});
|
261697
261705
|
const endpoints = theGraphMiddleware.subgraphs.map(({ graphqlQueryEndpoint }) => graphqlQueryEndpoint?.displayValue);
|
261698
|
-
const hasKitSubgraph = endpoints.map((endpoint) => endpoint
|
261706
|
+
const hasKitSubgraph = endpoints.map((endpoint) => getSubgraphName(endpoint)).some((endpoint) => endpoint === DEFAULT_SUBGRAPH_NAME);
|
261699
261707
|
return {
|
261700
261708
|
SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: endpoints,
|
261701
261709
|
SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: hasKitSubgraph ? DEFAULT_SUBGRAPH_NAME : undefined
|
@@ -269849,4 +269857,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
269849
269857
|
// src/cli.ts
|
269850
269858
|
sdkCliCommand();
|
269851
269859
|
|
269852
|
-
//# debugId=
|
269860
|
+
//# debugId=B1CBE41F1D2A7A7564756E2164756E21
|