File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed
Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ members = [
1010 " relay-client" ,
1111 " relay-server" ,
1212 " searcher-api-types" ,
13+ " searcher-client" ,
1314 " common"
1415]
1516
Original file line number Diff line number Diff line change 1+ [package ]
2+ name = " searcher-client"
3+ version = " 0.1.0"
4+ edition = " 2021"
5+
6+ [dependencies ]
7+ serde = { workspace = true }
8+ serde_json = { workspace = true }
9+
10+ alloy-primitives = " 0.8"
11+ alloy-rpc-types-mev = " 0.8"
12+ eyre = " 0.6.12"
13+ url = " 2.5.4"
14+ reqwest = { version = " 0.12" , features = [" json" ] }
15+
16+ searcher-api-types = { path = " ../searcher-api-types" }
Original file line number Diff line number Diff line change 1+ use alloy_rpc_types_mev:: EthBundleHash ;
2+ use reqwest:: Client ;
3+ use url:: Url ;
4+
5+ use searcher_api_types:: SendBundleRequest ;
6+
7+ pub async fn send_bundle ( url : Url , bundle : & SendBundleRequest ) -> eyre:: Result < EthBundleHash > {
8+ Ok ( serde_json:: from_str (
9+ & Client :: new ( )
10+ . post ( url)
11+ . json ( bundle)
12+ . send ( )
13+ . await ?
14+ . text ( )
15+ . await ?,
16+ ) ?)
17+ }
You can’t perform that action at this time.
0 commit comments