switchboard-program 0.1.23

A Rust library to interact with Switchboard's hosted data feeds.
Documentation

switchboard-program

A Rust library to interact with Switchboard'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

use switchboard_program;
use switchboard_program::RoundResult;
...
let round_result: RoundResult = switchboard_program::get_aggregator_result(
    switchboard_feed    // &AccountInfo
)?;

// pub struct RoundResult {
    // pub num_success: i32,
    // pub num_error: i32,
    // pub mean: f64,
    // pub round_open_slot: u64,
    // pub round_open_timestamp: i64,
    // pub min_response: f64,
    // pub max_response: f64,
// }