feat(api): Upgrade to v0.1.5 with improved event subscription API

This update includes the following improvements:
- Version upgraded to 0.1.5
- Added subscribe_events_v2 API with more granular account filtering
- Marked original subscribe_events API as deprecated
- Fixed bug
This commit is contained in:
ysq
2025-07-26 17:11:28 +08:00
parent 961864a39e
commit 2e864dd14e
13 changed files with 392 additions and 77 deletions
+4
View File
@@ -50,6 +50,10 @@ macro_rules! impl_unified_event {
fn set_transfer_datas(&mut self, transfer_datas: Vec<$crate::streaming::event_parser::common::types::TransferData>) {
self.metadata.transfer_datas = transfer_datas;
}
fn index(&self) -> String {
self.metadata.index.clone()
}
}
};
}
@@ -162,6 +162,7 @@ pub struct EventMetadata {
pub event_type: EventType,
pub program_id: Pubkey,
pub transfer_datas: Vec<TransferData>,
pub index: String,
}
impl EventMetadata {
@@ -174,6 +175,7 @@ impl EventMetadata {
protocol: ProtocolType,
event_type: EventType,
program_id: Pubkey,
index: String,
) -> Self {
Self {
id,
@@ -186,6 +188,7 @@ impl EventMetadata {
event_type,
program_id,
transfer_datas: vec![],
index,
}
}
pub fn set_id(&mut self, id: String) {