httpcat-cli 0.2.13 → 0.3.0-rc.2
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/release.yml +96 -0
- package/.github/workflows/sync-version.yml +31 -2
- package/README.md +185 -62
- package/additions.txt +3 -0
- package/bun.lock +180 -1276
- package/dist/agent/autonomous-trader.d.ts.map +1 -0
- package/dist/agent/autonomous-trader.js +362 -0
- package/dist/agent/autonomous-trader.js.map +1 -0
- package/dist/agent/ax-agent.d.ts.map +1 -1
- package/dist/agent/ax-agent.js +293 -18
- package/dist/agent/ax-agent.js.map +1 -1
- package/dist/agent/event-client.d.ts.map +1 -0
- package/dist/agent/event-client.js +82 -0
- package/dist/agent/event-client.js.map +1 -0
- package/dist/agent/log-stream.d.ts.map +1 -0
- package/dist/agent/log-stream.js +95 -0
- package/dist/agent/log-stream.js.map +1 -0
- package/dist/agent/memory/conversation-session.d.ts.map +1 -0
- package/dist/agent/memory/conversation-session.js +232 -0
- package/dist/agent/memory/conversation-session.js.map +1 -0
- package/dist/agent/memory/conversation-store.d.ts.map +1 -0
- package/dist/agent/memory/conversation-store.js +214 -0
- package/dist/agent/memory/conversation-store.js.map +1 -0
- package/dist/agent/memory/database-schema.d.ts.map +1 -0
- package/dist/agent/memory/database-schema.js +355 -0
- package/dist/agent/memory/database-schema.js.map +1 -0
- package/dist/agent/memory/decision-tracker.d.ts.map +1 -0
- package/dist/agent/memory/decision-tracker.js +274 -0
- package/dist/agent/memory/decision-tracker.js.map +1 -0
- package/dist/agent/memory/memory-manager.d.ts.map +1 -0
- package/dist/agent/memory/memory-manager.js +187 -0
- package/dist/agent/memory/memory-manager.js.map +1 -0
- package/dist/agent/memory/types.d.ts.map +1 -0
- package/dist/agent/memory/types.js +5 -0
- package/dist/agent/memory/types.js.map +1 -0
- package/dist/agent/message-formatter.d.ts.map +1 -0
- package/dist/agent/message-formatter.js +76 -0
- package/dist/agent/message-formatter.js.map +1 -0
- package/dist/agent/position-db.d.ts.map +1 -0
- package/dist/agent/position-db.js +154 -0
- package/dist/agent/position-db.js.map +1 -0
- package/dist/agent/simple-chat-ui-static.d.ts.map +1 -0
- package/dist/agent/simple-chat-ui-static.js +129 -0
- package/dist/agent/simple-chat-ui-static.js.map +1 -0
- package/dist/agent/simple-chat-ui.d.ts.map +1 -0
- package/dist/agent/simple-chat-ui.js +90 -0
- package/dist/agent/simple-chat-ui.js.map +1 -0
- package/dist/agent/tools.d.ts.map +1 -1
- package/dist/agent/tools.js +274 -5
- package/dist/agent/tools.js.map +1 -1
- package/dist/agent/ui.d.ts.map +1 -0
- package/dist/agent/ui.js +84 -0
- package/dist/agent/ui.js.map +1 -0
- package/dist/agent/unified-runtime.d.ts.map +1 -0
- package/dist/agent/unified-runtime.js +397 -0
- package/dist/agent/unified-runtime.js.map +1 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +406 -46
- package/dist/client.js.map +1 -1
- package/dist/commands/account.d.ts.map +1 -1
- package/dist/commands/account.js +51 -22
- package/dist/commands/account.js.map +1 -1
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +258 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/balances.d.ts.map +1 -1
- package/dist/commands/balances.js +122 -68
- package/dist/commands/balances.js.map +1 -1
- package/dist/commands/buy.d.ts.map +1 -1
- package/dist/commands/buy.js +73 -36
- package/dist/commands/buy.js.map +1 -1
- package/dist/commands/chat.d.ts.map +1 -1
- package/dist/commands/chat.js +200 -429
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/claim.d.ts.map +1 -1
- package/dist/commands/claim.js +84 -27
- package/dist/commands/claim.js.map +1 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +65 -42
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/health.d.ts.map +1 -1
- package/dist/commands/health.js +7 -5
- package/dist/commands/health.js.map +1 -1
- package/dist/commands/info.d.ts.map +1 -1
- package/dist/commands/info.js +125 -46
- package/dist/commands/info.js.map +1 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +56 -22
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/positions.d.ts.map +1 -1
- package/dist/commands/positions.js +76 -47
- package/dist/commands/positions.js.map +1 -1
- package/dist/commands/sell.d.ts.map +1 -1
- package/dist/commands/sell.js +62 -32
- package/dist/commands/sell.js.map +1 -1
- package/dist/commands/swap.d.ts.map +1 -0
- package/dist/commands/swap.js +392 -0
- package/dist/commands/swap.js.map +1 -0
- package/dist/commands/transactions.d.ts.map +1 -1
- package/dist/commands/transactions.js +28 -16
- package/dist/commands/transactions.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +132 -11
- package/dist/config.js.map +1 -1
- package/dist/index.js +453 -145
- package/dist/index.js.map +1 -1
- package/dist/interactive/art.d.ts.map +1 -1
- package/dist/interactive/art.js +38 -1
- package/dist/interactive/art.js.map +1 -1
- package/dist/interactive/shell.d.ts.map +1 -1
- package/dist/interactive/shell.js +398 -2259
- package/dist/interactive/shell.js.map +1 -1
- package/dist/mcp/chat-state.d.ts.map +1 -1
- package/dist/mcp/chat-state.js +2 -1
- package/dist/mcp/chat-state.js.map +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +108 -1
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/types/agent-info.d.ts.map +1 -0
- package/dist/types/agent-info.js +11 -0
- package/dist/types/agent-info.js.map +1 -0
- package/dist/ui/components/ScrollableList.d.ts.map +1 -0
- package/dist/ui/components/ScrollableList.js +72 -0
- package/dist/ui/components/ScrollableList.js.map +1 -0
- package/dist/ui/components/ThemeProvider.d.ts.map +1 -0
- package/dist/ui/components/ThemeProvider.js +87 -0
- package/dist/ui/components/ThemeProvider.js.map +1 -0
- package/dist/ui/components/ThemedBox.d.ts.map +1 -0
- package/dist/ui/components/ThemedBox.js +24 -0
- package/dist/ui/components/ThemedBox.js.map +1 -0
- package/dist/ui/components/agent/ChatHeader.d.ts.map +1 -0
- package/dist/ui/components/agent/ChatHeader.js +39 -0
- package/dist/ui/components/agent/ChatHeader.js.map +1 -0
- package/dist/ui/components/agent/Header.d.ts.map +1 -0
- package/dist/ui/components/agent/Header.js +14 -0
- package/dist/ui/components/agent/Header.js.map +1 -0
- package/dist/ui/components/agent/Input.d.ts.map +1 -0
- package/dist/ui/components/agent/Input.js +23 -0
- package/dist/ui/components/agent/Input.js.map +1 -0
- package/dist/ui/components/agent/Output.d.ts.map +1 -0
- package/dist/ui/components/agent/Output.js +23 -0
- package/dist/ui/components/agent/Output.js.map +1 -0
- package/dist/ui/components/chat/TokenChatUI.d.ts.map +1 -0
- package/dist/ui/components/chat/TokenChatUI.js +133 -0
- package/dist/ui/components/chat/TokenChatUI.js.map +1 -0
- package/dist/ui/components/shell/ShellHeader.d.ts.map +1 -0
- package/dist/ui/components/shell/ShellHeader.js +31 -0
- package/dist/ui/components/shell/ShellHeader.js.map +1 -0
- package/dist/ui/components/shell/ShellInput.d.ts.map +1 -0
- package/dist/ui/components/shell/ShellInput.js +147 -0
- package/dist/ui/components/shell/ShellInput.js.map +1 -0
- package/dist/ui/components/shell/ShellOutput.d.ts.map +1 -0
- package/dist/ui/components/shell/ShellOutput.js +8 -0
- package/dist/ui/components/shell/ShellOutput.js.map +1 -0
- package/dist/ui/hooks/useChatWebSocket.d.ts.map +1 -0
- package/dist/ui/hooks/useChatWebSocket.js +76 -0
- package/dist/ui/hooks/useChatWebSocket.js.map +1 -0
- package/dist/ui/hooks/useCommandHistory.d.ts.map +1 -0
- package/dist/ui/hooks/useCommandHistory.js +70 -0
- package/dist/ui/hooks/useCommandHistory.js.map +1 -0
- package/dist/ui/hooks/useDebounce.d.ts.map +1 -0
- package/dist/ui/hooks/useDebounce.js +17 -0
- package/dist/ui/hooks/useDebounce.js.map +1 -0
- package/dist/ui/hooks/useLogStream.d.ts.map +1 -0
- package/dist/ui/hooks/useLogStream.js +20 -0
- package/dist/ui/hooks/useLogStream.js.map +1 -0
- package/dist/ui/hooks/useVirtualScroll.d.ts.map +1 -0
- package/dist/ui/hooks/useVirtualScroll.js +70 -0
- package/dist/ui/hooks/useVirtualScroll.js.map +1 -0
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/constants.js +44 -2
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +3 -3
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/formatting.d.ts.map +1 -1
- package/dist/utils/formatting.js +37 -6
- package/dist/utils/formatting.js.map +1 -1
- package/dist/utils/loading.d.ts.map +1 -1
- package/dist/utils/loading.js +23 -2
- package/dist/utils/loading.js.map +1 -1
- package/dist/utils/privateKeyPrompt.d.ts.map +1 -1
- package/dist/utils/privateKeyPrompt.js +31 -7
- package/dist/utils/privateKeyPrompt.js.map +1 -1
- package/dist/utils/status.d.ts.map +1 -0
- package/dist/utils/status.js +96 -0
- package/dist/utils/status.js.map +1 -0
- package/dist/utils/token-resolver.d.ts.map +1 -1
- package/dist/utils/token-resolver.js +17 -7
- package/dist/utils/token-resolver.js.map +1 -1
- package/issues.txt +2 -0
- package/package.json +16 -6
- package/Screenshot 2025-12-21 at 8.56.02/342/200/257PM.png +0 -0
|
@@ -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 "✅
|
|
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
|
-
- **
|
|
107
|
-
- **
|
|
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:
|
|
127
|
+
🔗 Connected to: eip155:84532 (Base Sepolia)
|
|
122
128
|
🌐 Agent: https://agent.402.cat
|
|
123
129
|
|
|
124
130
|
httpcat> help
|
|
@@ -127,6 +133,7 @@ Available Commands:
|
|
|
127
133
|
create <name> <symbol> Create a new token
|
|
128
134
|
buy <id|name|symbol> <amount> Buy tokens ($0.05, $0.10, $0.20, or percentage like 50%)
|
|
129
135
|
sell <id|name|symbol> <amount|all> Sell tokens
|
|
136
|
+
swap <tokenIn> <tokenOut> <amount> Swap any token to any token (CLI only, $0.10)
|
|
130
137
|
info <id|name|symbol> Get token information
|
|
131
138
|
list [--sort mcap|created] List all tokens
|
|
132
139
|
positions [--active|--graduated] Get all your positions with comprehensive info
|
|
@@ -135,12 +142,10 @@ Available Commands:
|
|
|
135
142
|
chat [token] Start streaming chat (optional: token symbol/name/address)
|
|
136
143
|
balances Check wallet balances (ETH, USDC, and CAT)
|
|
137
144
|
account [list|switch|add] Manage accounts
|
|
138
|
-
|
|
139
|
-
agent
|
|
140
|
-
agent --setup | cat --setup Configure API key/provider
|
|
145
|
+
cat Start interactive AI assistant chat mode
|
|
146
|
+
agent setup Configure autonomous trading agent settings
|
|
141
147
|
health Check agent health
|
|
142
148
|
config [--show|--set|--reset] Manage configuration
|
|
143
|
-
network Show current network
|
|
144
149
|
env [list|use|show|add|update] Manage environments
|
|
145
150
|
help Show this help message
|
|
146
151
|
exit Exit the shell
|
|
@@ -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 (
|
|
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)
|
|
@@ -603,7 +649,7 @@ Account information includes:
|
|
|
603
649
|
- CAT balance (402CAT token)
|
|
604
650
|
- All positions (if any) with P&L
|
|
605
651
|
|
|
606
|
-
**Cost:**
|
|
652
|
+
**Cost:** $0.01 USDC (for positions data; balances are free)
|
|
607
653
|
|
|
608
654
|
**Security Note:** All accounts share the same password protection when password is enabled. Switch accounts anytime using the `--account` flag or `account switch` command.
|
|
609
655
|
|
|
@@ -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
|
|
735
|
+
### Cat (Interactive AI Assistant)
|
|
690
736
|
|
|
691
|
-
Interact with an AI-powered
|
|
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>
|
|
697
|
-
|
|
698
|
-
|
|
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
|
-
|
|
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
|
|
753
|
+
Before using the cat command, you'll need to configure your AI provider:
|
|
724
754
|
|
|
725
755
|
```bash
|
|
726
|
-
httpcat
|
|
727
|
-
# or
|
|
728
|
-
httpcat> cat --setup
|
|
756
|
+
httpcat config
|
|
729
757
|
```
|
|
730
758
|
|
|
731
|
-
|
|
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
|
|
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.
|
|
@@ -1347,6 +1416,51 @@ Get recent messages from chat (polling mechanism). Returns cached messages from
|
|
|
1347
1416
|
|
|
1348
1417
|
**Note:** Messages are cached in memory as they arrive via WebSocket. Poll this tool periodically to check for new messages.
|
|
1349
1418
|
|
|
1419
|
+
#### `view_fees`
|
|
1420
|
+
|
|
1421
|
+
View accumulated LP fees for a graduated token.
|
|
1422
|
+
|
|
1423
|
+
**Parameters:**
|
|
1424
|
+
|
|
1425
|
+
- `identifier` (string, required) - Token address, name, or symbol
|
|
1426
|
+
- `callerAddress` (string, optional) - Caller address (defaults to wallet address)
|
|
1427
|
+
- `privateKey` (string, optional) - Private key (overrides config/env)
|
|
1428
|
+
|
|
1429
|
+
**Returns:** Fee information including accumulated tokens and USDC, creator/platform shares, and LP lock status
|
|
1430
|
+
|
|
1431
|
+
**Cost:** Free (view only)
|
|
1432
|
+
|
|
1433
|
+
#### `claim_fees`
|
|
1434
|
+
|
|
1435
|
+
Claim accumulated LP fees for a graduated token.
|
|
1436
|
+
|
|
1437
|
+
**Parameters:**
|
|
1438
|
+
|
|
1439
|
+
- `identifier` (string, required) - Token address, name, or symbol
|
|
1440
|
+
- `callerAddress` (string, optional) - Caller address (defaults to wallet address)
|
|
1441
|
+
- `privateKey` (string, optional) - Private key (overrides config/env)
|
|
1442
|
+
|
|
1443
|
+
**Returns:** Transaction hash and claimed fee amounts
|
|
1444
|
+
|
|
1445
|
+
**Cost:** Gas fees for blockchain transaction
|
|
1446
|
+
|
|
1447
|
+
#### `get_transactions`
|
|
1448
|
+
|
|
1449
|
+
Get paginated transaction history with filtering options.
|
|
1450
|
+
|
|
1451
|
+
**Parameters:**
|
|
1452
|
+
|
|
1453
|
+
- `userAddress` (string, optional) - Filter by user address (defaults to wallet address)
|
|
1454
|
+
- `tokenId` (string, optional) - Filter by token ID
|
|
1455
|
+
- `type` (string, optional) - Filter by type: "buy", "sell", or "airdrop"
|
|
1456
|
+
- `limit` (number, optional) - Number of results (default: 50, max: 100)
|
|
1457
|
+
- `offset` (number, optional) - Pagination offset (default: 0)
|
|
1458
|
+
- `privateKey` (string, optional) - Private key (overrides config/env)
|
|
1459
|
+
|
|
1460
|
+
**Returns:** Array of transactions with type, status, token info, amount, fee, and timestamp
|
|
1461
|
+
|
|
1462
|
+
**Cost:** Varies based on API call
|
|
1463
|
+
|
|
1350
1464
|
### Chat Tools Usage Example
|
|
1351
1465
|
|
|
1352
1466
|
Here's how an AI agent like Claude Code would use the chat tools:
|
|
@@ -1500,8 +1614,8 @@ Updates an existing environment's agent URL and optionally its network.
|
|
|
1500
1614
|
|
|
1501
1615
|
#### Predefined Environments
|
|
1502
1616
|
|
|
1503
|
-
- **local** - `http://localhost:8787` (
|
|
1504
|
-
- **sepolia** - `https://agent.402.cat` (
|
|
1617
|
+
- **local** - `http://localhost:8787` (eip155:84532)
|
|
1618
|
+
- **sepolia** - `https://agent.402.cat` (eip155:84532)
|
|
1505
1619
|
|
|
1506
1620
|
#### Environment Priority
|
|
1507
1621
|
|
|
@@ -1584,7 +1698,7 @@ Config is stored at `~/.config/httpcat/config.json`:
|
|
|
1584
1698
|
}
|
|
1585
1699
|
],
|
|
1586
1700
|
"activeAccountIndex": 0,
|
|
1587
|
-
"network": "
|
|
1701
|
+
"network": "eip155:84532",
|
|
1588
1702
|
"agentUrl": "https://agent.402.cat",
|
|
1589
1703
|
"facilitatorUrl": "https://facilitators.x402scan.com",
|
|
1590
1704
|
"defaultMaxPayment": "10.00",
|
|
@@ -1593,12 +1707,12 @@ Config is stored at `~/.config/httpcat/config.json`:
|
|
|
1593
1707
|
"local": {
|
|
1594
1708
|
"name": "local",
|
|
1595
1709
|
"agentUrl": "http://localhost:8787",
|
|
1596
|
-
"network": "
|
|
1710
|
+
"network": "eip155:84532"
|
|
1597
1711
|
},
|
|
1598
1712
|
"sepolia": {
|
|
1599
1713
|
"name": "sepolia",
|
|
1600
1714
|
"agentUrl": "https://agent.402.cat",
|
|
1601
|
-
"network": "
|
|
1715
|
+
"network": "eip155:84532"
|
|
1602
1716
|
}
|
|
1603
1717
|
},
|
|
1604
1718
|
"preferences": {
|
|
@@ -1610,6 +1724,20 @@ Config is stored at `~/.config/httpcat/config.json`:
|
|
|
1610
1724
|
"provider": "openai",
|
|
1611
1725
|
"apiKey": "encrypted_key_here",
|
|
1612
1726
|
"model": "gpt-4"
|
|
1727
|
+
},
|
|
1728
|
+
"autonomousAgent": {
|
|
1729
|
+
"enabled": false,
|
|
1730
|
+
"maxTradeAmount": "10.00",
|
|
1731
|
+
"riskTolerance": "moderate",
|
|
1732
|
+
"tokenFilters": {
|
|
1733
|
+
"minHolders": 10,
|
|
1734
|
+
"maxWhalePercentage": 20,
|
|
1735
|
+
"minLiquidity": 1000
|
|
1736
|
+
},
|
|
1737
|
+
"stopLoss": 20,
|
|
1738
|
+
"takeProfit": 50,
|
|
1739
|
+
"eventStreamUrl": "wss://events.402.cat",
|
|
1740
|
+
"databasePath": "~/.config/httpcat/agent.db"
|
|
1613
1741
|
}
|
|
1614
1742
|
}
|
|
1615
1743
|
```
|
|
@@ -1618,27 +1746,32 @@ Config is stored at `~/.config/httpcat/config.json`:
|
|
|
1618
1746
|
|
|
1619
1747
|
- **Password Protection**: Set a password during setup to encrypt your private keys and seed phrase
|
|
1620
1748
|
- **Session Management**: Configurable timeout (default: 15 minutes via `passwordTimeoutMinutes`)
|
|
1749
|
+
- After the timeout, you'll need to re-enter your password to unlock the wallet
|
|
1750
|
+
- Session tokens are managed automatically to keep your wallet secure
|
|
1621
1751
|
- **Multi-Account Support**: Manage multiple accounts (seed-derived HD wallet accounts and custom imported accounts)
|
|
1622
1752
|
- **Encrypted Storage**: Keys and seed phrases are encrypted when password is enabled
|
|
1623
1753
|
- **Account Types**:
|
|
1624
|
-
- **
|
|
1625
|
-
- **
|
|
1754
|
+
- **Account 0 (Custom)**: Imported via private key during initial setup
|
|
1755
|
+
- **Account 1+ (Seed-Derived)**: Generated from your seed phrase using BIP-32/BIP-39 HD wallet derivation
|
|
1756
|
+
- You can add unlimited seed-derived accounts using `account add`
|
|
1757
|
+
- All accounts share the same password protection
|
|
1626
1758
|
|
|
1627
1759
|
**Security Notes:**
|
|
1628
1760
|
|
|
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
|
|
1761
|
+
- **Without password**: Private key stored in plain text (legacy `privateKey` field, auto-migrated to encrypted format on first password setup)
|
|
1762
|
+
- **With password**: Private key, seed phrase, and AI API keys are AES-256 encrypted
|
|
1763
|
+
- **Session Timeout**: Wallet automatically locks after 15 minutes of inactivity (configurable)
|
|
1631
1764
|
- **For production use**:
|
|
1632
1765
|
- Enable password protection during setup for encryption
|
|
1633
|
-
- Use `HTTPCAT_PRIVATE_KEY` environment variable for additional security
|
|
1766
|
+
- Use `HTTPCAT_PRIVATE_KEY` environment variable for additional security in scripts
|
|
1634
1767
|
- Set restrictive file permissions: `chmod 600 ~/.config/httpcat/config.json`
|
|
1635
|
-
- Use a dedicated wallet with limited funds
|
|
1768
|
+
- Use a dedicated wallet with limited funds for trading operations
|
|
1636
1769
|
|
|
1637
1770
|
## How It Works
|
|
1638
1771
|
|
|
1639
1772
|
### x402 Payment Protocol
|
|
1640
1773
|
|
|
1641
|
-
httpcat uses the [x402 protocol](https://x402.org) for micropayments:
|
|
1774
|
+
httpcat uses the [x402 protocol V2](https://x402.org) for micropayments:
|
|
1642
1775
|
|
|
1643
1776
|
1. **Request** - CLI makes a request to the agent
|
|
1644
1777
|
2. **402 Response** - Agent returns payment requirements
|
|
@@ -1678,7 +1811,7 @@ export HTTPCAT_PRIVATE_KEY=0x...
|
|
|
1678
1811
|
|
|
1679
1812
|
Make sure you have enough USDC in your wallet:
|
|
1680
1813
|
|
|
1681
|
-
- Test mode (
|
|
1814
|
+
- Test mode (Base Sepolia / eip155:84532): Get testnet USDC from faucets
|
|
1682
1815
|
- Production (base): Bridge USDC to Base
|
|
1683
1816
|
|
|
1684
1817
|
You also need ETH for gas fees.
|
|
@@ -1688,7 +1821,7 @@ You also need ETH for gas fees.
|
|
|
1688
1821
|
The payment verification failed. Check:
|
|
1689
1822
|
|
|
1690
1823
|
1. Wallet has sufficient USDC and ETH
|
|
1691
|
-
2. Network is correct (
|
|
1824
|
+
2. Network is correct (eip155:84532 for testnet vs eip155:8453 for mainnet)
|
|
1692
1825
|
3. Agent URL is reachable
|
|
1693
1826
|
4. Facilitator URL is correct
|
|
1694
1827
|
|
|
@@ -1706,16 +1839,6 @@ Check your config:
|
|
|
1706
1839
|
httpcat config --show
|
|
1707
1840
|
```
|
|
1708
1841
|
|
|
1709
|
-
### Check Wallet Balance
|
|
1710
|
-
|
|
1711
|
-
Use the balances command to check your wallet's ETH and USDC balances:
|
|
1712
|
-
|
|
1713
|
-
```bash
|
|
1714
|
-
httpcat balances
|
|
1715
|
-
```
|
|
1716
|
-
|
|
1717
|
-
This will show your wallet address, ETH balance (for gas fees), and USDC balance (for trading), with warnings if balances are low.
|
|
1718
|
-
|
|
1719
1842
|
## Examples
|
|
1720
1843
|
|
|
1721
1844
|
### Complete Workflow
|
package/additions.txt
ADDED