1
- use alloy:: rpc:: types:: mev:: EthSendBundle ;
2
1
use serde:: { Deserialize , Serialize } ;
2
+ use std:: collections:: BTreeMap ;
3
+
4
+ use alloy:: rpc:: types:: mev:: { EthCallBundle , EthCallBundleResponse , EthSendBundle } ;
5
+ use alloy_primitives:: { Address , B256 , U256 } ;
3
6
4
7
use crate :: SignedOrder ;
5
8
@@ -15,3 +18,37 @@ pub struct SignetEthBundle {
15
18
/// TODO: Link to docs
16
19
pub host_fills : Option < SignedOrder > ,
17
20
}
21
+
22
+ /// Response for `signet_sendBundle`
23
+ #[ derive( Debug , Clone , Copy , PartialEq , Eq , Serialize , Deserialize ) ]
24
+ #[ serde( rename_all = "camelCase" ) ]
25
+ pub struct SignetEthBundleResponse {
26
+ /// The bundle hash of the sent bundle.
27
+ ///
28
+ /// This is calculated as keccak256(tx_hashes) where tx_hashes are the concatenated transaction hashes.
29
+ pub bundle_hash : B256 ,
30
+ }
31
+
32
+ /// Bundle of transactions for `signet_callBundle`
33
+ ///
34
+ /// TODO: Link to docs.
35
+ #[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize ) ]
36
+ #[ serde( rename_all = "camelCase" ) ]
37
+ pub struct SignetCallBundle {
38
+ /// The bundle of transactions to simulate. Same structure as a Flashbots [EthCallBundle] bundle.
39
+ /// see <https://github.com/alloy-rs/alloy/blob/main/crates/rpc-types-mev/src/eth_calls.rs#L13-L33>
40
+ #[ serde( flatten) ]
41
+ pub bundle : EthCallBundle ,
42
+ /// Host fills to be applied to the bundle for simulation. The mapping corresponds
43
+ /// to asset => user => amount.
44
+ pub host_fills : BTreeMap < Address , BTreeMap < Address , U256 > > ,
45
+ }
46
+
47
+ /// Response for `signet_callBundle`
48
+ #[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize , Default ) ]
49
+ #[ serde( rename_all = "camelCase" ) ]
50
+ pub struct SignetCallBundleResponse {
51
+ /// The flattened "vanilla" response which comes from `eth_callBundle`
52
+ #[ serde( flatten) ]
53
+ pub response : EthCallBundleResponse ,
54
+ }
0 commit comments