httpcat-cli 0.2.13 → 0.3.0-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 (65) hide show
  1. package/.github/workflows/release.yml +96 -0
  2. package/.github/workflows/sync-version.yml +31 -2
  3. package/README.md +136 -48
  4. package/bun.lock +13 -1308
  5. package/dist/agent/tools.d.ts.map +1 -1
  6. package/dist/agent/tools.js +87 -5
  7. package/dist/agent/tools.js.map +1 -1
  8. package/dist/client.d.ts.map +1 -1
  9. package/dist/client.js +403 -46
  10. package/dist/client.js.map +1 -1
  11. package/dist/commands/account.d.ts.map +1 -1
  12. package/dist/commands/account.js +1 -0
  13. package/dist/commands/account.js.map +1 -1
  14. package/dist/commands/balances.d.ts.map +1 -1
  15. package/dist/commands/balances.js +39 -14
  16. package/dist/commands/balances.js.map +1 -1
  17. package/dist/commands/buy.d.ts.map +1 -1
  18. package/dist/commands/buy.js +29 -15
  19. package/dist/commands/buy.js.map +1 -1
  20. package/dist/commands/chat.d.ts.map +1 -1
  21. package/dist/commands/chat.js +34 -21
  22. package/dist/commands/chat.js.map +1 -1
  23. package/dist/commands/info.d.ts.map +1 -1
  24. package/dist/commands/info.js +12 -9
  25. package/dist/commands/info.js.map +1 -1
  26. package/dist/commands/positions.js +4 -4
  27. package/dist/commands/positions.js.map +1 -1
  28. package/dist/commands/sell.d.ts.map +1 -1
  29. package/dist/commands/sell.js +18 -11
  30. package/dist/commands/sell.js.map +1 -1
  31. package/dist/config.d.ts.map +1 -1
  32. package/dist/config.js +77 -10
  33. package/dist/config.js.map +1 -1
  34. package/dist/index.js +354 -118
  35. package/dist/index.js.map +1 -1
  36. package/dist/interactive/art.d.ts.map +1 -1
  37. package/dist/interactive/art.js +38 -0
  38. package/dist/interactive/art.js.map +1 -1
  39. package/dist/interactive/shell.d.ts.map +1 -1
  40. package/dist/interactive/shell.js +511 -111
  41. package/dist/interactive/shell.js.map +1 -1
  42. package/dist/mcp/chat-state.d.ts.map +1 -1
  43. package/dist/mcp/chat-state.js +2 -1
  44. package/dist/mcp/chat-state.js.map +1 -1
  45. package/dist/mcp/server.js +1 -1
  46. package/dist/mcp/tools.d.ts.map +1 -1
  47. package/dist/mcp/tools.js +108 -1
  48. package/dist/mcp/tools.js.map +1 -1
  49. package/dist/mcp/types.d.ts.map +1 -1
  50. package/dist/utils/constants.d.ts.map +1 -1
  51. package/dist/utils/constants.js +44 -2
  52. package/dist/utils/constants.js.map +1 -1
  53. package/dist/utils/errors.d.ts.map +1 -1
  54. package/dist/utils/errors.js +3 -3
  55. package/dist/utils/errors.js.map +1 -1
  56. package/dist/utils/privateKeyPrompt.d.ts.map +1 -1
  57. package/dist/utils/privateKeyPrompt.js +31 -7
  58. package/dist/utils/privateKeyPrompt.js.map +1 -1
  59. package/dist/utils/status.d.ts.map +1 -0
  60. package/dist/utils/status.js +67 -0
  61. package/dist/utils/status.js.map +1 -0
  62. package/dist/utils/token-resolver.d.ts.map +1 -1
  63. package/dist/utils/token-resolver.js +9 -0
  64. package/dist/utils/token-resolver.js.map +1 -1
  65. package/package.json +5 -4
@@ -764,3 +764,99 @@ jobs:
764
764
  echo "Version: ${{ needs.prepare.outputs.version }}"
765
765
  echo "npm: https://www.npmjs.com/package/httpcat-cli/v/${{ needs.prepare.outputs.version }}"
766
766
  echo "GitHub: https://github.com/${{ github.repository }}/releases/tag/${{ needs.prepare.outputs.tag }}"
767
+
768
+ # Job 6: Sync version to develop branch
769
+ sync-version:
770
+ name: Sync Version to Develop
771
+ runs-on: ubuntu-latest
772
+ needs: [create-release]
773
+ permissions:
774
+ contents: write
775
+ steps:
776
+ - name: Checkout code
777
+ uses: actions/checkout@v6
778
+ with:
779
+ fetch-depth: 0
780
+ token: ${{ secrets.GITHUB_TOKEN }}
781
+
782
+ - name: Checkout develop branch
783
+ run: |
784
+ git checkout develop
785
+ git pull origin develop
786
+
787
+ - name: Check for new commits in develop
788
+ id: check-commits
789
+ run: |
790
+ # Check if develop has commits that aren't in main
791
+ COMMITS_AHEAD=$(git rev-list --count origin/main..HEAD 2>/dev/null || echo "0")
792
+ echo "commits_ahead=$COMMITS_AHEAD" >> $GITHUB_OUTPUT
793
+
794
+ if [ "$COMMITS_AHEAD" -gt 0 ]; then
795
+ echo "ℹ️ Develop has $COMMITS_AHEAD commit(s) not in main"
796
+ echo "These will be preserved by rebasing onto main"
797
+ else
798
+ echo "✅ Develop has no new commits - can fast-forward to main"
799
+ fi
800
+
801
+ - name: Rebase develop onto main
802
+ run: |
803
+ echo "Updating develop to include latest from main..."
804
+ git fetch origin main
805
+
806
+ # Check if we can fast-forward (no new commits in develop)
807
+ COMMITS_AHEAD="${{ steps.check-commits.outputs.commits_ahead }}"
808
+
809
+ if [ "$COMMITS_AHEAD" -eq 0 ]; then
810
+ # Fast-forward: just move develop to main
811
+ echo "Fast-forwarding develop to main..."
812
+ git reset --hard origin/main
813
+ else
814
+ # Rebase: replay develop's commits on top of main
815
+ echo "Rebasing develop onto main..."
816
+ git rebase origin/main || {
817
+ echo "⚠️ Rebase conflict detected - this shouldn't happen if develop was properly merged"
818
+ echo "Falling back to reset (this will discard develop-only commits)"
819
+ git rebase --abort 2>/dev/null || true
820
+ git reset --hard origin/main
821
+ }
822
+ fi
823
+ echo "✅ Develop updated to include latest from main"
824
+
825
+ - name: Verify package.json version
826
+ run: |
827
+ CURRENT_VERSION=$(node -p "require('./package.json').version")
828
+ RELEASE_VERSION="${{ needs.prepare.outputs.version }}"
829
+
830
+ echo "Current version in package.json: $CURRENT_VERSION"
831
+ echo "Release version: $RELEASE_VERSION"
832
+
833
+ if [ "$CURRENT_VERSION" != "$RELEASE_VERSION" ]; then
834
+ echo "Updating package.json version..."
835
+ npm version "$RELEASE_VERSION" --no-git-tag-version --allow-same-version
836
+ git add package.json
837
+ git commit -m "chore: sync version to $RELEASE_VERSION" || echo "No changes to commit"
838
+ else
839
+ echo "✅ Version already matches"
840
+ fi
841
+
842
+ - name: Push to develop
843
+ run: |
844
+ git config user.name "github-actions[bot]"
845
+ git config user.email "github-actions[bot]@users.noreply.github.com"
846
+
847
+ # Check if there are any changes to push
848
+ if git diff --quiet origin/develop HEAD; then
849
+ echo "✅ No changes to push (develop already up to date)"
850
+ else
851
+ COMMITS_AHEAD="${{ steps.check-commits.outputs.commits_ahead }}"
852
+ if [ "$COMMITS_AHEAD" -eq 0 ]; then
853
+ # Fast-forward push (no force needed)
854
+ echo "Pushing fast-forward update..."
855
+ git push origin develop
856
+ else
857
+ # Rebase requires force push (but this is safe after rebase)
858
+ echo "Pushing rebased develop branch..."
859
+ git push origin develop --force-with-lease
860
+ fi
861
+ echo "✅ Develop updated and pushed"
862
+ fi
@@ -1,9 +1,18 @@
1
1
  name: Sync Version to Develop
2
2
 
3
3
  # This workflow runs after a release to reset develop to match main and sync the version
4
+ # It has multiple triggers to ensure it runs reliably:
5
+ # 1. release event (when a release is published)
6
+ # 2. workflow_run (when the release workflow completes - backup trigger)
7
+ # 3. workflow_dispatch (manual trigger)
4
8
  on:
5
9
  release:
6
10
  types: [published]
11
+ workflow_run:
12
+ workflows: ["Publish Switch"]
13
+ types: [completed]
14
+ branches:
15
+ - main
7
16
  workflow_dispatch:
8
17
  inputs:
9
18
  version:
@@ -24,6 +33,12 @@ jobs:
24
33
  fetch-depth: 0
25
34
  token: ${{ secrets.GITHUB_TOKEN }}
26
35
 
36
+ - name: Setup GitHub CLI
37
+ if: github.event_name == 'workflow_run'
38
+ uses: cli/cli@v2
39
+ with:
40
+ token: ${{ secrets.GITHUB_TOKEN }}
41
+
27
42
  - name: Get version from release
28
43
  id: version
29
44
  run: |
@@ -32,16 +47,30 @@ jobs:
32
47
  VERSION="${{ inputs.version }}"
33
48
  echo "✅ Using provided version: $VERSION"
34
49
  elif [ -n "${{ github.event.release.tag_name }}" ]; then
50
+ # Release event trigger
35
51
  VERSION="${{ github.event.release.tag_name }}"
36
52
  # Remove 'v' prefix if present
37
53
  VERSION="${VERSION#v}"
38
- echo "✅ Version from release: $VERSION"
54
+ echo "✅ Version from release event: $VERSION"
55
+ elif [ "${{ github.event_name }}" == "workflow_run" ]; then
56
+ # Workflow run trigger - get latest release tag
57
+ echo "Getting latest release tag..."
58
+ LATEST_TAG=$(gh api repos/${{ github.repository }}/releases/latest --jq '.tag_name' || echo "")
59
+ if [ -n "$LATEST_TAG" ]; then
60
+ VERSION="$LATEST_TAG"
61
+ # Remove 'v' prefix if present
62
+ VERSION="${VERSION#v}"
63
+ echo "✅ Version from latest release: $VERSION"
64
+ else
65
+ echo "❌ Could not get latest release tag"
66
+ exit 1
67
+ fi
39
68
  else
40
69
  echo "❌ No version provided and no release event found"
41
70
  exit 1
42
71
  fi
43
72
  echo "version=$VERSION" >> $GITHUB_OUTPUT
44
- echo "✅ Version from release: $VERSION"
73
+ echo "✅ Final version: $VERSION"
45
74
 
46
75
  - name: Checkout develop branch
47
76
  run: |
package/README.md CHANGED
@@ -102,11 +102,17 @@ httpcat
102
102
 
103
103
  You'll be prompted to enter:
104
104
 
105
- - **Private Key** - Your wallet's private key (starts with 0x)
106
- - **Network** - `base-sepolia` (testnet) or `base` (mainnet)
107
- - **Agent URL** - The httpcat agent endpoint
105
+ - **Private Key** - Your wallet's private key (starts with 0x) or seed phrase for HD wallet
106
+ - **Password** - (Optional) Password to encrypt your private keys and seed phrase
107
+ - **Network** - Network format: `eip155:84532` (Base Sepolia testnet) or `eip155:8453` (Base mainnet)
108
+ - **Agent URL** - The httpcat agent endpoint (default: https://agent.402.cat)
108
109
  - **ASCII Art** - Enable or disable cat art
109
110
 
111
+ **Network Format:** Uses CAIP-2 format (`eip155:<chainId>`):
112
+
113
+ - Base Sepolia (testnet): `eip155:84532` (Chain ID: 84532)
114
+ - Base (mainnet): `eip155:8453` (Chain ID: 8453)
115
+
110
116
  ### Interactive Mode
111
117
 
112
118
  Once configured, running `httpcat` without arguments starts an interactive shell:
@@ -118,7 +124,7 @@ $ httpcat
118
124
  ( ^.^ ) Welcome to httpcat!
119
125
  > ^ < Your agent for token operations
120
126
 
121
- 🔗 Connected to: base-sepolia
127
+ 🔗 Connected to: eip155:84532 (Base Sepolia)
122
128
  🌐 Agent: https://agent.402.cat
123
129
 
124
130
  httpcat> help
@@ -135,9 +141,8 @@ Available Commands:
135
141
  chat [token] Start streaming chat (optional: token symbol/name/address)
136
142
  balances Check wallet balances (ETH, USDC, and CAT)
137
143
  account [list|switch|add] Manage accounts
138
- agent <query> | cat <query> Ask the cat to do something (agent and cat are synonyms)
139
- agent --chat | cat --chat Enter interactive chat mode
140
- agent --setup | cat --setup Configure API key/provider
144
+ cat Start interactive AI assistant chat mode
145
+ agent setup Configure autonomous trading agent settings
141
146
  health Check agent health
142
147
  config [--show|--set|--reset] Manage configuration
143
148
  network Show current network
@@ -239,6 +244,8 @@ httpcat create "My Token" "MTK" --photo ./logo.png
239
244
  - `-p, --photo <url|path>` - Token photo URL or file path (supports http/https URLs, local file paths, or base64 data URLs)
240
245
  - `-w, --website <url>` - Website URL
241
246
 
247
+ **Note:** If no photo is provided, a unique [Robohash](https://robohash.org/) avatar is automatically generated for your token based on the token address.
248
+
242
249
  **Cost:** $0.01 USDC
243
250
 
244
251
  ### Buy Tokens
@@ -284,7 +291,7 @@ httpcat buy MTK 0.10 -r 10 -d 500
284
291
 
285
292
  **Amounts:**
286
293
 
287
- - Test mode (base-sepolia): `0.05`, `0.10`, or `0.20` USDC
294
+ - Test mode (Base Sepolia / eip155:84532): `0.05`, `0.10`, or `0.20` USDC
288
295
  - Production (base): `50`, `100`, or `200` USDC
289
296
  - Percentage: `10%`, `50%`, `100%` (percentage of your USDC balance)
290
297
  - Example: `httpcat buy MTK 50%` - Buy with 50% of your USDC balance
@@ -297,6 +304,8 @@ httpcat buy MTK 0.10 -r 10 -d 500
297
304
  When using `-r, --repeat`, the command will:
298
305
 
299
306
  - Execute the specified number of buys sequentially
307
+ - Wait for transaction confirmation between each buy
308
+ - Automatically retry failed transactions (up to 10 attempts with exponential backoff)
300
309
  - Stop early if the token graduates (reaches 100% graduation progress)
301
310
  - Stop early if you run out of funds (HTTP 402 error)
302
311
  - Display a compact summary for each buy
@@ -328,6 +337,39 @@ httpcat sell MTK all
328
337
 
329
338
  **Cost:** Dynamic based on amount (1% fee deducted from proceeds)
330
339
 
340
+ ### Swap Tokens
341
+
342
+ Swap any ERC20 token to any other ERC20 token using pro DEX aggregation with optimal routing.
343
+
344
+ **CLI:**
345
+
346
+ ```bash
347
+ httpcat swap <tokenIn> <tokenOut> <amount>
348
+ httpcat swap <tokenIn> <tokenOut> <amount> --slippage <bps>
349
+ ```
350
+
351
+ **Parameters:**
352
+
353
+ - `tokenIn` - Token to sell (contract address)
354
+ - `tokenOut` - Token to buy (contract address)
355
+ - `amount` - Amount to sell in smallest unit (e.g., 1000000 = 1 USDC with 6 decimals)
356
+
357
+ **Options:**
358
+
359
+ - `-s, --slippage <bps>` - Slippage tolerance in basis points (default: 50 = 0.5%)
360
+
361
+ **Examples:**
362
+
363
+ ```bash
364
+ # Swap 1 USDC for WETH with default 0.5% slippage
365
+ httpcat swap 0x036cbd53842c5426634e7929541ec2318f3dcf7e 0x4200000000000000000000000000000000000006 1000000
366
+
367
+ # Swap with 1% slippage tolerance
368
+ httpcat swap 0x036c... 0x4200... 1000000 --slippage 100
369
+ ```
370
+
371
+ **Cost:** $0.10 USDC
372
+
331
373
  ### Token Info
332
374
 
333
375
  Get detailed information about a token.
@@ -469,6 +511,7 @@ httpcat --json claim "My Token"
469
511
  **Output:**
470
512
 
471
513
  When viewing (without `--execute`):
514
+
472
515
  - Total accumulated fees (tokens and USDC)
473
516
  - Creator share (80%)
474
517
  - Platform share (20%)
@@ -476,6 +519,7 @@ When viewing (without `--execute`):
476
519
  - V4 position details (if applicable)
477
520
 
478
521
  When claiming (with `--execute`):
522
+
479
523
  - Transaction hash
480
524
  - Fees claimed (tokens and USDC)
481
525
  - Creator and platform shares distribution
@@ -515,6 +559,7 @@ httpcat --json transactions --offset 50
515
559
  **Output:**
516
560
 
517
561
  For each transaction:
562
+
518
563
  - Transaction type (buy, sell, or airdrop)
519
564
  - Status (pending, success, or failed)
520
565
  - Token information (name, symbol, ID)
@@ -596,6 +641,7 @@ httpcat --json account
596
641
  **Output:**
597
642
 
598
643
  Account information includes:
644
+
599
645
  - Account index and type (Seed-Derived or Custom)
600
646
  - Wallet address (checksummed)
601
647
  - ETH balance (for gas fees)
@@ -686,64 +732,87 @@ While in a chat session, you can use these commands:
686
732
 
687
733
  **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.
688
734
 
689
- ### Cat / Agent
735
+ ### Cat (Interactive AI Assistant)
690
736
 
691
- Interact with an AI-powered cat assistant that can help you with token operations, portfolio management, and more. **`agent` and `cat` are synonyms** - you can use either command name.
737
+ Interact with an AI-powered assistant that can help you with token operations, portfolio management, and more using natural language.
692
738
 
693
739
  **Interactive:**
694
740
 
695
741
  ```bash
696
- httpcat> agent "Buy 100 WOW tokens" # Ask the cat to do something
697
- httpcat> cat "What tokens do I own?" # Same thing, different name
698
- httpcat> agent --chat # Enter interactive chat mode
699
- httpcat> cat --chat # Same thing
700
- httpcat> agent --setup # Configure API key/provider
701
- httpcat> cat --setup # Same thing
702
- ```
703
-
704
- **CLI:**
705
-
706
- ```bash
707
- httpcat agent "Buy 100 WOW tokens"
708
- httpcat cat "What tokens do I own?"
709
- httpcat agent --chat
710
- httpcat cat --chat
711
- httpcat agent --setup
712
- httpcat cat --setup
742
+ httpcat> cat
743
+ # Starts interactive AI chat session
744
+ # Type /exit to quit
713
745
  ```
714
746
 
715
747
  **Usage:**
716
748
 
717
- - `agent <query>` or `cat <query>` - Ask the cat to execute a task (e.g., "Buy WOW tokens", "Check my balance", "List my positions")
718
- - `agent --chat` or `cat --chat` - Enter interactive chat mode for extended conversations
719
- - `agent --setup` or `cat --setup` - Configure or reconfigure your AI provider (OpenAI or Anthropic) and API key
749
+ The `cat` command starts an interactive AI assistant session where you can ask questions and give trading commands in natural language. The assistant will execute operations on your behalf.
720
750
 
721
751
  **First-Time Setup:**
722
752
 
723
- Before using the cat/agent, you'll need to configure it:
753
+ Before using the cat command, you'll need to configure your AI provider:
724
754
 
725
755
  ```bash
726
- httpcat> agent --setup
727
- # or
728
- httpcat> cat --setup
756
+ httpcat config
729
757
  ```
730
758
 
731
- You'll be prompted to:
759
+ During setup, you'll be prompted to:
760
+
732
761
  - Choose an AI provider (OpenAI or Anthropic)
733
762
  - Enter your API key
734
763
  - Select a model (defaults provided)
735
764
 
736
765
  **How It Works:**
737
766
 
738
- The cat uses an AI agent (powered by OpenAI GPT-4 or Anthropic Claude) to understand natural language requests and execute token operations on your behalf. It can:
767
+ The cat assistant uses AI (powered by OpenAI GPT-4 or Anthropic Claude) to understand natural language requests and execute token operations on your behalf. It can:
768
+
739
769
  - Buy and sell tokens
740
770
  - Check balances and positions
741
771
  - List tokens
742
772
  - Get token information
773
+ - Answer questions about your portfolio
743
774
  - And more!
744
775
 
745
776
  **Note:** The cat requires an API key from either OpenAI or Anthropic. Your API key is stored locally and encrypted, and is only sent to the LLM provider - never to any other server.
746
777
 
778
+ ### Agent (Autonomous Trading)
779
+
780
+ Configure and run an autonomous trading agent that monitors token events and makes trading decisions based on your risk parameters.
781
+
782
+ **Interactive:**
783
+
784
+ ```bash
785
+ httpcat> agent setup # Configure autonomous trading settings
786
+ ```
787
+
788
+ **CLI:**
789
+
790
+ ```bash
791
+ httpcat agent setup
792
+ ```
793
+
794
+ **Configuration Options:**
795
+
796
+ When setting up the autonomous agent, you can configure:
797
+
798
+ - **Max Trade Amount** - Maximum USDC per trade
799
+ - **Risk Tolerance** - Conservative, moderate, or aggressive
800
+ - **Token Filters** - Minimum holders, max whale percentage, min liquidity
801
+ - **Trading Thresholds** - Stop loss and take profit percentages
802
+ - **Auto-Execute** - Enable automatic trade execution or recommendation-only mode
803
+
804
+ **How It Works:**
805
+
806
+ The autonomous agent:
807
+
808
+ 1. Monitors real-time token events via event stream
809
+ 2. Analyzes tokens based on your configured filters and risk parameters
810
+ 3. Makes trading decisions using AI reasoning
811
+ 4. Either executes trades automatically or provides recommendations (based on your settings)
812
+ 5. Tracks positions and maintains a decision history database
813
+
814
+ **Note:** The autonomous agent requires AI provider configuration (same as the `cat` command). Always start with recommendation-only mode before enabling auto-execution.
815
+
747
816
  ### Help
748
817
 
749
818
  Display help information for httpcat.
@@ -1500,8 +1569,8 @@ Updates an existing environment's agent URL and optionally its network.
1500
1569
 
1501
1570
  #### Predefined Environments
1502
1571
 
1503
- - **local** - `http://localhost:8787` (base-sepolia)
1504
- - **sepolia** - `https://agent.402.cat` (base-sepolia)
1572
+ - **local** - `http://localhost:8787` (eip155:84532)
1573
+ - **sepolia** - `https://agent.402.cat` (eip155:84532)
1505
1574
 
1506
1575
  #### Environment Priority
1507
1576
 
@@ -1584,7 +1653,7 @@ Config is stored at `~/.config/httpcat/config.json`:
1584
1653
  }
1585
1654
  ],
1586
1655
  "activeAccountIndex": 0,
1587
- "network": "base-sepolia",
1656
+ "network": "eip155:84532",
1588
1657
  "agentUrl": "https://agent.402.cat",
1589
1658
  "facilitatorUrl": "https://facilitators.x402scan.com",
1590
1659
  "defaultMaxPayment": "10.00",
@@ -1610,6 +1679,20 @@ Config is stored at `~/.config/httpcat/config.json`:
1610
1679
  "provider": "openai",
1611
1680
  "apiKey": "encrypted_key_here",
1612
1681
  "model": "gpt-4"
1682
+ },
1683
+ "autonomousAgent": {
1684
+ "enabled": false,
1685
+ "maxTradeAmount": "10.00",
1686
+ "riskTolerance": "moderate",
1687
+ "tokenFilters": {
1688
+ "minHolders": 10,
1689
+ "maxWhalePercentage": 20,
1690
+ "minLiquidity": 1000
1691
+ },
1692
+ "stopLoss": 20,
1693
+ "takeProfit": 50,
1694
+ "eventStreamUrl": "wss://events.402.cat",
1695
+ "databasePath": "~/.config/httpcat/agent.db"
1613
1696
  }
1614
1697
  }
1615
1698
  ```
@@ -1618,27 +1701,32 @@ Config is stored at `~/.config/httpcat/config.json`:
1618
1701
 
1619
1702
  - **Password Protection**: Set a password during setup to encrypt your private keys and seed phrase
1620
1703
  - **Session Management**: Configurable timeout (default: 15 minutes via `passwordTimeoutMinutes`)
1704
+ - After the timeout, you'll need to re-enter your password to unlock the wallet
1705
+ - Session tokens are managed automatically to keep your wallet secure
1621
1706
  - **Multi-Account Support**: Manage multiple accounts (seed-derived HD wallet accounts and custom imported accounts)
1622
1707
  - **Encrypted Storage**: Keys and seed phrases are encrypted when password is enabled
1623
1708
  - **Account Types**:
1624
- - **Seed-Derived** (Account 1+): Generated from your seed phrase using BIP-32/BIP-39
1625
- - **Custom** (Account 0): Imported via private key
1709
+ - **Account 0 (Custom)**: Imported via private key during initial setup
1710
+ - **Account 1+ (Seed-Derived)**: Generated from your seed phrase using BIP-32/BIP-39 HD wallet derivation
1711
+ - You can add unlimited seed-derived accounts using `account add`
1712
+ - All accounts share the same password protection
1626
1713
 
1627
1714
  **Security Notes:**
1628
1715
 
1629
- - **Without password**: Private key stored in plain text (legacy `privateKey` field, auto-migrated to encrypted format)
1630
- - **With password**: Private key, seed phrase, and AI API keys are encrypted
1716
+ - **Without password**: Private key stored in plain text (legacy `privateKey` field, auto-migrated to encrypted format on first password setup)
1717
+ - **With password**: Private key, seed phrase, and AI API keys are AES-256 encrypted
1718
+ - **Session Timeout**: Wallet automatically locks after 15 minutes of inactivity (configurable)
1631
1719
  - **For production use**:
1632
1720
  - Enable password protection during setup for encryption
1633
- - Use `HTTPCAT_PRIVATE_KEY` environment variable for additional security
1721
+ - Use `HTTPCAT_PRIVATE_KEY` environment variable for additional security in scripts
1634
1722
  - Set restrictive file permissions: `chmod 600 ~/.config/httpcat/config.json`
1635
- - Use a dedicated wallet with limited funds
1723
+ - Use a dedicated wallet with limited funds for trading operations
1636
1724
 
1637
1725
  ## How It Works
1638
1726
 
1639
1727
  ### x402 Payment Protocol
1640
1728
 
1641
- httpcat uses the [x402 protocol](https://x402.org) for micropayments:
1729
+ httpcat uses the [x402 protocol V2](https://x402.org) for micropayments:
1642
1730
 
1643
1731
  1. **Request** - CLI makes a request to the agent
1644
1732
  2. **402 Response** - Agent returns payment requirements
@@ -1678,7 +1766,7 @@ export HTTPCAT_PRIVATE_KEY=0x...
1678
1766
 
1679
1767
  Make sure you have enough USDC in your wallet:
1680
1768
 
1681
- - Test mode (base-sepolia): Get testnet USDC from faucets
1769
+ - Test mode (Base Sepolia / eip155:84532): Get testnet USDC from faucets
1682
1770
  - Production (base): Bridge USDC to Base
1683
1771
 
1684
1772
  You also need ETH for gas fees.
@@ -1688,7 +1776,7 @@ You also need ETH for gas fees.
1688
1776
  The payment verification failed. Check:
1689
1777
 
1690
1778
  1. Wallet has sufficient USDC and ETH
1691
- 2. Network is correct (base-sepolia vs base)
1779
+ 2. Network is correct (eip155:84532 for testnet vs eip155:8453 for mainnet)
1692
1780
  3. Agent URL is reachable
1693
1781
  4. Facilitator URL is correct
1694
1782