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
ethereum_foundation = "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae"
usdc_balance = make_erc20_client("USDC", "ethereum").balanceOf(ethereum_foundation)
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.2.tar.gz
(13.5 kB
view hashes)
Built Distribution
web3client-0.3.2-py3-none-any.whl
(15.2 kB
view hashes)
Close
Hashes for web3client-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58cc68a2186a00d524609a230289a4455a2bf1a6d8a621772a7695749aac8cf9 |
|
MD5 | e2c90b41213de679dce4dabad0da1a2a |
|
BLAKE2b-256 | 3f9bef2e90c937e1c4293ead51bc060c4d7df10efd660e8b28d2af78410e6f3d |