Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.

Commit bff62db

Browse files
committed
adds SignetEthBundle type
This change copies over the SignetEthBundle type from signet-types. This colocation allows other crates depending on this one to craft bundles without depending on signet-node. - copies SignetEthBundle type from signet-node into the bundle module - exposes bundle module for external use
1 parent 7908238 commit bff62db

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

Cargo.toml

+1-4
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,14 @@ repository = "https://github.com/init4tech/zenith"
1111
license = "AGPL-3.0"
1212

1313
[dependencies]
14+
alloy = { version = "0.9", features = ["full", "json-rpc", "signer-aws", "rpc-types-mev"] }
1415
alloy-primitives = { version = "0.8.11", features = ["serde", "tiny-keccak"] }
1516
alloy-sol-types = { version = "0.8.11", features = ["json"] }
16-
1717
alloy-rlp = { version = "0.3.4" }
18-
19-
alloy = { version = "=0.7.3", features = ["full", "json-rpc", "signer-aws"] }
2018
alloy-contract = { version = "=0.7.3", features = ["pubsub"] }
2119

2220
serde = { version = "1.0.197", features = ["derive"] }
2321

2422
[dev-dependencies]
2523
serde_json = "1.0.94"
2624
tokio = { version = "1.37.0", features = ["macros"] }
27-

src/bundle.rs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
use alloy::rpc::types::mev::EthSendBundle;
2+
use serde::{Deserialize, Serialize};
3+
4+
use crate::SignedOrder;
5+
6+
/// Wraps a flashbots style EthSendBundle with host fills to make a Signet compatible bundle
7+
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
8+
#[serde(rename_all = "camelCase")]
9+
pub struct SignetEthBundle {
10+
/// The bundle of transactions to simulate. Same structure as a Flashbots [EthSendBundle] bundle.
11+
/// see <https://github.com/alloy-rs/alloy/blob/main/crates/rpc-types-mev/src/eth_calls.rs#L121-L139>
12+
#[serde(flatten)]
13+
pub bundle: EthSendBundle,
14+
/// Host fills to be applied with the bundle, represented as a signed permit2 order.
15+
/// TODO: Link to docs
16+
pub host_fills: Option<SignedOrder>,
17+
}

src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ pub use block::{decode_txns, encode_txns, Alloy2718Coder, Coder, ZenithBlock, Ze
2222
mod orders;
2323
pub use orders::{AggregateOrders, SignedOrder};
2424

25+
mod bundle;
26+
pub use bundle::SignetEthBundle;
27+
2528
mod req;
2629
pub use req::SignRequest;
2730

0 commit comments

Comments
 (0)