跳转到主要内容

ethpm_types: EIP-2678的实现

项目描述

快速入门

EthPM是一个包含使用EIP-2678的合约、部署和源代码数据类型的Ethereum包清单。该库验证和序列化与合约相关的数据,并提供JSON模式。

依赖项

安装

通过pip

您可以通过 pip 安装最新版本。

pip install ethpm-types

通过 setuptools

您也可以克隆仓库并使用 setuptools 获取最新版本

git clone https://github.com/ApeWorX/ethpm-types.git
cd ethpm-types
python3 setup.py install

快速使用

从属性数据字典开始,例如合同实例,您可以构建 EthPM 类型对象。

from ethpm_types import ContractInstance

contract = ContractInstance(contractType="ContractClassName", address="0x123...")
print(contract.contract_type)

您还可以使用 .from_signature 类方法解析 ethpm_types.abi 对象

from ethpm_types.abi import MethodABI, EventABI

>>> MethodABI.from_signature("function_name(uint256 arg1)")
MethodABI(type='function', name='function_name', inputs=[...], ...)

>>> EventABI.from_signature("Transfer(address indexed from, address indexed to, uint256 value)")
EventABI(type='event', name='Transfer', inputs=[...], ...)

项目详情


发布历史 发布通知 | RSS 源

下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关 安装软件包 的更多信息。

源代码分发

ethpm-types-0.6.18.tar.gz (1.2 MB 查看哈希值)

上传时间 源代码

构建分发

ethpm_types-0.6.18-py3-none-any.whl (33.7 kB 查看哈希值)

上传时间 Python 3

支持者