MEVBlockerProvider

Documentation for eth_defi.provider.mev_blocker.MEVBlockerProvider Python class.

class MEVBlockerProvider

Bases: eth_defi.provider.named.BaseNamedProvider

Routes methods that execute transaction through a special MEV proof endpoint.

  • Depending on whether we are sending a transaction or reading from the blockchain, switch between the JSON-RPC endpoint.

  • Route all outgoing transactions through a special MEV blocker endpoint

Attributes summary

call_endpoint_uri

Return the active node URI where call JSON-RPCs go.

ccip_read_max_redirects

endpoint_uri

Map us to the transact provider by the default

global_ccip_read_enabled

has_persistent_connection

is_async

logger

provider_counter

Keep tabs on how much API traffic we generate through each endpoint

Methods summary

__init__(call_provider, transact_provider[, ...])

batch_request_func(w3, middleware_onion)

decode_rpc_response(raw_response)

encode_batch_rpc_request(requests)

encode_rpc_request(method, params)

is_connected([show_traceback])

is_transact_method(method)

Does this RPC method do a transaction

make_batch_request(requests)

make_request(method, params)

request_func(w3, middleware_onion)

@param w3 is the web3 instance @param middleware_onion is an iterable of middleware, ordered by first to execute @returns a function that calls all the middleware and eventually self.make_request()

__init__(call_provider, transact_provider, transact_methods=('eth_sendTransaction', 'eth_sendRawTransaction'))
Parameters
provider_counter

Keep tabs on how much API traffic we generate through each endpoint

is_transact_method(method)

Does this RPC method do a transaction

Parameters

method (web3.types.RPCEndpoint) –

Return type

bool

property endpoint_uri: str

Map us to the transact provider by the default

property call_endpoint_uri: str

Return the active node URI where call JSON-RPCs go.

Warning

Endpoint URIs often contain API keys. They should be never publicly displayed as is.

request_func(w3, middleware_onion)

@param w3 is the web3 instance @param middleware_onion is an iterable of middleware,

ordered by first to execute

@returns a function that calls all the middleware and

eventually self.make_request()

Parameters
  • w3 (Web3) –

  • middleware_onion (web3.datastructures.NamedElementOnion[str, Type[web3.middleware.base.Web3Middleware]]) –

Return type

Callable[[…], web3.types.RPCResponse]