API Reference
Wallet API
REST API endpoints for managing spending wallets.
Wallet API
Spending wallets are self-custody wallets for calling skills. Users generate keypairs client-side, and only the public address is registered with the API.
Overview
Spending wallets enable:
- Fiat users to deposit USDC and call skills
- Self-custody - private keys never touch the server
- Multiple wallets - generate new wallets while keeping history
Register Wallet
POST /wallet/generate
Register a new spending wallet address.
Request:
Parameters:
| Field | Type | Required | Description |
|---|---|---|---|
address | string | Yes | Ethereum address (0x...) |
label | string | No | User-friendly name |
Response:
Get Active Wallet
GET /wallet
Get the user's active spending wallet with on-chain USDC balance.
Request:
Response:
The balance field is the real-time USDC balance on Base network, fetched from the blockchain.
Returns null if the user has no active wallet.
List All Wallets
GET /wallet/all
List all spending wallets including revoked ones.
Request:
Response:
Update Wallet Label
PATCH /wallet/:address
Update a wallet's label.
Request:
Parameters:
| Field | Type | Required | Description |
|---|---|---|---|
label | string | null | Yes | New label (null to remove) |
Response:
Revoke Wallet
DELETE /wallet/:address
Soft-delete (revoke) a spending wallet.
Request:
Response:
Revoking a wallet:
- Marks it as
revokedAtwith current timestamp - Removes it from the active wallet
- Does NOT affect funds - the wallet still exists on-chain
- Keeps history visible in
GET /wallet/all
Workflow Example
Error Responses
| Status | Error | Description |
|---|---|---|
| 400 | Address already registered | Address belongs to another user |
| 404 | Wallet not found | Address not registered for this user |
| 401 | Authentication required | Missing or invalid auth |