A Rust library to interact with Switchboard V2's hosted data feeds.
This package can be used to manage Switchboard data feed account parsing.
Specifically, this package will return the most recent confirmed round result from a provided data feed AccountInfo.
```rust use switchboard_v2::AggregatorAccountData; use std::convert::TryInto;
let feedresult = AggregatorAccountData::new(feedaccountinfo)?.getresult()?;
let decimal: f64 = feedresult.tryinto()?; ```
```rust use switchboard_v2::VrfAccountData;
let vrf = VrfAccountData::new(vrfaccountinfo)?; let resultbuffer = vrf.getresult()?; if result_buffer == [0u8; 32] { msg!("vrf buffer empty"); return Ok(()); }
let value: &[u128] = bytemuck::castslice(&resultbuffer[..]); let result = value[0] % 256000 as u128; ```