gmsol/pyth/mod.rs
1/// Pyth Pull Oracle.
2#[cfg(feature = "pyth-pull-oracle")]
3pub mod pull_oracle;
4
5/// Push Oracle.
6pub mod push_oracle;
7
8use anchor_client::solana_sdk::pubkey::Pubkey;
9#[cfg(feature = "pyth-pull-oracle")]
10pub use pull_oracle::{
11 hermes::{EncodingType, Hermes},
12 PythPullOracle, PythPullOracleContext, PythPullOracleOps,
13};
14
15pub use push_oracle::find_pyth_feed_account;
16use pyth_sdk::Identifier;
17
18/// Convert a pubkey to feed id.
19pub fn pubkey_to_identifier(feed: &Pubkey) -> Identifier {
20 Identifier::new(feed.to_bytes())
21}