@alchemy/cli 0.7.1 → 0.7.2-alpha.26

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.
@@ -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
+ };
@@ -11,8 +11,8 @@ import {
11
11
  prepareLogin,
12
12
  revokeToken,
13
13
  waitForCallback
14
- } from "./chunk-HSKKIATB.js";
15
- import "./chunk-QEDAULQ2.js";
14
+ } from "./chunk-C5HNQOLB.js";
15
+ import "./chunk-2BALTY22.js";
16
16
  export {
17
17
  AUTH_PORT,
18
18
  DEFAULT_EXPIRES_IN_SECONDS,
@@ -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 {
@@ -517,6 +500,9 @@ var replMode = false;
517
500
  function setReplMode(enabled) {
518
501
  replMode = enabled;
519
502
  }
503
+ function isReplMode() {
504
+ return replMode;
505
+ }
520
506
  function exitWithError(err) {
521
507
  const cliErr = err instanceof CLIError ? err : new CLIError(
522
508
  ErrorCode.INTERNAL_ERROR,
@@ -573,5 +559,6 @@ export {
573
559
  errAdminAPI,
574
560
  errSetupRequired,
575
561
  setReplMode,
562
+ isReplMode,
576
563
  exitWithError
577
564
  };
@@ -5,7 +5,7 @@ import {
5
5
  isJSONMode,
6
6
  quiet,
7
7
  rgb
8
- } from "./chunk-QEDAULQ2.js";
8
+ } from "./chunk-2BALTY22.js";
9
9
 
10
10
  // src/lib/terminal-ui.ts
11
11
  import * as readline from "readline";
@@ -2,7 +2,7 @@
2
2
  if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
3
3
  import {
4
4
  isJSONMode
5
- } from "./chunk-QEDAULQ2.js";
5
+ } from "./chunk-2BALTY22.js";
6
6
 
7
7
  // src/lib/interaction.ts
8
8
  import { stdin, stdout } from "process";
@@ -2,7 +2,7 @@
2
2
  if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
3
3
  import {
4
4
  getBaseDomain
5
- } from "./chunk-QEDAULQ2.js";
5
+ } from "./chunk-2BALTY22.js";
6
6
 
7
7
  // src/lib/auth.ts
8
8
  import { createHash, randomBytes } from "crypto";
@@ -2,7 +2,7 @@
2
2
  if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
3
3
  import {
4
4
  isRevealMode
5
- } from "./chunk-QEDAULQ2.js";
5
+ } from "./chunk-2BALTY22.js";
6
6
 
7
7
  // src/lib/secrets.ts
8
8
  function maskSecret(value) {