diff --git a/contracts/data-feed/src/data_feed.rs b/contracts/data-feed/src/data_feed.rs index 5663700..cf9c54b 100644 --- a/contracts/data-feed/src/data_feed.rs +++ b/contracts/data-feed/src/data_feed.rs @@ -113,6 +113,43 @@ impl IsSep40Admin for DataFeed { } } +impl IsSep40 for DataFeed { + #[doc = " Return all assets quoted by the price feed"] + fn assets(&self) -> loam_sdk::soroban_sdk::Vec { + self.assets.keys() + } + + #[doc = " Return the base asset the price is reported in"] + fn base(&self) -> Asset { + self.base.clone() + } + + #[doc = " Return the number of decimals for all assets quoted by the oracle"] + fn decimals(&self) -> u32 { + self.decimals + } + + #[doc = " Get the most recent price for an asset"] + fn lastprice(&self, asset: Asset) -> Option { + todo!() + } + + #[doc = " Get price in base asset at specific timestamp"] + fn price(&self, asset: Asset, timestamp: u64) -> Option { + todo!() + } + + #[doc = " Get last N price records"] + fn prices(&self, asset: Asset, records: u32) -> Option> { + todo!() + } + + #[doc = " Return default tick period timeframe (&self, in seconds)"] + fn resolution(&self) -> u32 { + todo!() + } +} + /// Get the timestamp from env, converted to milliseconds fn now() -> u64 { env().ledger().timestamp() * 1000 diff --git a/contracts/data-feed/src/sep40.rs b/contracts/data-feed/src/sep40.rs index ed969e2..d111e23 100644 --- a/contracts/data-feed/src/sep40.rs +++ b/contracts/data-feed/src/sep40.rs @@ -5,6 +5,7 @@ use loam_sdk::{ //quoted asset definition #[loam_sdk::soroban_sdk::contracttype] +#[derive(Clone)] pub enum Asset { /// Can be a Stellar Classic or Soroban asset Stellar(loam_sdk::soroban_sdk::Address),