Wallet Balance Skill
Multi-chain asset overview. Zero config required.
What This Does
Query wallet balances across multiple chains:
- - EVM Chains: Ethereum, BSC, Base, Arbitrum, Polygon
- Bitcoin: BTC addresses
- Address Memory: Remember addresses for quick re-query
- Portfolio View: Combined total across all chains
Optional: Configure Tokenview API for comprehensive token coverage.
Installation
Prerequisites
- - Node.js 18+ - Required to run the gateway
- Redis (optional) - For caching and rate limiting
Quick Install
CODEBLOCK0
The gateway will start on port 3000 (or set PORT in .env).
Quick Start
CODEBLOCK1
Commands
Query Single Address
CODEBLOCK2
Parameters:
- -
input - Wallet address (0x..., bc1..., etc.) or ENS/BNB domain - INLINECODE3 - Skip cache and fetch fresh data
Example Response:
CODEBLOCK3
Query Memory (Multiple Addresses)
CODEBLOCK4
Returns combined portfolio across all remembered addresses.
Memory Management
CODEBLOCK5
Supported Inputs
| Type | Example | Notes |
|---|
| EVM Address | INLINECODE4 | Any EVM chain |
| BTC Address |
bc1q... or
1A... | Bitcoin mainnet |
| ENS Domain |
vitalik.eth | Ethereum name service |
| BNB Domain |
example.bnb | BSC name service |
Data Sources
| Configuration | Coverage |
|---|
| No Tokenview | ETH, BSC native + USDT only |
| With Tokenview |
Full multi-chain portfolio |
Environment Variables
| Variable | Default | Description |
|---|
| INLINECODE9 | 3000 | Gateway port |
| INLINECODE10 |
- | Optional Redis for caching |
|
TOKENVIEW_API_KEY | - | Optional for full coverage |
|
ETH_RPC_URL | PublicNode | Ethereum RPC endpoint |
|
BNB_RPC_URL | PublicNode | BSC RPC endpoint |
Response Format
Single Address Response
- -
total_usd - Total portfolio value in USD - INLINECODE15 - Assets grouped by chain
- INLINECODE16 - Token balances and values
- INLINECODE17 -
public_only or INLINECODE19 - INLINECODE20 - Data source attribution
Memory Query Response
- - INLINECODE21
- INLINECODE22 - Array of individual address results
- INLINECODE23 - Aggregated portfolio value
Security Notes
- - Local HTTP Server: This skill starts a local HTTP server on the configured port (default 3000)
- File Persistence: Address memory is persisted to
remembered-addresses.json by default, or the path specified by INLINECODE25 - External Requests: Wallet addresses are sent to external services (RPC providers, CoinGecko, optionally Tokenview)
- No Private Keys: This skill never requires or handles private keys
- Redis Optional: Service works without Redis, but with no caching or rate limiting
- Rate Limiting: When Redis is available, requests are rate-limited per IP and address
Health Check
CODEBLOCK6
Maintainer: Antalpha AI Team
License: MIT
技能名称: wallet-balance
详细描述:
钱包余额技能
多链资产概览。无需配置。
功能说明
跨多条链查询钱包余额:
- - EVM链:以太坊、BSC、Base、Arbitrum、Polygon
- 比特币:BTC地址
- 地址记忆:记住地址以便快速重新查询
- 投资组合视图:所有链的合并总额
可选:配置Tokenview API以获取全面的代币覆盖。
安装
前提条件
- - Node.js 18+ - 运行网关所需
- Redis(可选) - 用于缓存和速率限制
快速安装
bash
cd skills/wallet-balance
npm install
npm start
网关将在端口3000上启动(或在.env中设置PORT)。
快速开始
bash
查询单个地址
curl http://127.0.0.1:3000/agent-skills/v1/assets?input=0x...
从记忆中查询
curl http://127.0.0.1:3000/agent-skills/v1/assets?from_memory=1
添加地址到记忆
curl -X POST http://127.0.0.1:3000/agent-skills/v1/memory \
-H Content-Type: application/json \
-d {add:0x...}
命令
查询单个地址
bash
GET /agent-skills/v1/assets?input=<地址或域名>
参数:
- - input - 钱包地址(0x...、bc1...等)或ENS/BNB域名
- refresh=1 - 跳过缓存并获取最新数据
示例响应:
json
{
status: ok,
address: 0x...,
total_usd: 5188.18,
chains: [
{
chain: Ethereum,
chain_id: 1,
tokens: [
{
symbol: USDT,
amount: 5185.5,
value_usd: 5184.26,
token_kind: erc20
},
{
symbol: ETH,
amount: 0.00179932,
value_usd: 3.92,
token_kind: native
}
]
}
],
datasource: publiconly,
attribution: Data aggregated by Antalpha AI
}
查询记忆(多个地址)
bash
GET /agent-skills/v1/assets?from_memory=1
返回所有已记忆地址的合并投资组合。
记忆管理
bash
列出已记忆的地址
GET /agent-skills/v1/memory
添加地址
POST /agent-skills/v1/memory
Body: {add: 0x...} 或 {add: [0x..., bc1...]}
移除地址
POST /agent-skills/v1/memory
Body: {remove: 0x...}
支持的输入
| 类型 | 示例 | 备注 |
|---|
| EVM地址 | 0x4Da2...C0490 | 任何EVM链 |
| BTC地址 |
bc1q... 或 1A... | 比特币主网 |
| ENS域名 | vitalik.eth | 以太坊名称服务 |
| BNB域名 | example.bnb | BSC名称服务 |
数据源
| 配置 | 覆盖范围 |
|---|
| 无Tokenview | 仅ETH、BSC原生代币 + USDT |
| 有Tokenview |
完整的多链投资组合 |
环境变量
| 变量 | 默认值 | 描述 |
|---|
| PORT | 3000 | 网关端口 |
| REDIS_URL |
- | 可选的Redis用于缓存 |
| TOKENVIEW
APIKEY | - | 可选,用于完整覆盖 |
| ETH
RPCURL | PublicNode | 以太坊RPC端点 |
| BNB
RPCURL | PublicNode | BSC RPC端点 |
响应格式
单个地址响应
- - totalusd - 投资组合总价值(美元)
- chains[] - 按链分组的资产
- chains[].tokens[] - 代币余额和价值
- datasource - public_only 或 tokenview
- attribution - 数据来源归属
记忆查询响应
- - querymode: memory
- results[] - 各个地址结果的数组
- combinedtotal_usd - 汇总的投资组合价值
安全说明
- - 本地HTTP服务器:此技能在配置的端口(默认3000)上启动一个本地HTTP服务器
- 文件持久化:地址记忆默认持久化到remembered-addresses.json,或由MEMORYSTOREPATH指定的路径
- 外部请求:钱包地址会发送到外部服务(RPC提供商、CoinGecko,可选Tokenview)
- 无私钥:此技能从不要求或处理私钥
- Redis可选:服务无需Redis即可运行,但无缓存或速率限制
- 速率限制:当Redis可用时,请求按IP和地址进行速率限制
健康检查
bash
curl http://127.0.0.1:3000/healthz
维护者:Antalpha AI团队
许可证:MIT