- Struct
MetaOracle
- Struct
TrustedData
- Constants
- Function
new
- Function
add_simple_oracle
- Function
median
- Function
data
- Function
threshold
- Function
time_window_ms
- Function
ticker
- Function
max_timestamp
- Function
value
- Function
oracles
use 0x1::option;
use 0x1::string;
use 0x1::vector;
use 0x2::object;
use 0x2::sort;
use 0x3::oracle;
use 0x3::oracle_data;
struct MetaOracle<T>
struct TrustedData<T> has copy, drop
const ErrorUnsupportedDataType: u64 = 1;
const ErrorValidDataSizeLessThanThreshold: u64 = 0;
public fun new<T: copy, drop>(threshold: u64, time_window_ms: u64, ticker: string::String): oracle_meta::MetaOracle<T>
public fun add_simple_oracle<T: copy, drop, store>(meta_oracle: &mut oracle_meta::MetaOracle<T>, oracle: &object::Object<oracle::SimpleOracle>)
take the median value
public fun median<T: copy, drop>(meta_oracle: oracle_meta::MetaOracle<T>): oracle_meta::TrustedData<T>
public fun data<T>(meta: &oracle_meta::MetaOracle<T>): &vector<option::Option<oracle_data::Data<T>>>
public fun threshold<T>(meta: &oracle_meta::MetaOracle<T>): u64
public fun time_window_ms<T>(meta: &oracle_meta::MetaOracle<T>): u64
public fun ticker<T>(meta: &oracle_meta::MetaOracle<T>): string::String
public fun max_timestamp<T>(meta: &oracle_meta::MetaOracle<T>): u64
public fun value<T>(data: &oracle_meta::TrustedData<T>): &T
public fun oracles<T>(data: &oracle_meta::TrustedData<T>): vector<address>