refactor(events): recent_blockhash as base58 string (same as signature)

- EventMetadata.recent_blockhash: Option<Vec<u8>> -> Option<String>
- Add bs58 dependency; gRPC path: bs58::encode message bytes
- VersionedTransaction path: use Hash::to_string() (base58)
- parse_events_from_grpc_instruction/parse_events_from_instruction: accept Option<&str>

Made-with: Cursor
This commit is contained in:
Wood
2026-03-07 20:24:46 +08:00
parent 63af06edd3
commit 2da2b06e1f
3 changed files with 11 additions and 10 deletions
+3 -3
View File
@@ -312,9 +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.
/// Transaction message recent blockhash as base58 string (same encoding as signature), when available.
#[serde(default)]
pub recent_blockhash: Option<Vec<u8>>,
pub recent_blockhash: Option<String>,
}
impl EventMetadata {
@@ -331,7 +331,7 @@ impl EventMetadata {
inner_index: Option<i64>,
recv_us: i64,
tx_index: Option<u64>,
recent_blockhash: Option<Vec<u8>>,
recent_blockhash: Option<String>,
) -> Self {
Self {
signature,