ethpm_types: EIP-2678的实现
项目描述
快速入门
EthPM是一个包含使用EIP-2678的合约、部署和源代码数据类型的Ethereum包清单。该库验证和序列化与合约相关的数据,并提供JSON模式。
依赖项
- python3版本3.9到3.12。
安装
通过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=[...], ...)
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解有关 安装软件包 的更多信息。
源代码分发
ethpm-types-0.6.18.tar.gz (1.2 MB 查看哈希值)
构建分发
ethpm_types-0.6.18-py3-none-any.whl (33.7 kB 查看哈希值)
关闭
ethpm-types-0.6.18.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 727ed978a99db114ee57b833d28c2ac0105f70fcddcb524cc93ccb4bff50631e |
|
MD5 | b8bc716147f20b3a69b19ea357e97547 |
|
BLAKE2b-256 | 4aa87a2e71c230a6cf1d629eb4dc2aa3749fdffe7bde64ab3e81ed653a9a811e |
关闭
ethpm_types-0.6.18-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | ffd8598970a57e015c53b4cac6ef110648061c3a02e6d6e375561d9feb57c9c9 |
|
MD5 | bcbc001bb440d06454fa8e9c0d2cdc77 |
|
BLAKE2b-256 | b8e6dd7fdebf33a3d83be1ba9e791c28b1a7dc2daeb1d6a96d642e683d5cf125 |