kabu_rpc_handler/dto/
flashbots.rs

1use alloy_primitives::{Bytes, B256, U64};
2use serde::{Deserialize, Serialize};
3use utoipa::PartialSchema;
4use utoipa::ToSchema;
5
6#[derive(Debug, Deserialize, ToSchema)]
7#[serde(rename_all = "camelCase")]
8pub struct BundleParam {
9    #[serde(rename = "txs")]
10    #[schema(schema_with = String::schema)]
11    pub transactions: Vec<Bytes>,
12
13    #[serde(rename = "blockNumber")]
14    #[schema(schema_with = String::schema)]
15    pub target_block: Option<U64>,
16    // dropped the rest of the fields
17}
18
19#[derive(Debug, Deserialize, ToSchema)]
20pub struct BundleRequest {
21    #[allow(dead_code)]
22    pub jsonrpc: String,
23    #[allow(dead_code)]
24    pub id: u64,
25    #[allow(dead_code)]
26    pub method: String,
27    pub params: Vec<BundleParam>,
28}
29
30#[derive(Serialize, ToSchema)]
31#[serde(rename_all = "camelCase")]
32pub struct BundleResponse {
33    #[schema(schema_with = String::schema)]
34    pub bundle_hash: Option<B256>,
35}
36
37#[derive(Serialize, ToSchema)]
38pub struct SendBundleResponse {
39    pub jsonrpc: String,
40    pub id: u64,
41    pub result: BundleResponse,
42}