P4A Kivy/KivyMD Developer sample & tools.
Project description
ETHBinductor (ETH Contract abi Bind Conductor)
This tool helps to generate web3py bind of etherium contract abi from abi json.
Installation:
pip install ethbinductor
Additional lib for binds:
pip install ethbind
Usage:
Run cli:
python -m ethbinductor
or
python3 -m ethbinductor
else
ethbinductor
Parse abi & get using abi providers:
# Contract (ERC20) load using etherscan http json api (default output to console)
ethbinductor get-abi 0xc3761eb917cd790b30dad99f6cc5b4ff93c4f9ea --abi-provider etherscan
Save json abi into the file (more providers see in the sources & cli help)
# Contract (ERC20) load using etherscan http json api (save to file)
ethbinductor get-abi 0xc3761eb917cd790b30dad99f6cc5b4ff93c4f9ea --abi-provider etherscan --output file examples/abi/erc20.json
Translate json abi to the code bind:
# Contract (ERC20) load using file & translate it to native Python binding (default output to console)
ethbinductor abi2py --cls-name ERC20 --abi-provider file examples/abi/erc20.json
# Same, but save translated code to file
ethbinductor abi2py --cls-name ERC20 --abi-provider file examples/abi/erc20.json --output file examples/eth_erc20_bind.py
# Contract (ERC20) load using etherscan & translate it to native Python binding (default output to console)
ethbinductor abi2py --cls-name ERC20 --abi-provider etherscan 0xc3761eb917cd790b30dad99f6cc5b4ff93c4f9ea
Save Python bind into the file (more providers see in the sources & cli help)
# Contract (ERC20) load using etherscan & translate it to native Python binding (save to file)
ethbinductor abi2py --cls-name ERC20 --abi-provider etherscan 0xc3761eb917cd790b30dad99f6cc5b4ff93c4f9ea --output file examples/eth_erc20_bind.py
Bind example of ERC20 you can see here with usage example but, first install base lib:
pip install ethbind
TODO: Custom samples & providers (for example to use bscscan with your api key & etc.)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ethbinductor-0.0.8.tar.gz
(13.2 kB
view hashes)
Built Distribution
Close
Hashes for ethbinductor-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b9ff6913cf84d3862179f96f5830ee90ce82f963d66f0edab2bdce49652fe54 |
|
MD5 | e1a5ffb05b7397ab7cbb21c02f0e15f2 |
|
BLAKE2b-256 | 862f340e2091a27706970a13de3b7c7cec0411283fce5661b824004a7131446c |