@covalenthq/goldrush-cli 3.0.0 → 3.0.1

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/README.md CHANGED
@@ -15,7 +15,7 @@ goldrush auth
15
15
  goldrush balances eth-mainnet 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
16
16
 
17
17
  # Stream new DEX pairs
18
- goldrush newpairs eth-mainnet
18
+ goldrush new_pairs eth-mainnet
19
19
 
20
20
  # Launch proxy server (for MCP bridge)
21
21
  goldrush proxy
@@ -32,7 +32,7 @@ goldrush install
32
32
  | `goldrush auth` | Set up API key (OS keychain) |
33
33
  | `goldrush balances <chain> <address>` | Token balances with rich table |
34
34
  | `goldrush transfers <chain> <address>` | Transfer history |
35
- | `goldrush newpairs <chain>` | Stream new DEX pairs |
35
+ | `goldrush new_pairs <chain>` | Stream new DEX pairs |
36
36
  | `goldrush ohlcv <chain>` | OHLCV pairs stream |
37
37
  | `goldrush search <query>` | Token search |
38
38
  | `goldrush traders <chain>` | Top traders |
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // package.json
4
4
  var package_default = {
5
5
  name: "@covalenthq/goldrush-cli",
6
- version: "3.0.0",
6
+ version: "3.0.1",
7
7
  description: "Terminal-first blockchain data & algorithmic trading CLI powered by GoldRush API",
8
8
  type: "module",
9
9
  bin: {
@@ -190,9 +190,18 @@ async function validateApiKey(key) {
190
190
  "eth-mainnet",
191
191
  "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
192
192
  );
193
- return !response.error;
194
- } catch {
195
- return false;
193
+ if (response.error) {
194
+ return {
195
+ valid: false,
196
+ error_message: response.error_message
197
+ };
198
+ }
199
+ return { valid: true };
200
+ } catch (error) {
201
+ return {
202
+ valid: false,
203
+ error_message: error?.message || "The API key could not be validated.\nGet a key at https://goldrush.dev/platform/apikey/"
204
+ };
196
205
  }
197
206
  }
198
207
  async function getMaskedApiKey() {
@@ -287,8 +296,8 @@ var authCommand = new Command("auth").description("Set up your GoldRush API key"
287
296
  }
288
297
  const spinner = createSpinner("Validating API key...");
289
298
  spinner.start();
290
- const isValid = await validateApiKey(apiKey.trim());
291
- if (isValid) {
299
+ const result = await validateApiKey(apiKey.trim());
300
+ if (result.valid) {
292
301
  await setApiKey(apiKey.trim());
293
302
  spinner.succeed("API key validated and stored securely");
294
303
  console.log(
@@ -303,7 +312,7 @@ Key: ${colors.gold(apiKey.trim().slice(0, 6) + "..." + apiKey.trim().slice(-4))}
303
312
  console.log(
304
313
  errorBox(
305
314
  "Authentication Failed",
306
- "The API key could not be validated.\nGet a key at https://goldrush.dev/platform/apikey/"
315
+ result.error_message || "The API key could not be validated.\nGet a key at https://goldrush.dev/platform/apikey/"
307
316
  )
308
317
  );
309
318
  }
@@ -4816,7 +4825,7 @@ var configCommand = new Command4("config").description("View or update GoldRush
4816
4825
  console.log(
4817
4826
  infoBox(
4818
4827
  "Current Settings",
4819
- `Port: ${colors.gold(String(config2.port))}
4828
+ `Proxy Port: ${colors.gold(String(config2.port))}
4820
4829
  Default Chain: ${colors.accent(config2.defaultChain)}
4821
4830
  Quote Currency: ${colors.gold(config2.quoteCurrency)}`
4822
4831
  )
@@ -4824,7 +4833,7 @@ Quote Currency: ${colors.gold(config2.quoteCurrency)}`
4824
4833
  const action = await select({
4825
4834
  message: "What would you like to update?",
4826
4835
  choices: [
4827
- { name: `Port (${config2.port})`, value: "port" },
4836
+ { name: `Proxy Port (${config2.port})`, value: "port" },
4828
4837
  {
4829
4838
  name: `Default Chain (${config2.defaultChain})`,
4830
4839
  value: "chain"
@@ -6592,11 +6601,13 @@ Proxy Port: ${colors.accent(String(port))}`
6592
6601
  } else {
6593
6602
  const spinner = createSpinner("Validating API key...");
6594
6603
  spinner.start();
6595
- const valid = await validateApiKey(apiKey);
6596
- if (valid) {
6604
+ const result = await validateApiKey(apiKey);
6605
+ if (result.valid) {
6597
6606
  spinner.succeed("API key is valid");
6598
6607
  } else {
6599
- spinner.fail("API key is invalid or expired");
6608
+ spinner.fail(
6609
+ `API key is invalid or expired${result.error_message ? `: ${result.error_message}` : ""}`
6610
+ );
6600
6611
  }
6601
6612
  }
6602
6613
  const proxySpinner = createSpinner(
@@ -6615,7 +6626,7 @@ Proxy Port: ${colors.accent(String(port))}`
6615
6626
  }
6616
6627
  } catch {
6617
6628
  proxySpinner.warn(
6618
- `Proxy server not reachable on port ${port}. Run \`goldrush start\` to launch it.`
6629
+ `Proxy server not reachable on port ${port}. Run \`goldrush proxy\` to launch it.`
6619
6630
  );
6620
6631
  }
6621
6632
  });