We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6b04e0 commit fcd55c4Copy full SHA for fcd55c4
target_chains/stylus/contracts/pyth-receiver/src/lib.rs
@@ -111,6 +111,12 @@ impl PythReceiver {
111
}
112
113
114
+ pub fn price_feed_exists(&self, id: [u8; 32]) -> bool {
115
+ let id_fb = FixedBytes::<32>::from(id);
116
+ let price_info = self.latest_price_info.get(id_fb);
117
+ return price_info.publish_time.get() != U64::ZERO;
118
+ }
119
+
120
pub fn query_price_feed(&self, id: [u8; 32]) -> Result<PriceFeedReturn, PythReceiverError> {
121
let id_fb = FixedBytes::<32>::from(id);
122
0 commit comments