MultiProviderWeb3
Documentation for eth_defi.provider.multi_provider.MultiProviderWeb3 Python class.
- class MultiProviderWeb3[source]
A web3 instance that knows about multiple RPC endpoints it is using.
Can use
eth_defi.provider.mev_blocker.MEVBlockerProvider
for making transactions to prevent frontrunningThere might be several call (read) providers for reading on-chain data with fallbacks using
eth_defi.provider.fallback.FallbackProvider
See
Attributes summary
api
client_version
ens
middleware_onion
pm
provider
strict_bytes_type_checking
Methods summary
__init__
([provider, middlewares, modules, ...])attach_modules
(modules)Attach modules to the Web3 instance.
enable_unstable_package_management_api
()from_wei
(number, unit)Takes a number of wei and converts it to any other ether unit.
Get active call provider.
Get active transact provider.
How many times different APIs where called.
Get configured transact provider.
Get the fallback provider multiplexer.
is_address
(value)Is the given string an address in any of the known formats?
is_checksum_address
(value)is_connected
()is_encodable
(_type, value)keccak
([primitive, text, hexstr])normalize_values
(w3, abi_types, values)solidity_keccak
(abi_types, values)Executes keccak256 exactly as Solidity does.
Recycles to the next call provider (if available).
to_bytes
([primitive, hexstr, text])to_checksum_address
(value)Makes a checksum address given a supported format.
to_hex
([primitive, hexstr, text])Auto converts any supported value into its hex representation.
to_int
([primitive, hexstr, text])Converts value to its integer representation.
to_json
(obj)Convert a complex object (like a transaction object) to a JSON string
to_text
([primitive, hexstr, text])to_wei
(number, unit)Takes a number of a unit and converts it to wei.
- get_active_transact_provider()[source]
Get active transact provider.
Can be a call provider if not configured.