Metadata-Version: 2.1
Name: web3Batch
Version: 0.0.3
Summary: Library to send batch requests using web3.py
Home-page: https://github.com/zovenor/web3Batch
Author: zovenor
Author-email: zovenor@gmail.com
Project-URL: Bug Tracker, https://github.com/zovenor/web3Batch/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE.txt

# web3Batch.py

### Installation
```commandline
pip install web3Batch
```
### Example

```python
from web3 import Web3
from web3Batch import We3Batch

contract_addresses = ['0x...', '0x...', ...]
endpoint_uri = 'https://localhost:6000'

web3 = Web3(Web3.HTTPProvider(endpoint_uri))

# Your abi for contracts
abi = {...}

contracts = [web3.eth.contract(
    address=web3.to_checksum_address(contract_address)
) for contract_address in contract_addresses]

wb = Web3Batch(endpoint_uri)

for contract in contracts:
    wb.add_contract_request(
        contract=contract,
        fn_name='balanceOf',
        args=(web3.to_checksum_address(contract.address))
    )

responses = wb.send_requests()
```
