aawp-skill 1.5.0 → 1.6.8
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 +64 -6
- package/SKILL.md +550 -0
- package/bin/install.js +21 -2
- package/package.json +47 -4
package/README.md
CHANGED
|
@@ -61,16 +61,15 @@ AAWP ships as an [Agent Skills](https://agentskills.io) compatible skill — wor
|
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
63
|
# Universal — auto-detects your AI client
|
|
64
|
-
curl -fsSL https://aawp.ai/install.sh | sh
|
|
65
|
-
|
|
66
|
-
# npm / npx
|
|
67
64
|
npx aawp-ai
|
|
68
65
|
|
|
69
|
-
#
|
|
70
|
-
|
|
66
|
+
# Git (OpenClaw / full daemon + all scripts)
|
|
67
|
+
git clone https://github.com/aawp-ai/aawp.git ~/.agents/skills/aawp
|
|
71
68
|
```
|
|
72
69
|
|
|
73
70
|
> **OpenClaw** is the only client with a persistent background daemon, enabling autonomous DCA strategies, price alerts, and scheduled transactions without a live session.
|
|
71
|
+
>
|
|
72
|
+
> ⚠️ `clawhub install aawp` is temporarily unavailable — the skill was incorrectly flagged by ClawHub's automated scanner due to the precompiled native signing binary and daemon process (core components of the protocol). Use `git clone` for the full install.
|
|
74
73
|
|
|
75
74
|
---
|
|
76
75
|
|
|
@@ -169,6 +168,56 @@ All LP fees flow back to the AAWP wallet automatically.
|
|
|
169
168
|
|
|
170
169
|
---
|
|
171
170
|
|
|
171
|
+
### Yield / DeFi
|
|
172
|
+
|
|
173
|
+
Earn yield via **Aave V3** (Base, Ethereum, Arbitrum, Optimism, Polygon) and **Venus Protocol** (BSC).
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
node scripts/yield.js --chain base rates # Browse supply/borrow APYs
|
|
177
|
+
node scripts/yield.js --chain base supply USDC 100 # Supply 100 USDC
|
|
178
|
+
node scripts/yield.js --chain base withdraw USDC 50 # Withdraw 50 USDC
|
|
179
|
+
node scripts/yield.js --chain base borrow USDC 200 # Borrow against collateral
|
|
180
|
+
node scripts/yield.js --chain base repay USDC 200 # Repay debt (max to clear)
|
|
181
|
+
node scripts/yield.js --chain base positions # View all open positions
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### NFT Operations
|
|
185
|
+
|
|
186
|
+
Manage ERC-721 and ERC-1155 tokens across all 6 chains.
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
node scripts/nft.js --chain base balance # List all NFTs owned
|
|
190
|
+
node scripts/nft.js --chain base info <contract> <tokenId> # Token metadata + owner
|
|
191
|
+
node scripts/nft.js --chain base transfer <contract> <tokenId> <to>
|
|
192
|
+
node scripts/nft.js --chain base approve <contract> <tokenId> <operator>
|
|
193
|
+
node scripts/nft.js --chain base mint <contract> [tokenId] # ERC-1155 mint
|
|
194
|
+
node scripts/nft.js --chain base floor <contract> # Floor price (OpenSea/BscScan)
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Limit Orders
|
|
198
|
+
|
|
199
|
+
Place on-chain limit orders via **CoW Protocol** (Base, Ethereum, Arbitrum, Optimism, Polygon) and **1inch Limit Order v4** (BSC).
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
node scripts/limit-order.js --chain base place ETH USDC 0.1 3000 # Sell 0.1 ETH at $3000
|
|
203
|
+
node scripts/limit-order.js --chain base list # Open orders
|
|
204
|
+
node scripts/limit-order.js --chain base cancel <orderUid> # Cancel
|
|
205
|
+
node scripts/limit-order.js --chain base status <orderUid> # Check fill status
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Cross-chain Portfolio
|
|
209
|
+
|
|
210
|
+
Parallel snapshot of all balances across all 6 chains with USD pricing.
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
node scripts/portfolio.js # Full portfolio — all chains
|
|
214
|
+
node scripts/portfolio.js --chain base # Single chain breakdown
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Output: native + ERC-20 balances, USD value per asset, total net worth.
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
172
221
|
### Backup & restore
|
|
173
222
|
|
|
174
223
|
```bash
|
|
@@ -176,7 +225,7 @@ node scripts/wallet-manager.js backup ./aawp-backup.tar.gz
|
|
|
176
225
|
node scripts/wallet-manager.js restore ./aawp-backup.tar.gz
|
|
177
226
|
```
|
|
178
227
|
|
|
179
|
-
> The backup includes 6 critical files: `seed.enc`, `aawp-core.node`,
|
|
228
|
+
> The backup includes 6 critical files: `seed.enc`, `aawp-core.node`, hardware-binding anchors, and the Guardian key. All 6 are required to restore access. Keep it offline and encrypted.
|
|
180
229
|
|
|
181
230
|
---
|
|
182
231
|
|
|
@@ -242,6 +291,15 @@ Same address on every chain via CREATE2 vanity deployment:
|
|
|
242
291
|
|
|
243
292
|
Verified on: BaseScan · Etherscan · Arbiscan · Optimistic Etherscan · BscScan · PolygonScan
|
|
244
293
|
|
|
294
|
+
### $AAWP Token
|
|
295
|
+
|
|
296
|
+
| | |
|
|
297
|
+
|---|---|
|
|
298
|
+
| **Token** | [`0x1f959d5498c3b1f4527201a67b9a483b3eecf74d`](https://basescan.org/token/0x1f959d5498c3b1f4527201a67b9a483b3eecf74d) |
|
|
299
|
+
| **Chain** | Base |
|
|
300
|
+
| **Deployed by** | AAWP AI Wallet ([`0x85bd...ecc8`](https://basescan.org/address/0x85bdA4ad53927FDBe42fB02Dd878E8035D92ecc8)) via Clanker V4 |
|
|
301
|
+
| **Tokenomics** | 80% public liquidity · 20% ecosystem (30d cliff + 3y vesting) |
|
|
302
|
+
|
|
245
303
|
---
|
|
246
304
|
|
|
247
305
|
## License
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aawp
|
|
3
|
+
version: 1.6.8
|
|
4
|
+
description: >
|
|
5
|
+
AAWP (AI Agent Wallet Protocol) — the only crypto wallet protocol built exclusively
|
|
6
|
+
for AI Agents on EVM-compatible blockchains. Not for humans. The signer is the AI Agent
|
|
7
|
+
itself, cryptographically bound at wallet creation. Supports wallet lifecycle management,
|
|
8
|
+
token transfers, DEX swaps, cross-chain bridging, arbitrary contract interactions,
|
|
9
|
+
DCA automation, and price alerts.
|
|
10
|
+
environment:
|
|
11
|
+
- name: AAWP_GUARDIAN_KEY
|
|
12
|
+
description: "Private key for the Guardian gas-relay wallet (auto-generated in config/guardian.json if not set)"
|
|
13
|
+
required: false
|
|
14
|
+
- name: AAWP_GAS_KEY
|
|
15
|
+
description: "Alias for AAWP_GUARDIAN_KEY"
|
|
16
|
+
required: false
|
|
17
|
+
- name: AAWP_WALLET
|
|
18
|
+
description: "Pinned wallet address — prevents accidental operations on wrong wallet"
|
|
19
|
+
required: false
|
|
20
|
+
- name: AAWP_CONFIG
|
|
21
|
+
description: "Override config directory path (default: ./config)"
|
|
22
|
+
required: false
|
|
23
|
+
- name: AAWP_CORE
|
|
24
|
+
description: "Override native addon directory path (default: ./core)"
|
|
25
|
+
required: false
|
|
26
|
+
- name: AAWP_SKILL
|
|
27
|
+
description: "Override skill root directory path"
|
|
28
|
+
required: false
|
|
29
|
+
- name: AAWP_AI_TOKEN
|
|
30
|
+
description: "Daemon auth token (auto-generated at startup, not user-supplied)"
|
|
31
|
+
required: false
|
|
32
|
+
credentials:
|
|
33
|
+
- name: "Guardian Key"
|
|
34
|
+
description: "ECDSA private key for the gas-relay wallet. Auto-generated on first provision and stored in config/guardian.json. Used ONLY to pay gas fees — never holds user assets."
|
|
35
|
+
- name: "Encrypted Seed"
|
|
36
|
+
description: "Agent signing seed, encrypted at rest. Generated during provisioning, stored in the .agent-config directory. This is the agent's on-chain signing authority."
|
|
37
|
+
persistence:
|
|
38
|
+
- type: daemon
|
|
39
|
+
description: "Local signing daemon (background process) listens on a Unix socket at /tmp/.aawp-daemon.*. Holds the signing key in memory during operation. Managed via ensure-daemon.sh / restart-daemon.sh."
|
|
40
|
+
- type: files
|
|
41
|
+
description: "Writes to config/ and .agent-config/ directories, plus a daemon PID lock under /tmp/."
|
|
42
|
+
- type: cron
|
|
43
|
+
description: "DCA strategies and price alerts register OpenClaw cron jobs for autonomous scheduled execution."
|
|
44
|
+
native_binary:
|
|
45
|
+
file: core/aawp-core.node
|
|
46
|
+
hash_file: core/aawp-core.node.hash
|
|
47
|
+
description: >
|
|
48
|
+
Precompiled Node.js N-API addon (linux-x64) for cryptographic operations.
|
|
49
|
+
Built from Rust via napi-rs. Hash recorded in aawp-core.node.hash.
|
|
50
|
+
source: "https://github.com/aawp-ai/aawp"
|
|
51
|
+
verification: "On-chain factory approveBinary(hash) — only whitelisted builds can operate wallets"
|
|
52
|
+
architecture: linux-x64
|
|
53
|
+
runtime: "Node.js N-API (ABI stable)"
|
|
54
|
+
risk_disclosure: >
|
|
55
|
+
This skill runs a persistent signing daemon and can autonomously submit
|
|
56
|
+
on-chain transactions as the AI Agent. It manages encrypted private key material
|
|
57
|
+
and a precompiled native binary. DCA/price-alert features register cron jobs.
|
|
58
|
+
The on-chain factory enforces both binary approval and AI-exclusive ownership —
|
|
59
|
+
only whitelisted AI Agent daemon builds can create or operate wallets. Humans
|
|
60
|
+
cannot be the signer. Review the guardian architecture and verify binary
|
|
61
|
+
provenance before installing.
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
# AAWP — AI Agent Wallet Protocol
|
|
65
|
+
|
|
66
|
+
> **📦 Installer-Only Package**
|
|
67
|
+
> The ClawHub/npm package (`aawp-skill`) contains only this manifest (SKILL.md), README, and a small `bin/install.js` bootstrap.
|
|
68
|
+
> The full runtime stack — native signing addon (`core/aawp-core.node`), wallet scripts (`scripts/*.js`), and daemon — is fetched from [github.com/aawp-ai/aawp](https://github.com/aawp-ai/aawp) during `bash scripts/provision.sh`.
|
|
69
|
+
> The native binary hash is verified on-chain via the AAWP factory (`approveBinary(hash)`) before any wallet operation is permitted.
|
|
70
|
+
|
|
71
|
+
> **⚠️ Human Approval Required**
|
|
72
|
+
> The following actions **must be confirmed by a human** before execution:
|
|
73
|
+
> - First-time provisioning (`provision.sh`) — generates and encrypts the agent signing seed
|
|
74
|
+
> - Wallet creation (`wallet-manager.js create`) — deploys on-chain contract
|
|
75
|
+
> - DCA / price-alert cron registration — grants the agent autonomous recurring transaction rights
|
|
76
|
+
> - Factory binary approval (`approveBinary`) — whitelists the running binary on all chains
|
|
77
|
+
>
|
|
78
|
+
> All other operations (balance checks, quotes, reads) are safe to run autonomously.
|
|
79
|
+
|
|
80
|
+
The only crypto wallet protocol built exclusively for AI Agents. Not for humans.
|
|
81
|
+
|
|
82
|
+
AAWP enforces a single invariant: the signer is the AI Agent itself — locked in at wallet creation, immutable, verifiable on-chain. AI Agents manage their own on-chain assets across EVM networks through a guardian-based architecture. Transactions are signed locally via a sharded-key daemon — no human approval per tx, with full recovery and freeze capabilities for the human guardian.
|
|
83
|
+
|
|
84
|
+
**Networks:** Ethereum · Base · BNB Chain · Polygon · Optimism · Arbitrum
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Architecture Overview
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
┌─────────────────────────────────────────────────┐
|
|
92
|
+
│ AI Agent (OpenClaw) │
|
|
93
|
+
│ ┌───────────────┐ ┌──────────────────────┐ │
|
|
94
|
+
│ │ wallet-manager│───▶│ Signing Daemon │ │
|
|
95
|
+
│ │ dca / alerts │ │ (Unix socket) │ │
|
|
96
|
+
│ └───────────────┘ │ ┌──────────────────┐ │ │
|
|
97
|
+
│ │ │ aawp-core.node │ │ │
|
|
98
|
+
│ │ │ (Rust N-API) │ │ │
|
|
99
|
+
│ │ └──────────────────┘ │ │
|
|
100
|
+
│ └──────────┬───────────┘ │
|
|
101
|
+
│ │ sign │
|
|
102
|
+
│ ┌───────────────┐ ▼ │
|
|
103
|
+
│ │ Guardian Key │──▶ Pay gas ──▶ EVM Chain │
|
|
104
|
+
│ │ (gas only) │ │ │
|
|
105
|
+
│ └───────────────┘ ┌──────────▼───────────┐ │
|
|
106
|
+
│ │ Smart Contract Wallet │ │
|
|
107
|
+
│ │ (holds assets) │ │
|
|
108
|
+
│ └──────────────────────┘ │
|
|
109
|
+
└─────────────────────────────────────────────────┘
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Key separation:** Guardian pays gas → Wallet holds assets → Daemon signs transactions.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Quick Reference
|
|
117
|
+
|
|
118
|
+
| Task | Command |
|
|
119
|
+
|------|---------|
|
|
120
|
+
| Create wallet | `wallet-manager.js --chain base create` |
|
|
121
|
+
| Check balance | `wallet-manager.js --chain base balance` |
|
|
122
|
+
| Send ETH | `wallet-manager.js --chain base send <to> <amount>` |
|
|
123
|
+
| Send ERC-20 | `wallet-manager.js --chain base send-token USDC <to> <amount>` |
|
|
124
|
+
| Get swap quote | `wallet-manager.js --chain base quote ETH USDC 0.01` |
|
|
125
|
+
| Execute swap | `wallet-manager.js --chain base swap ETH USDC 0.01` |
|
|
126
|
+
| Bridge cross-chain | `wallet-manager.js --chain base bridge ETH optimism 0.1` |
|
|
127
|
+
| Contract call | `wallet-manager.js --chain base call <addr> "fn(args)" ...` |
|
|
128
|
+
| Contract read | `wallet-manager.js --chain base read <addr> "fn() returns (uint)" ...` |
|
|
129
|
+
| DCA strategy | `dca.js add --chain base --from ETH --to USDC --amount 0.01 --cron "0 9 * * *"` |
|
|
130
|
+
| Price alert | `price-alert.js add --chain base --from ETH --to USDC --above 2600 --notify` |
|
|
131
|
+
| Cross-chain portfolio | `portfolio.js` |
|
|
132
|
+
| Single chain portfolio | `portfolio.js --chain base` |
|
|
133
|
+
| Limit order | `limit-order.js --chain base create ETH USDC 0.1 2700` |
|
|
134
|
+
| List orders | `limit-order.js --chain base list` |
|
|
135
|
+
| List NFTs | `nft.js --chain base balance` |
|
|
136
|
+
| NFT transfer | `nft.js --chain base transfer <contract> <tokenId> <to>` |
|
|
137
|
+
| NFT floor price | `nft.js --chain eth floor <contract>` |
|
|
138
|
+
| Yield rates | `yield.js --chain base rates` |
|
|
139
|
+
| Supply collateral | `yield.js --chain base supply USDC 1000` |
|
|
140
|
+
| Borrow | `yield.js --chain base borrow USDC 200` |
|
|
141
|
+
| Aave positions | `yield.js --chain base positions` |
|
|
142
|
+
| Diagnostics | `bash scripts/doctor.sh` |
|
|
143
|
+
| Backup | `wallet-manager.js backup ./backup.tar.gz` |
|
|
144
|
+
|
|
145
|
+
All commands: `node scripts/wallet-manager.js --help`
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Getting Started
|
|
150
|
+
|
|
151
|
+
### 1. Provision
|
|
152
|
+
|
|
153
|
+
First run is automatic — `ensure-daemon.sh` detects a missing seed and provisions.
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
bash scripts/provision.sh # Initialize
|
|
157
|
+
bash scripts/provision.sh --reset # Full reset (⚠️ destroys existing wallet)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### 2. Create Wallet
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
node scripts/wallet-manager.js --chain base create
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
If the Guardian needs gas, you'll see a funding guide with the Guardian address and private key.
|
|
167
|
+
|
|
168
|
+
### 3. Pin & Fund
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
export AAWP_WALLET=0x... # Pin your wallet address
|
|
172
|
+
# Send a small amount of native token to the wallet address
|
|
173
|
+
node scripts/wallet-manager.js --chain base balance
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### 4. Test
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
node scripts/wallet-manager.js --chain base quote ETH USDC 0.001
|
|
180
|
+
node scripts/wallet-manager.js --chain base swap ETH USDC 0.001
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
> After fresh provisioning, verify the daemon binary hash is approved on the factory contract. If not, the factory owner must call `approveBinary(hash)`.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Wallet Manager CLI
|
|
188
|
+
|
|
189
|
+
**Entry point:** `node scripts/wallet-manager.js`
|
|
190
|
+
**Chain flag:** `--chain <base|bsc|polygon|optimism|arbitrum|ethereum>`
|
|
191
|
+
|
|
192
|
+
### Wallet Lifecycle
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
wallet-manager.js --chain base status # Status overview
|
|
196
|
+
wallet-manager.js --chain base balance # Native + token balances
|
|
197
|
+
wallet-manager.js --chain base portfolio # Full portfolio view
|
|
198
|
+
wallet-manager.js compute-address # Predict wallet address
|
|
199
|
+
wallet-manager.js --chain base history # Transaction history
|
|
200
|
+
wallet-manager.js --chain base upgrade-signer # Rotate signer key
|
|
201
|
+
wallet-manager.js --chain base guardian-chains # Guardian chain info
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Transfers
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
wallet-manager.js --chain base send <recipient> <amount>
|
|
208
|
+
wallet-manager.js --chain base send-token <symbol> <recipient> <amount>
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Trading
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
wallet-manager.js --chain base quote <from> <to> <amount> # Preview (no gas)
|
|
215
|
+
wallet-manager.js --chain base swap <from> <to> <amount> # Execute
|
|
216
|
+
wallet-manager.js --chain base bridge <token> <dest> <amount> # Cross-chain
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Approvals
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
wallet-manager.js --chain base approve <token> <spender> <amount>
|
|
223
|
+
wallet-manager.js --chain base allowance <token> <spender>
|
|
224
|
+
wallet-manager.js --chain base revoke <token> <spender>
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Contract Interaction
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
# Write (sends tx)
|
|
231
|
+
wallet-manager.js --chain base call <contract> "transfer(address,uint256)" 0xTo 1000
|
|
232
|
+
|
|
233
|
+
# Read (free)
|
|
234
|
+
wallet-manager.js --chain base read <contract> "balanceOf(address) returns (uint256)" 0xAddr
|
|
235
|
+
|
|
236
|
+
# Batch (atomic)
|
|
237
|
+
wallet-manager.js --chain base batch ./calls.json
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Batch format:
|
|
241
|
+
```json
|
|
242
|
+
[
|
|
243
|
+
{ "to": "0x...", "sig": "approve(address,uint256)", "args": ["0x...", "1000000"] },
|
|
244
|
+
{ "to": "0x...", "sig": "transfer(address,uint256)", "args": ["0x...", "500000"] }
|
|
245
|
+
]
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Address Book
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
wallet-manager.js addr add <label> <address>
|
|
252
|
+
wallet-manager.js addr list
|
|
253
|
+
wallet-manager.js addr get <label>
|
|
254
|
+
wallet-manager.js addr remove <label>
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### RPC & Backup
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
wallet-manager.js get-rpc
|
|
261
|
+
wallet-manager.js --chain base set-rpc <url|default>
|
|
262
|
+
wallet-manager.js backup ./backup.tar.gz
|
|
263
|
+
wallet-manager.js restore ./backup.tar.gz
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## DCA Automation
|
|
269
|
+
|
|
270
|
+
**Entry point:** `node scripts/dca.js`
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
dca.js add --chain base --from ETH --to USDC --amount 0.01 --cron "0 9 * * *" --name "Daily ETH→USDC"
|
|
274
|
+
dca.js list
|
|
275
|
+
dca.js run <id>
|
|
276
|
+
dca.js history <id>
|
|
277
|
+
dca.js remove <id>
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Registers an OpenClaw cron job that executes swaps on schedule.
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Price Alerts
|
|
285
|
+
|
|
286
|
+
**Entry point:** `node scripts/price-alert.js`
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
# Notification only
|
|
290
|
+
price-alert.js add --chain base --from ETH --to USDC --above 2600 --notify
|
|
291
|
+
|
|
292
|
+
# Auto-swap on trigger
|
|
293
|
+
price-alert.js add --chain base --from ETH --to USDC --below 2200 --notify --auto-swap 0.01
|
|
294
|
+
|
|
295
|
+
price-alert.js list
|
|
296
|
+
price-alert.js check
|
|
297
|
+
price-alert.js remove <id>
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Daemon Management
|
|
303
|
+
|
|
304
|
+
| Script | Purpose |
|
|
305
|
+
|--------|---------|
|
|
306
|
+
| `scripts/doctor.sh` | Full diagnostic check |
|
|
307
|
+
| `scripts/ensure-daemon.sh` | Start daemon if not running (auto-provisions on first run) |
|
|
308
|
+
| `scripts/restart-daemon.sh` | Force restart |
|
|
309
|
+
|
|
310
|
+
Run `doctor.sh` before sensitive operations or when signing seems off.
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## Cross-Chain Portfolio View
|
|
315
|
+
|
|
316
|
+
**Entry point:** `node scripts/portfolio.js`
|
|
317
|
+
**Supported chains:** All 6 (base · eth · arb · op · polygon · bsc) — queried **in parallel**
|
|
318
|
+
|
|
319
|
+
### Commands
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
portfolio.js # Full cross-chain summary with USD values
|
|
323
|
+
portfolio.js --chain base # Single chain only
|
|
324
|
+
portfolio.js --no-prices # Skip CoinGecko pricing (faster)
|
|
325
|
+
portfolio.js --hide-zero # Hide zero-balance tokens
|
|
326
|
+
portfolio.js --json # Raw JSON output (for automation)
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Output Includes
|
|
330
|
+
- Native balance per chain (ETH / BNB / MATIC)
|
|
331
|
+
- All ERC-20 token balances via **Multicall3** (1 RPC call per chain)
|
|
332
|
+
- USD value per token (CoinGecko public API)
|
|
333
|
+
- **Total portfolio value** across all chains
|
|
334
|
+
- **Top 8 holdings** ranked by USD value with % allocation
|
|
335
|
+
- **Multi-chain holdings** — same token aggregated across chains
|
|
336
|
+
|
|
337
|
+
**Tokens tracked:** USDC, USDT, WETH, DAI, WBTC, BNB/WBNB, MATIC, ARB, OP, CAKE, AERO, GMX, PEPE, and more per chain.
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
## Limit Orders (CoW Protocol — Gasless)
|
|
342
|
+
|
|
343
|
+
**Entry point:** `node scripts/limit-order.js`
|
|
344
|
+
**Supported chains:** `eth` · `base` · `arb` · `op` · `polygon` (CoW Protocol) · `bsc` (1inch Limit Orders)
|
|
345
|
+
|
|
346
|
+
Orders are signed off-chain (EIP-712) and settled by solvers — **no gas on order creation** (except BSC cancel which is on-chain).
|
|
347
|
+
|
|
348
|
+
### Commands
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
limit-order.js --chain base create ETH USDC 0.1 2700 # Sell 0.1 ETH at ≥2700 USDC
|
|
352
|
+
limit-order.js --chain eth create USDC ETH 1000 0.00037 # Buy ETH with 1000 USDC
|
|
353
|
+
limit-order.js --chain base list # List open orders
|
|
354
|
+
limit-order.js --chain base history # All orders (filled/expired)
|
|
355
|
+
limit-order.js --chain base cancel <orderUid> # Cancel open order
|
|
356
|
+
limit-order.js --chain base create ETH USDC 0.1 2700 --expiry 48 # 48h validity
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
**Notes:**
|
|
360
|
+
- First-time use requires one ERC-20 approval transaction (CoW VaultRelayer)
|
|
361
|
+
- `price` = amount of buyToken per 1 sellToken
|
|
362
|
+
- Orders persist in `config/limit-orders.json` for local tracking
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
## NFT Operations (ERC-721 & ERC-1155)
|
|
367
|
+
|
|
368
|
+
**Entry point:** `node scripts/nft.js`
|
|
369
|
+
**Supported chains:** All 6 chains (BSC via BscScan NFT API)
|
|
370
|
+
|
|
371
|
+
### Commands
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
nft.js --chain base balance # List all NFTs (via Alchemy public API)
|
|
375
|
+
nft.js --chain eth balance --contract 0xBC4C... # NFTs from specific collection
|
|
376
|
+
nft.js --chain eth info 0xBC4C... 1234 # Token metadata, owner, traits
|
|
377
|
+
nft.js --chain base transfer 0xNFT... 42 0xTo... # ERC-721 transfer
|
|
378
|
+
nft.js --chain base transfer 0xNFT... 42 0xTo... 5 # ERC-1155 transfer (amount=5)
|
|
379
|
+
nft.js --chain base approve 0xNFT... 0xOperator... # setApprovalForAll = true
|
|
380
|
+
nft.js --chain base revoke 0xNFT... 0xOperator... # setApprovalForAll = false
|
|
381
|
+
nft.js --chain base mint 0xContract... # Call mint() on contract
|
|
382
|
+
nft.js --chain base mint 0xContract... 0xcalldata # Mint with custom calldata
|
|
383
|
+
nft.js --chain eth floor 0xBC4C... # Floor price from OpenSea
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
**Notes:**
|
|
387
|
+
- `balance` auto-detects ERC-721 vs ERC-1155 and fetches metadata
|
|
388
|
+
- `info` resolves IPFS URIs and displays traits
|
|
389
|
+
- `floor` queries OpenSea public API; Blur link provided for ETH collections
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
## Yield / DeFi (Aave V3)
|
|
394
|
+
|
|
395
|
+
**Entry point:** `node scripts/yield.js`
|
|
396
|
+
**Supported chains:** `base` · `eth` · `arb` · `op` · `polygon` (Aave V3) · `bsc` (Venus Protocol)
|
|
397
|
+
|
|
398
|
+
### Commands
|
|
399
|
+
|
|
400
|
+
```bash
|
|
401
|
+
yield.js --chain base rates # Show supply/borrow APY for all tokens
|
|
402
|
+
yield.js --chain base positions # Show active Aave positions & health factor
|
|
403
|
+
yield.js --chain base supply USDC 1000 # Supply 1000 USDC as collateral
|
|
404
|
+
yield.js --chain base withdraw USDC 500 # Withdraw 500 USDC
|
|
405
|
+
yield.js --chain base withdraw USDC max # Full withdrawal
|
|
406
|
+
yield.js --chain base borrow USDC 200 # Borrow 200 USDC (variable rate, default)
|
|
407
|
+
yield.js --chain base borrow USDC 200 --rate stable # Borrow at stable rate
|
|
408
|
+
yield.js --chain base repay USDC 200 # Repay partial debt
|
|
409
|
+
yield.js --chain base repay USDC max # Full repayment
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
### Supported Tokens by Chain
|
|
413
|
+
|
|
414
|
+
| Chain | Tokens |
|
|
415
|
+
|---------|--------|
|
|
416
|
+
| base | USDC, WETH, cbBTC, USDbC |
|
|
417
|
+
| eth | USDC, USDT, DAI, WBTC, WETH |
|
|
418
|
+
| arb | USDC, USDT, WETH, WBTC, DAI |
|
|
419
|
+
| op | USDC, USDT, WETH, WBTC, DAI |
|
|
420
|
+
| polygon | USDC, USDT, WETH, WBTC, DAI, WMATIC |
|
|
421
|
+
|
|
422
|
+
> **Safety note:** Always check your health factor after borrowing. Health factor < 1.0 triggers liquidation. Use `positions` to monitor.
|
|
423
|
+
|
|
424
|
+
---
|
|
425
|
+
|
|
426
|
+
## Token Launch (Clanker V4)
|
|
427
|
+
|
|
428
|
+
Deploy a token via your AAWP wallet as the on-chain deployer, admin, and LP fee recipient.
|
|
429
|
+
|
|
430
|
+
**Script:** `scripts/deploy-clanker.js`
|
|
431
|
+
|
|
432
|
+
### Supported chains
|
|
433
|
+
|
|
434
|
+
| Key | Chain | ChainId |
|
|
435
|
+
|-----|-------|---------|
|
|
436
|
+
| `base` | Base | 8453 |
|
|
437
|
+
| `eth` | Ethereum | 1 |
|
|
438
|
+
| `arb` | Arbitrum | 42161 |
|
|
439
|
+
| `unichain` | Unichain | 130 |
|
|
440
|
+
| `bera` | Berachain | 143 |
|
|
441
|
+
| `bsc` | BSC | 56 |
|
|
442
|
+
|
|
443
|
+
### Usage
|
|
444
|
+
|
|
445
|
+
```bash
|
|
446
|
+
# 1. Edit CONFIG at the top of the script
|
|
447
|
+
# 2. Preview (no broadcast)
|
|
448
|
+
node scripts/deploy-clanker.js --dry-run
|
|
449
|
+
|
|
450
|
+
# 3. Deploy
|
|
451
|
+
node scripts/deploy-clanker.js
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
### CONFIG reference
|
|
455
|
+
|
|
456
|
+
```js
|
|
457
|
+
const CONFIG = {
|
|
458
|
+
chain: 'base', // base | eth | arb | unichain | bera | bsc
|
|
459
|
+
name: 'My Token',
|
|
460
|
+
symbol: 'MTK',
|
|
461
|
+
image: 'https://...', // square image URL
|
|
462
|
+
description: '...',
|
|
463
|
+
website: '', // optional
|
|
464
|
+
twitter: '', // optional
|
|
465
|
+
|
|
466
|
+
initialMarketCap: 10, // ETH (min ~10 ≈ $25K FDV)
|
|
467
|
+
poolPositions: 'Standard', // Standard | Project | TwentyETH
|
|
468
|
+
feeConfig: 'StaticBasic', // StaticBasic (1%) | DynamicBasic | Dynamic3
|
|
469
|
+
devBuyEth: 0.003, // ETH to buy at launch (0 to skip)
|
|
470
|
+
|
|
471
|
+
vault: {
|
|
472
|
+
enabled: false, // true = lock a portion of supply
|
|
473
|
+
percentage: 20, // % of supply (1–90)
|
|
474
|
+
lockupDays: 7, // cliff (min 7 days)
|
|
475
|
+
vestingDays: 180, // linear unlock after cliff
|
|
476
|
+
},
|
|
477
|
+
|
|
478
|
+
tokenAdmin: null, // null = AAWP wallet
|
|
479
|
+
rewardRecipient: null, // null = AAWP wallet (receives LP fees)
|
|
480
|
+
};
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
> **How it works:** the AAWP wallet calls `Clanker.deployToken()` directly (gas limit 8M).
|
|
484
|
+
> `tokenAdmin` and all LP fee rewards default to the AAWP wallet — the AI Agent owns its token end-to-end.
|
|
485
|
+
|
|
486
|
+
---
|
|
487
|
+
|
|
488
|
+
## Deployment Reference
|
|
489
|
+
|
|
490
|
+
AAWP contracts share identical addresses across all chains via CREATE2 vanity deployment:
|
|
491
|
+
|
|
492
|
+
| Contract | Address |
|
|
493
|
+
|----------|---------|
|
|
494
|
+
| **Factory Proxy** | `0xAAAA3Df87F112c743BbC57c4de1700C72eB7aaAA` |
|
|
495
|
+
| **Identity Proxy** | `0xAAAafBf6F88367C75A9B701fFb4684Df6bCA1D1d` |
|
|
496
|
+
|
|
497
|
+
Verified on: Etherscan · BaseScan · BscScan · PolygonScan · Optimistic Etherscan · Arbiscan
|
|
498
|
+
|
|
499
|
+
---
|
|
500
|
+
|
|
501
|
+
## Security
|
|
502
|
+
|
|
503
|
+
| Rule | Why |
|
|
504
|
+
|------|-----|
|
|
505
|
+
| **Fund the wallet, not the guardian** | Guardian only pays gas — your assets live in the wallet contract |
|
|
506
|
+
| **Pin wallet address** | `export AAWP_WALLET=0x...` prevents operating on wrong address |
|
|
507
|
+
| **Quote before swap** | Preview rates and slippage before executing |
|
|
508
|
+
| **Start small** | Test with minimal amounts on new chains or operations |
|
|
509
|
+
| **Never expose secrets** | Seeds, keys, shards must never appear in logs or chat |
|
|
510
|
+
| **Verify binary approval** | Confirm daemon hash is approved on factory after provisioning |
|
|
511
|
+
|
|
512
|
+
---
|
|
513
|
+
|
|
514
|
+
## Troubleshooting
|
|
515
|
+
|
|
516
|
+
| Error | Fix |
|
|
517
|
+
|-------|-----|
|
|
518
|
+
| `E_AI_GATE` / `hmac_mismatch` | Restart daemon: `bash scripts/restart-daemon.sh` |
|
|
519
|
+
| `InvalidSignature` | Verify signer alignment and binary approval on factory |
|
|
520
|
+
| `Call failed` | Check balance, gas, and transaction parameters |
|
|
521
|
+
| `E40` / `E41` | Kill duplicate daemon process, then restart |
|
|
522
|
+
| `BinaryNotApproved` | Factory owner must call `approveBinary(hash)` on all 6 chains |
|
|
523
|
+
| TX reverts with ~1M gas used | Add `--gas-limit 8000000` — Clanker V4 / Uniswap V4 ops need up to 6M |
|
|
524
|
+
|
|
525
|
+
---
|
|
526
|
+
|
|
527
|
+
## File Structure
|
|
528
|
+
|
|
529
|
+
```
|
|
530
|
+
aawp/
|
|
531
|
+
├── SKILL.md # This document
|
|
532
|
+
├── WALLET_SETUP.md # First-time setup guide
|
|
533
|
+
├── config/
|
|
534
|
+
│ ├── chains.json # Network RPC & contract addresses
|
|
535
|
+
│ └── guardian.json # Guardian wallet (auto-generated, gitignored)
|
|
536
|
+
├── scripts/
|
|
537
|
+
│ ├── wallet-manager.js # Primary CLI
|
|
538
|
+
│ ├── dca.js # DCA automation
|
|
539
|
+
│ ├── price-alert.js # Price alert system
|
|
540
|
+
│ ├── provision.sh # Initial provisioning
|
|
541
|
+
│ ├── doctor.sh # Diagnostics
|
|
542
|
+
│ ├── ensure-daemon.sh # Daemon lifecycle
|
|
543
|
+
│ └── restart-daemon.sh # Force restart
|
|
544
|
+
├── core/
|
|
545
|
+
│ ├── aawp-core.node # Native signing addon (linux-x64)
|
|
546
|
+
│ ├── aawp-core.node.hash # Binary integrity hash
|
|
547
|
+
│ ├── loader.js # Addon loader
|
|
548
|
+
│ └── index.d.ts # TypeScript declarations
|
|
549
|
+
└── daemon/ # Daemon implementation
|
|
550
|
+
```
|
package/bin/install.js
CHANGED
|
@@ -11,6 +11,15 @@ const SKILL_NAME = 'aawp';
|
|
|
11
11
|
const RAW_BASE = 'https://raw.githubusercontent.com/aawp-ai/aawp/main/skills/aawp';
|
|
12
12
|
const FALLBACK = 'https://aawp.ai/skill';
|
|
13
13
|
|
|
14
|
+
// ── Content validation ────────────────────────────────────────────────────────
|
|
15
|
+
function validateSkillMd(content, sourceUrl) {
|
|
16
|
+
// Must be a valid SKILL.md with expected markers
|
|
17
|
+
if (!content.startsWith('---')) throw new Error('Downloaded content is not a valid SKILL.md (missing YAML frontmatter)');
|
|
18
|
+
if (!content.includes('name: aawp')) throw new Error('Downloaded SKILL.md does not match expected skill identity');
|
|
19
|
+
if (!content.includes('aawp.ai')) throw new Error('Downloaded SKILL.md failed content integrity check');
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
|
|
14
23
|
// ── ANSI colors ───────────────────────────────────────────────────────────────
|
|
15
24
|
const isTTY = process.stdout.isTTY;
|
|
16
25
|
const c = (code, s) => isTTY ? `\x1b[${code}m${s}\x1b[0m` : s;
|
|
@@ -49,11 +58,19 @@ async function fetchText(url) {
|
|
|
49
58
|
}
|
|
50
59
|
|
|
51
60
|
async function downloadSkillMd() {
|
|
61
|
+
const primaryUrl = `${RAW_BASE}/SKILL.md`;
|
|
62
|
+
const fallbackUrl = `${FALLBACK}/SKILL.md`;
|
|
63
|
+
let content, sourceUrl;
|
|
52
64
|
try {
|
|
53
|
-
|
|
65
|
+
content = await fetchText(primaryUrl);
|
|
66
|
+
sourceUrl = primaryUrl;
|
|
54
67
|
} catch {
|
|
55
|
-
|
|
68
|
+
content = await fetchText(fallbackUrl);
|
|
69
|
+
sourceUrl = fallbackUrl;
|
|
56
70
|
}
|
|
71
|
+
info(`Source: ${dim(sourceUrl)}`);
|
|
72
|
+
validateSkillMd(content, sourceUrl);
|
|
73
|
+
return content;
|
|
57
74
|
}
|
|
58
75
|
|
|
59
76
|
// ── Client detection ──────────────────────────────────────────────────────────
|
|
@@ -118,6 +135,8 @@ async function main() {
|
|
|
118
135
|
console.log('');
|
|
119
136
|
console.log(` ${bold('AAWP Skill Installer')} ${dim('v' + VERSION)}`);
|
|
120
137
|
console.log(` ${dim('AI Agent Wallet Protocol — aawp.ai')}`);
|
|
138
|
+
console.log(` ${dim('This package installs the SKILL.md manifest only.')}`);
|
|
139
|
+
console.log(` ${dim('Runtime binary + scripts are fetched from GitHub during provisioning.')}`);
|
|
121
140
|
console.log('');
|
|
122
141
|
|
|
123
142
|
const detected = CLIENTS.filter(c => c.detect());
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aawp-skill",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "AAWP — AI Agent Wallet Protocol skill installer",
|
|
3
|
+
"version": "1.6.8",
|
|
4
|
+
"description": "AAWP — AI Agent Wallet Protocol skill installer (installer-only; runtime files fetched from GitHub at provisioning time)",
|
|
5
5
|
"bin": {
|
|
6
6
|
"aawp-skill": "bin/install.js"
|
|
7
7
|
},
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"bin/install.js",
|
|
13
|
-
"README.md"
|
|
13
|
+
"README.md",
|
|
14
|
+
"SKILL.md"
|
|
14
15
|
],
|
|
15
16
|
"keywords": ["aawp", "ai-agent", "wallet", "web3", "skill"],
|
|
16
17
|
"author": "aawp-ai",
|
|
@@ -19,5 +20,47 @@
|
|
|
19
20
|
"type": "git",
|
|
20
21
|
"url": "https://github.com/aawp-ai/aawp.git"
|
|
21
22
|
},
|
|
22
|
-
"homepage": "https://aawp.ai"
|
|
23
|
+
"homepage": "https://aawp.ai",
|
|
24
|
+
"clawhub": {
|
|
25
|
+
"installType": "installer",
|
|
26
|
+
"note": "This package is an installer manifest only. The native binary (aawp-core.node), wallet scripts, and provisioning tools are downloaded from https://github.com/aawp-ai/aawp at runtime via 'bash scripts/provision.sh'. The native binary hash is verified on-chain via the AAWP factory contract before any wallet operations.",
|
|
27
|
+
"capabilities": [
|
|
28
|
+
"wallet-lifecycle",
|
|
29
|
+
"evm-transactions",
|
|
30
|
+
"signing-daemon",
|
|
31
|
+
"cron-dca",
|
|
32
|
+
"cron-price-alerts"
|
|
33
|
+
],
|
|
34
|
+
"humanApprovalRequired": [
|
|
35
|
+
"provision (first-time wallet creation)",
|
|
36
|
+
"binary verification (approveBinary on factory)"
|
|
37
|
+
],
|
|
38
|
+
"env": [
|
|
39
|
+
{
|
|
40
|
+
"name": "AAWP_WALLET",
|
|
41
|
+
"description": "Pinned wallet address — prevents accidental operations on wrong wallet",
|
|
42
|
+
"required": false
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "AAWP_GUARDIAN_KEY",
|
|
46
|
+
"description": "Private key for Guardian gas-relay wallet (auto-generated if not set)",
|
|
47
|
+
"required": false
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "AAWP_CONFIG",
|
|
51
|
+
"description": "Override config directory path (default: ./config)",
|
|
52
|
+
"required": false
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "AAWP_CORE",
|
|
56
|
+
"description": "Override native addon directory path (default: ./core)",
|
|
57
|
+
"required": false
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "AAWP_SKILL",
|
|
61
|
+
"description": "Override skill root directory path",
|
|
62
|
+
"required": false
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
23
66
|
}
|