pyth_sui_sdk/
pyth_sdk.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use pyth_sdk::PriceIdentifier;

use crate::price_info::PriceInfoObject;

impl PriceInfoObject {
    /// Get the off chain price identifier from the Pyth sdk
    pub fn pyth_price_id(&self) -> PriceIdentifier {
        PriceIdentifier::new(
            self.price_info
                .price_feed
                .price_identifier
                .bytes
                .to_vec()
                .try_into()
                .expect("Validated lenght onchain"),
        )
    }
}