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.

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 call provider.

get_active_transact_provider()

Get active transact provider.

get_api_call_counts()

How many times different APIs where called.

get_configured_transact_provider()

Get configured transact provider.

get_fallback_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([show_traceback])

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.

switch_to_next_call_provider()

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.

Return type

eth_defi.provider.named.BaseNamedProvider | web3.providers.rpc.HTTPProvider

get_configured_transact_provider()[source]

Get configured transact provider.

Return type

eth_defi.provider.mev_blocker.MEVBlockerProvider | None

get_active_call_provider()[source]

Get active call provider.

Return type

eth_defi.provider.named.BaseNamedProvider | web3.providers.rpc.HTTPProvider

get_fallback_provider()[source]

Get the fallback provider multiplexer.

Return type

eth_defi.provider.fallback.FallbackProvider

switch_to_next_call_provider()[source]

Recycles to the next call provider (if available).

get_api_call_counts()[source]

How many times different APIs where called.

Returns

RPC endpoint name, call count dict

Return type

Dict[str, int]