diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index 67740a1a..04dfc516 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -4,6 +4,7 @@ import { Proof } from './interfaces/Proof' import { PublicKey } from './interfaces/PublicKey' import { Service, ServiceType } from './interfaces/Service' import Web3Provider from '../datatokens/Web3Provider' +import { BestPrice } from './interfaces/BestPrice' /** * DID Descriptor Object. * Contains all the data related to an asset. @@ -51,6 +52,8 @@ export class DDO { public proof: Proof + public price: BestPrice + public constructor(ddo: Partial = {}) { Object.assign(this, ddo, { created: (ddo && ddo.created) || new Date().toISOString().replace(/\.[0-9]{3}/, '') diff --git a/src/ddo/interfaces/BestPrice.ts b/src/ddo/interfaces/BestPrice.ts new file mode 100644 index 00000000..b5433e80 --- /dev/null +++ b/src/ddo/interfaces/BestPrice.ts @@ -0,0 +1,7 @@ +export interface BestPrice { + type: 'pool' | 'exchange' + address: string + value: number + ocean?: number + datatoken?: number +} diff --git a/src/ddo/interfaces/index.ts b/src/ddo/interfaces/index.ts index dc85b0a8..ecfe4420 100644 --- a/src/ddo/interfaces/index.ts +++ b/src/ddo/interfaces/index.ts @@ -1,5 +1,6 @@ export * from './AdditionalInformation' export * from './Authentication' +export * from './BestPrice' export * from './Curation' export * from './EditableMetadata' export * from './EditableMetadataLinks'