1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
pub use ;
pub use ;
pub use LaserstreamError;
// Re-export commonly used types from laserstream-core-proto
pub use geyser as grpc;
pub use solana;
/// Compressed account (cuckoo) filtering.
///
/// Track large pubkey sets without re-uploading an explicit list every request:
/// build a compact cuckoo filter (~3 bytes/account) and let the server match
/// against it (no false negatives, <1% false positives — re-check locally with
/// [`CompressedAccountFilterSet::contains`]).
///
/// ```no_run
/// use helius_laserstream::cuckoo::{CompressedAccountFilterSet, Pubkey};
/// use helius_laserstream::grpc::SubscribeRequest;
/// # fn tracked_pubkeys() -> Vec<Pubkey> { vec![] }
/// # let new_pk = Pubkey::default();
/// let mut set = CompressedAccountFilterSet::with_capacity(2_000_000).unwrap();
/// for pk in tracked_pubkeys() { set.insert(pk).unwrap(); }
///
/// let mut req = SubscribeRequest::default();
/// set.insert_into_subscribe_request(&mut req, "tracked_accounts");
/// // ... subscribe(req) ...
///
/// // On change, mutate and re-send on the SAME stream:
/// set.insert(new_pk).unwrap();
/// if set.take_dirty() {
/// set.insert_into_subscribe_request(&mut req, "tracked_accounts");
/// // handle.write(req).await
/// }
/// ```