feat: refactor subscription API with multi-filter support

- Support multiple transaction/account filters as vectors
- Add Token2022 extended state parsing
- Add pumpswap pool monitoring example
- Enhance AccountFilter with memcmp filters

BREAKING CHANGE: API signature changes for subscription methods
This commit is contained in:
ysq
2025-09-10 23:21:08 +08:00
parent 304c943d79
commit 5ea536bef6
13 changed files with 491 additions and 327 deletions
+7 -7
View File
@@ -1,6 +1,9 @@
use crate::{
common::AnyResult,
streaming::{grpc::pool::factory, grpc::EventPretty, yellowstone_grpc::YellowstoneGrpc},
streaming::{
grpc::{pool::factory, EventPretty},
yellowstone_grpc::{TransactionFilter, YellowstoneGrpc},
},
};
use futures::{SinkExt, StreamExt};
use log::error;
@@ -39,12 +42,9 @@ impl YellowstoneGrpc {
let addrs = vec![SYSTEM_PROGRAM_ID.to_string()];
let account_include = account_include.unwrap_or_default();
let account_exclude = account_exclude.unwrap_or_default();
let transactions = self.subscription_manager.get_subscribe_request_filter(
account_include,
account_exclude,
addrs,
None,
);
let tx_filter =
vec![TransactionFilter { account_include, account_exclude, account_required: addrs }];
let transactions = self.subscription_manager.get_subscribe_request_filter(tx_filter, None);
let (mut subscribe_tx, mut stream, _) = self
.subscription_manager
.subscribe_with_request(transactions, None, None, None)