Skip to content

Commit 654c615

Browse files
committed
feat: add metering bundle types
Add TransactionResult and MeterBundleResponse types to support bundle execution metering with resource tracking.
1 parent f04c52c commit 654c615

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

crates/core/src/types.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,35 @@ impl BundleWithMetadata {
129129
}
130130
}
131131

132+
#[derive(Debug, Clone, Serialize, Deserialize)]
133+
#[serde(rename_all = "camelCase")]
134+
pub struct TransactionResult {
135+
pub coinbase_diff: String,
136+
pub eth_sent_to_coinbase: String,
137+
pub from_address: Address,
138+
pub gas_fees: String,
139+
pub gas_price: String,
140+
pub gas_used: u64,
141+
pub to_address: Option<Address>,
142+
pub tx_hash: TxHash,
143+
pub value: String,
144+
pub execution_time_us: u128,
145+
}
146+
147+
#[derive(Debug, Clone, Serialize, Deserialize)]
148+
#[serde(rename_all = "camelCase")]
149+
pub struct MeterBundleResponse {
150+
pub bundle_gas_price: String,
151+
pub bundle_hash: B256,
152+
pub coinbase_diff: String,
153+
pub eth_sent_to_coinbase: String,
154+
pub gas_fees: String,
155+
pub results: Vec<TransactionResult>,
156+
pub state_block_number: u64,
157+
pub total_gas_used: u64,
158+
pub total_execution_time_us: u128,
159+
}
160+
132161
#[cfg(test)]
133162
mod tests {
134163
use super::*;

0 commit comments

Comments
 (0)