switchboard-v2
A Rust library to interact with Switchboard V2's hosted data feeds.
Description
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.
Usage
Aggregator
use AggregatorAccountData;
use TryInto;
let feed_result = new?.get_result?;
let decimal: f64 = feed_result.try_into?;
Aggregator History
use AggregatorHistoryBuffer;
use TryInto;
let history_buffer = new?;
let current_timestamp = get?.unix_timestamp;
let one_hour_ago: f64 = history_buffer.lower_bound.unwrap.try_into?;
VRF Account
use VrfAccountData;
let vrf = new?;
let result_buffer = vrf.get_result?;
let value: & = cast_slice;
let result = value % 256000 as u128;