base-blockchain

查询 Base(以太坊 L2)区块链数据,包括钱包余额、代币信息、交易记录、Gas 分析与合约检查。无需 API 密钥。

仓库最近推送
GitHub Stars
136
Forks
22
Issues / PRs
0

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "base-blockchain":https://skillpi.com/zh/skills/deepskill-d572d4a641e7e25f2f0e56af1d3d6bf0da40252709ca38c51fb9ac2990668f83。安装前核对上游来源和版本:https://github.com/AlexAI-MCP/hermes-CCC。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

查询 Base(以太坊 L2)区块链数据,包括钱包余额、代币信息、交易记录、Gas 分析与合约检查。无需 API 密钥。

0 下载

介绍来源: third_party · AlexAI-MCP · 1.0.0 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: base-blockchain
description: Query Base (Ethereum L2) blockchain data — wallet balances, token info, transactions, gas analysis, contract inspection. No API key required.
version: 1.0.0
author: hermes-CCC (ported from Hermes Agent by NousResearch)
license: MIT
metadata:
  hermes:
    tags: [Base, Blockchain, Crypto, Web3, EVM, L2, Ethereum, DeFi]
    related_skills: [solana]

Base Blockchain

Query Base (Ethereum L2) on-chain data enriched with USD pricing. No API key needed — uses public RPC + CoinGecko.

Base RPC Endpoints

Mainnet: https://mainnet.base.org
Testnet: https://sepolia.base.org
Chain ID: 8453 (mainnet) / 84532 (testnet)

Python Setup

import urllib.request, json

RPC = "https://mainnet.base.org"

def rpc_call(method, params=[]):
    payload = json.dumps({"jsonrpc":"2.0","method":method,"params":params,"id":1}).encode()
    req = urllib.request.Request(RPC, data=payload, headers={"Content-Type":"application/json"})
    with urllib.request.urlopen(req) as r:
        return json.loads(r.read())["result"]

Wallet Balance

def get_eth_balance(address):
    hex_balance = rpc_call("eth_getBalance", [address, "latest"])
    return int(hex_balance, 16) / 1e18

addr = "0xYourWalletAddress"
print(f"Balance: {get_eth_balance(addr):.6f} ETH")

ERC-20 Token Balance

# balanceOf(address) = keccak256 first 4 bytes = 0x70a08231
def get_token_balance(token_addr, wallet_addr, decimals=18):
    data = "0x70a08231" + wallet_addr[2:].zfill(64)
    result = rpc_call("eth_call", [{"to": token_addr, "data": data}, "latest"])
    return int(result, 16) / (10 ** decimals)

# USDC on Base (6 decimals)
usdc = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
print(f"USDC: {get_token_balance(usdc, addr, decimals=6):.2f}")

Transaction Details

def get_tx(tx_hash):
    return rpc_call("eth_getTransactionByHash", [tx_hash])

def get_tx_receipt(tx_hash):
    return rpc_call("eth_getTransactionReceipt", [tx_hash])

tx = get_tx("0xabc123...")
print(f"From: {tx['from']}")
print(f"To: {tx['to']}")
print(f"Value: {int(tx['value'],16)/1e18} ETH")

Gas Analysis

def get_gas_price():
    hex_gas = rpc_call("eth_gasPrice")
    gwei = int(hex_gas, 16) / 1e9
    return gwei

print(f"Gas price: {get_gas_price():.2f} Gwei")

# Estimate gas for a transfer
def estimate_gas(from_addr, to_addr, value_eth):
    return rpc_call("eth_estimateGas", [{
        "from": from_addr,
        "to": to_addr,
        "value": hex(int(value_eth * 1e18))
    }])

ETH Price (CoinGecko)

def get_eth_price_usd():
    url = "https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd"
    with urllib.request.urlopen(url) as r:
        return json.loads(r.read())["ethereum"]["usd"]

price = get_eth_price_usd()
balance = get_eth_balance(addr)
print(f"Portfolio: ${balance * price:.2f} USD")

Block Info

def get_latest_block():
    return rpc_call("eth_getBlockByNumber", ["latest", False])

block = get_latest_block()
print(f"Block: {int(block['number'],16)}")
print(f"Txs: {len(block['transactions'])}")

Contract Inspection

# Check if address is a contract
def is_contract(address):
    code = rpc_call("eth_getCode", [address, "latest"])
    return code != "0x"

# Read contract storage slot
def get_storage(address, slot):
    return rpc_call("eth_getStorageAt", [address, hex(slot), "latest"])

Basescan API (optional)

For detailed tx history, use Basescan API (free key at basescan.org):

BASESCAN = "https://api.basescan.org/api"
# Get tx list for address
params = f"?module=account&action=txlist&address={addr}&apikey=YOUR_KEY"

当前收录版本

1.0.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值95/100

亮点

  • 直接解决用户查询Base链上数据的核心任务痛点
  • 功能完整且实用,涵盖钱包余额、代币信息、交易记录、Gas分析、合约检查等高频需求
  • 无需API密钥,使用公共RPC和CoinGecko,降低使用门槛
触发精准90/100

亮点

  • 触发词精准完整,覆盖多种变体,边界清晰
  • description明确描述了Skill的核心功能和适用场景
结构规范85/100

亮点

  • Phase/步骤清晰,有出口条件,含端到端示例
  • frontmatter完整,单文件≤500行
  • 代码示例丰富且结构良好
执行可靠80/100

亮点

  • 工具来源明确,参数正确
  • 覆盖主要异常,不可逆操作有确认机制
  • 提供了可选的Basescan API用于更详细的历史记录查询
证据可验 (前四项均值)88/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

  • 账号、密钥或授权

    使用专用、最小权限账号,不把密钥粘贴到公开内容或命令日志;核对接收数据的服务与租户。

    主文档提及 · 第 3, 15, 157 行
文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • api.basescan.org
  • api.coingecko.com
  • mainnet.base.org
  • sepolia.base.org

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。