httpcat-cli 0.0.26 → 0.0.27-rc.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.
Files changed (67) hide show
  1. package/.github/workflows/README.md +19 -2
  2. package/.github/workflows/ci.yml +31 -20
  3. package/.github/workflows/homebrew-tap.yml +1 -1
  4. package/.github/workflows/rc-publish.yml +169 -0
  5. package/.github/workflows/release.yml +223 -71
  6. package/README.md +94 -76
  7. package/bun.lock +2933 -0
  8. package/dist/commands/account.d.ts.map +1 -1
  9. package/dist/commands/account.js +14 -7
  10. package/dist/commands/account.js.map +1 -1
  11. package/dist/commands/balances.d.ts.map +1 -0
  12. package/dist/commands/balances.js +171 -0
  13. package/dist/commands/balances.js.map +1 -0
  14. package/dist/commands/buy.d.ts.map +1 -1
  15. package/dist/commands/buy.js +739 -32
  16. package/dist/commands/buy.js.map +1 -1
  17. package/dist/commands/chat.d.ts.map +1 -1
  18. package/dist/commands/chat.js +467 -906
  19. package/dist/commands/chat.js.map +1 -1
  20. package/dist/commands/claim.d.ts.map +1 -0
  21. package/dist/commands/claim.js +65 -0
  22. package/dist/commands/claim.js.map +1 -0
  23. package/dist/commands/create.d.ts.map +1 -1
  24. package/dist/commands/create.js +0 -1
  25. package/dist/commands/create.js.map +1 -1
  26. package/dist/commands/info.d.ts.map +1 -1
  27. package/dist/commands/info.js +128 -26
  28. package/dist/commands/info.js.map +1 -1
  29. package/dist/commands/list.d.ts.map +1 -1
  30. package/dist/commands/list.js +30 -23
  31. package/dist/commands/list.js.map +1 -1
  32. package/dist/commands/positions.d.ts.map +1 -1
  33. package/dist/commands/positions.js +178 -105
  34. package/dist/commands/positions.js.map +1 -1
  35. package/dist/commands/sell.d.ts.map +1 -1
  36. package/dist/commands/sell.js +713 -24
  37. package/dist/commands/sell.js.map +1 -1
  38. package/dist/index.js +315 -99
  39. package/dist/index.js.map +1 -1
  40. package/dist/interactive/shell.d.ts.map +1 -1
  41. package/dist/interactive/shell.js +328 -179
  42. package/dist/interactive/shell.js.map +1 -1
  43. package/dist/mcp/tools.d.ts.map +1 -1
  44. package/dist/mcp/tools.js +8 -8
  45. package/dist/mcp/tools.js.map +1 -1
  46. package/dist/utils/constants.d.ts.map +1 -0
  47. package/dist/utils/constants.js +66 -0
  48. package/dist/utils/constants.js.map +1 -0
  49. package/dist/utils/formatting.d.ts.map +1 -1
  50. package/dist/utils/formatting.js +3 -5
  51. package/dist/utils/formatting.js.map +1 -1
  52. package/dist/utils/token-resolver.d.ts.map +1 -1
  53. package/dist/utils/token-resolver.js +71 -40
  54. package/dist/utils/token-resolver.js.map +1 -1
  55. package/dist/utils/validation.d.ts.map +1 -1
  56. package/dist/utils/validation.js +4 -3
  57. package/dist/utils/validation.js.map +1 -1
  58. package/jest.config.js +1 -1
  59. package/package.json +19 -13
  60. package/.claude/settings.local.json +0 -41
  61. package/dist/commands/balance.d.ts.map +0 -1
  62. package/dist/commands/balance.js +0 -112
  63. package/dist/commands/balance.js.map +0 -1
  64. package/homebrew-httpcat/Formula/httpcat.rb +0 -18
  65. package/homebrew-httpcat/README.md +0 -31
  66. package/homebrew-httpcat/homebrew-httpcat/Formula/httpcat.rb +0 -18
  67. package/homebrew-httpcat/homebrew-httpcat/README.md +0 -31
@@ -1,41 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(gh repo create:*)",
5
- "WebSearch",
6
- "Bash(npm publish:*)",
7
- "Bash(curl:*)",
8
- "Bash(shasum:*)",
9
- "Bash(git add:*)",
10
- "Bash(git commit:*)",
11
- "Bash(git push)",
12
- "Bash(git init:*)",
13
- "Bash(git remote add:*)",
14
- "Bash(git branch:*)",
15
- "Bash(git push:*)",
16
- "Bash(brew tap:*)",
17
- "Bash(brew install:*)",
18
- "Bash(brew info:*)",
19
- "Bash(npm view:*)",
20
- "Bash(yarn build:*)",
21
- "Bash(npm version:*)",
22
- "Bash(npm run build:*)",
23
- "Bash(gh pr list:*)",
24
- "Bash(gh pr view:*)",
25
- "Bash(gh pr diff:*)",
26
- "Bash(gh pr merge:*)",
27
- "Bash(cat:*)",
28
- "Bash(git pull:*)",
29
- "Bash(git rebase:*)",
30
- "Bash(bun test:*)",
31
- "Bash(gh run list:*)",
32
- "Bash(gh run:*)",
33
- "Bash(ssh:*)",
34
- "Bash(md5sum:*)",
35
- "Bash(xargs:*)",
36
- "Bash(jq)"
37
- ],
38
- "deny": [],
39
- "ask": []
40
- }
41
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"balance.d.ts","sourceRoot":"","sources":["../../src/commands/balance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAShC,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAAC,UAAU,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,CA8GzE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAGzD"}
@@ -1,112 +0,0 @@
1
- import chalk from "chalk";
2
- import { privateKeyToAccount } from "viem/accounts";
3
- import { formatEther } from "viem";
4
- import { getUSDCBalance } from "x402/shared/evm";
5
- import { evm } from "x402/types";
6
- import { printCat } from "../interactive/art.js";
7
- import { formatAddress, printWarning } from "../utils/formatting.js";
8
- import inquirer from "inquirer";
9
- /**
10
- * Checks and displays wallet balances for a given private key.
11
- * This mimics the behavior of promptForPrivateKey but without saving to config.
12
- */
13
- export async function checkBalance(privateKey) {
14
- let pk = privateKey;
15
- // If no private key provided, prompt for it (same as other commands)
16
- if (!pk) {
17
- console.log();
18
- // Show wizard cat
19
- printCat("wizard");
20
- console.log(chalk.bold.cyan("🔐 Checking wallet balance...\n"));
21
- // Prompt for private key with password masking
22
- const answers = await inquirer.prompt([
23
- {
24
- type: "password",
25
- name: "privateKey",
26
- message: "Enter your private key:",
27
- mask: "•",
28
- validate: (input) => {
29
- if (!input) {
30
- return "Private key is required";
31
- }
32
- if (!input.startsWith("0x")) {
33
- return "Private key must start with 0x";
34
- }
35
- if (input.length !== 66) {
36
- return "Private key must be 66 characters long (0x + 64 hex chars)";
37
- }
38
- return true;
39
- },
40
- },
41
- ]);
42
- pk = answers.privateKey;
43
- console.log(chalk.green("✓ Private key validated!\n"));
44
- }
45
- else {
46
- // If private key provided, still show the wizard cat and header
47
- console.log();
48
- printCat("wizard");
49
- console.log(chalk.bold.cyan("🔐 Checking wallet balance...\n"));
50
- }
51
- // Derive wallet address
52
- console.log(chalk.dim("📍 Deriving wallet address..."));
53
- const account = privateKeyToAccount(pk);
54
- const address = account.address;
55
- console.log(chalk.dim(" Wallet:"), chalk.cyan(formatAddress(address, 12)));
56
- console.log();
57
- // Check balances
58
- console.log(chalk.dim("💰 Checking balances on Base Sepolia...\n"));
59
- try {
60
- // Create signer to check balances
61
- const signer = evm.createSignerSepolia(pk);
62
- // Check ETH balance
63
- const ethBalance = await signer.getBalance({ address });
64
- const ethFormatted = formatEther(ethBalance);
65
- // Check USDC balance
66
- const usdcBalance = await getUSDCBalance(signer, address);
67
- const usdcFormatted = (Number(usdcBalance) / 10 ** 6).toFixed(2);
68
- // Display balances
69
- console.log(chalk.dim(" ETH: "), chalk.yellow(`${ethFormatted} ETH`));
70
- console.log(chalk.dim(" USDC:"), chalk.green(`$${usdcFormatted} USDC`));
71
- console.log();
72
- // Show warnings if balances are low
73
- const ethNum = Number(ethFormatted);
74
- const usdcNum = Number(usdcFormatted);
75
- if (ethNum < 0.001 && usdcNum < 1) {
76
- printWarning("Low balances detected!");
77
- console.log(chalk.dim(" You need Base Sepolia ETH for gas fees"));
78
- console.log(chalk.dim(" You need Base Sepolia USDC for trading\n"));
79
- }
80
- else if (ethNum < 0.001) {
81
- printWarning("Low ETH balance - you may not have enough for gas fees\n");
82
- }
83
- else if (usdcNum < 1) {
84
- printWarning("Low USDC balance - you may not have enough for trades\n");
85
- }
86
- // Always show reminder about requirements
87
- console.log(chalk.yellow("⚠️ Important:"));
88
- console.log(chalk.dim(" Ensure you have Base Sepolia ETH (for gas fees)"));
89
- console.log(chalk.dim(" and Base Sepolia USDC (for trading) in this wallet!\n"));
90
- return {
91
- address,
92
- ethBalance: ethBalance.toString(),
93
- usdcBalance: usdcBalance.toString(),
94
- ethFormatted,
95
- usdcFormatted,
96
- };
97
- }
98
- catch (error) {
99
- // If balance check fails, just warn but continue
100
- console.log(chalk.yellow("⚠️ Could not check balances (network may be slow)"));
101
- console.log(chalk.dim(" Make sure you have Base Sepolia ETH and USDC!\n"));
102
- throw error;
103
- }
104
- }
105
- /**
106
- * Display balance information (for JSON output)
107
- */
108
- export function displayBalance(balance) {
109
- // This is mainly for JSON mode, but we already display in checkBalance
110
- // So this is a no-op for interactive mode
111
- }
112
- //# sourceMappingURL=balance.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"balance.js","sourceRoot":"","sources":["../../src/commands/balance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,QAAQ,MAAM,UAAU,CAAC;AAUhC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,UAAgB;IACjD,IAAI,EAAE,GAAG,UAAU,CAAC;IAEpB,qEAAqE;IACrE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CAA0C;AAC5C,CAAC"}
@@ -1,18 +0,0 @@
1
- class Httpcat < Formula
2
- desc "CLI tool for interacting with httpcat agent - create, buy, and sell tokens with x402 payments"
3
- homepage "https://github.com/hathbanger/httpcat-cli"
4
- url "https://registry.npmjs.org/httpcat-cli/-/httpcat-cli-0.0.25.tgz"
5
- sha256 "8c5573880238a6d13584aa7476ec9e770cce367c9f1d7d5d30d8cf4cfc9200c7"
6
- license "MIT"
7
-
8
- depends_on "node"
9
-
10
- def install
11
- system "npm", "install", *std_npm_args
12
- bin.install_symlink Dir["#{libexec}/bin/*"]
13
- end
14
-
15
- test do
16
- assert_match "0.0.25", shell_output("#{bin}/httpcat --version")
17
- end
18
- end
@@ -1,31 +0,0 @@
1
- # Homebrew Tap for httpcat-cli
2
-
3
- Official Homebrew tap for [httpcat-cli](https://github.com/hathbanger/httpcat-cli).
4
-
5
- ## Installation
6
-
7
- ```bash
8
- brew tap hathbanger/httpcat
9
- brew install httpcat
10
- ```
11
-
12
- ## Usage
13
-
14
- After installation, you can use the `httpcat` command:
15
-
16
- ```bash
17
- httpcat --help
18
- ```
19
-
20
- ## Updating
21
-
22
- ```bash
23
- brew upgrade httpcat
24
- ```
25
-
26
- ## Uninstall
27
-
28
- ```bash
29
- brew uninstall httpcat
30
- brew untap hathbanger/httpcat
31
- ```
@@ -1,18 +0,0 @@
1
- class Httpcat < Formula
2
- desc "CLI tool for interacting with httpcat agent - create, buy, and sell tokens with x402 payments"
3
- homepage "https://github.com/hathbanger/httpcat-cli"
4
- url "https://registry.npmjs.org/httpcat-cli/-/httpcat-cli-0.0.25.tgz"
5
- sha256 "8c5573880238a6d13584aa7476ec9e770cce367c9f1d7d5d30d8cf4cfc9200c7"
6
- license "MIT"
7
-
8
- depends_on "node"
9
-
10
- def install
11
- system "npm", "install", *std_npm_args
12
- bin.install_symlink Dir["#{libexec}/bin/*"]
13
- end
14
-
15
- test do
16
- assert_match "0.0.25", shell_output("#{bin}/httpcat --version")
17
- end
18
- end
@@ -1,31 +0,0 @@
1
- # Homebrew Tap for httpcat-cli
2
-
3
- Official Homebrew tap for [httpcat-cli](https://github.com/hathbanger/httpcat-cli).
4
-
5
- ## Installation
6
-
7
- ```bash
8
- brew tap hathbanger/httpcat
9
- brew install httpcat
10
- ```
11
-
12
- ## Usage
13
-
14
- After installation, you can use the `httpcat` command:
15
-
16
- ```bash
17
- httpcat --help
18
- ```
19
-
20
- ## Updating
21
-
22
- ```bash
23
- brew upgrade httpcat
24
- ```
25
-
26
- ## Uninstall
27
-
28
- ```bash
29
- brew uninstall httpcat
30
- brew untap hathbanger/httpcat
31
- ```