agentwallet
Original:🇺🇸 English
Translated
Wallets for AI agents with x402 payment signing, referral rewards, and policy-controlled actions.
15installs
Added on
NPX Install
npx skill4agent add frames-engineering/skills agentwalletTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →AgentWallet
AgentWallet provides server wallets for AI agents. Wallets are provisioned after email OTP verification. All signing happens server-side and is policy-controlled.
TL;DR - Quick Reference
FIRST: Check if already connected by reading . If file exists with , you're connected - DO NOT ask user for email.
~/.agentwallet/config.jsonapiTokenNeed to connect (no config file)? Ask user for email → POST to → user enters OTP → POST to → save API token.
/api/connect/start/api/connect/completex402 Payments? Use the ONE-STEP endpoint (recommended) - just send target URL + body, server handles everything.
/x402/fetchx402/fetch - ONE-STEP PAYMENT PROXY (RECOMMENDED)
This is the simplest way to call x402 APIs. Send the target URL and body - the server handles 402 detection, payment signing, and retry automatically.
bash
curl -s -X POST "https://agentwallet.mcpay.tech/api/wallets/USERNAME/actions/x402/fetch" \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{"url":"https://enrichx402.com/api/exa/search","method":"POST","body":{"query":"AI agents","numResults":3}}'That's it! The response contains the final API result:
json
{
"success": true,
"response": {
"status": 200,
"body": {"results": [...]},
"contentType": "application/json"
},
"payment": {
"chain": "eip155:8453",
"amountFormatted": "0.01 USDC",
"recipient": "0x..."
},
"paid": true,
"attempts": 2,
"duration": 1234
}x402/fetch Request Options
| Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | Target API URL (must be HTTPS in production) |
| string | No | HTTP method: GET, POST, PUT, DELETE, PATCH (default: GET) |
| object | No | Request body (auto-serialized to JSON) |
| object | No | Additional headers to send |
| string | No | |
| boolean | No | Preview payment cost without paying |
| number | No | Request timeout in ms (default: 30000, max: 120000) |
| string | No | For deduplication |
Dry Run (Preview Cost)
Add to the request body. Returns payment details without executing:
"dryRun": truejson
{
"success": true,
"dryRun": true,
"payment": {
"required": true,
"chain": "eip155:8453",
"amountFormatted": "0.01 USDC",
"policyAllowed": true
}
}Error Codes
| Code | HTTP | Description |
|---|---|---|
| 400 | URL malformed or blocked (localhost, internal IPs) |
| 403 | Policy check failed (amount too high, etc.) |
| 403 | Wallet is frozen |
| 504 | Target API timed out |
| 502 | Target API returned 5xx error |
| 402 | Payment was rejected by target API |
| 400 | No compatible payment network |
Config File Reference
Store credentials at :
~/.agentwallet/config.jsonjson
{
"username": "your-username",
"email": "your@email.com",
"evmAddress": "0x...",
"solanaAddress": "...",
"apiToken": "mf_...",
"moltbookLinked": false,
"moltbookUsername": null,
"xHandle": null
}| Field | Description |
|---|---|
| Your unique AgentWallet username |
| Email used for OTP verification |
| EVM wallet address |
| Solana wallet address |
| Fund API token for authenticated requests (starts with |
| Whether a Moltbook account is linked |
| Linked Moltbook username (if any) |
| X/Twitter handle from Moltbook (if linked) |
Security: Never commit to git. Set . Treat like a password.
chmod 600apiTokenConnect Flow
Web flow: Ask user for email → direct to → user enters 6-digit OTP → page displays credentials (, , etc.). User should save the API token securely.
https://agentwallet.mcpay.tech/connect?email=EMAILAGENTWALLET_USERNAMEAGENTWALLET_API_TOKENAPI flow (for CLI/agents):
Step 1 - Send OTP:
bash
curl -X POST https://agentwallet.mcpay.tech/api/connect/start \
-H "Content-Type: application/json" \
-d '{"email":"your@email.com"}'Returns in response. For referrals, add to body.
username"ref":"REFERRER_USERNAME"Step 2 - Ask user for OTP, then complete:
bash
curl -X POST https://agentwallet.mcpay.tech/api/connect/complete \
-H "Content-Type: application/json" \
-d '{"username":"USERNAME_FROM_STEP_1","email":"your@email.com","otp":"USER_OTP"}'Returns , , . Save the for all wallet operations.
apiTokenevmAddresssolanaAddressapiTokenReferral & Airdrop Program
Share your referral link:
https://agentwallet.mcpay.tech/connect?ref=YOUR_USERNAME&email=THEIR_EMAILBoth referrer and new agent earn airdrop points. Points: referral (200), first tx (50), daily active (10), weekly streak (100).
Tiers: Bronze (0-4, 1x), Silver (5-24, 1.5x), Gold (25-99, 2x), Diamond (100+, 3x).
Check rewards:
bash
curl https://agentwallet.mcpay.tech/api/wallets/YOUR_USERNAME/referrals \
-H "Authorization: Bearer FUND_API_TOKEN"Network Pulse
Public network stats: — returns active agents, transaction counts, volume, trending APIs.
GET https://agentwallet.mcpay.tech/api/network/pulsePersonal stats (authenticated): — returns rank, transaction history, volume, referral info, streak.
GET https://agentwallet.mcpay.tech/api/wallets/YOUR_USERNAME/statsSkill Files
| File | URL |
|---|---|
| SKILL.md (this file) | |
| HEARTBEAT.md | |
| package.json (metadata) | |
Heartbeat
Run periodically to check for skill updates, wallet status, and recent activity:
bash
curl https://agentwallet.mcpay.tech/heartbeat.mdBase URL:
https://agentwallet.mcpay.tech/api/v1Authentication
Use your Fund API token (starts with ) as:
mf_Authorization: Bearer FUND_API_TOKENCheck connection (public, no auth): — returns with wallet addresses if connected.
GET https://agentwallet.mcpay.tech/api/wallets/USERNAMEconnected: true/falseFunding Wallets
Direct users to to fund via Coinbase Onramp (card, bank, or Coinbase account). Supports Base (USDC) and Solana (SOL).
https://agentwallet.mcpay.tech/u/YOUR_USERNAMECheck balance after funding:
bash
curl https://agentwallet.mcpay.tech/api/wallets/USERNAME/balances \
-H "Authorization: Bearer FUND_API_TOKEN"Wallet Operations
Balances: (auth required)
GET /api/wallets/USERNAME/balancesActivity: (auth optional — authenticated sees all events, public sees limited). Event types: , , , .
GET /api/wallets/USERNAME/activity?limit=50otp.*policy.*wallet.action.*x402.authorization.signedActions (Policy Controlled)
EVM Transfer
bash
curl -X POST "https://agentwallet.mcpay.tech/api/wallets/USERNAME/actions/transfer" \
-H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" \
-d '{"to":"0x...","amount":"1000000","asset":"usdc","chainId":8453}'Fields: (address), (smallest units — ETH: 18 decimals, USDC: 6 decimals), ( or ), , (optional).
toamountasset"eth""usdc"chainIdidempotencyKeySupported USDC chains: Ethereum (1), Sepolia (11155111), Optimism (10), Polygon (137), Arbitrum (42161), Base (8453), Base Sepolia (84532).
Solana Transfer
bash
curl -X POST "https://agentwallet.mcpay.tech/api/wallets/USERNAME/actions/transfer-solana" \
-H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" \
-d '{"to":"RECIPIENT","amount":"1000000000","asset":"sol","network":"devnet"}'Fields: (address), (smallest units — SOL: 9 decimals, USDC: 6 decimals), ( or ), ( or ), (optional).
toamountasset"sol""usdc"network"mainnet""devnet"idempotencyKeyEVM Contract Call
bash
curl -X POST "https://agentwallet.mcpay.tech/api/wallets/USERNAME/actions/contract-call" \
-H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" \
-d '{"to":"0x...","data":"0x...","value":"0","chainId":8453}'Sign Message
bash
curl -X POST "https://agentwallet.mcpay.tech/api/wallets/USERNAME/actions/sign-message" \
-H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" \
-d '{"chain":"solana","message":"hello"}'Solana Devnet Faucet
Request free devnet SOL for testing. Sends 0.1 SOL to your Solana wallet on devnet. Rate limited to 3 requests per 24 hours.
bash
curl -X POST "https://agentwallet.mcpay.tech/api/wallets/USERNAME/actions/faucet-sol" \
-H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" \
-d '{}'Response:
{"actionId":"...","status":"confirmed","amount":"0.1 SOL","txHash":"...","explorer":"...","remaining":2}Response format for all actions:
{"actionId":"...","status":"confirmed","txHash":"...","explorer":"..."}x402 Manual Flow (Advanced)
Use this only if you need fine-grained control. For most cases, use x402/fetch above.
Protocol Versions
| Version | Payment Header | Network Format |
|---|---|---|
| v1 | | Short names ( |
| v2 | | CAIP-2 ( |
Flow
- Call target API → get 402 response. Payment info is in the HEADER (body may be empty
payment-required).{} - Sign: with
POST /api/wallets/USERNAME/actions/x402/pay. The{"requirement": "<header value or JSON>", "preferredChain": "evm"}field accepts both base64 strings and JSON objects.requirement - Retry original request with the header from response field and
usage.headervalue.paymentSignature
Signing endpoint: (x402/pay with SLASH, not dash)
/api/wallets/{USERNAME}/actions/x402/paySign Request Options
| Field | Type | Description |
|---|---|---|
| string or object | Payment requirement (base64 or JSON) |
| | Preferred blockchain |
| number | Specific EVM chain ID |
| string | For deduplication |
| boolean | Sign without storing (for testing) |
Key Rules
- Signatures are ONE-TIME USE — consumed even on failed requests
- Use single-line curl — multiline causes escaping errors
\ - USDC amounts use 6 decimals (10000 = $0.01)
- Always use field (not deprecated
requirement)paymentRequiredHeader
Supported Networks
| Network | CAIP-2 Identifier | Token |
|---|---|---|
| Base Mainnet | | USDC |
| Base Sepolia | | USDC |
| Solana Mainnet | | USDC |
| Solana Devnet | | USDC |
Common Errors
| Error | Solution |
|---|---|
| 404/405 on signing | Use |
| Use single-line curl, not multiline with |
| Get a NEW signature for each request |
| Fund wallet at |
Policies
Get current policy:
bash
curl https://agentwallet.mcpay.tech/api/wallets/YOUR_USERNAME/policy \
-H "Authorization: Bearer FUND_API_TOKEN"Update policy:
bash
curl -X PATCH https://agentwallet.mcpay.tech/api/wallets/YOUR_USERNAME/policy \
-H "Authorization: Bearer FUND_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"max_per_tx_usd":"25","allow_chains":["base","solana"],"allow_contracts":["0x..."]}'Response Format
Success:
json
{"success": true, "data": {...}}Error:
json
{"success": false, "error": "Description", "hint": "How to fix"}