MEVBlockerProvider
Documentation for eth_defi.provider.mev_blocker.MEVBlockerProvider Python class.
- class MEVBlockerProvider
Bases:
eth_defi.provider.named.BaseNamedProviderRoutes 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
Return the active node URI where call JSON-RPCs go.
ccip_read_max_redirectsMap us to the transact provider by the default
global_ccip_read_enabledhas_persistent_connectionis_asyncloggerKeep 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
call_provider (eth_defi.provider.named.BaseNamedProvider) –
transact_provider (eth_defi.provider.named.BaseNamedProvider) –
- 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
- 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()