agentwallet
EVM wallet with accountability for autonomous agents. Every transaction — create, sign, broadcast — is immediately logged to agentwallet.json. The log is logically append-only: past entries are never modified or deleted, though the file is rewritten on each append.
⚠️ High-impact tool. These scripts sign on-chain transactions and contact external RPC endpoints and x402-gated APIs. Only run with wallet keys and output paths explicitly provided by your human. Always confirm --max-amount is set for x402 flows.
Install
This skill is distributed via ClawHub. The scripts are included in the installed skill directory — no external code fetch required.
Dependencies (install once if not present):
CODEBLOCK0
Usage
Arbitrary contract call (e.g. bridge, custom protocol):
python3 agentwallet/scripts/log_transaction.py 0.004 ETH Linea 0xBridgeContract "bridge to Base" \
--wallet-key ~/.secrets/eth_wallet.json \
--rpc https://rpc.linea.build \
--calldata 0x1234abcd... \
--output ~/website/treasury.json
Signs and broadcasts a raw contract call with custom calldata. Logs the transaction automatically.
x402 payment to a gated API (e.g. Actors.dev email, GateSkip):
python3 agentwallet/scripts/x402_request.py \
--url https://actors.dev/emails \
--wallet-key ~/.secrets/eth_wallet.json \
--rpc https://mainnet.base.org \
--output ~/website/treasury.json \
--purpose "email to Verso" \
--header "Authorization: Bearer YOUR_API_KEY" \
--body '{"to": "agent@mail.actors.dev", "subject": "Hi", "body": "Hello!"}' \
--max-amount 0.02 \
--pay-to 0x3604712bd95ba2ff36b624f3ffeb6b73b34604ea
Handles full 402→sign EIP-712→retry flow. Logs USDC spend automatically.
Always set
--max-amount. Use
--pay-to only when the facilitator address is stable — some providers (e.g. Actors.dev via Stripe) rotate it per request by design, so
--pay-to would always abort.
Uniswap V3 swap (e.g. ETH → USDC on Base):
python3 agentwallet/scripts/log_transaction.py 0.0012 ETH Base - "swap ETH to USDC" \
--wallet-key ~/.secrets/eth_wallet.json \
--rpc https://mainnet.base.org \
--swap-to 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 \
--asset-out USDC --decimals-out 6
Logs two entries automatically: ETH out + USDC in.
CODEBLOCK4
Send ETH:
CODEBLOCK5
Send ERC20 (e.g. USDC on Base, 6 decimals):
CODEBLOCK6
Log only (no broadcast):
CODEBLOCK7
Options
| Option | Description |
|---|
| INLINECODE5 | JSON file with "private_key" field. Required for broadcasting. |
| INLINECODE7 |
EVM-compatible RPC endpoint. Required for broadcasting. |
|
--contract <addr> | ERC20 contract address. Omit for native ETH. |
|
--decimals <int> | Token decimals. Default: 18. USDC = 6. |
|
--output <path> | Path to
agentwallet.json.
Required — ask your human if unsure. |
|
--tx-hash <hash> | Skip broadcast, log an existing hash only. |
|
--direction <sent\|received> | Direction of the transaction. Default:
sent. Use
received to log incoming transactions (requires
--tx-hash). |
|
--calldata <hex> | Raw calldata hex (with or without
0x prefix) — triggers arbitrary contract call instead of transfer. |
|
--swap-to <contract> | Output token contract address — triggers Uniswap V3 swap instead of transfer. |
|
--asset-out <symbol> | Output asset symbol for the log (default: TOKEN). |
|
--decimals-out <int> | Output token decimals (default: 6). |
|
--fee <int> | Uniswap V3 pool fee tier in bps (default: 500 = 0.05%). |
|
--min-out <amount> | Minimum output amount in human units (e.g.
2.4). Enables slippage protection — swap reverts if output is below this. Recommended for larger swaps. |
Wallet JSON format
CODEBLOCK8
Keep at chmod 600. Never commit to git.
Log format
CODEBLOCK9
Rules
- - Log before or immediately after every transaction — never batch or defer
- Use
"pending" for tx hash if not yet confirmed - Never modify or delete past log entries — the log is a permanent audit trail
- If
--wallet-key or --output are not known, ask your human before proceeding - For x402 flows, always confirm
--max-amount is set to prevent signing unexpected amounts
Docs
Full documentation: https://cdnsoft.github.io/agentwallet
agentwallet
具备自主代理问责能力的EVM钱包。每笔交易——创建、签名、广播——都会立即记录到agentwallet.json中。该日志逻辑上仅可追加:过往条目不会被修改或删除,但每次追加时文件会被重写。
⚠️ 高风险工具。 这些脚本会签署链上交易,并连接外部RPC端点及x402网关API。仅在人类明确提供钱包密钥和输出路径时运行。对于x402流程,务必确认已设置--max-amount参数。
安装
本技能通过ClawHub分发。脚本包含在已安装的技能目录中——无需额外获取外部代码。
依赖项(如未安装,只需安装一次):
bash
pip install eth-account requests
使用方法
任意合约调用(例如:跨链桥、自定义协议):
bash
python3 agentwallet/scripts/log_transaction.py 0.004 ETH Linea 0xBridgeContract bridge to Base \
--wallet-key ~/.secrets/eth_wallet.json \
--rpc https://rpc.linea.build \
--calldata 0x1234abcd... \
--output ~/website/treasury.json
使用自定义calldata签署并广播原始合约调用。自动记录交易。
向网关API支付x402费用(例如:Actors.dev邮件、GateSkip):
bash
python3 agentwallet/scripts/x402_request.py \
--url https://actors.dev/emails \
--wallet-key ~/.secrets/eth_wallet.json \
--rpc https://mainnet.base.org \
--output ~/website/treasury.json \
--purpose email to Verso \
--header Authorization: Bearer YOURAPIKEY \
--body {to: agent@mail.actors.dev, subject: Hi, body: Hello!} \
--max-amount 0.02 \
--pay-to 0x3604712bd95ba2ff36b624f3ffeb6b73b34604ea
处理完整的402→签署EIP-712→重试流程。自动记录USDC支出。
务必设置--max-amount。仅在协调方地址固定时使用--pay-to——某些提供商(例如通过Stripe的Actors.dev)会按设计为每个请求轮换地址,因此--pay-to将始终中止。
Uniswap V3兑换(例如:Base链上ETH兑换USDC):
bash
python3 agentwallet/scripts/log_transaction.py 0.0012 ETH Base - swap ETH to USDC \
--wallet-key ~/.secrets/eth_wallet.json \
--rpc https://mainnet.base.org \
--swap-to 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 \
--asset-out USDC --decimals-out 6
自动记录两条条目:ETH转出 + USDC转入。
bash
python3 agentwallet/scripts/log_transaction.py [options]
发送ETH:
bash
python3 agentwallet/scripts/log_transaction.py 0.001 ETH Base 0xRecipient fund wallet \
--wallet-key ~/.secrets/eth_wallet.json \
--rpc https://mainnet.base.org
发送ERC20代币(例如:Base链上USDC,6位小数):
bash
python3 agentwallet/scripts/log_transaction.py 0.02 USDC Base 0xRecipient GateSkip captcha \
--wallet-key ~/.secrets/eth_wallet.json \
--rpc https://mainnet.base.org \
--contract 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 \
--decimals 6
仅记录(不广播):
bash
python3 agentwallet/scripts/log_transaction.py 0.02 USDC Base 0xRecipient manual payment \
--tx-hash 0xabc123...
选项
| 选项 | 描述 |
|---|
| --wallet-key <路径> | 包含private_key字段的JSON文件。广播交易时必需。 |
| --rpc <URL> |
兼容EVM的RPC端点。广播交易时必需。 |
| --contract <地址> | ERC20合约地址。发送原生ETH时省略。 |
| --decimals <整数> | 代币小数位数。默认值:18。USDC = 6。 |
| --output <路径> | agentwallet.json的路径。
必需——如果不确定,请询问人类。 |
| --tx-hash <哈希> | 跳过广播,仅记录现有哈希。 |
| --direction
| 交易方向。默认值:sent。使用received记录转入交易(需要--tx-hash)。 |
| --calldata <十六进制> | 原始calldata十六进制(带或不带0x前缀)——触发任意合约调用而非转账。 |
| --swap-to <合约> | 输出代币合约地址——触发Uniswap V3兑换而非转账。 |
| --asset-out <符号> | 用于日志的输出资产符号(默认值:TOKEN)。 |
| --decimals-out <整数> | 输出代币小数位数(默认值:6)。 |
| --fee <整数> | Uniswap V3池费率(以基点为单位,默认值:500 = 0.05%)。 |
| --min-out <金额> | 最小输出金额(以人类单位表示,例如2.4)。启用滑点保护——如果输出低于此值,兑换将回滚。建议用于较大金额的兑换。 |
钱包JSON格式
json
{ private_key: 0x... }
保持chmod 600权限。切勿提交到git。
日志格式
json
{
transactions: [
{
date: 2026-04-01T10:00:00Z,
amount: 0.02,
asset: USDC,
network: Base,
to: 0xRecipient...,
purpose: GateSkip captcha solve,
tx_hash: 0xabc123...
}
]
}
规则
- - 在每笔交易之前或之后立即记录——绝不批量处理或延迟
- 如果交易哈希尚未确认,使用pending状态
- 绝不修改或删除过往日志条目——日志是永久的审计追踪
- 如果--wallet-key或--output未知,在继续之前询问人类
- 对于x402流程,务必确认已设置--max-amount,以防止签署意外金额
文档
完整文档:https://cdnsoft.github.io/agentwallet