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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//! Solana chain support.
//!
//! Implements structured extraction of Solana blocks, transactions, token
//! transfers, and account activity from JSON-RPC `getBlock` responses.
//!
//! # Two Approaches
//!
//! **Custom extraction** — implement [`Plugin::on_raw`] and parse raw JSON yourself:
//!
//! ```rust,no_run
//! use quicknode_cascade::solana::{Plugin, PluginFuture};
//!
//! struct MyParser;
//! impl Plugin for MyParser {
//! fn name(&self) -> &'static str { "my-parser" }
//! fn on_raw<'a>(&'a self, slot: u64, raw: &'a serde_json::Value) -> PluginFuture<'a> {
//! Box::pin(async move {
//! // parse raw JSON however you need
//! Ok(())
//! })
//! }
//! }
//! ```
//!
//! **Built-in extraction** — use [`Plugin::on_block`], [`Plugin::on_transaction`], etc.
//! and let the framework extract structured data for you.
//!
//! Both can be combined. [`extract_block()`] is also exposed as a public utility
//! you can call from `on_raw` if you want the framework's extraction as a starting point.
pub
pub use ;
pub use ;
/// Extract structured data from a raw `getBlock` JSON-RPC response.
///
/// Takes ownership of the JSON Value (zero-copy where possible).
/// Returns block metadata, transactions, token transfers, and account activity.
///
/// Use this from [`Plugin::on_raw`] if you want the framework's extraction
/// as a starting point alongside your own custom parsing.
///
/// # Example
///
/// ```rust,no_run
/// use quicknode_cascade::solana::{self, Plugin, PluginFuture};
///
/// struct HybridPlugin;
/// impl Plugin for HybridPlugin {
/// fn name(&self) -> &'static str { "hybrid" }
/// fn on_raw<'a>(&'a self, slot: u64, raw: &'a serde_json::Value) -> PluginFuture<'a> {
/// Box::pin(async move {
/// // Use the framework's extraction
/// let extracted = solana::extract_block(slot, raw.clone());
/// println!("{} txs", extracted.transactions.len());
///
/// // PLUS do your own custom parsing from the same raw JSON
/// if let Some(rewards) = raw.get("rewards") {
/// println!("rewards: {}", rewards);
/// }
/// Ok(())
/// })
/// }
/// }
/// ```
/// All extracted data for a single slot.
///
/// Returned by [`extract_block()`]. Contains the block metadata, all transactions,
/// token balance changes, and account activity records.
pub use SlotExtract;
/// Re-exports for convenience. `use quicknode_cascade::solana::prelude::*;`