Agentwallet

From lxyeternal/MalSkillBench · View interactive version

Agentwallet is an AI agent skill from the GitHub repository lxyeternal/MalSkillBench. Use this skill to safely create a wallet the agent can use for transfers, swaps, and any EVM chain transaction. Also supports raw signing.

How to use this skill

Skill file

Vincent - A wallet for agents

Use this skill to safely create a wallet the agent can use for transfers, swaps, and any EVM chain transaction without ever exposing private keys to the agent. Create a wallet, set spending policies, and your agent can transfer tokens, do swaps, and interact with smart contracts within the boundaries you define.

The agent never sees the private key. All transactions are executed server-side through a smart account. The wallet owner controls what the agent can do via configurable policies.

Which Secret Type to Use

| Type | Use Case | Network | Gas |

| ------------------- | ----------------------------------------- | ----------------------- | ---------------- |

| EVM_WALLET | Transfers, swaps, DeFi, contract calls | Any EVM chain | Sponsored (free) |

| RAW_SIGNER | Raw message signing for special protocols | Any (Ethereum + Solana) | You pay |

Choose EVM_WALLET (default) for:

Choose RAW_SIGNER only when you need:

Configuration

All API requests require a Bearer token (the API key returned when creating a wallet). If you're an openclaw instance, store and retrieve it from ~/.openclaw/credentials/agentwallet/<API_KEY_ID>.json. Otherwise, you can store it in your current working directory at agentwallet/<API_KEY_ID>.json.

Authorization: Bearer <API_KEY>

Quick Start

1. Create a Wallet

Create a new smart account wallet for your agent. This generates a private key server-side (you never see it), creates a ZeroDev smart account, and returns an API key for the agent plus a claim URL for the wallet owner.

curl -X POST "https://heyvincent.ai/api/secrets" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "EVM_WALLET",
    "memo": "My agent wallet",
    "chainId": 84532
  }'

Response includes:

After creating, tell the user:

"Here is your wallet claim URL: <claimUrl>. Use this to claim ownership, set spending policies, and monitor your agent's wallet activity."

2. Get Wallet Address

curl -X GET "https://heyvincent.ai/api/skills/evm-wallet/address" \
  -H "Authorization: Bearer <API_KEY>"

3. Check Balances

# Get all token balances across all supported chains (ETH, WETH, USDC, etc.)
curl -X GET "https://heyvincent.ai/api/skills/evm-wallet/balances" \
  -H "Authorization: Bearer <API_KEY>"

# Filter to specific chains (comma-separated chain IDs)
curl -X GET "https://heyvincent.ai/api/skills/evm-wallet/balances?chainIds=1,137,42161" \
  -H "Authorization: Bearer <API_KEY>"

Returns all ERC-20 tokens and native balances with symbols, decimals, logos, and USD values.

4. Transfer ETH or Tokens

# Transfer native ETH
curl -X POST "https://heyvincent.ai/api/skills/evm-wallet/transfer" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "0xRecipientAddress",
    "amount": "0.01"
  }'

# Transfer ERC-20 token
curl -X POST "https://heyvincent.ai/api/skills/evm-wallet/transfer" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "0xRecipientAddress",
    "amount": "100",
    "token": "0xTokenContractAddress"
  }'

5. Swap Tokens

Swap one token for another using DEX liquidity (powered by 0x).

# Preview a swap (no execution, just pricing)
curl -X POST "https://heyvincent.ai/api/skills/evm-wallet/swap/preview" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "sellToken": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
    "buyToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "sellAmount": "0.1",
    "chainId": 1
  }'

# Execute a swap
curl -X POST "https://heyvincent.ai/api/skills/evm-wallet/swap/execute" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "sellToken": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
    "buyToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "sellAmount": "0.1",
    "chainId": 1,
    "slippageBps": 100
  }'

The preview endpoint returns expected buy amount, route info, and fees without executing. The execute endpoint performs the actual swap through the smart account, handling ERC20 approvals automatically.

6. Send Arbitrary Transaction

Interact with any smart contract by sending custom calldata.

curl -X POST "https://heyvincent.ai/api/skills/evm-wallet/send-transaction" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "0xContractAddress",
    "data": "0xCalldata",
    "value": "0"
  }'

Policies

The wallet owner controls what the agent can do by setting policies via the claim URL. If a transaction violates a policy, the API will reject it or require human approval via Telegram.

| Policy | What it does |

| --------------------------- | ------------------------------------------------------------------- |

| Address allowlist | Only allow transfers/calls to specific addresses |

| Token allowlist | Only allow transfers of specific ERC-20 tokens |

| Function allowlist | Only allow calling specific contract functions (by 4-byte selector) |

| Spending limit (per tx) | Max USD value per transaction |

| Spending limit (daily) | Max USD value per rolling 24 hours |

| Spending limit (weekly) | Max USD value per rolling 7 days |

| Require approval | Every transaction needs human approval via Telegram |

| Approval threshold | Transactions above a USD amount need human approval |

If no policies are set, all actions are allowed by default. Once the owner claims the wallet and adds policies, the agent operates within those boundaries.

Re-linking (Recovering API Access)

If the agent loses its API key, the wallet owner can generate a re-link token from the frontend. The agent then exchanges this token for a new API key.

How it works:

  1. The user generates a re-link token from the wallet detail page in the frontend
  2. The user gives the token to the agent (e.g. by pasting it in chat)
  3. The agent calls the re-link endpoint to exchange the token for a new API key
curl -X POST "https://heyvincent.ai/api/secrets/relink" \
  -H "Content-Type: application/json" \
  -d '{
    "relinkToken": "<TOKEN_FROM_USER>",
    "apiKeyName": "Re-linked API Key"
  }'

Response includes:

Important: Re-link tokens are one-time use and expire after 10 minutes. No authentication is required on this endpoint -- the token itself is the authorization.

If a user tells you they have a re-link token, use this endpoint to regain access to the wallet. Store the returned API key and use it for all subsequent requests.

Important Notes


Raw Signer (Advanced)

For raw ECDSA/Ed25519 signing when smart accounts won't work.

Create a Raw Signer

curl -X POST "https://heyvincent.ai/api/secrets" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "RAW_SIGNER",
    "memo": "My raw signer"
  }'

Response includes both Ethereum (secp256k1) and Solana (ed25519) addresses derived from the same seed.

Get Addresses

curl -X GET "https://heyvincent.ai/api/skills/raw-signer/addresses" \
  -H "Authorization: Bearer <API_KEY>"

Returns ethAddress and solanaAddress.

Sign a Message

curl -X POST "https://heyvincent.ai/api/skills/raw-signer/sign" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "0x<hex-encoded-bytes>",
    "curve": "ethereum"
  }'

Returns a hex-encoded signature. For Ethereum, this is r || s || v (65 bytes). For Solana, it's a 64-byte ed25519 signature.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.