This crate allows to subscribe to events from the Searchers API of MEV Blocker with Alloy. Since the signature fields are stripped, the parsing of the transaction fails silently in Alloy. To address this, the extension dynamically adds these fields during deserialization, enabling a pending MEV Blocker transaction to be deserialized into an alloy_rpc_types_eth::Transaction
.
It is hard to tell who is right here. Alloy has a valid point to require all fields for a valid transaction. For some clients with less strict typing, the parsing of the transaction works. This does not require any workaround and for that reason, the API of MEV Blocker is for many people easy to use. For Alloy, it is not possible to parse the transaction without the signature fields.
See subscribe_mev_blocker.rs
in examples for a full usage examples.
Example usage:
let ws_client = WsConnect::new(MEV_BLOCKER_SEARCHERS_URL);
let provider = ProviderBuilder::new().on_ws(ws_client).await?;
let subscription = provider.subscribe_mev_blocker_pending_transactions().await?;
Many thanks to the CoW DAO to provide such an API. And many thanks to the alloy-rs team.
This project is licensed under the Apache 2.0 or MIT.