@alchemy/cli 0.12.0 → 0.13.0
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/{auth-AU7LPEQL.js → auth-YB6AALZO.js} +2 -2
- package/dist/{chunk-ILPOKA4Y.js → chunk-5DR7BHUX.js} +1 -1
- package/dist/{chunk-2VVJKVRL.js → chunk-DWNXGFON.js} +1 -1
- package/dist/{chunk-BFOZ2KM7.js → chunk-OE6B6S2H.js} +1 -1
- package/dist/{chunk-OL5MEN62.js → chunk-PRSZJXA6.js} +1 -1
- package/dist/{chunk-CJDHJYLM.js → chunk-PYIVNQEI.js} +1 -1
- package/dist/index.js +43 -20
- package/dist/{interactive-6L2HNSOS.js → interactive-6SOB4IYV.js} +3 -3
- package/dist/{onboarding-RXNSVGSW.js → onboarding-TYRUMFUL.js} +2 -2
- package/dist/{policy-prompt-YU6L2VJZ.js → policy-prompt-LY6DMMT4.js} +2 -2
- package/dist/{resolve-WXXPXPCU.js → resolve-GELBKDTP.js} +1 -1
- package/package.json +1 -1
|
@@ -3,10 +3,10 @@ if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
|
|
|
3
3
|
import {
|
|
4
4
|
registerAuth,
|
|
5
5
|
selectAppAfterAuth
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5DR7BHUX.js";
|
|
7
7
|
import "./chunk-I6YQX7PF.js";
|
|
8
8
|
import "./chunk-RPSHRYCZ.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-PRSZJXA6.js";
|
|
10
10
|
import "./chunk-DXQAGBW6.js";
|
|
11
11
|
import "./chunk-LANOFNO6.js";
|
|
12
12
|
import "./chunk-5BEJA752.js";
|
|
@@ -1092,7 +1092,7 @@ var AdminClient = class _AdminClient {
|
|
|
1092
1092
|
}
|
|
1093
1093
|
async updateNetworkAllowlist(id, networks) {
|
|
1094
1094
|
const resp = await this.request("PUT", `/v1/apps/${id}/networks`, {
|
|
1095
|
-
|
|
1095
|
+
networkAllowlist: networks
|
|
1096
1096
|
});
|
|
1097
1097
|
return resp.data;
|
|
1098
1098
|
}
|
package/dist/index.js
CHANGED
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
errNotLoggedInForPolicyLookup,
|
|
6
6
|
errSponsorshipNeedsPolicy,
|
|
7
7
|
selectOrCreatePolicy
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PYIVNQEI.js";
|
|
9
9
|
import {
|
|
10
10
|
registerAuth
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5DR7BHUX.js";
|
|
12
12
|
import {
|
|
13
13
|
openBrowser
|
|
14
14
|
} from "./chunk-I6YQX7PF.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
getSetupStatus,
|
|
19
19
|
isSetupComplete,
|
|
20
20
|
shouldRunOnboarding
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-DWNXGFON.js";
|
|
22
22
|
import {
|
|
23
23
|
isInteractiveAllowed
|
|
24
24
|
} from "./chunk-RPSHRYCZ.js";
|
|
@@ -63,12 +63,12 @@ import {
|
|
|
63
63
|
updateSession,
|
|
64
64
|
validateNetwork,
|
|
65
65
|
walletNetworkToChain
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-PRSZJXA6.js";
|
|
67
67
|
import {
|
|
68
68
|
getAvailableUpdate,
|
|
69
69
|
getUpdateStatus,
|
|
70
70
|
printUpdateNotice
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-OE6B6S2H.js";
|
|
72
72
|
import {
|
|
73
73
|
bold,
|
|
74
74
|
brand,
|
|
@@ -581,8 +581,8 @@ function registerConfig(program2) {
|
|
|
581
581
|
"Interactive policy selection requires an interactive terminal. Pass an ID: `alchemy config set evm-gas-policy-id <id>`."
|
|
582
582
|
);
|
|
583
583
|
}
|
|
584
|
-
const { selectOrCreatePolicy: selectOrCreatePolicy2 } = await import("./policy-prompt-
|
|
585
|
-
const { resolveNetwork: resolveNetwork2 } = await import("./resolve-
|
|
584
|
+
const { selectOrCreatePolicy: selectOrCreatePolicy2 } = await import("./policy-prompt-LY6DMMT4.js");
|
|
585
|
+
const { resolveNetwork: resolveNetwork2 } = await import("./resolve-GELBKDTP.js");
|
|
586
586
|
const network = resolveNetwork2(program2);
|
|
587
587
|
await selectOrCreatePolicy2({
|
|
588
588
|
flavor: "sponsorship",
|
|
@@ -636,8 +636,8 @@ function registerConfig(program2) {
|
|
|
636
636
|
"Interactive policy selection requires an interactive terminal. Pass an ID: `alchemy config set solana-fee-policy-id <id>`."
|
|
637
637
|
);
|
|
638
638
|
}
|
|
639
|
-
const { selectOrCreatePolicy: selectOrCreatePolicy2 } = await import("./policy-prompt-
|
|
640
|
-
const { resolveSolanaNetwork: resolveSolanaNetwork2 } = await import("./resolve-
|
|
639
|
+
const { selectOrCreatePolicy: selectOrCreatePolicy2 } = await import("./policy-prompt-LY6DMMT4.js");
|
|
640
|
+
const { resolveSolanaNetwork: resolveSolanaNetwork2 } = await import("./resolve-GELBKDTP.js");
|
|
641
641
|
const network = resolveSolanaNetwork2(program2);
|
|
642
642
|
await selectOrCreatePolicy2({
|
|
643
643
|
flavor: "solana",
|
|
@@ -694,7 +694,7 @@ function registerConfig(program2) {
|
|
|
694
694
|
printJSON(toMap(cfg));
|
|
695
695
|
return;
|
|
696
696
|
}
|
|
697
|
-
const { resolveAuthToken: resolveAuthToken2 } = await import("./resolve-
|
|
697
|
+
const { resolveAuthToken: resolveAuthToken2 } = await import("./resolve-GELBKDTP.js");
|
|
698
698
|
const validToken = resolveAuthToken2(cfg);
|
|
699
699
|
const authStatus = cfg.auth_token ? validToken ? `${green("\u2713")} authenticated${cfg.auth_token_expires_at ? ` ${dim(`(expires ${cfg.auth_token_expires_at})`)}` : ""}` : `${yellow("\u25C6")} expired${cfg.auth_token_expires_at ? ` ${dim(`(${cfg.auth_token_expires_at})`)}` : ""}` : dim("(not set) \u2014 run 'alchemy auth' to log in");
|
|
700
700
|
const pairs = [
|
|
@@ -874,6 +874,21 @@ function matchesSearch(app, query) {
|
|
|
874
874
|
function appToTableRow(app) {
|
|
875
875
|
return [app.id, app.name, String(app.chainNetworks.length), app.createdAt];
|
|
876
876
|
}
|
|
877
|
+
function appToListJSON(app) {
|
|
878
|
+
return {
|
|
879
|
+
id: app.id,
|
|
880
|
+
name: app.name,
|
|
881
|
+
createdAt: app.createdAt,
|
|
882
|
+
networkCount: app.chainNetworks.length,
|
|
883
|
+
networks: app.chainNetworks.map((network) => ({
|
|
884
|
+
id: network.id,
|
|
885
|
+
name: network.name
|
|
886
|
+
}))
|
|
887
|
+
};
|
|
888
|
+
}
|
|
889
|
+
function appToJSON(app, opts) {
|
|
890
|
+
return opts.full ? maskAppSecrets(app) : appToListJSON(app);
|
|
891
|
+
}
|
|
877
892
|
function handleDryRun(opts, action, payload, humanMsg) {
|
|
878
893
|
if (!opts.dryRun) return false;
|
|
879
894
|
if (isJSONMode()) {
|
|
@@ -885,7 +900,7 @@ function handleDryRun(opts, action, payload, humanMsg) {
|
|
|
885
900
|
}
|
|
886
901
|
function registerApps(program2) {
|
|
887
902
|
const cmd = program2.command("app").description("Manage Alchemy apps");
|
|
888
|
-
cmd.command("list").description("List all apps").option("--cursor <cursor>", "Pagination cursor").option("--limit <n>", "Max results per page", parseInt).option("--all", "Fetch all pages").option("--search <query>", "Search apps by name or id (client-side)").option("--id <appId>", "Filter by exact app id (client-side)").action(async (opts) => {
|
|
903
|
+
cmd.command("list").description("List all apps").option("--cursor <cursor>", "Pagination cursor").option("--limit <n>", "Max results per page", parseInt).option("--all", "Fetch all pages").option("--search <query>", "Search apps by name or id (client-side)").option("--id <appId>", "Filter by exact app id (client-side)").option("--full", "Return full sanitized app payload in JSON mode").action(async (opts) => {
|
|
889
904
|
try {
|
|
890
905
|
const admin = adminClientFromFlags(program2);
|
|
891
906
|
const fetchAll = Boolean(opts.all);
|
|
@@ -918,7 +933,7 @@ function registerApps(program2) {
|
|
|
918
933
|
const filteredApps = hasId ? result2.apps.filter((a) => a.id === idQuery) : hasSearch ? result2.apps.filter((a) => matchesSearch(a, searchQuery)) : result2.apps;
|
|
919
934
|
if (isJSONMode()) {
|
|
920
935
|
printJSON({
|
|
921
|
-
apps: filteredApps.map(
|
|
936
|
+
apps: filteredApps.map((app) => appToJSON(app, { full: opts.full })),
|
|
922
937
|
pageInfo: {
|
|
923
938
|
mode: fetchAll ? "all" : "search",
|
|
924
939
|
pages: result2.pages,
|
|
@@ -952,7 +967,10 @@ function registerApps(program2) {
|
|
|
952
967
|
() => admin.listApps({ cursor: opts.cursor, limit: opts.limit })
|
|
953
968
|
);
|
|
954
969
|
if (isJSONMode()) {
|
|
955
|
-
printJSON({
|
|
970
|
+
printJSON({
|
|
971
|
+
...result,
|
|
972
|
+
apps: result.apps.map((app) => appToJSON(app, { full: opts.full }))
|
|
973
|
+
});
|
|
956
974
|
return;
|
|
957
975
|
}
|
|
958
976
|
const interactivePagination = isInteractiveAllowed(program2) && !opts.all;
|
|
@@ -1043,7 +1061,7 @@ function registerApps(program2) {
|
|
|
1043
1061
|
const products = opts.products ? splitCommaList(opts.products) : void 0;
|
|
1044
1062
|
const payload = {
|
|
1045
1063
|
name: opts.name,
|
|
1046
|
-
networks,
|
|
1064
|
+
networkAllowlist: networks,
|
|
1047
1065
|
...opts.description && { description: opts.description },
|
|
1048
1066
|
...products && { products }
|
|
1049
1067
|
};
|
|
@@ -1134,7 +1152,12 @@ function registerApps(program2) {
|
|
|
1134
1152
|
cmd.command("networks <id>").description("Update app network allowlist").requiredOption("--networks <networks>", "Comma-separated network IDs").option("--dry-run", "Preview without executing").action(async (id, opts) => {
|
|
1135
1153
|
try {
|
|
1136
1154
|
const networks = splitCommaList(opts.networks);
|
|
1137
|
-
if (handleDryRun(
|
|
1155
|
+
if (handleDryRun(
|
|
1156
|
+
opts,
|
|
1157
|
+
"networks",
|
|
1158
|
+
{ id, networkAllowlist: networks },
|
|
1159
|
+
`Would update networks for app ${id}: ${networks.join(", ")}`
|
|
1160
|
+
)) return;
|
|
1138
1161
|
const admin = adminClientFromFlags(program2);
|
|
1139
1162
|
const app = await withSpinner(
|
|
1140
1163
|
"Updating networks\u2026",
|
|
@@ -10373,7 +10396,7 @@ async function flushProcessOutput() {
|
|
|
10373
10396
|
}
|
|
10374
10397
|
program.name("alchemy").description(
|
|
10375
10398
|
"The Alchemy CLI lets you query blockchain data, call JSON-RPC methods, and manage your Alchemy configuration."
|
|
10376
|
-
).version("0.
|
|
10399
|
+
).version("0.13.0", "-v, --version", "display CLI version").option("--api-key <key>", "Alchemy API key (env: ALCHEMY_API_KEY)").option(
|
|
10377
10400
|
"-n, --network <network>",
|
|
10378
10401
|
"Target network for networked commands"
|
|
10379
10402
|
).option("--x402", "Use x402 wallet-based gateway auth").option(
|
|
@@ -10560,11 +10583,11 @@ ${styledLine}`;
|
|
|
10560
10583
|
"wallet"
|
|
10561
10584
|
];
|
|
10562
10585
|
if (!skipAppPrompt.includes(cmdName) && isInteractiveAllowed(program) && !opts.apiKey && !process.env.ALCHEMY_API_KEY) {
|
|
10563
|
-
const { resolveAuthToken: resolveAuthToken2 } = await import("./resolve-
|
|
10586
|
+
const { resolveAuthToken: resolveAuthToken2 } = await import("./resolve-GELBKDTP.js");
|
|
10564
10587
|
const authToken = resolveAuthToken2(cfg);
|
|
10565
10588
|
const hasApiKey = Boolean(cfg.api_key?.trim() || cfg.app?.apiKey);
|
|
10566
10589
|
if (authToken && !hasApiKey) {
|
|
10567
|
-
const { selectAppAfterAuth } = await import("./auth-
|
|
10590
|
+
const { selectAppAfterAuth } = await import("./auth-YB6AALZO.js");
|
|
10568
10591
|
console.log("");
|
|
10569
10592
|
console.log(` No app selected. Please select an app to continue.`);
|
|
10570
10593
|
await selectAppAfterAuth(authToken);
|
|
@@ -10599,7 +10622,7 @@ ${styledLine}`;
|
|
|
10599
10622
|
if (isInteractiveAllowed(program)) {
|
|
10600
10623
|
let latestForInteractiveStartup = null;
|
|
10601
10624
|
if (shouldRunOnboarding(program, cfg)) {
|
|
10602
|
-
const { runOnboarding } = await import("./onboarding-
|
|
10625
|
+
const { runOnboarding } = await import("./onboarding-TYRUMFUL.js");
|
|
10603
10626
|
const latest = getAvailableUpdateOnce();
|
|
10604
10627
|
const completed = await runOnboarding(program, latest);
|
|
10605
10628
|
updateShownDuringInteractiveStartup = Boolean(latest);
|
|
@@ -10613,7 +10636,7 @@ ${styledLine}`;
|
|
|
10613
10636
|
latestForInteractiveStartup
|
|
10614
10637
|
);
|
|
10615
10638
|
}
|
|
10616
|
-
const { startREPL } = await import("./interactive-
|
|
10639
|
+
const { startREPL } = await import("./interactive-6SOB4IYV.js");
|
|
10617
10640
|
program.exitOverride();
|
|
10618
10641
|
program.configureOutput({
|
|
10619
10642
|
writeErr: () => {
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
|
|
3
3
|
import {
|
|
4
4
|
getSetupMethod
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DWNXGFON.js";
|
|
6
6
|
import "./chunk-RPSHRYCZ.js";
|
|
7
7
|
import {
|
|
8
8
|
getRPCNetworkIds
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PRSZJXA6.js";
|
|
10
10
|
import {
|
|
11
11
|
getUpdateNoticeLines
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OE6B6S2H.js";
|
|
13
13
|
import {
|
|
14
14
|
bold,
|
|
15
15
|
brand,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
|
|
3
3
|
import {
|
|
4
4
|
getUpdateNoticeLines
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OE6B6S2H.js";
|
|
6
6
|
import {
|
|
7
7
|
bold,
|
|
8
8
|
brand,
|
|
@@ -51,7 +51,7 @@ async function runOnboarding(_program, latestUpdate = null) {
|
|
|
51
51
|
auth_token_expires_at: result.expiresAt
|
|
52
52
|
});
|
|
53
53
|
console.log(` ${green("\u2713")} Logged in successfully`);
|
|
54
|
-
const { selectAppAfterAuth } = await import("./auth-
|
|
54
|
+
const { selectAppAfterAuth } = await import("./auth-YB6AALZO.js");
|
|
55
55
|
await selectAppAfterAuth(result.token);
|
|
56
56
|
return true;
|
|
57
57
|
} catch (err) {
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
errNotLoggedInForPolicyLookup,
|
|
6
6
|
errSponsorshipNeedsPolicy,
|
|
7
7
|
selectOrCreatePolicy
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-PYIVNQEI.js";
|
|
9
|
+
import "./chunk-PRSZJXA6.js";
|
|
10
10
|
import "./chunk-DXQAGBW6.js";
|
|
11
11
|
import "./chunk-LANOFNO6.js";
|
|
12
12
|
import "./chunk-5BEJA752.js";
|