@alchemy/cli 0.7.2 → 0.7.4
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-F2IXC6CM.js +16 -0
- package/dist/{auth-TA3SL4BL.js → auth-GD7BJOMK.js} +2 -2
- package/dist/{chunk-KLPWJFWP.js → chunk-2BALTY22.js} +2 -19
- package/dist/{chunk-DGKUBK7G.js → chunk-5IL2PMZ6.js} +1 -1
- package/dist/{chunk-RE5HSYJJ.js → chunk-64A5W4M2.js} +1 -1
- package/dist/{chunk-INVT5BV6.js → chunk-C5HNQOLB.js} +1 -1
- package/dist/{chunk-BAZ4NGOD.js → chunk-JUCUKTP3.js} +1 -1
- package/dist/{chunk-5LCA2B6S.js → chunk-K6V3R7SH.js} +514 -509
- package/dist/{chunk-MB6REYQL.js → chunk-N36ZNOVV.js} +3 -3
- package/dist/chunk-R4W44A6E.js +134 -0
- package/dist/{chunk-LQXLZLCY.js → chunk-XSN4XA5Z.js} +6 -6
- package/dist/{errors-J6HNGXVA.js → errors-E2P6WHTX.js} +1 -1
- package/dist/index.js +391 -81
- package/dist/{interactive-JNTFVCUJ.js → interactive-MHAC5WQI.js} +13 -10
- package/dist/{onboarding-WN3IMTGS.js → onboarding-CT4RRH6O.js} +6 -6
- package/dist/{resolve-ZCR3YCHJ.js → resolve-WXT5ZCUK.js} +3 -3
- package/package.json +18 -24
- package/scripts/postinstall.cjs +2 -0
- package/dist/auth-7QNYRHIK.js +0 -16
- package/dist/chunk-EZ2ZD7YO.js +0 -64
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
|
|
3
|
+
import {
|
|
4
|
+
registerAuth,
|
|
5
|
+
selectAppAfterAuth
|
|
6
|
+
} from "./chunk-XSN4XA5Z.js";
|
|
7
|
+
import "./chunk-C5HNQOLB.js";
|
|
8
|
+
import "./chunk-64A5W4M2.js";
|
|
9
|
+
import "./chunk-K6V3R7SH.js";
|
|
10
|
+
import "./chunk-5IL2PMZ6.js";
|
|
11
|
+
import "./chunk-JUCUKTP3.js";
|
|
12
|
+
import "./chunk-2BALTY22.js";
|
|
13
|
+
export {
|
|
14
|
+
registerAuth,
|
|
15
|
+
selectAppAfterAuth
|
|
16
|
+
};
|
|
@@ -91,9 +91,6 @@ function parseBaseURLOverride(envVarName, options = {}) {
|
|
|
91
91
|
return parsed;
|
|
92
92
|
}
|
|
93
93
|
var BREADCRUMB_HEADER = "alchemy-cli";
|
|
94
|
-
function escapeRegExp(input) {
|
|
95
|
-
return input.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
96
|
-
}
|
|
97
94
|
async function fetchWithTimeout(url, init) {
|
|
98
95
|
try {
|
|
99
96
|
return await fetch(url, {
|
|
@@ -109,22 +106,6 @@ async function fetchWithTimeout(url, init) {
|
|
|
109
106
|
throw errNetwork(`Request timed out after ${timeout}ms`);
|
|
110
107
|
}
|
|
111
108
|
const message = err.message ?? String(err);
|
|
112
|
-
const causeMessage = err.cause?.message ?? "";
|
|
113
|
-
const causeCode = err.cause?.code ?? "";
|
|
114
|
-
const fullErrorText = `${message} ${causeMessage} ${causeCode}`;
|
|
115
|
-
if (/ENOTFOUND|EAI_AGAIN|getaddrinfo/i.test(fullErrorText)) {
|
|
116
|
-
try {
|
|
117
|
-
const hostname = new URL(url).hostname;
|
|
118
|
-
const networkSlug = hostname.replace(new RegExp(`\\.g\\.${escapeRegExp(getBaseDomain())}$`), "");
|
|
119
|
-
if (networkSlug !== hostname) {
|
|
120
|
-
throw errInvalidArgs(
|
|
121
|
-
`Unknown network '${networkSlug}'. Run 'alchemy evm network list' to see available networks.`
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
} catch (innerErr) {
|
|
125
|
-
if (innerErr instanceof CLIError) throw innerErr;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
109
|
throw errNetwork(message);
|
|
129
110
|
}
|
|
130
111
|
}
|
|
@@ -323,6 +304,7 @@ var ErrorCode = {
|
|
|
323
304
|
RATE_LIMITED: "RATE_LIMITED",
|
|
324
305
|
PAYMENT_REQUIRED: "PAYMENT_REQUIRED",
|
|
325
306
|
SETUP_REQUIRED: "SETUP_REQUIRED",
|
|
307
|
+
QUOTE_FAILED: "QUOTE_FAILED",
|
|
326
308
|
INTERNAL_ERROR: "INTERNAL_ERROR"
|
|
327
309
|
};
|
|
328
310
|
var RETRYABLE_CODES = /* @__PURE__ */ new Set([
|
|
@@ -344,6 +326,7 @@ var EXIT_CODES = {
|
|
|
344
326
|
ADMIN_API_ERROR: 8,
|
|
345
327
|
PAYMENT_REQUIRED: 9,
|
|
346
328
|
SETUP_REQUIRED: 3,
|
|
329
|
+
QUOTE_FAILED: 10,
|
|
347
330
|
INTERNAL_ERROR: 1
|
|
348
331
|
};
|
|
349
332
|
var CLIError = class extends Error {
|