feat(events): add recent_blockhash to EventMetadata

- EventMetadata: add recent_blockhash (Option<Vec<u8>>)
- gRPC path: extract from message.recent_blockhash, thread through parse_instruction_events_from_grpc_transaction and parse_events_from_grpc_instruction
- VersionedTransaction path: get from message.recent_blockhash(), pass into parse_events_from_instruction
- BlockMeta event: pass None for recent_blockhash

Made-with: Cursor
This commit is contained in:
Wood
2026-03-07 16:59:07 +08:00
parent 7270372604
commit 63af06edd3
3 changed files with 22 additions and 0 deletions
@@ -312,6 +312,9 @@ pub struct EventMetadata {
pub swap_data: Option<SwapData>,
pub outer_index: i64,
pub inner_index: Option<i64>,
/// Transaction message recent blockhash (32 bytes), when available.
#[serde(default)]
pub recent_blockhash: Option<Vec<u8>>,
}
impl EventMetadata {
@@ -328,6 +331,7 @@ impl EventMetadata {
inner_index: Option<i64>,
recv_us: i64,
tx_index: Option<u64>,
recent_blockhash: Option<Vec<u8>>,
) -> Self {
Self {
signature,
@@ -343,6 +347,7 @@ impl EventMetadata {
outer_index,
inner_index,
tx_index,
recent_blockhash,
}
}