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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
//! # Switchboard On-Demand Oracle SDK
//!
//! Official Rust SDK for Switchboard On-Demand Oracles on Solana.
//!
//! This SDK provides secure, efficient access to real-time oracle data with
//! comprehensive validation and zero-copy performance optimizations.
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use switchboard_on_demand::prelude::*;
//! # use solana_program::account_info::AccountInfo;
//! # let queue_account: AccountInfo = todo!();
//! # let slothash_sysvar: AccountInfo = todo!();
//! # let instructions_sysvar: AccountInfo = todo!();
//! # let clock_slot: u64 = 0;
//!
//! // Configure the verifier with required accounts
//! let quote = QuoteVerifier::new()
//! .queue(&queue_account)
//! .slothash_sysvar(&slothash_sysvar)
//! .ix_sysvar(&instructions_sysvar)
//! .clock_slot(clock_slot)
//! .max_age(150)
//! .verify_instruction_at(0)?;
//!
//! // Access feed data
//! for feed in quote.feeds() {
//! println!("Feed {}: {}", feed.hex_id(), feed.value());
//! }
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
//!
//! ## Security Considerations
//!
//! - Always validate oracle data freshness with appropriate `max_age` values
//! - Use minimum sample counts for critical operations
//! - Verify feed signatures in production environments
//! - Monitor for stale data and implement appropriate fallback mechanisms
//!
//! ## Feature Flags
//!
//! - `client` - Enable RPC client functionality
//! - `anchor` - Enable Anchor framework integration
use Arc;
/// Current SDK version
pub const VERSION: &str = env!;
/// SDK name for identification
pub const SDK_NAME: &str = "switchboard-on-demand";
/// Supported Switchboard On-Demand program versions on Solana
pub const SUPPORTED_PROGRAM_VERSIONS: & = &;
/// Minimum supported Solana version for compatibility
pub const MIN_SOLANA_VERSION: &str = "1.18.0";
/// Decimal number utilities for handling Switchboard oracle data
pub use *;
/// Core oracle functionality for on-demand data feeds
pub use *;
/// Utility functions and helpers
pub use *;
/// Traits extracted from anchor-lang to avoid dependency conflicts
pub use *;
/// Solana program ID constants
pub use *;
/// Solana account definitions and parsers
/// Solana instruction builders and processors
/// Common type definitions
/// Re-exports of commonly used types and traits for convenience
/// Solana sysvar utilities
pub use *;
/// AccountInfo compatibility layer
pub use ;
cfg_client!