shll-skills 6.0.0 → 6.0.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/README.md +89 -89
- package/SKILL.md +9 -6
- package/dist/{chunk-2U3WQBTG.mjs → chunk-MPUPO5EJ.mjs} +280 -282
- package/dist/index.js +278 -283
- package/dist/index.mjs +4 -9
- package/dist/mcp.js +280 -287
- package/dist/mcp.mjs +6 -13
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# SHLL Skills — AI Agent DeFi Toolkit on BSC
|
|
2
2
|
|
|
3
|
-
[](https://shll.run) [](https://twitter.com/shllrun) [](https://www.npmjs.com/package/shll-skills)
|
|
3
|
+
[](https://shll.run) [](https://twitter.com/shllrun) [](https://www.npmjs.com/package/shll-skills) [](https://clawhub.ai/kledx/shll-skills)
|
|
4
4
|
|
|
5
|
-
A **CLI + MCP Server** toolkit that gives any AI agent the ability to execute DeFi operations on BSC Mainnet securely. Supports PancakeSwap V2/V3 swaps, Venus lending, Four.meme bonding curve trades, setup flows, and raw calldata execution through PolicyGuard.
|
|
6
|
-
|
|
7
|
-
Version `6.0.0` finalizes the modular layout:
|
|
8
|
-
- `shared/*` for constants, clients, schemas, errors, ABIs, and cross-cutting helpers
|
|
9
|
-
- `services/*` for single-source business logic
|
|
10
|
-
- `commands/*` and `tools/*` as thin CLI/MCP adapters
|
|
5
|
+
A **CLI + MCP Server** toolkit that gives any AI agent the ability to execute DeFi operations on BSC Mainnet securely. Supports PancakeSwap V2/V3 swaps, Venus lending, Four.meme bonding curve trades, setup flows, and raw calldata execution through PolicyGuard.
|
|
6
|
+
|
|
7
|
+
Version `6.0.0` finalizes the modular layout:
|
|
8
|
+
- `shared/*` for constants, clients, schemas, errors, ABIs, and cross-cutting helpers
|
|
9
|
+
- `services/*` for single-source business logic
|
|
10
|
+
- `commands/*` and `tools/*` as thin CLI/MCP adapters
|
|
11
11
|
|
|
12
12
|
## Install
|
|
13
13
|
|
|
@@ -74,32 +74,32 @@ The server communicates via **stdio** using JSON-RPC 2.0. Send `tools/list` to d
|
|
|
74
74
|
|
|
75
75
|
### Available MCP Tools (24 total)
|
|
76
76
|
|
|
77
|
-
| Tool | Type | Description |
|
|
78
|
-
|------|------|-------------|
|
|
79
|
-
| `portfolio` | Read | Vault holdings + token balances |
|
|
80
|
-
| `balance` | Read | BNB or token balance of the agent vault |
|
|
81
|
-
| `price` | Read | Real-time token price (DexScreener) |
|
|
82
|
-
| `search` | Read | Search token by name/symbol on BSC |
|
|
83
|
-
| `tokens` | Read | List known token symbols + addresses |
|
|
84
|
-
| `policies` | Read | View active on-chain policies + config |
|
|
85
|
-
| `status` | Read | One-shot readiness overview with blockers, warnings, and next actions |
|
|
86
|
-
| `history` | Read | Recent transactions + policy rejections |
|
|
87
|
-
| `token_restriction` | Read | View token whitelist restriction status + whitelisted tokens |
|
|
88
|
-
| `listings` | Read | Available agent templates for rent |
|
|
89
|
-
| `four_info` | Read | Query Four.meme bonding curve token info |
|
|
90
|
-
| `swap` | Write | PancakeSwap V2/V3 auto-routing swap |
|
|
91
|
-
| `wrap` | Write | BNB → WBNB in vault |
|
|
92
|
-
| `unwrap` | Write | WBNB → BNB in vault |
|
|
93
|
-
| `lend` | Write | Supply tokens to Venus for yield |
|
|
94
|
-
| `redeem` | Write | Withdraw from Venus |
|
|
95
|
-
| `transfer` | Write | Send BNB or ERC20 from vault |
|
|
96
|
-
| `four_buy` | Write | Buy a Four.meme bonding-curve token |
|
|
97
|
-
| `four_sell` | Write | Sell a Four.meme bonding-curve token |
|
|
98
|
-
| `config` | Write | Configure risk parameters (spending limits, cooldown) |
|
|
99
|
-
| `setup_guide` | Info | Generate dual-wallet onboarding URL + steps |
|
|
100
|
-
| `generate_wallet` | Info | Create new operator wallet (not the owner, mint, or vault wallet) |
|
|
101
|
-
| `execute_calldata` | Write | Execute raw calldata from any source through PolicyGuard |
|
|
102
|
-
| `execute_calldata_batch` | Write | Execute multiple calldata actions atomically through PolicyGuard |
|
|
77
|
+
| Tool | Type | Description |
|
|
78
|
+
|------|------|-------------|
|
|
79
|
+
| `portfolio` | Read | Vault holdings + token balances |
|
|
80
|
+
| `balance` | Read | BNB or token balance of the agent vault |
|
|
81
|
+
| `price` | Read | Real-time token price (DexScreener) |
|
|
82
|
+
| `search` | Read | Search token by name/symbol on BSC |
|
|
83
|
+
| `tokens` | Read | List known token symbols + addresses |
|
|
84
|
+
| `policies` | Read | View active on-chain policies + config |
|
|
85
|
+
| `status` | Read | One-shot readiness overview with blockers, warnings, and next actions |
|
|
86
|
+
| `history` | Read | Recent transactions + policy rejections |
|
|
87
|
+
| `token_restriction` | Read | View token whitelist restriction status + whitelisted tokens |
|
|
88
|
+
| `listings` | Read | Available agent templates for rent |
|
|
89
|
+
| `four_info` | Read | Query Four.meme bonding curve token info |
|
|
90
|
+
| `swap` | Write | PancakeSwap V2/V3 auto-routing swap |
|
|
91
|
+
| `wrap` | Write | BNB → WBNB in vault |
|
|
92
|
+
| `unwrap` | Write | WBNB → BNB in vault |
|
|
93
|
+
| `lend` | Write | Supply tokens to Venus for yield |
|
|
94
|
+
| `redeem` | Write | Withdraw from Venus |
|
|
95
|
+
| `transfer` | Write | Send BNB or ERC20 from vault |
|
|
96
|
+
| `four_buy` | Write | Buy a Four.meme bonding-curve token |
|
|
97
|
+
| `four_sell` | Write | Sell a Four.meme bonding-curve token |
|
|
98
|
+
| `config` | Write | Configure risk parameters (spending limits, cooldown) |
|
|
99
|
+
| `setup_guide` | Info | Generate dual-wallet onboarding URL + steps |
|
|
100
|
+
| `generate_wallet` | Info | Create new operator wallet (not the owner, mint, or vault wallet) |
|
|
101
|
+
| `execute_calldata` | Write | Execute raw calldata from any source through PolicyGuard |
|
|
102
|
+
| `execute_calldata_batch` | Write | Execute multiple calldata actions atomically through PolicyGuard |
|
|
103
103
|
|
|
104
104
|
---
|
|
105
105
|
|
|
@@ -109,58 +109,58 @@ For OpenClaw, shell scripts, or manual use.
|
|
|
109
109
|
|
|
110
110
|
### Quick Start
|
|
111
111
|
|
|
112
|
-
```bash
|
|
113
|
-
# 1. Generate an operator wallet (AI-only hot wallet)
|
|
114
|
-
shll-run generate-wallet
|
|
115
|
-
export RUNNER_PRIVATE_KEY="0x..."
|
|
116
|
-
|
|
117
|
-
# 2. Get setup link (user completes on shll.run with their OWNER wallet)
|
|
118
|
-
shll-run setup-guide -l 0xABC...DEF -d 30
|
|
119
|
-
|
|
120
|
-
# 3. After the user sends back token-id, verify readiness
|
|
121
|
-
shll-run status -k 5
|
|
122
|
-
shll-run portfolio -k 5
|
|
123
|
-
|
|
124
|
-
# 4. Trade
|
|
125
|
-
shll-run swap -f BNB -t USDC -a 0.1 -k 5
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
In OpenClaw, AI should set `RUNNER_PRIVATE_KEY` for the current session automatically. Do not ask the user to edit environment variables manually during chat onboarding.
|
|
112
|
+
```bash
|
|
113
|
+
# 1. Generate an operator wallet (AI-only hot wallet)
|
|
114
|
+
shll-run generate-wallet
|
|
115
|
+
export RUNNER_PRIVATE_KEY="0x..."
|
|
116
|
+
|
|
117
|
+
# 2. Get setup link (user completes on shll.run with their OWNER wallet)
|
|
118
|
+
shll-run setup-guide -l 0xABC...DEF -d 30
|
|
119
|
+
|
|
120
|
+
# 3. After the user sends back token-id, verify readiness
|
|
121
|
+
shll-run status -k 5
|
|
122
|
+
shll-run portfolio -k 5
|
|
123
|
+
|
|
124
|
+
# 4. Trade
|
|
125
|
+
shll-run swap -f BNB -t USDC -a 0.1 -k 5
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
In OpenClaw, AI should set `RUNNER_PRIVATE_KEY` for the current session automatically. Do not ask the user to edit environment variables manually during chat onboarding.
|
|
129
129
|
|
|
130
130
|
### Commands
|
|
131
131
|
|
|
132
132
|
#### Trading
|
|
133
133
|
```bash
|
|
134
|
-
shll-run swap -f <FROM> -t <TO> -a <AMT> -k <ID> # Auto V2/V3 routing
|
|
135
|
-
shll-run swap -f BNB -t USDT -a 0.1 -k 5 -v v3 -s 2 # Use V3 with 2% slippage
|
|
136
|
-
shll-run wrap -a <BNB> -k <ID> # BNB -> WBNB
|
|
137
|
-
shll-run unwrap -a <BNB> -k <ID> # WBNB -> BNB
|
|
138
|
-
shll-run transfer --token <SYM> -a <AMT> --to <ADDR> -k <ID>
|
|
139
|
-
shll-run four_buy --token <ADDR> -a <BNB> -k <ID> # Buy on Four.meme bonding curve
|
|
140
|
-
shll-run four_sell --token <ADDR> -a <TOKEN_AMT> -k <ID> # Sell on Four.meme bonding curve
|
|
134
|
+
shll-run swap -f <FROM> -t <TO> -a <AMT> -k <ID> # Auto V2/V3 routing
|
|
135
|
+
shll-run swap -f BNB -t USDT -a 0.1 -k 5 -v v3 -s 2 # Use V3 with 2% slippage
|
|
136
|
+
shll-run wrap -a <BNB> -k <ID> # BNB -> WBNB
|
|
137
|
+
shll-run unwrap -a <BNB> -k <ID> # WBNB -> BNB
|
|
138
|
+
shll-run transfer --token <SYM> -a <AMT> --to <ADDR> -k <ID>
|
|
139
|
+
shll-run four_buy --token <ADDR> -a <BNB> -k <ID> # Buy on Four.meme bonding curve
|
|
140
|
+
shll-run four_sell --token <ADDR> -a <TOKEN_AMT> -k <ID> # Sell on Four.meme bonding curve
|
|
141
141
|
```
|
|
142
142
|
|
|
143
143
|
#### Lending (Venus Protocol)
|
|
144
144
|
```bash
|
|
145
|
-
shll-run lend -t USDT -a 100 -k <ID> # Supply to Venus
|
|
146
|
-
shll-run redeem -t USDT -a 50 -k <ID> # Withdraw from Venus
|
|
145
|
+
shll-run lend -t USDT -a 100 -k <ID> # Supply to Venus
|
|
146
|
+
shll-run redeem -t USDT -a 50 -k <ID> # Withdraw from Venus
|
|
147
147
|
```
|
|
148
148
|
|
|
149
149
|
#### Market Data (read-only)
|
|
150
150
|
```bash
|
|
151
|
-
shll-run portfolio -k <ID> # Vault holdings + USD values
|
|
152
|
-
shll-run price --token <SYM> # Real-time price (DexScreener)
|
|
153
|
-
shll-run search --query <TEXT> # Find token by name
|
|
154
|
-
shll-run tokens # List known tokens
|
|
155
|
-
shll-run four_info --token <ADDR> # Four.meme token status
|
|
151
|
+
shll-run portfolio -k <ID> # Vault holdings + USD values
|
|
152
|
+
shll-run price --token <SYM> # Real-time price (DexScreener)
|
|
153
|
+
shll-run search --query <TEXT> # Find token by name
|
|
154
|
+
shll-run tokens # List known tokens
|
|
155
|
+
shll-run four_info --token <ADDR> # Four.meme token status
|
|
156
156
|
```
|
|
157
157
|
|
|
158
158
|
#### Risk Management
|
|
159
|
-
```bash
|
|
160
|
-
shll-run policies -k <ID> # View active on-chain policies
|
|
161
|
-
shll-run status -k <ID> # Readiness, blockers, warnings, next actions
|
|
162
|
-
shll-run config -k <ID> --tx-limit <BNB> --daily-limit <BNB> --cooldown <SEC>
|
|
163
|
-
```
|
|
159
|
+
```bash
|
|
160
|
+
shll-run policies -k <ID> # View active on-chain policies
|
|
161
|
+
shll-run status -k <ID> # Readiness, blockers, warnings, next actions
|
|
162
|
+
shll-run config -k <ID> --tx-limit <BNB> --daily-limit <BNB> --cooldown <SEC>
|
|
163
|
+
```
|
|
164
164
|
|
|
165
165
|
---
|
|
166
166
|
|
|
@@ -173,34 +173,34 @@ AI Agent -> CLI/MCP -> PolicyClient.validate() -> PolicyGuard (on-chain) -> vaul
|
|
|
173
173
|
1. AI constructs a tool call (MCP) or CLI command
|
|
174
174
|
2. `PolicyClient.validate()` simulates against all on-chain policies
|
|
175
175
|
3. If approved, `AgentNFA.execute()` routes through PolicyGuard → vault
|
|
176
|
-
4. PolicyGuard enforces: spending limits, cooldowns, recipient checks, and protocol rules
|
|
176
|
+
4. PolicyGuard enforces: spending limits, cooldowns, recipient checks, and protocol rules
|
|
177
177
|
|
|
178
178
|
## Security: Dual-Wallet Architecture
|
|
179
179
|
|
|
180
|
-
| | Owner Wallet | Operator Wallet (RUNNER_PRIVATE_KEY) |
|
|
181
|
-
|---|---|---|
|
|
182
|
-
| **Who holds it** | User (MetaMask/hardware) | AI agent |
|
|
183
|
-
| **Use it for** | Rent or mint the agent, hold the Agent NFT, authorize operator | Pay gas and execute policy-limited actions |
|
|
184
|
-
| **Can trade** | — | ✅ Within PolicyGuard limits |
|
|
185
|
-
| **Can withdraw vault** | ✅ | ❌ |
|
|
186
|
-
| **Can transfer NFT** | ✅ | ❌ |
|
|
187
|
-
| **Risk if leaked** | 🚨 Full vault access | ⚠️ Limited to policy-allowed trades |
|
|
188
|
-
|
|
189
|
-
Do not use the operator wallet to mint or rent the agent. Do not hold the Agent NFT in the operator wallet. Keep only a small BNB balance there for gas.
|
|
190
|
-
|
|
191
|
-
After setup, run `status` first. It returns a machine-friendly readiness object with:
|
|
192
|
-
- `readiness.ready`
|
|
193
|
-
- `readiness.blockers`
|
|
194
|
-
- `readiness.warnings`
|
|
195
|
-
- `readiness.nextActions`
|
|
196
|
-
|
|
197
|
-
This is the intended handoff for AI onboarding flows before any trading command.
|
|
180
|
+
| | Owner Wallet | Operator Wallet (RUNNER_PRIVATE_KEY) |
|
|
181
|
+
|---|---|---|
|
|
182
|
+
| **Who holds it** | User (MetaMask/hardware) | AI agent |
|
|
183
|
+
| **Use it for** | Rent or mint the agent, hold the Agent NFT, authorize operator | Pay gas and execute policy-limited actions |
|
|
184
|
+
| **Can trade** | — | ✅ Within PolicyGuard limits |
|
|
185
|
+
| **Can withdraw vault** | ✅ | ❌ |
|
|
186
|
+
| **Can transfer NFT** | ✅ | ❌ |
|
|
187
|
+
| **Risk if leaked** | 🚨 Full vault access | ⚠️ Limited to policy-allowed trades |
|
|
188
|
+
|
|
189
|
+
Do not use the operator wallet to mint or rent the agent. Do not hold the Agent NFT in the operator wallet. Keep only a small BNB balance there for gas.
|
|
190
|
+
|
|
191
|
+
After setup, run `status` first. It returns a machine-friendly readiness object with:
|
|
192
|
+
- `readiness.ready`
|
|
193
|
+
- `readiness.blockers`
|
|
194
|
+
- `readiness.warnings`
|
|
195
|
+
- `readiness.nextActions`
|
|
196
|
+
|
|
197
|
+
This is the intended handoff for AI onboarding flows before any trading command.
|
|
198
198
|
|
|
199
199
|
## Environment Variables
|
|
200
200
|
|
|
201
201
|
| Variable | Required | Description |
|
|
202
202
|
|----------|----------|-------------|
|
|
203
|
-
| `RUNNER_PRIVATE_KEY` | Yes for write ops and agent-linked reads | Operator wallet key (~$1 BNB for gas) |
|
|
203
|
+
| `RUNNER_PRIVATE_KEY` | Yes for write ops and agent-linked reads | Operator wallet key (~$1 BNB for gas) |
|
|
204
204
|
| `SHLL_RPC` | No | BSC RPC URL override. Recommended: use a private RPC (e.g. QuickNode, Alchemy, GetBlock) for better reliability and speed |
|
|
205
205
|
|
|
206
206
|
> **Note:** Contract addresses (AgentNFA, PolicyGuard) are hardcoded for security reasons. Override env vars are intentionally not supported to prevent supply-chain attacks.
|
package/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: shll-run
|
|
3
3
|
description: Execute DeFi transactions on BSC via SHLL AgentNFA. The AI handles all commands and users only need to chat.
|
|
4
|
-
version: 6.0.
|
|
4
|
+
version: 6.0.2
|
|
5
5
|
author: SHLL Team
|
|
6
6
|
website: https://shll.run
|
|
7
7
|
twitter: https://twitter.com/shllrun
|
|
@@ -68,7 +68,7 @@ On-chain guardrails:
|
|
|
68
68
|
- Spending limits, cooldowns, whitelist rules, and protocol rules are enforced on-chain.
|
|
69
69
|
- Raw calldata is blocked if the recipient cannot be decoded safely.
|
|
70
70
|
|
|
71
|
-
## Current Critical Constraints (v6.0.
|
|
71
|
+
## Current Critical Constraints (v6.0.2)
|
|
72
72
|
|
|
73
73
|
1. `init` command is disabled. Do not use it.
|
|
74
74
|
2. Raw calldata remains high risk; rely on strict recipient safety checks.
|
|
@@ -146,11 +146,10 @@ Write commands include:
|
|
|
146
146
|
- `raw`
|
|
147
147
|
- `lend`
|
|
148
148
|
- `redeem`
|
|
149
|
-
- `config`
|
|
150
149
|
- `four_buy`
|
|
151
150
|
- `four_sell`
|
|
152
151
|
|
|
153
|
-
Read-only commands
|
|
152
|
+
Read-only commands (no confirmation needed): `config`, `policies`, `status`, `history`, `portfolio`, `price`, `tokens`, `search`, `balance`, `four_info`.
|
|
154
153
|
|
|
155
154
|
## CLI Commands
|
|
156
155
|
|
|
@@ -187,6 +186,7 @@ If `-l/--listing` is omitted, `setup-guide` auto-selects an active listing from
|
|
|
187
186
|
|
|
188
187
|
### Read-only and audit
|
|
189
188
|
|
|
189
|
+
- `shll-run config -k <tokenId>` (view-only; modify via web console)
|
|
190
190
|
- `shll-run portfolio -k <tokenId>`
|
|
191
191
|
- `shll-run price --token <symbolOrAddress>`
|
|
192
192
|
- `shll-run search --query <text>`
|
|
@@ -239,10 +239,13 @@ When the user provides a token address:
|
|
|
239
239
|
5. `Unable to decode recipient from calldata`
|
|
240
240
|
- Use built-in command flow or provide calldata with a decodable vault recipient.
|
|
241
241
|
|
|
242
|
-
6. `
|
|
242
|
+
6. `No V2/V3 liquidity or direct path found`
|
|
243
|
+
- The pair does not exist or lacks liquidity. DO NOT tell the user to wrap BNB to WBNB; the `swap` command handles native BNB automatically via `swapExactETHForTokens`. If a swap fails, it's because the direct pool is empty or invalid, not because BNB is unplugged.
|
|
244
|
+
|
|
245
|
+
7. `init command is disabled`
|
|
243
246
|
- Use `setup-guide` instead.
|
|
244
247
|
|
|
245
|
-
|
|
248
|
+
8. Unsure what is broken
|
|
246
249
|
- Check the structured `errorCode`, `message`, and `details` fields in the JSON response first.
|
|
247
250
|
|
|
248
251
|
## Product UX Rules
|