Asynchronous wrapper of Web3
class that makes queries, builds transactions, calls contract functions, broadcasts
transactions and fetches event logs asynchronously.
- Custom
AsyncWebsocketProvider
that supportseth_subscribe
andeth_unsubscribe
RPC methods, listening tonewHeads
,newPendingTransactions
andlogs
. - Custom
MulticallHTTPProvider
that automatically combines concurrenteth_call
requests into a single call toMulticall
contract.
Define the following in .env
according to the chain you use
WEB3_INFURA_PROJECT_ID=
WEB3_INFURA_SCHEME=https
WEB3_WS_PROVIDER_URI=
NETWORK=goerli
BLOCK_EXPLORER=https://api-goerli.etherscan.io/
EXPLORER_API_KEY=
Install dependencies
pip install -r requirements.txt
pip install websockets~=11.0.3