Skip to content

Commit

Permalink
Implement eth_sendPrivateTransaction server
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcph4 committed Jan 28, 2025
1 parent 0259e7f commit ffd83d2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{fmt::Display, str::FromStr};

use ajj::Router;
use alloy_primitives::FixedBytes;
use alloy_primitives::{FixedBytes, TxHash};
use alloy_rpc_types_mev::{
CancelBundleRequest, CancelPrivateTransactionRequest, EthBundleHash,
EthCallBundle, EthCallBundleResponse, EthSendBundle,
Expand Down Expand Up @@ -196,6 +196,18 @@ pub fn router() -> Router<()> {
EthCallBundleResponse::default();
Ok::<EthCallBundleResponse, &'static str>(sim_resp)
})
.route(
"eth_sendPrivateTransaction",
|params: Vec<PrivateTransactionRequest>| async move {
if let Some(bundle) = params.first() {
info!("Received private transaction request: {:?}", bundle);
Ok::<TxHash, &'static str>(TxHash::ZERO)
} else {
warn!("Received eth_sendBundle with no bundles");
Err("Must specify exactly one bundle")
}
},
)
}

#[tokio::main]
Expand Down

0 comments on commit ffd83d2

Please sign in to comment.