catalog/repos/0xgizmolab--alchemy-web3-skill.md

135 lines
4.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 多链区块链数据查询
`区块链` `Web3` `NFT` `Alchemy` `CLI`
# alchemy-web3
> 通过一个 CLI 查询 80+ 条链上的区块链数据
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Made by GizmoLab](https://img.shields.io/badge/Made%20by-GizmoLab-blue)](https://gizmolab.io?utm_source=alchemy-web3-skill&utm_medium=github&utm_campaign=skill)
使用 Alchemy 生产级 API 获取 NFT、代币余额、交易历史等数据。适用于人类开发者和 AI 智能体。
## 快速开始
```bash
npx skills add 0xGizmolab/alchemy-web3-skill
```
支持 Claude Code、Cursor、OpenCode、Windsurf 以及 [35+ 其他智能体](https://skills.sh)。
## 功能特性
- 🔍 查询任意钱包的 NFT、代币、余额
- ⛓️ 支持 80+ 条链以太坊、Polygon、Arbitrum、Base、Solana……
- 🤖 内置 AI 智能体工作流
- 🛠️ 简洁的 CLI + curl 示例 + JS SDK
## 配置
### 1. 获取 API Key
在 [alchemy.com](https://www.alchemy.com/?utm_source=gizmolab&utm_medium=skill&utm_campaign=alchemy-web3) 注册(提供免费套餐)
### 2. 设置 API Key
```bash
export ALCHEMY_API_KEY="your_key_here"
```
### 3. 查询
```bash
# 获取钱包余额
./scripts/alchemy.sh balance 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
# 获取所有 NFT
./scripts/alchemy.sh nfts 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
# 获取代币余额
./scripts/alchemy.sh tokens 0x...
# 查询 Gas 价格
./scripts/alchemy.sh gas
# 查询不同链
./scripts/alchemy.sh --chain polygon-mainnet balance 0x...
```
## 命令列表
| 命令 | 说明 |
|------|------|
| `balance <address>` | 获取 ETH/原生代币余额 |
| `tokens <address>` | 获取所有 ERC-20 代币余额 |
| `nfts <address>` | 获取持有的所有 NFT |
| `nft-metadata <contract> <id>` | 获取指定 NFT 的元数据 |
| `collection <contract>` | 获取合集中的 NFT |
| `transfers <address>` | 获取交易历史 |
| `block <number\|latest>` | 获取区块信息 |
| `tx <hash>` | 获取交易详情 |
| `gas` | 获取当前 Gas 价格 |
## 支持的链
以太坊、Polygon、Arbitrum、Optimism、Base、zkSync、Linea、Scroll、Blast、Solana 以及 70+ 条其他链。
完整列表见 [references/chains.md](references/chains.md)。
## AI 智能体工作流
本工具专为 AI 智能体自动化区块链监控而设计:
- **巨鲸追踪器** — 监控大钱包的动向
- **投资组合监控** — 跨链追踪余额
- **NFT 地板价预警** — 价格下跌时告警
- **代币变动检测** — 检测代币转入/转出
- **Gas 优化器** — 等待低 Gas 时机再交易
完整示例见 [references/agent-workflows.md](references/agent-workflows.md)。
## 安装
### OpenClaw / ClawHub
```bash
clawhub install alchemy-web3
```
### 手动安装
```bash
git clone https://github.com/0xGizmolab/alchemy-web3-skill.git
cd alchemy-web3-skill
chmod +x scripts/alchemy.sh
```
## 文档
- [SKILL.md](SKILL.md) — 完整文档
- [references/nft-api.md](references/nft-api.md) — NFT API 参考
- [references/token-api.md](references/token-api.md) — 代币 API 参考
- [references/node-api.md](references/node-api.md) — 节点 API 参考
- [references/chains.md](references/chains.md) — 支持的链
- [references/agent-workflows.md](references/agent-workflows.md) — AI 智能体示例
## 相关资源
- [Alchemy 控制台](https://dashboard.alchemy.com)
- [Alchemy 文档](https://www.alchemy.com/docs)
- [Alchemy SDK](https://github.com/alchemyplatform/alchemy-sdk-js)
## 关于
**由 [GizmoLab](https://gizmolab.io?utm_source=alchemy-web3-skill&utm_medium=github&utm_campaign=skill) 构建** 🔧
GizmoLab 是一家 Web3 开发机构,专注于构建 dApp、智能合约和区块链工具。
- 🌐 [gizmolab.io](https://gizmolab.io?utm_source=alchemy-web3-skill&utm_medium=github&utm_campaign=skill) — 机构服务
- 🛠️ [tools.gizmolab.io](https://tools.gizmolab.io?utm_source=alchemy-web3-skill&utm_medium=github&utm_campaign=skill) — 免费区块链开发工具
- 🎨 [ui.gizmolab.io](https://ui.gizmolab.io?utm_source=alchemy-web3-skill&utm_medium=github&utm_campaign=skill) — Web3 UI 组件
## 许可证
MIT