Trait pallet_chainlink_feed::pallet::FeedInterface [−][src]
pub trait FeedInterface<T: Config> {
type Value: Parameter + BaseArithmetic;
fn first_valid_round(&self) -> Option<RoundId>;
fn latest_round(&self) -> RoundId;
fn data_at(
&self,
round: RoundId
) -> Option<RoundData<T::BlockNumber, Self::Value>>;
fn latest_data(&self) -> RoundData<T::BlockNumber, Self::Value>;
fn decimals(&self) -> u8;
}
Expand description
Trait for read-only access to a feed.
Associated Types
type Value: Parameter + BaseArithmetic
Required methods
fn first_valid_round(&self) -> Option<RoundId>
fn first_valid_round(&self) -> Option<RoundId>
Returns the id of the first round that contains non-default data.
Check this if you want to make sure that the data returned by
latest_data
is sensible.
fn latest_round(&self) -> RoundId
fn latest_round(&self) -> RoundId
Returns the id of the latest oracle round.
Returns the data for a given round.
Will return None
if there is no data for the given round.
fn latest_data(&self) -> RoundData<T::BlockNumber, Self::Value>
fn latest_data(&self) -> RoundData<T::BlockNumber, Self::Value>
Returns the latest data for the feed.
Will always return data but may contain default data if there has
not been a valid round, yet.
Check first_valid_round
to determine whether there is useful data,
yet.