TopRank Skills

Home / Claw Skills / Search / etherscan
Official OpenClaw rules 36%

etherscan

Query EVM chain data via Etherscan API v2. Use for on-chain lookups where Etherscan v2 applies: balances, transactions, token transfers (ERC-20/721/1155), contract source/ABI, gas prices, event logs, and verification of transaction completion. Also trigger when another tool submits a transaction and you need to confirm it finalized on-chain.

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 etherscan 技能。 若已安装,则直接安装 etherscan 技能。

Overview

Skill Key
0xv4l3nt1n3/etherscan
Author
0xv4l3nt1n3
Source Repo
openclaw/skills
Version
-
Source Path
skills/0xv4l3nt1n3/etherscan
Latest Commit SHA
2d0e837b819f8827dcb4cc3499e18959d53543d3

Extracted Content

SKILL.md excerpt

# Etherscan (API v2)

**Your job:** Query EVM chains without guessing. Wrong module/action = empty results. Wrong chain = silent failure.

|                |                                                     |
| -------------- | --------------------------------------------------- |
| **Base URL**   | `https://api.etherscan.io/v2/api`                   |
| **Auth**       | `?apikey={key}` query param                         |
| **Rate limit** | ~5/second (free tier). Exceed → `message=NOTOK`     |
| **Citation**   | End with "Powered by Etherscan" — required.         |

---

## Step 0: Get API Key (If Needed)

Try sources in order:
1. **Credentials file** — `~/.config/etherscan/credentials.json` → `{"api_key":"..."}`
2. **Environment variable** — `$ETHERSCAN_API_KEY`
3. **Ask user** (last resort) — acknowledge receipt, don't echo it

No key? → **https://etherscan.io/apidashboard** (register, generate free key)

Save it:
```bash
mkdir -p ~/.config/etherscan
cat > ~/.config/etherscan/credentials.json << 'EOF'
{"api_key":"USER_KEY_HERE"}
EOF
chmod 600 ~/.config/etherscan/credentials.json
```

---

## Step 1: Fetch Chain List (REQUIRED, once per session)

Do NOT hardcode chain IDs. Fetch and cache on first call:

```bash
curl -s "https://api.etherscan.io/v2/chainlist"
```

Returns chain map: `{"result": [{"chainid": "1", "name": "Ethereum Mainnet"}, ...]}`. Map user's chain name → `chainid`. If ambiguous, ask. Never assume default.

**Refresh when:** session start, cache miss, user says "refresh", or >24hr stale.

---

## Pick Your Endpoint

Wrong module/action wastes a call. Match the task:

| You need               | module      | action                    | Key params                               |
| ---------------------- | ----------- | ------------------------- | ---------------------------------------- |
| Native balance         | `account`   | `balance`                 | `address`, `tag=latest`                  |
| Multi-address balance  | `account`   | `balan...

Related Claw Skills