chain

Documentation for eth_defi.chain Python module.

Chain specific configuration.

Many chains like Polygon and BNB Chain may need their own Web3 connection tuning. In this module, we have helpers.

Module Attributes

POA_MIDDLEWARE_NEEDED_CHAIN_IDS

List of chain ids that need to have proof-of-authority middleweare installed

Functions

fetch_block_timestamp(web3, block_number)

Get the block mined at timestamp.

get_graphql_url(provider)

Resolve potential GraphQL endpoint API for a JSON-RPC provider.

has_graphql_support(provider)

Check if a node has GoEthereum GraphQL API turned on.

install_api_call_counter_middleware(web3)

Install API call counter middleware.

install_api_call_counter_middleware_on_provider(...)

Install API call counter middleware on a specific API provider.

install_chain_middleware(web3[, poa_middleware])

Install any chain-specific middleware to Web3 instance.

install_retry_middleware(web3)

Install gracefully HTTP request retry middleware.