@chainalert/cli 0.0.1 → 0.0.3

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.
@@ -6,8 +6,8 @@ import {
6
6
  getAlert,
7
7
  getAlertStats,
8
8
  listAlerts
9
- } from "./chunk-IC5RERFB.js";
10
- import "./chunk-K2BGDX7X.js";
9
+ } from "./chunk-ZJN3UG7K.js";
10
+ import "./chunk-7AIFW2QP.js";
11
11
  import {
12
12
  dim,
13
13
  print,
@@ -15,7 +15,7 @@ import {
15
15
  printJson,
16
16
  printKV,
17
17
  printTable
18
- } from "./chunk-WPW7UBVR.js";
18
+ } from "./chunk-7IOPEYQM.js";
19
19
 
20
20
  // src/commands/alerts.ts
21
21
  async function run(args, flags) {
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  loadConfig,
7
7
  saveConfig
8
- } from "./chunk-K2BGDX7X.js";
8
+ } from "./chunk-7AIFW2QP.js";
9
9
  import {
10
10
  dim,
11
11
  print,
@@ -13,7 +13,7 @@ import {
13
13
  printJson,
14
14
  printKV,
15
15
  printSuccess
16
- } from "./chunk-WPW7UBVR.js";
16
+ } from "./chunk-7IOPEYQM.js";
17
17
 
18
18
  // src/commands/auth.ts
19
19
  async function run(args, flags) {
@@ -10,15 +10,15 @@ import {
10
10
  deleteChannel,
11
11
  listChannels,
12
12
  testChannel
13
- } from "./chunk-IC5RERFB.js";
14
- import "./chunk-K2BGDX7X.js";
13
+ } from "./chunk-ZJN3UG7K.js";
14
+ import "./chunk-7AIFW2QP.js";
15
15
  import {
16
16
  print,
17
17
  printError,
18
18
  printJson,
19
19
  printSuccess,
20
20
  printTable
21
- } from "./chunk-WPW7UBVR.js";
21
+ } from "./chunk-7IOPEYQM.js";
22
22
 
23
23
  // src/commands/channels.ts
24
24
  async function run(args, flags) {
@@ -3,7 +3,7 @@ import {
3
3
  CONFIG_DIR,
4
4
  CONFIG_FILE,
5
5
  DEFAULT_API_URL
6
- } from "./chunk-WPW7UBVR.js";
6
+ } from "./chunk-7IOPEYQM.js";
7
7
 
8
8
  // src/config/store.ts
9
9
  import { readFileSync, writeFileSync, mkdirSync, existsSync } from "fs";
@@ -3,8 +3,8 @@
3
3
  // src/config/constants.ts
4
4
  import { homedir } from "os";
5
5
  import { join } from "path";
6
- var VERSION = "0.0.1";
7
- var DEFAULT_API_URL = "https://api.chainalert.dev";
6
+ var VERSION = "0.0.3";
7
+ var DEFAULT_API_URL = "https://chainalert.dev/api";
8
8
  var CONFIG_DIR = join(homedir(), ".chainalert");
9
9
  var CONFIG_FILE = join(CONFIG_DIR, "config.json");
10
10
 
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  getApiKey,
4
4
  getApiUrl
5
- } from "./chunk-K2BGDX7X.js";
5
+ } from "./chunk-7AIFW2QP.js";
6
6
 
7
7
  // src/client/http.ts
8
8
  var ApiError = class extends Error {
@@ -14,11 +14,8 @@ var ApiError = class extends Error {
14
14
  }
15
15
  };
16
16
  async function request(method, path, opts) {
17
- const baseUrl = getApiUrl();
18
- if (!baseUrl) {
19
- throw new Error("API URL not configured. Run `chainalert config set apiUrl <url>` first.");
20
- }
21
- const url = new URL(path, baseUrl);
17
+ const baseUrl = getApiUrl().replace(/\/?$/, "/");
18
+ const url = new URL(path.replace(/^\//, ""), baseUrl);
22
19
  if (opts?.params) {
23
20
  for (const [key, value] of Object.entries(opts.params)) {
24
21
  if (value !== void 0) {
@@ -5,8 +5,8 @@ import {
5
5
  import {
6
6
  getStorageSlots,
7
7
  resolveContract
8
- } from "./chunk-IC5RERFB.js";
9
- import "./chunk-K2BGDX7X.js";
8
+ } from "./chunk-ZJN3UG7K.js";
9
+ import "./chunk-7AIFW2QP.js";
10
10
  import {
11
11
  bold,
12
12
  dim,
@@ -14,7 +14,7 @@ import {
14
14
  printError,
15
15
  printJson,
16
16
  printKV
17
- } from "./chunk-WPW7UBVR.js";
17
+ } from "./chunk-7IOPEYQM.js";
18
18
 
19
19
  // src/commands/contracts.ts
20
20
  async function run(args, flags) {
@@ -12,8 +12,8 @@ import {
12
12
  listDetections,
13
13
  testDetection,
14
14
  updateDetection
15
- } from "./chunk-IC5RERFB.js";
16
- import "./chunk-K2BGDX7X.js";
15
+ } from "./chunk-ZJN3UG7K.js";
16
+ import "./chunk-7AIFW2QP.js";
17
17
  import {
18
18
  bold,
19
19
  dim,
@@ -26,7 +26,7 @@ import {
26
26
  printTable,
27
27
  red,
28
28
  yellow
29
- } from "./chunk-WPW7UBVR.js";
29
+ } from "./chunk-7IOPEYQM.js";
30
30
 
31
31
  // src/commands/detections.ts
32
32
  async function run(args, flags) {
@@ -5,8 +5,8 @@ import {
5
5
  import {
6
6
  getEvent,
7
7
  listEvents
8
- } from "./chunk-IC5RERFB.js";
9
- import "./chunk-K2BGDX7X.js";
8
+ } from "./chunk-ZJN3UG7K.js";
9
+ import "./chunk-7AIFW2QP.js";
10
10
  import {
11
11
  dim,
12
12
  print,
@@ -14,7 +14,7 @@ import {
14
14
  printJson,
15
15
  printKV,
16
16
  printTable
17
- } from "./chunk-WPW7UBVR.js";
17
+ } from "./chunk-7IOPEYQM.js";
18
18
 
19
19
  // src/commands/events.ts
20
20
  async function run(args, flags) {
@@ -4,15 +4,15 @@ import {
4
4
  } from "./chunk-CE4DKHAY.js";
5
5
  import {
6
6
  getHealth
7
- } from "./chunk-IC5RERFB.js";
8
- import "./chunk-K2BGDX7X.js";
7
+ } from "./chunk-ZJN3UG7K.js";
8
+ import "./chunk-7AIFW2QP.js";
9
9
  import {
10
10
  print,
11
11
  printError,
12
12
  printJson,
13
13
  printSuccess,
14
14
  red
15
- } from "./chunk-WPW7UBVR.js";
15
+ } from "./chunk-7IOPEYQM.js";
16
16
 
17
17
  // src/commands/health.ts
18
18
  async function run(args, flags) {
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  bold,
5
5
  print,
6
6
  printError
7
- } from "./chunk-WPW7UBVR.js";
7
+ } from "./chunk-7IOPEYQM.js";
8
8
 
9
9
  // src/index.ts
10
10
  function parseArgs(argv) {
@@ -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-Q43IBAFT.js");
70
+ const { startRepl } = await import("./repl-ZG7IN2B4.js");
71
71
  await startRepl();
72
72
  return;
73
73
  }
74
74
  case "chat": {
75
- const { startRepl } = await import("./repl-Q43IBAFT.js");
75
+ const { startRepl } = await import("./repl-ZG7IN2B4.js");
76
76
  await startRepl();
77
77
  return;
78
78
  }
@@ -80,68 +80,68 @@ async function main() {
80
80
  case "login":
81
81
  case "logout":
82
82
  case "whoami": {
83
- const auth = await import("./auth-6LTJFNU2.js");
83
+ const auth = await import("./auth-WLMAW2H7.js");
84
84
  await auth.run([root, ...rest], flags);
85
85
  return;
86
86
  }
87
87
  case "config": {
88
- const auth = await import("./auth-6LTJFNU2.js");
88
+ const auth = await import("./auth-WLMAW2H7.js");
89
89
  await auth.runConfig(rest, flags);
90
90
  return;
91
91
  }
92
92
  // Resource commands
93
93
  case "health": {
94
- const mod = await import("./health-7R5HLRCZ.js");
94
+ const mod = await import("./health-IAKHPFHP.js");
95
95
  await mod.run(rest, flags);
96
96
  return;
97
97
  }
98
98
  case "networks": {
99
- const mod = await import("./networks-CF2ARYQO.js");
99
+ const mod = await import("./networks-JE4WWOVC.js");
100
100
  await mod.run(rest, flags);
101
101
  return;
102
102
  }
103
103
  case "templates": {
104
- const mod = await import("./templates-LYY2SV42.js");
104
+ const mod = await import("./templates-WKWXRABA.js");
105
105
  await mod.run(rest, flags);
106
106
  return;
107
107
  }
108
108
  case "detections": {
109
- const mod = await import("./detections-QSMNEXXI.js");
109
+ const mod = await import("./detections-R7GW3LKO.js");
110
110
  await mod.run(rest, flags);
111
111
  return;
112
112
  }
113
113
  case "alerts": {
114
- const mod = await import("./alerts-STXD4TE5.js");
114
+ const mod = await import("./alerts-TWALVXNJ.js");
115
115
  await mod.run(rest, flags);
116
116
  return;
117
117
  }
118
118
  case "events": {
119
- const mod = await import("./events-FM7VK5VH.js");
119
+ const mod = await import("./events-B2OW4AKX.js");
120
120
  await mod.run(rest, flags);
121
121
  return;
122
122
  }
123
123
  case "state-changes": {
124
- const mod = await import("./state-changes-B6BIS4OJ.js");
124
+ const mod = await import("./state-changes-LT2VCBT2.js");
125
125
  await mod.run(rest, flags);
126
126
  return;
127
127
  }
128
128
  case "channels": {
129
- const mod = await import("./channels-C5JZON37.js");
129
+ const mod = await import("./channels-D7MIHEHO.js");
130
130
  await mod.run(rest, flags);
131
131
  return;
132
132
  }
133
133
  case "contracts": {
134
- const mod = await import("./contracts-J7JYPQXP.js");
134
+ const mod = await import("./contracts-N73PHLWK.js");
135
135
  await mod.run(rest, flags);
136
136
  return;
137
137
  }
138
138
  case "org-contracts": {
139
- const mod = await import("./org-contracts-DM2BTHTO.js");
139
+ const mod = await import("./org-contracts-UNDFKFMP.js");
140
140
  await mod.run(rest, flags);
141
141
  return;
142
142
  }
143
143
  case "rpc-configs": {
144
- const mod = await import("./rpc-configs-P2QCFCDJ.js");
144
+ const mod = await import("./rpc-configs-LHCPRKBY.js");
145
145
  await mod.run(rest, flags);
146
146
  return;
147
147
  }
@@ -4,14 +4,14 @@ import {
4
4
  } from "./chunk-CE4DKHAY.js";
5
5
  import {
6
6
  listNetworks
7
- } from "./chunk-IC5RERFB.js";
8
- import "./chunk-K2BGDX7X.js";
7
+ } from "./chunk-ZJN3UG7K.js";
8
+ import "./chunk-7AIFW2QP.js";
9
9
  import {
10
10
  print,
11
11
  printError,
12
12
  printJson,
13
13
  printTable
14
- } from "./chunk-WPW7UBVR.js";
14
+ } from "./chunk-7IOPEYQM.js";
15
15
 
16
16
  // src/commands/networks.ts
17
17
  async function run(args, flags) {
@@ -7,8 +7,8 @@ import {
7
7
  getOrgContractTraits,
8
8
  listOrgContracts,
9
9
  registerOrgContract
10
- } from "./chunk-IC5RERFB.js";
11
- import "./chunk-K2BGDX7X.js";
10
+ } from "./chunk-ZJN3UG7K.js";
11
+ import "./chunk-7AIFW2QP.js";
12
12
  import {
13
13
  dim,
14
14
  print,
@@ -17,7 +17,7 @@ import {
17
17
  printKV,
18
18
  printSuccess,
19
19
  printTable
20
- } from "./chunk-WPW7UBVR.js";
20
+ } from "./chunk-7IOPEYQM.js";
21
21
 
22
22
  // src/commands/org-contracts.ts
23
23
  async function run(args, flags) {
@@ -28,12 +28,12 @@ import {
28
28
  testChannel,
29
29
  testDetection,
30
30
  updateDetection
31
- } from "./chunk-IC5RERFB.js";
31
+ } from "./chunk-ZJN3UG7K.js";
32
32
  import {
33
33
  getApiKey,
34
34
  getApiUrl,
35
35
  loadConfig
36
- } from "./chunk-K2BGDX7X.js";
36
+ } from "./chunk-7AIFW2QP.js";
37
37
  import {
38
38
  bold,
39
39
  cyan,
@@ -42,7 +42,7 @@ import {
42
42
  printDim,
43
43
  printError,
44
44
  printWarn
45
- } from "./chunk-WPW7UBVR.js";
45
+ } from "./chunk-7IOPEYQM.js";
46
46
 
47
47
  // src/repl/repl.ts
48
48
  import { createInterface } from "readline";
@@ -6,15 +6,15 @@ import {
6
6
  addRpcConfig,
7
7
  listRpcConfigs,
8
8
  testRpcConfig
9
- } from "./chunk-IC5RERFB.js";
10
- import "./chunk-K2BGDX7X.js";
9
+ } from "./chunk-ZJN3UG7K.js";
10
+ import "./chunk-7AIFW2QP.js";
11
11
  import {
12
12
  print,
13
13
  printError,
14
14
  printJson,
15
15
  printSuccess,
16
16
  printTable
17
- } from "./chunk-WPW7UBVR.js";
17
+ } from "./chunk-7IOPEYQM.js";
18
18
 
19
19
  // src/commands/rpc-configs.ts
20
20
  async function run(args, flags) {
@@ -4,15 +4,15 @@ import {
4
4
  } from "./chunk-CE4DKHAY.js";
5
5
  import {
6
6
  listStateChanges
7
- } from "./chunk-IC5RERFB.js";
8
- import "./chunk-K2BGDX7X.js";
7
+ } from "./chunk-ZJN3UG7K.js";
8
+ import "./chunk-7AIFW2QP.js";
9
9
  import {
10
10
  dim,
11
11
  print,
12
12
  printError,
13
13
  printJson,
14
14
  printTable
15
- } from "./chunk-WPW7UBVR.js";
15
+ } from "./chunk-7IOPEYQM.js";
16
16
 
17
17
  // src/commands/state-changes.ts
18
18
  async function run(args, flags) {
@@ -5,8 +5,8 @@ import {
5
5
  import {
6
6
  getTemplate,
7
7
  listTemplates
8
- } from "./chunk-IC5RERFB.js";
9
- import "./chunk-K2BGDX7X.js";
8
+ } from "./chunk-ZJN3UG7K.js";
9
+ import "./chunk-7AIFW2QP.js";
10
10
  import {
11
11
  bold,
12
12
  dim,
@@ -15,7 +15,7 @@ import {
15
15
  printJson,
16
16
  printKV,
17
17
  printTable
18
- } from "./chunk-WPW7UBVR.js";
18
+ } from "./chunk-7IOPEYQM.js";
19
19
 
20
20
  // src/commands/templates.ts
21
21
  async function run(args, flags) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainalert/cli",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "ChainAlert CLI — manage blockchain monitoring from the command line",
5
5
  "type": "module",
6
6
  "license": "MIT",