@chainalert/cli 0.0.5 → 0.0.6

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ask
4
- } from "./chunk-6FDEYAAT.js";
4
+ } from "./chunk-56X2ZTGI.js";
5
5
  import {
6
6
  loadConfig,
7
7
  saveConfig
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  confirm
4
- } from "./chunk-6FDEYAAT.js";
4
+ } from "./chunk-56X2ZTGI.js";
5
5
  import {
6
6
  spinner
7
7
  } from "./chunk-CE4DKHAY.js";
@@ -2,26 +2,35 @@
2
2
 
3
3
  // src/util/prompt.ts
4
4
  import { createInterface } from "readline";
5
+ var replRl = null;
6
+ function setReplRl(rl) {
7
+ replRl = rl;
8
+ }
5
9
  function confirm(question) {
10
+ if (replRl) replRl.pause();
6
11
  const rl = createInterface({ input: process.stdin, output: process.stderr });
7
12
  return new Promise((resolve) => {
8
13
  rl.question(`${question} [y/N] `, (answer) => {
9
14
  rl.close();
15
+ if (replRl) replRl.resume();
10
16
  resolve(answer.trim().toLowerCase() === "y");
11
17
  });
12
18
  });
13
19
  }
14
20
  function ask(question) {
21
+ if (replRl) replRl.pause();
15
22
  const rl = createInterface({ input: process.stdin, output: process.stderr });
16
23
  return new Promise((resolve) => {
17
24
  rl.question(question, (answer) => {
18
25
  rl.close();
26
+ if (replRl) replRl.resume();
19
27
  resolve(answer.trim());
20
28
  });
21
29
  });
22
30
  }
23
31
 
24
32
  export {
33
+ setReplRl,
25
34
  confirm,
26
35
  ask
27
36
  };
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  confirm
4
- } from "./chunk-6FDEYAAT.js";
4
+ } from "./chunk-56X2ZTGI.js";
5
5
  import {
6
6
  spinner
7
7
  } from "./chunk-CE4DKHAY.js";
package/dist/index.js CHANGED
@@ -67,12 +67,12 @@ async function main() {
67
67
  switch (root) {
68
68
  // No command or "chat" -> interactive REPL
69
69
  case void 0: {
70
- const { startRepl } = await import("./repl-LJY4YK5T.js");
70
+ const { startRepl } = await import("./repl-DQU6NZJV.js");
71
71
  await startRepl();
72
72
  return;
73
73
  }
74
74
  case "chat": {
75
- const { startRepl } = await import("./repl-LJY4YK5T.js");
75
+ const { startRepl } = await import("./repl-DQU6NZJV.js");
76
76
  await startRepl();
77
77
  return;
78
78
  }
@@ -80,12 +80,12 @@ async function main() {
80
80
  case "login":
81
81
  case "logout":
82
82
  case "whoami": {
83
- const auth = await import("./auth-YTQPDHBH.js");
83
+ const auth = await import("./auth-Q7GKIG24.js");
84
84
  await auth.run([root, ...rest], flags);
85
85
  return;
86
86
  }
87
87
  case "config": {
88
- const auth = await import("./auth-YTQPDHBH.js");
88
+ const auth = await import("./auth-Q7GKIG24.js");
89
89
  await auth.runConfig(rest, flags);
90
90
  return;
91
91
  }
@@ -106,7 +106,7 @@ async function main() {
106
106
  return;
107
107
  }
108
108
  case "detections": {
109
- const mod = await import("./detections-KMOYIRPE.js");
109
+ const mod = await import("./detections-LMJFG257.js");
110
110
  await mod.run(rest, flags);
111
111
  return;
112
112
  }
@@ -126,7 +126,7 @@ async function main() {
126
126
  return;
127
127
  }
128
128
  case "channels": {
129
- const mod = await import("./channels-NT6NNET7.js");
129
+ const mod = await import("./channels-WIGDNPEC.js");
130
130
  await mod.run(rest, flags);
131
131
  return;
132
132
  }
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- confirm
4
- } from "./chunk-6FDEYAAT.js";
3
+ confirm,
4
+ setReplRl
5
+ } from "./chunk-56X2ZTGI.js";
5
6
  import {
6
7
  addRpcConfig,
7
8
  createChannel,
@@ -128,7 +129,7 @@ var registry = [
128
129
  },
129
130
  networkSlug: {
130
131
  type: "string",
131
- description: 'Filter by network slug, e.g. "ethereum-mainnet", "arbitrum-one".'
132
+ description: 'Filter by network slug, e.g. "ethereum", "arbitrum", "base", "polygon", "sepolia".'
132
133
  },
133
134
  page: { type: "number", description: "Page number (1-based)." },
134
135
  limit: { type: "number", description: "Results per page (default 20, max 100)." }
@@ -167,7 +168,7 @@ var registry = [
167
168
  },
168
169
  networkId: {
169
170
  type: "string",
170
- description: 'The network ID to monitor, e.g. "ethereum-mainnet", "arbitrum-one", "base-mainnet", "polygon-mainnet".'
171
+ description: 'The network slug to monitor, e.g. "ethereum", "arbitrum", "base", "polygon", "sepolia".'
171
172
  },
172
173
  inputs: {
173
174
  type: "object",
@@ -463,7 +464,7 @@ var registry = [
463
464
  },
464
465
  networkId: {
465
466
  type: "string",
466
- description: 'The network ID, e.g. "ethereum-mainnet", "arbitrum-one".'
467
+ description: 'The network slug, e.g. "ethereum", "arbitrum", "base", "polygon", "sepolia".'
467
468
  }
468
469
  },
469
470
  required: ["address", "networkId"]
@@ -514,7 +515,7 @@ var registry = [
514
515
  },
515
516
  networkId: {
516
517
  type: "string",
517
- description: 'The network ID, e.g. "ethereum-mainnet", "arbitrum-one".'
518
+ description: 'The network slug, e.g. "ethereum", "arbitrum", "base", "polygon", "sepolia".'
518
519
  },
519
520
  label: {
520
521
  type: "string",
@@ -543,7 +544,7 @@ var registry = [
543
544
  properties: {
544
545
  networkId: {
545
546
  type: "string",
546
- description: 'The network ID to configure, e.g. "ethereum-mainnet", "arbitrum-one".'
547
+ description: 'The network slug to configure, e.g. "ethereum", "arbitrum", "base", "polygon", "sepolia".'
547
548
  },
548
549
  rpcUrl: {
549
550
  type: "string",
@@ -1554,6 +1555,7 @@ async function startRepl() {
1554
1555
  output: process.stdout,
1555
1556
  prompt: cyan("chainalert> ")
1556
1557
  });
1558
+ setReplRl(rl);
1557
1559
  rl.prompt();
1558
1560
  rl.on("line", async (line) => {
1559
1561
  const input = line.trim();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainalert/cli",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "ChainAlert CLI — manage blockchain monitoring from the command line",
5
5
  "type": "module",
6
6
  "license": "MIT",