pub trait PriceFeedTrait {
// Required methods
fn base(env: Env) -> Asset;
fn assets(env: Env) -> Vec<Asset>;
fn decimals(env: Env) -> u32;
fn resolution(env: Env) -> u32;
fn price(env: Env, asset: Asset, timestamp: u64) -> Option<PriceData>;
fn prices(env: Env, asset: Asset, records: u32) -> Option<Vec<PriceData>>;
fn lastprice(env: Env, asset: Asset) -> Option<PriceData>;
}
Expand description
Oracle feed interface description
Required Methods§
Sourcefn resolution(env: Env) -> u32
fn resolution(env: Env) -> u32
Return default tick period timeframe (in seconds)
Sourcefn price(env: Env, asset: Asset, timestamp: u64) -> Option<PriceData>
fn price(env: Env, asset: Asset, timestamp: u64) -> Option<PriceData>
Get price in base asset at specific timestamp
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.