httpcat-cli 0.0.25 → 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.
- package/.github/workflows/README.md +19 -2
- package/.github/workflows/ci.yml +31 -20
- package/.github/workflows/homebrew-tap.yml +1 -1
- package/.github/workflows/rc-publish.yml +169 -0
- package/.github/workflows/release.yml +223 -71
- package/README.md +113 -71
- package/bun.lock +2933 -0
- package/dist/commands/account.d.ts.map +1 -1
- package/dist/commands/account.js +14 -7
- package/dist/commands/account.js.map +1 -1
- package/dist/commands/balances.d.ts.map +1 -0
- package/dist/commands/balances.js +171 -0
- package/dist/commands/balances.js.map +1 -0
- package/dist/commands/buy.d.ts.map +1 -1
- package/dist/commands/buy.js +746 -24
- package/dist/commands/buy.js.map +1 -1
- package/dist/commands/chat.d.ts.map +1 -1
- package/dist/commands/chat.js +467 -906
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/claim.d.ts.map +1 -0
- package/dist/commands/claim.js +65 -0
- package/dist/commands/claim.js.map +1 -0
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +0 -1
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/info.d.ts.map +1 -1
- package/dist/commands/info.js +128 -26
- package/dist/commands/info.js.map +1 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +30 -23
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/positions.d.ts.map +1 -1
- package/dist/commands/positions.js +178 -105
- package/dist/commands/positions.js.map +1 -1
- package/dist/commands/sell.d.ts.map +1 -1
- package/dist/commands/sell.js +713 -24
- package/dist/commands/sell.js.map +1 -1
- package/dist/index.js +417 -109
- package/dist/index.js.map +1 -1
- package/dist/interactive/shell.d.ts.map +1 -1
- package/dist/interactive/shell.js +328 -179
- package/dist/interactive/shell.js.map +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +8 -8
- package/dist/mcp/tools.js.map +1 -1
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/constants.js +66 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/formatting.d.ts.map +1 -1
- package/dist/utils/formatting.js +3 -5
- package/dist/utils/formatting.js.map +1 -1
- package/dist/utils/token-resolver.d.ts.map +1 -1
- package/dist/utils/token-resolver.js +71 -40
- package/dist/utils/token-resolver.js.map +1 -1
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +4 -3
- package/dist/utils/validation.js.map +1 -1
- package/jest.config.js +1 -1
- package/package.json +19 -13
- package/.claude/settings.local.json +0 -41
- package/dist/commands/balance.d.ts.map +0 -1
- package/dist/commands/balance.js +0 -112
- package/dist/commands/balance.js.map +0 -1
- package/homebrew-httpcat/Formula/httpcat.rb +0 -18
- package/homebrew-httpcat/README.md +0 -31
- package/homebrew-httpcat/homebrew-httpcat/Formula/httpcat.rb +0 -18
- package/homebrew-httpcat/homebrew-httpcat/README.md +0 -31
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# httpcat
|
|
1
|
+
# httpcat-cli
|
|
2
2
|
|
|
3
3
|
> 🐱 Command-line interface for interacting with the httpcat agent - create, buy, and sell tokens with x402 payments
|
|
4
4
|
|
|
@@ -131,7 +131,7 @@ Available Commands:
|
|
|
131
131
|
list [--sort mcap|created] List all tokens
|
|
132
132
|
positions Get all your positions with comprehensive info
|
|
133
133
|
chat [token] Start streaming chat (optional: token symbol/name/address)
|
|
134
|
-
|
|
134
|
+
balances Check wallet balances (ETH and USDC)
|
|
135
135
|
health Check agent health
|
|
136
136
|
config [--show|--set|--reset] Manage configuration
|
|
137
137
|
network Show current network
|
|
@@ -150,13 +150,12 @@ httpcat> create "Meow Token" "MEOW"
|
|
|
150
150
|
┌─────────────────────────────────────────┐
|
|
151
151
|
│ 🎉 Meow Token (MEOW) │
|
|
152
152
|
├─────────────────────────────────────────┤
|
|
153
|
-
│ Token ID: abc123-4567-89ab-cdef-... │
|
|
154
153
|
│ Address: 0x789abcd... │
|
|
155
154
|
│ Supply: 1,000,000,000 MEOW │
|
|
156
155
|
│ Status: Active │
|
|
157
156
|
└─────────────────────────────────────────┘
|
|
158
157
|
|
|
159
|
-
httpcat> buy
|
|
158
|
+
httpcat> buy 0x789abcd... 0.20
|
|
160
159
|
|
|
161
160
|
💰 Tokens purchased successfully!
|
|
162
161
|
|
|
@@ -196,9 +195,9 @@ httpcat create "My Token" "MTK" --photo https://example.com/photo.png --website
|
|
|
196
195
|
|
|
197
196
|
**Options:**
|
|
198
197
|
|
|
199
|
-
-
|
|
200
|
-
-
|
|
201
|
-
-
|
|
198
|
+
- `-p, --photo <url>` - Token photo URL
|
|
199
|
+
- `-b, --banner <url>` - Banner image URL
|
|
200
|
+
- `-w, --website <url>` - Website URL
|
|
202
201
|
|
|
203
202
|
**Cost:** $0.01 USDC
|
|
204
203
|
|
|
@@ -209,7 +208,7 @@ Purchase tokens from the bonding curve.
|
|
|
209
208
|
**Interactive:**
|
|
210
209
|
|
|
211
210
|
```bash
|
|
212
|
-
httpcat> buy
|
|
211
|
+
httpcat> buy 0x1234... 0.20
|
|
213
212
|
httpcat> buy "My Token" 0.10
|
|
214
213
|
httpcat> buy MTK 0.05
|
|
215
214
|
```
|
|
@@ -217,14 +216,29 @@ httpcat> buy MTK 0.05
|
|
|
217
216
|
**CLI:**
|
|
218
217
|
|
|
219
218
|
```bash
|
|
220
|
-
httpcat buy
|
|
219
|
+
httpcat buy 0x1234567890abcdef1234567890abcdef12345678 0.20
|
|
221
220
|
httpcat buy "My Token" 0.10
|
|
222
221
|
httpcat buy MTK 0.05
|
|
223
222
|
```
|
|
224
223
|
|
|
224
|
+
**Options:**
|
|
225
|
+
|
|
226
|
+
- `-r, --repeat <count>` - Execute multiple buys in sequence (stops early if token graduates or insufficient funds)
|
|
227
|
+
- `-d, --delay <ms>` - Delay in milliseconds between repeat operations (default: 0)
|
|
228
|
+
|
|
229
|
+
**Examples with repeat:**
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
# Execute 10 buys back-to-back
|
|
233
|
+
httpcat buy MTK 0.10 -r 10
|
|
234
|
+
|
|
235
|
+
# Execute 10 buys with 500ms delay between each
|
|
236
|
+
httpcat buy MTK 0.10 -r 10 -d 500
|
|
237
|
+
```
|
|
238
|
+
|
|
225
239
|
**Token Identifier:**
|
|
226
240
|
|
|
227
|
-
- Token
|
|
241
|
+
- Token address: `0x1234...` (contract address)
|
|
228
242
|
- Token name: `"My Token"` (use quotes if it contains spaces)
|
|
229
243
|
- Token symbol: `MTK` (case-insensitive)
|
|
230
244
|
|
|
@@ -235,6 +249,16 @@ httpcat buy MTK 0.05
|
|
|
235
249
|
|
|
236
250
|
**Cost:** Amount + 1% fee (e.g., $5.05 for $5 purchase)
|
|
237
251
|
|
|
252
|
+
**Repeat Mode Behavior:**
|
|
253
|
+
|
|
254
|
+
When using `-r, --repeat`, the command will:
|
|
255
|
+
|
|
256
|
+
- Execute the specified number of buys sequentially
|
|
257
|
+
- Stop early if the token graduates (reaches 100% graduation progress)
|
|
258
|
+
- Stop early if you run out of funds (HTTP 402 error)
|
|
259
|
+
- Display a compact summary for each buy
|
|
260
|
+
- Show a final summary with total buys completed, total spent, and final status
|
|
261
|
+
|
|
238
262
|
### Sell Tokens
|
|
239
263
|
|
|
240
264
|
Sell tokens back to the bonding curve.
|
|
@@ -242,7 +266,7 @@ Sell tokens back to the bonding curve.
|
|
|
242
266
|
**Interactive:**
|
|
243
267
|
|
|
244
268
|
```bash
|
|
245
|
-
httpcat> sell
|
|
269
|
+
httpcat> sell 0x1234... 1000 # Sell 1000 tokens
|
|
246
270
|
httpcat> sell "My Token" 50% # Sell 50% of holdings
|
|
247
271
|
httpcat> sell MTK all # Sell all tokens
|
|
248
272
|
```
|
|
@@ -250,14 +274,14 @@ httpcat> sell MTK all # Sell all tokens
|
|
|
250
274
|
**CLI:**
|
|
251
275
|
|
|
252
276
|
```bash
|
|
253
|
-
httpcat sell
|
|
277
|
+
httpcat sell 0x1234567890abcdef1234567890abcdef12345678 1000
|
|
254
278
|
httpcat sell "My Token" 50%
|
|
255
279
|
httpcat sell MTK all
|
|
256
280
|
```
|
|
257
281
|
|
|
258
282
|
**Token Identifier:**
|
|
259
283
|
|
|
260
|
-
-
|
|
284
|
+
- Address, name, or symbol (same as buy command)
|
|
261
285
|
|
|
262
286
|
**Cost:** Dynamic based on amount (1% fee deducted from proceeds)
|
|
263
287
|
|
|
@@ -268,7 +292,7 @@ Get detailed information about a token.
|
|
|
268
292
|
**Interactive:**
|
|
269
293
|
|
|
270
294
|
```bash
|
|
271
|
-
httpcat> info
|
|
295
|
+
httpcat> info 0x1234...
|
|
272
296
|
httpcat> info "My Token"
|
|
273
297
|
httpcat> info MTK
|
|
274
298
|
```
|
|
@@ -276,14 +300,14 @@ httpcat> info MTK
|
|
|
276
300
|
**CLI:**
|
|
277
301
|
|
|
278
302
|
```bash
|
|
279
|
-
httpcat info
|
|
303
|
+
httpcat info 0x1234567890abcdef1234567890abcdef12345678
|
|
280
304
|
httpcat info "My Token"
|
|
281
305
|
httpcat info MTK
|
|
282
306
|
```
|
|
283
307
|
|
|
284
308
|
**Token Identifier:**
|
|
285
309
|
|
|
286
|
-
-
|
|
310
|
+
- Address, name, or symbol (same as buy command)
|
|
287
311
|
|
|
288
312
|
**Output:**
|
|
289
313
|
|
|
@@ -317,9 +341,9 @@ httpcat list --page 3 --sort name
|
|
|
317
341
|
|
|
318
342
|
**Options:**
|
|
319
343
|
|
|
320
|
-
-
|
|
321
|
-
-
|
|
322
|
-
-
|
|
344
|
+
- `-s, --sort <field>` - Sort by `mcap`, `created`, or `name` (default: `mcap`)
|
|
345
|
+
- `-l, --limit <n>` - Items per page (default: 20, max: 100)
|
|
346
|
+
- `-p, --page <n>` - Page number (default: 1)
|
|
323
347
|
|
|
324
348
|
**Cost:** $0.0001 USDC
|
|
325
349
|
|
|
@@ -337,13 +361,14 @@ httpcat> positions
|
|
|
337
361
|
|
|
338
362
|
```bash
|
|
339
363
|
httpcat positions
|
|
340
|
-
httpcat
|
|
341
|
-
httpcat
|
|
364
|
+
httpcat -j positions
|
|
365
|
+
httpcat -k 0x... positions
|
|
342
366
|
```
|
|
343
367
|
|
|
344
368
|
**Output:**
|
|
345
369
|
|
|
346
370
|
For each position:
|
|
371
|
+
|
|
347
372
|
- Token information (name, symbol, address, status, price, market cap, graduation progress)
|
|
348
373
|
- Position details (tokens owned, USDC invested, current value, average cost per token)
|
|
349
374
|
- Performance metrics (profit/loss in USDC and percentage ROI)
|
|
@@ -352,6 +377,7 @@ For each position:
|
|
|
352
377
|
- Timestamps (position created and updated dates)
|
|
353
378
|
|
|
354
379
|
Portfolio summary:
|
|
380
|
+
|
|
355
381
|
- Total positions count
|
|
356
382
|
- Total portfolio value
|
|
357
383
|
- Total amount invested
|
|
@@ -359,21 +385,21 @@ Portfolio summary:
|
|
|
359
385
|
|
|
360
386
|
**Cost:** $0.01 USDC
|
|
361
387
|
|
|
362
|
-
### Check
|
|
388
|
+
### Check Balances
|
|
363
389
|
|
|
364
390
|
Check your wallet's ETH and USDC balances.
|
|
365
391
|
|
|
366
392
|
**Interactive:**
|
|
367
393
|
|
|
368
394
|
```bash
|
|
369
|
-
httpcat>
|
|
395
|
+
httpcat> balances
|
|
370
396
|
```
|
|
371
397
|
|
|
372
398
|
**CLI:**
|
|
373
399
|
|
|
374
400
|
```bash
|
|
375
|
-
httpcat
|
|
376
|
-
httpcat
|
|
401
|
+
httpcat balances
|
|
402
|
+
httpcat balances -k 0x...
|
|
377
403
|
```
|
|
378
404
|
|
|
379
405
|
**Output:**
|
|
@@ -425,8 +451,8 @@ httpcat chat
|
|
|
425
451
|
httpcat chat MTK
|
|
426
452
|
httpcat chat "My Token"
|
|
427
453
|
httpcat chat 0x1234...
|
|
428
|
-
httpcat
|
|
429
|
-
httpcat
|
|
454
|
+
httpcat -j chat MTK
|
|
455
|
+
httpcat -j -f stream-json chat MTK # Structured JSON input
|
|
430
456
|
```
|
|
431
457
|
|
|
432
458
|
**Token Identifier:**
|
|
@@ -437,7 +463,7 @@ httpcat --json --input-format stream-json chat MTK # Structured JSON input
|
|
|
437
463
|
|
|
438
464
|
**Options:**
|
|
439
465
|
|
|
440
|
-
-
|
|
466
|
+
- `-f, --input-format <format>` - Input format (only works with `--json`): `"text"` (default) or `"stream-json"` (realtime streaming input)
|
|
441
467
|
- `"text"`: Line-delimited text input (default)
|
|
442
468
|
- `"stream-json"`: Newline-delimited JSON (NDJSON) objects. Each line is a JSON object: `{"message": "text"}` or `{"command": "/renew"}`
|
|
443
469
|
|
|
@@ -445,6 +471,20 @@ httpcat --json --input-format stream-json chat MTK # Structured JSON input
|
|
|
445
471
|
|
|
446
472
|
**Note:** For AI agents, consider using MCP tools (`chat_join`, `chat_send_message`, etc.) instead of CLI streaming for better integration. See [MCP Chat Tools](#chat-tools-usage-example) section.
|
|
447
473
|
|
|
474
|
+
### Help
|
|
475
|
+
|
|
476
|
+
Display help information for httpcat.
|
|
477
|
+
|
|
478
|
+
**CLI:**
|
|
479
|
+
|
|
480
|
+
```bash
|
|
481
|
+
httpcat help
|
|
482
|
+
httpcat --help
|
|
483
|
+
httpcat -h
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
All three commands show the same help output with available commands and options.
|
|
487
|
+
|
|
448
488
|
### Configuration
|
|
449
489
|
|
|
450
490
|
Manage your httpcat configuration.
|
|
@@ -452,17 +492,17 @@ Manage your httpcat configuration.
|
|
|
452
492
|
**Interactive:**
|
|
453
493
|
|
|
454
494
|
```bash
|
|
455
|
-
httpcat> config
|
|
456
|
-
httpcat> config
|
|
457
|
-
httpcat> config
|
|
495
|
+
httpcat> config -s # Show current config
|
|
496
|
+
httpcat> config -S network=base # Update a setting
|
|
497
|
+
httpcat> config -r # Re-run setup wizard
|
|
458
498
|
```
|
|
459
499
|
|
|
460
500
|
**CLI:**
|
|
461
501
|
|
|
462
502
|
```bash
|
|
463
503
|
httpcat config # Run setup wizard
|
|
464
|
-
httpcat config
|
|
465
|
-
httpcat config
|
|
504
|
+
httpcat config -s # Show current config (JSON)
|
|
505
|
+
httpcat config -S network=base # Update a setting
|
|
466
506
|
```
|
|
467
507
|
|
|
468
508
|
### MCP Server
|
|
@@ -505,10 +545,10 @@ Perfect for scripting, automation, or LLM/agent integration.
|
|
|
505
545
|
|
|
506
546
|
### JSON Output
|
|
507
547
|
|
|
508
|
-
Add
|
|
548
|
+
Add `-j, --json` flag to any command:
|
|
509
549
|
|
|
510
550
|
```bash
|
|
511
|
-
$ httpcat
|
|
551
|
+
$ httpcat -j create "Test Token" "TEST"
|
|
512
552
|
{
|
|
513
553
|
"success": true,
|
|
514
554
|
"operation": "create_token",
|
|
@@ -715,7 +755,7 @@ All commands with `--json` flag return structured JSON responses. The output fol
|
|
|
715
755
|
}
|
|
716
756
|
```
|
|
717
757
|
|
|
718
|
-
**
|
|
758
|
+
**Balances (`balances`)**
|
|
719
759
|
|
|
720
760
|
```json
|
|
721
761
|
{
|
|
@@ -741,7 +781,7 @@ All commands with `--json` flag return structured JSON responses. The output fol
|
|
|
741
781
|
Minimal output, only exit codes:
|
|
742
782
|
|
|
743
783
|
```bash
|
|
744
|
-
$ httpcat
|
|
784
|
+
$ httpcat -q buy abc123-... 0.20
|
|
745
785
|
$ echo $?
|
|
746
786
|
0
|
|
747
787
|
```
|
|
@@ -761,21 +801,21 @@ $ echo $?
|
|
|
761
801
|
#!/bin/bash
|
|
762
802
|
|
|
763
803
|
# Create a token
|
|
764
|
-
RESULT=$(httpcat
|
|
765
|
-
|
|
804
|
+
RESULT=$(httpcat -j create "AI Token" "AI")
|
|
805
|
+
TOKEN_ADDRESS=$(echo $RESULT | jq -r '.data.tokenAddress')
|
|
766
806
|
|
|
767
807
|
# Buy some tokens
|
|
768
|
-
httpcat
|
|
808
|
+
httpcat -j buy $TOKEN_ADDRESS 5
|
|
769
809
|
|
|
770
810
|
# Get current info
|
|
771
|
-
httpcat
|
|
811
|
+
httpcat -j info $TOKEN_ADDRESS
|
|
772
812
|
|
|
773
813
|
# Sell 50% if profitable
|
|
774
|
-
INFO=$(httpcat
|
|
814
|
+
INFO=$(httpcat -j info $TOKEN_ADDRESS)
|
|
775
815
|
PNL=$(echo $INFO | jq -r '.data.userPosition.pnl')
|
|
776
816
|
|
|
777
817
|
if (( $(echo "$PNL > 0" | bc -l) )); then
|
|
778
|
-
httpcat
|
|
818
|
+
httpcat -j sell $TOKEN_ADDRESS 50%
|
|
779
819
|
fi
|
|
780
820
|
```
|
|
781
821
|
|
|
@@ -785,11 +825,11 @@ For scripts that need raw streaming access:
|
|
|
785
825
|
|
|
786
826
|
```bash
|
|
787
827
|
# Using stream-json input format
|
|
788
|
-
echo '{"message": "Hello!"}' | httpcat
|
|
789
|
-
echo '{"command": "/renew"}' | httpcat
|
|
828
|
+
echo '{"message": "Hello!"}' | httpcat -j -f stream-json chat MTK
|
|
829
|
+
echo '{"command": "/renew"}' | httpcat -j -f stream-json chat MTK
|
|
790
830
|
|
|
791
831
|
# Or pipe multiple messages
|
|
792
|
-
cat messages.ndjson | httpcat
|
|
832
|
+
cat messages.ndjson | httpcat -j -f stream-json chat MTK
|
|
793
833
|
```
|
|
794
834
|
|
|
795
835
|
**Note:** For AI agents, MCP tools are recommended over CLI streaming. See [MCP Chat Tools](#chat-tools-usage-example) section.
|
|
@@ -895,7 +935,7 @@ Buy tokens from the bonding curve.
|
|
|
895
935
|
|
|
896
936
|
**Parameters:**
|
|
897
937
|
|
|
898
|
-
- `identifier` (string, required) -
|
|
938
|
+
- `identifier` (string, required) - Address, name, or symbol
|
|
899
939
|
- `amount` (string, required) - Amount: "0.05", "0.10", or "0.20" (testnet) | "50", "100", or "200" (mainnet)
|
|
900
940
|
- `privateKey` (string, optional) - Private key (overrides config/env)
|
|
901
941
|
|
|
@@ -907,7 +947,7 @@ Sell tokens back to the bonding curve.
|
|
|
907
947
|
|
|
908
948
|
**Parameters:**
|
|
909
949
|
|
|
910
|
-
- `identifier` (string, required) -
|
|
950
|
+
- `identifier` (string, required) - Address, name, or symbol
|
|
911
951
|
- `amount` (string, required) - Amount: number (e.g., "1000"), percentage (e.g., "50%"), or "all"
|
|
912
952
|
- `privateKey` (string, optional) - Private key (overrides config/env)
|
|
913
953
|
|
|
@@ -919,7 +959,7 @@ Get detailed information about a token.
|
|
|
919
959
|
|
|
920
960
|
**Parameters:**
|
|
921
961
|
|
|
922
|
-
- `identifier` (string, required) -
|
|
962
|
+
- `identifier` (string, required) - Address, name, or symbol
|
|
923
963
|
- `privateKey` (string, optional) - Private key (overrides config/env)
|
|
924
964
|
|
|
925
965
|
**Returns:** Token details, price, market cap, graduation progress, and your position (if you own tokens)
|
|
@@ -948,6 +988,7 @@ Get all your positions with comprehensive information including current value, p
|
|
|
948
988
|
- `privateKey` (string, optional) - Private key (overrides config/env)
|
|
949
989
|
|
|
950
990
|
**Returns:** All positions for the requesting address with:
|
|
991
|
+
|
|
951
992
|
- Position details (tokens owned, USDC invested, current value, average cost)
|
|
952
993
|
- Performance metrics (profit/loss, ROI percentage)
|
|
953
994
|
- Position age and transaction history
|
|
@@ -1040,33 +1081,34 @@ Here's how an AI agent like Claude Code would use the chat tools:
|
|
|
1040
1081
|
|
|
1041
1082
|
```javascript
|
|
1042
1083
|
// Step 1: Join the FRIDA token chat room
|
|
1043
|
-
const joinResult = await mcp.callTool("chat_join", {
|
|
1044
|
-
tokenIdentifier: "FRIDA"
|
|
1084
|
+
const joinResult = await mcp.callTool("chat_join", {
|
|
1085
|
+
tokenIdentifier: "FRIDA",
|
|
1045
1086
|
});
|
|
1046
1087
|
// Returns: { leaseId: "abc123...", leaseExpiresAt: "...", lastMessages: [...] }
|
|
1047
1088
|
|
|
1048
1089
|
// Step 2: Send a message
|
|
1049
1090
|
const sendResult = await mcp.callTool("chat_send_message", {
|
|
1050
1091
|
message: "Hello FRIDA community!",
|
|
1051
|
-
leaseId: joinResult.leaseId
|
|
1092
|
+
leaseId: joinResult.leaseId,
|
|
1052
1093
|
});
|
|
1053
1094
|
// Returns: { messageId: "msg456...", timestamp: "...", message: "...", author: "0x..." }
|
|
1054
1095
|
|
|
1055
1096
|
// Step 3: Poll for new messages (agent does this periodically)
|
|
1056
1097
|
const messages = await mcp.callTool("chat_get_recent_messages", {
|
|
1057
1098
|
leaseId: joinResult.leaseId,
|
|
1058
|
-
limit: 20
|
|
1099
|
+
limit: 20,
|
|
1059
1100
|
});
|
|
1060
1101
|
// Returns: { messages: [...] }
|
|
1061
1102
|
|
|
1062
1103
|
// Step 4: Renew lease when needed
|
|
1063
1104
|
const renewal = await mcp.callTool("chat_renew_lease", {
|
|
1064
|
-
leaseId: joinResult.leaseId
|
|
1105
|
+
leaseId: joinResult.leaseId,
|
|
1065
1106
|
});
|
|
1066
1107
|
// Returns: { leaseId: "new-lease-id...", leaseExpiresAt: "..." }
|
|
1067
1108
|
```
|
|
1068
1109
|
|
|
1069
1110
|
**Key Benefits:**
|
|
1111
|
+
|
|
1070
1112
|
- No shell scripting or process management required
|
|
1071
1113
|
- WebSocket connections maintained automatically by MCP server
|
|
1072
1114
|
- Messages cached in memory for quick retrieval
|
|
@@ -1088,7 +1130,7 @@ Once configured, AI assistants can use the tools like this:
|
|
|
1088
1130
|
|
|
1089
1131
|
```
|
|
1090
1132
|
create_token(name="Moon Token", symbol="MOON", websiteUrl="https://moon.com")
|
|
1091
|
-
buy_token(identifier="
|
|
1133
|
+
buy_token(identifier="0x1234...", amount="0.20")
|
|
1092
1134
|
token_info(identifier="MOON")
|
|
1093
1135
|
list_tokens(sort="mcap", limit=10)
|
|
1094
1136
|
check_balance()
|
|
@@ -1166,7 +1208,7 @@ httpcat env show
|
|
|
1166
1208
|
|
|
1167
1209
|
```bash
|
|
1168
1210
|
# Add a custom environment
|
|
1169
|
-
httpcat env add production http://production-agent:8787
|
|
1211
|
+
httpcat env add production http://production-agent:8787 -n base
|
|
1170
1212
|
|
|
1171
1213
|
# Switch to it
|
|
1172
1214
|
httpcat env use production
|
|
@@ -1207,8 +1249,8 @@ You can also pass the private key directly via command-line flag (highest priori
|
|
|
1207
1249
|
|
|
1208
1250
|
```bash
|
|
1209
1251
|
# Private key priority: CLI flag > Environment variable > Config file
|
|
1210
|
-
httpcat
|
|
1211
|
-
httpcat
|
|
1252
|
+
httpcat -k 0x1234567890abcdef... create "My Token" "MTK"
|
|
1253
|
+
httpcat -k 0x1234567890abcdef... -j buy 0x1234... 0.20
|
|
1212
1254
|
```
|
|
1213
1255
|
|
|
1214
1256
|
**Note:** The `--private-key` flag takes precedence over environment variables and config file settings.
|
|
@@ -1217,8 +1259,8 @@ httpcat --private-key 0x1234567890abcdef... --json buy abc123-... 0.20
|
|
|
1217
1259
|
|
|
1218
1260
|
```bash
|
|
1219
1261
|
# Switch to mainnet
|
|
1220
|
-
httpcat config
|
|
1221
|
-
httpcat config
|
|
1262
|
+
httpcat config -S network=base
|
|
1263
|
+
httpcat config -S agentUrl=http://production-url:8787
|
|
1222
1264
|
|
|
1223
1265
|
# Or in interactive mode
|
|
1224
1266
|
httpcat> network base
|
|
@@ -1333,10 +1375,10 @@ httpcat config --show
|
|
|
1333
1375
|
|
|
1334
1376
|
### Check Wallet Balance
|
|
1335
1377
|
|
|
1336
|
-
Use the
|
|
1378
|
+
Use the balances command to check your wallet's ETH and USDC balances:
|
|
1337
1379
|
|
|
1338
1380
|
```bash
|
|
1339
|
-
httpcat
|
|
1381
|
+
httpcat balances
|
|
1340
1382
|
```
|
|
1341
1383
|
|
|
1342
1384
|
This will show your wallet address, ETH balance (for gas fees), and USDC balance (for trading), with warnings if balances are low.
|
|
@@ -1349,23 +1391,23 @@ This will show your wallet address, ETH balance (for gas fees), and USDC balance
|
|
|
1349
1391
|
# Setup
|
|
1350
1392
|
httpcat config
|
|
1351
1393
|
|
|
1352
|
-
# Check your wallet
|
|
1353
|
-
httpcat
|
|
1394
|
+
# Check your wallet balances
|
|
1395
|
+
httpcat balances
|
|
1354
1396
|
|
|
1355
1397
|
# Create a token
|
|
1356
|
-
httpcat create "Moon Cat" "MOON" --website https://mooncat.io
|
|
1398
|
+
httpcat create "Moon Cat" "MOON" -w --website https://mooncat.io
|
|
1357
1399
|
|
|
1358
1400
|
# Buy tokens
|
|
1359
|
-
httpcat buy
|
|
1401
|
+
httpcat buy 0x1234... 5
|
|
1360
1402
|
|
|
1361
1403
|
# Check your position
|
|
1362
|
-
httpcat info
|
|
1404
|
+
httpcat info 0x1234...
|
|
1363
1405
|
|
|
1364
1406
|
# Get all your positions with comprehensive info
|
|
1365
1407
|
httpcat positions
|
|
1366
1408
|
|
|
1367
1409
|
# Sell half when profitable
|
|
1368
|
-
httpcat sell
|
|
1410
|
+
httpcat sell 0x1234... 50%
|
|
1369
1411
|
|
|
1370
1412
|
# List all your tokens (shows positions)
|
|
1371
1413
|
httpcat list
|
|
@@ -1376,16 +1418,16 @@ httpcat list
|
|
|
1376
1418
|
```bash
|
|
1377
1419
|
#!/bin/bash
|
|
1378
1420
|
|
|
1379
|
-
|
|
1421
|
+
TOKEN_ADDRESS="0x1234567890abcdef1234567890abcdef12345678"
|
|
1380
1422
|
|
|
1381
1423
|
# Monitor and trade
|
|
1382
1424
|
while true; do
|
|
1383
|
-
INFO=$(httpcat
|
|
1425
|
+
INFO=$(httpcat -j info $TOKEN_ADDRESS)
|
|
1384
1426
|
PROGRESS=$(echo $INFO | jq -r '.data.graduationProgress')
|
|
1385
1427
|
|
|
1386
1428
|
# Buy if close to graduation
|
|
1387
1429
|
if (( $(echo "$PROGRESS > 90" | bc -l) )); then
|
|
1388
|
-
httpcat
|
|
1430
|
+
httpcat -q buy $TOKEN_ADDRESS 5
|
|
1389
1431
|
fi
|
|
1390
1432
|
|
|
1391
1433
|
sleep 60
|