Client to interact with multiple EVM blockchain
Project description
Easy to use Python client to interact with multiple EVM blockchain.
Features
- Easily create a client to interact with EVM-compatible chains.
- Preconfigured for the most popular chains: Ethereum, Binance, Avalanche, Cronos, etc.
- Support for ERC20 operations, using the token name (e.g. USDC) instead of address.
- Exposes the underlying web3.py client to allow for more flexibility
Examples
Get the latest block on both Ethereum and Avalanche:
from web3factory.factory import make_client
eth_block = make_client('ethereum').getLatestBlock()
avax_block = make_client('avalanche').getLatestBlock()
Find the USDC balance of the Ethereum foundation:
from web3factory.factory import make_erc20_client
address = "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae"
usdc_balance = make_erc20_client("USDC", "ethereum").balanceOf(address)
Install
pip3 install -U web3client
It doesn't work 😡
Don't panic! Instead...
- Please check if your issue is listed in the Issues tab.
- If not, consider writing a new issue 🙂
Testing
pytest tests
TO DO
- Test ERC20 read functions
- Harmonize between camel case and snake case
- Easy accessors for token and network props
- Add BNB chain
- Add write examples and tests
- Add Uniswap V2 LP contracts
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
web3client-0.3.3.tar.gz
(13.5 kB
view hashes)
Built Distribution
web3client-0.3.3-py3-none-any.whl
(15.2 kB
view hashes)
Close
Hashes for web3client-0.3.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a47a8d60164ccb46defcfb0c3c8962522d6fbf511a9dd8c375c3ff2ac5943cca |
|
MD5 | fad5b12911e5cd23cdd4ee08c0ba9521 |
|
BLAKE2b-256 | de070e4bb2651191d5c83cdf40a17498a775ad61ecd8d9a858ac01cd5630463c |