Open alexcos20 opened 2 months ago
Updated DDO type (based on what we talked about at EOC meeting)
interface TokenInfo {
address: string
name: string
symbol: string
decimals?: number
}
interface ServicePrice {
type: 'fixedrate' | 'dispenser'
price: string
contract: string
token?: TokenInfo
exchangeId?: string
}
interface ServiceStat {
datatokenAddress: string
name: string
symbol: string
serviceId: string
orders: number
prices: ServicePrice[]
}
interface OffChain {
stats: {
services: ServiceStat[]
}
}
interface AssetExtended extends Asset {
offchain: OffChain
}
In order to proper display assets in dApps, we need all info regarding assets, including prices. Every datatoken can have one or more fixed rate exchanges or dispensers. But we need to be careful when adding this to a DDO, cause this can quickly result to hash missmatches.
To Do:
So , a DDO can look like:
To do:
-[ ] exclude "offchain" from every hash compute
-[ ] for MetaDataCreated:
-[ ] for MetaDataUpdated:
-[ ] indexer: add monitor for DispenserActivated and DispenserDeactivated events (https://github.com/oceanprotocol/contracts/blob/main/contracts/pools/dispenser/Dispenser.sol#L39-L45). If such an event is detected, get all ddos with a match and update it (remove dispenser/add dispenser)
-[ ] indexer: add monitor for ExchangeActivated and ExchangeDeactivated events (https://github.com/oceanprotocol/contracts/blob/main/contracts/pools/fixedRate/FixedRateExchange.sol#L103-L111). If such an event is detected, get all ddos with a match and update it (remove dispenser/add fixed rate)
-[ ] indexer: add monitor for ExchangeRateChanged event(https://github.com/oceanprotocol/contracts/blob/main/contracts/pools/fixedRate/FixedRateExchange.sol#L90C11-L94). If such an event is detected, get all ddos with a match and update them with the new rate
-[ ] indexer: add monitor for OrderStarted event(https://github.com/oceanprotocol/contracts/blob/main/contracts/templates/ERC20TemplateEnterprise.sol#L85-L93). If such an event is detected, get all ddos with a match and update orders count