Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计异常

web3-pyweb3 PY 命令行

Agent Skill

web3-py 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

371

周安装

17

GitHub Stars

4

下载量

140
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:web3-py(web3 PY 命令行)
来源仓库:https://github.com/alphaonedev/openclaw-graph
仓库路径:skills/web3-py
安装命令:
npx skills add https://github.com/alphaonedev/openclaw-graph --skill web3-py
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/alphaonedev/openclaw-graph --skill web3-py

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合整理项目状态与变更事项。

  • 支持围绕仓库动态、代码提交和协作流程进行信息梳理与分析。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装。
  • 安装前需确认权限边界,避免触发不必要的网络请求或文件系统操作。
  • web3-py 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

web3-py

Purpose

web3-py is a Python library for interacting with the Ethereum blockchain using Web3 protocols. It enables programmatic access to blockchain data, smart contracts, and transactions.

When to Use

Use this skill when building Python applications that need to query Ethereum data, deploy smart contracts, or handle transactions. Applicable for dApps, blockchain analytics, or automated scripts interacting with Ethereum nodes.

Key Capabilities

  • Connect to Ethereum nodes via HTTP, WebSocket, or IPC providers.
  • Manage accounts, sign transactions, and handle gas estimates.
  • Interact with smart contracts using ABI definitions.
  • Query blockchain state, including balances, blocks, and events.
  • Support for Ethereum-compatible chains like Binance Smart Chain.

Usage Patterns

Always import web3-py and initialize a Web3 instance with a provider. Use environment variables for sensitive keys, e.g., set INFURA_API_KEY in your shell. Structure code to handle asynchronous operations with web3.async for better performance. For production, wrap calls in try-except blocks and use a reliable provider URL.

Common Commands/API

  • To get an account balance: Use web3.eth.get_balance(address). Example: from web3 import Web3 w3 = Web3(Web3.HTTPProvider('https://mainnet.infura.io/v3/' + os.getenv('INFURA_API_KEY'))) balance = w3.eth.get_balance('0xYourAddress')
  • To send a transaction: Use w3.eth.send_transaction(transaction). Example: tx = {'from': account.address, 'to': '0xRecipient', 'value': w3.to_wei(1, 'ether')} signed_tx = w3.eth.account.sign_transaction(tx, private_key=os.getenv('ETH_PRIVATE_KEY')) tx_hash = w3.eth.send_raw_transaction(signed_tx.rawTransaction)
  • To call a smart contract function: Use contract.functions.myFunction().call(). Example: contract = w3.eth.contract(address='0xContractAddress', abi=contract_abi) result = contract.functions.balanceOf('0xAddress').call()
  • To estimate gas: Use w3.eth.estimate_gas(transaction). Pass a dictionary with 'from', 'to', and 'data' keys.

Integration Notes

Integrate web3-py by installing via pip install web3. Configure providers with URLs like https://mainnet.infura.io/v3/$INFURA_API_KEY for Infura. Use env vars for keys: e.g., os.getenv('INFURA_API_KEY') for API access. For local nodes, use IPC: Web3(Web3.IPCProvider('/path/to/geth.ipc')). Ensure compatibility with Ethereum versions; specify chain ID in transactions to prevent replay attacks. Test integrations in a sandbox like Ganache before production.

Error Handling

Handle connection errors with try-except for ConnectionError, e.g.:

try:
    w3.eth.get_block('latest')
except web3.exceptions.ConnectionError:
    print("Node unreachable; check provider URL and network status.")

For transaction failures, catch ValueError for insufficient funds or gas issues:

try:
    tx_hash = w3.eth.send_transaction(tx)
except ValueError as e:
    if 'insufficient funds' in str(e):
        raise Exception("Add funds to account before retrying.")

Validate inputs like addresses with w3.is_address(address) before use. Log errors with details like error codes (e.g., RPC errors from providers) for debugging.

Concrete Usage Examples

  1. Querying token balance: To get the ERC-20 balance of an address on Ethereum mainnet, initialize Web3 with Infura, load the token contract, and call the balanceOf function. Example usage in a script: Set INFURA_API_KEY env var, then run the snippet above under Common Commands/API for contract calls.
  2. Deploying a simple smart contract: Compile a Solidity contract to ABI and bytecode, then use w3.eth.contract to deploy. Example: In code, create a contract instance and send a transaction with the bytecode, handling gas limits as shown in the send_transaction example.

Graph Relationships

  • Related to cluster: blockchain (e.g., shares capabilities with other blockchain tools).
  • Connected to tags: web3 (direct API interactions), python (Python-based implementation), ethereum (specific to Ethereum ecosystem).
  • Links to: smart-contracts (via contract handling features), as indicated in embedding hint.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.49%
按下载量换算52

Claude

29.25%
按下载量换算41

Cursor

16.43%
按下载量换算23

Gemini CLI

8.27%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

未通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills