use af_sui_pkg_sdk::sui_pkg_sdk;
use sui_framework_sdk::object::UID;
use sui_framework_sdk::package::UpgradeCap;
use wormhole_sui_sdk::consumed_vaas::ConsumedVAAs;
use wormhole_sui_sdk::external_address::ExternalAddress;
#[cfg(feature = "pyth-sdk")]
mod pyth_sdk;
#[cfg(feature = "json-rpc")]
pub mod read;
#[cfg(feature = "ptb")]
pub mod update;
sui_pkg_sdk!(pyth {
module state {
struct LatestOnly has drop {}
struct State has key, store {
id: UID,
governance_data_source: data_source::DataSource,
stale_price_threshold: u64,
base_update_fee: u64,
fee_recipient_address: address,
last_executed_governance_sequence: u64,
consumed_vaas: ConsumedVAAs,
upgrade_cap: UpgradeCap
}
}
module data_source {
struct DataSource has copy, drop, store {
emitter_chain: u64,
emitter_address: ExternalAddress,
}
}
module price_info {
struct PriceInfoObject has key, store {
id: UID,
price_info: PriceInfo
}
struct PriceInfo has copy, drop, store {
attestation_time: u64,
arrival_time: u64,
price_feed: price_feed::PriceFeed,
}
}
module price_feed {
struct PriceFeed has copy, drop, store {
price_identifier: price_identifier::PriceIdentifier,
price: price::Price,
ema_price: price::Price,
}
}
module price_identifier {
struct PriceIdentifier has copy, drop, store {
bytes: vector<u8>,
}
}
module price {
struct Price has copy, drop, store {
price: i64::I64,
conf: u64,
expo: i64::I64,
timestamp: u64,
}
}
module i64 {
struct I64 has copy, drop, store {
negative: bool,
magnitude: u64,
}
}
});