1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub mod structs;
use solana_program::account_info::AccountInfo;
use solana_program::program_error::ProgramError;
pub use structs::{AggregatorAccountData, AggregatorRound, SwitchboardDecimal};
anchor_lang::declare_id!("3TSYZ3oXt9e42TdXFuYVaQyLP5ZX3fWtMhaQReHPau5f");
pub fn get_aggregator_result(
switchboard_feed: &AccountInfo,
) -> Result<AggregatorRound, ProgramError> {
let aggregator = AggregatorAccountData::new(switchboard_feed)?;
aggregator.get_result()
}