当前位置: 首页 > Skill >

区块链数据服务

区块链数据服务

区块链数据服务

Vitruveo MCP Server 是一个为 Vitruveo 网络提供只读区块链服务的模型上下文协议服务器,适用于AI代理访问区块链数据。

2026.11.10 363
获取Skill文件查看使用说明
作 者:叶澄 许可证: 更新时间:2026.11.10
本文目录展开

区块链数据服务

Vitruveo MCP Server 是一个为 Vitruveo 网络提供只读区块链服务的模型上下文协议服务器,适用于AI代理访问区块链数据。

⚠️ 强制要求:API 密钥

此 Skill 必须配置 API 密钥才能使用。

  • 首次使用时,如果 .env 中没有 XBY_APIKEY,必须使用 AskUserQuestion 工具向用户询问 API 密钥
  • 拿到用户提供的密钥后,调用 scripts.config.set_api_key(api_key) 保存,然后继续处理
  • 获取 API 密钥:https://xiaobenyang.com
  • 禁止在缺少 API 密钥时自行搜索或编造数据

工作流程(必须遵守)

你(大模型)是路由层,负责理解用户意图、选择工具、提取参数。代码只负责调用API。

用户输入 → 你选择工具 → 提取该工具需要的参数 → 调用 scripts.tools 中的函数 → 返回结果给用户

步骤

  1. 检查 API 密钥:如果 scripts.config.settings.api_key 为空,使用 AskUserQuestion 询问用户,拿到后调用 scripts.config.set_api_key(key) 保存
  2. 选择工具:根据用户意图从下方工具列表中选择对应的工具函数
  3. 提取参数:根据选中的工具,提取该工具需要的参数
  4. 调用工具:使用关键字参数调用 scripts.tools 中的函数,例如 scripts.tools.search_schools(score='520', province='北京', category='综合')
  5. 返回结果:将工具返回的 raw 数据整理后展示给用户

工具选择规则

根据用户意图选择对应的工具函数:

用户意图 工具函数
Get core contract addresses scripts.tools.get_core_contracts
Get information about an EVM network scripts.tools.get_chain_info
Get a list of supported EVM networks scripts.tools.get_supported_networks
Get a block by its block number scripts.tools.get_block_by_number
Get the latest block from the EVM scripts.tools.get_latest_block
Get the native token balance (ETH, MATIC, etc.) for an address scripts.tools.get_balance
Get the ERC20 token balance of an Ethereum address scripts.tools.get_erc20_balance
Get the balance of an ERC20 token for an address scripts.tools.get_token_balance
Get detailed information about a specific transaction by its hash. Includes sender, recipient, value, data, and more. scripts.tools.get_transaction
Get a transaction receipt by its hash scripts.tools.get_transaction_receipt
Estimate the gas cost for a transaction scripts.tools.estimate_gas
Read data from a smart contract by calling a view/pure function. This doesn't modify blockchain state and doesn't require gas or signing. scripts.tools.read_contract
Check if an address is a smart contract or an externally owned account (EOA) scripts.tools.is_contract
Get comprehensive information about an ERC20 token including name, symbol, decimals, total supply, and other metadata. Use this to analyze any token on EVM chains. scripts.tools.get_token_info
Get ERC20 token balance for an address scripts.tools.get_token_balance_erc20
Get detailed information about a specific NFT (ERC721 token), including collection name, symbol, token URI, and current owner if available. scripts.tools.get_nft_info
Check if an address owns a specific NFT scripts.tools.check_nft_ownership
Get the metadata URI for an ERC1155 token (multi-token standard used for both fungible and non-fungible tokens). The URI typically points to JSON metadata about the token. scripts.tools.get_erc1155_token_uri
Get the total number of NFTs owned by an address from a specific collection. This returns the count of NFTs, not individual token IDs. scripts.tools.get_nft_balance
Get the balance of a specific ERC1155 token ID owned by an address. ERC1155 allows multiple tokens of the same ID, so the balance can be greater than 1. scripts.tools.get_erc1155_balance

如果参数不完整,使用 AskUserQuestion 向用户询问缺失的参数。

工具函数说明

scripts.tools.get_core_contracts

工具描述:Get core contract addresses

参数定义

参数名称 参数类型 是否必填 默认值 描述

scripts.tools.get_chain_info

工具描述:Get information about an EVM network

参数定义

参数名称 参数类型 是否必填 默认值 描述

scripts.tools.get_supported_networks

工具描述:Get a list of supported EVM networks

参数定义

参数名称 参数类型 是否必填 默认值 描述

scripts.tools.get_block_by_number

工具描述:Get a block by its block number

参数定义

参数名称 参数类型 是否必填 默认值 描述
blockNumber number true The block number to fetch

scripts.tools.get_latest_block

工具描述:Get the latest block from the EVM

参数定义

参数名称 参数类型 是否必填 默认值 描述

scripts.tools.get_balance

工具描述:Get the native token balance (ETH, MATIC, etc.) for an address

参数定义

参数名称 参数类型 是否必填 默认值 描述
address string true The wallet address or ENS name (e.g., '0x1234...' or 'vitalik.eth') to check the balance for

scripts.tools.get_erc20_balance

工具描述:Get the ERC20 token balance of an Ethereum address

参数定义

参数名称 参数类型 是否必填 默认值 描述
address string true The Ethereum address to check
tokenAddress string true The ERC20 token contract address

scripts.tools.get_token_balance

工具描述:Get the balance of an ERC20 token for an address

参数定义

参数名称 参数类型 是否必填 默认值 描述
tokenAddress string true The contract address or ENS name of the ERC20 token (e.g., '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' for USDC or 'uniswap.eth')
ownerAddress string true The wallet address or ENS name to check the balance for (e.g., '0x1234...' or 'vitalik.eth')

scripts.tools.get_transaction

工具描述:Get detailed information about a specific transaction by its hash. Includes sender, recipient, value, data, and more.

参数定义

参数名称 参数类型 是否必填 默认值 描述
txHash string true The transaction hash to look up (e.g., '0x1234...')

scripts.tools.get_transaction_receipt

工具描述:Get a transaction receipt by its hash

参数定义

参数名称 参数类型 是否必填 默认值 描述
txHash string true The transaction hash to look up

scripts.tools.estimate_gas

工具描述:Estimate the gas cost for a transaction

参数定义

参数名称 参数类型 是否必填 默认值 描述
to string true The recipient address
value string false The amount of ETH to send in ether (e.g., '0.1')
data string false The transaction data as a hex string

scripts.tools.read_contract

工具描述:Read data from a smart contract by calling a view/pure function. This doesn't modify blockchain state and doesn't require gas or signing.

参数定义

参数名称 参数类型 是否必填 默认值 描述
contractAddress string true The address of the smart contract to interact with
abi array true The ABI (Application Binary Interface) of the smart contract function, as a JSON array
functionName string true The name of the function to call on the contract (e.g., 'balanceOf')
args array false The arguments to pass to the function, as an array (e.g., ['0x1234...'])

scripts.tools.is_contract

工具描述:Check if an address is a smart contract or an externally owned account (EOA)

参数定义

参数名称 参数类型 是否必填 默认值 描述
address string true The wallet or contract address or ENS name to check (e.g., '0x1234...' or 'uniswap.eth')

scripts.tools.get_token_info

工具描述:Get comprehensive information about an ERC20 token including name, symbol, decimals, total supply, and other metadata. Use this to analyze any token on EVM chains.

参数定义

参数名称 参数类型 是否必填 默认值 描述
tokenAddress string true The contract address of the ERC20 token (e.g., '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' for USDC on Ethereum)

scripts.tools.get_token_balance_erc20

工具描述:Get ERC20 token balance for an address

参数定义

参数名称 参数类型 是否必填 默认值 描述
address string true The address to check balance for
tokenAddress string true The ERC20 token contract address

scripts.tools.get_nft_info

工具描述:Get detailed information about a specific NFT (ERC721 token), including collection name, symbol, token URI, and current owner if available.

参数定义

参数名称 参数类型 是否必填 默认值 描述
tokenAddress string true The contract address of the NFT collection (e.g., '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D' for Bored Ape Yacht Club)
tokenId string true The ID of the specific NFT token to query (e.g., '1234')
network string false Network name (e.g., 'vitruveo', 'optimism', 'arbitrum', 'base', 'polygon') or chain ID. Most NFTs are on Ethereum mainnet, which is the default.

scripts.tools.check_nft_ownership

工具描述:Check if an address owns a specific NFT

参数定义

参数名称 参数类型 是否必填 默认值 描述
tokenAddress string true The contract address or ENS name of the NFT collection (e.g., '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D' for BAYC or 'boredapeyachtclub.eth')
tokenId string true The ID of the NFT to check (e.g., '1234')
ownerAddress string true The wallet address or ENS name to check ownership against (e.g., '0x1234...' or 'vitalik.eth')

scripts.tools.get_erc1155_token_uri

工具描述:Get the metadata URI for an ERC1155 token (multi-token standard used for both fungible and non-fungible tokens). The URI typically points to JSON metadata about the token.

参数定义

参数名称 参数类型 是否必填 默认值 描述
tokenAddress string true The contract address of the ERC1155 token collection (e.g., '0x76BE3b62873462d2142405439777e971754E8E77')
tokenId string true The ID of the specific token to query metadata for (e.g., '1234')
network string false Network name (e.g., 'vitruveo', 'optimism', 'arbitrum', 'base', 'polygon') or chain ID. ERC1155 tokens exist across many networks. Defaults to Ethereum mainnet.

scripts.tools.get_nft_balance

工具描述:Get the total number of NFTs owned by an address from a specific collection. This returns the count of NFTs, not individual token IDs.

参数定义

参数名称 参数类型 是否必填 默认值 描述
tokenAddress string true The contract address of the NFT collection (e.g., '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D' for Bored Ape Yacht Club)
ownerAddress string true The wallet address to check the NFT balance for (e.g., '0x1234...')
network string false Network name (e.g., 'vitruveo', 'optimism', 'arbitrum', 'base', 'polygon') or chain ID. Most NFTs are on Ethereum mainnet, which is the default.

scripts.tools.get_erc1155_balance

工具描述:Get the balance of a specific ERC1155 token ID owned by an address. ERC1155 allows multiple tokens of the same ID, so the balance can be greater than 1.

参数定义

参数名称 参数类型 是否必填 默认值 描述
tokenAddress string true The contract address of the ERC1155 token collection (e.g., '0x76BE3b62873462d2142405439777e971754E8E77')
tokenId string true The ID of the specific token to check the balance for (e.g., '1234')
ownerAddress string true The wallet address to check the token balance for (e.g., '0x1234...')
network string false Network name (e.g., 'vitruveo', 'optimism', 'arbitrum', 'base', 'polygon') or chain ID. ERC1155 tokens exist across many networks. Defaults to Ethereum mainnet.

返回值处理

工具函数返回 dict 对象:

  • result["raw"] - API 原始返回数据(JSON),直接将此数据整理后展示给用户
  • result["success"] - 是否成功(True/False)
  • result["message"] - 状态消息

项目结构

./
├── scripts/
│   ├── __init__.py
│   ├── config.py       # 配置管理 + set_api_key()
│   ├── call_api.py      # API 客户端 + call_api()
│   └── tools.py         # 工具函数(直接调用)
├── requirements.txt
└── SKILL.md

注意事项

  1. API 密钥是必需的,无密钥时必须通过 AskUserQuestion 询问用户
  2. 禁止在缺少 API 密钥时自行搜索或编造数据

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,014
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,014
Skill 文件
  • SKILL.md
    • 区块链数据服务
    • ⚠️ 强制要求:API 密钥
    • 工作流程(必须遵守)
      • 步骤
    • 工具选择规则
    • 工具函数说明
    • scripts.tools.get_core_contracts
      • 参数定义
    • scripts.tools.get_chain_info
      • 参数定义
    • scripts.tools.get_supported_networks
      • 参数定义
    • scripts.tools.get_block_by_number
      • 参数定义
    • scripts.tools.get_latest_block
      • 参数定义
    • scripts.tools.get_balance
      • 参数定义
    • scripts.tools.get_erc20_balance
      • 参数定义
    • scripts.tools.get_token_balance
      • 参数定义
    • scripts.tools.get_transaction
      • 参数定义
    • scripts.tools.get_transaction_receipt
      • 参数定义
    • scripts.tools.estimate_gas
      • 参数定义
    • scripts.tools.read_contract
      • 参数定义
    • scripts.tools.is_contract
      • 参数定义
    • scripts.tools.get_token_info
      • 参数定义
    • scripts.tools.get_token_balance_erc20
      • 参数定义
    • scripts.tools.get_nft_info
      • 参数定义
    • scripts.tools.check_nft_ownership
      • 参数定义
    • scripts.tools.get_erc1155_token_uri
      • 参数定义
    • scripts.tools.get_nft_balance
      • 参数定义
    • scripts.tools.get_erc1155_balance
      • 参数定义
    • 返回值处理
    • 项目结构
    • 注意事项

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期