1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

Merge pull request #340 from oceanprotocol/feature/ddo-pricing

update DDO
This commit is contained in:
Matthias Kretschmann 2020-10-08 12:38:37 +02:00 committed by GitHub
commit c5e5365359
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 0 deletions

View File

@ -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<DDO> = {}) {
Object.assign(this, ddo, {
created: (ddo && ddo.created) || new Date().toISOString().replace(/\.[0-9]{3}/, '')

View File

@ -0,0 +1,7 @@
export interface BestPrice {
type: 'pool' | 'exchange'
address: string
value: number
ocean?: number
datatoken?: number
}

View File

@ -1,5 +1,6 @@
export * from './AdditionalInformation'
export * from './Authentication'
export * from './BestPrice'
export * from './Curation'
export * from './EditableMetadata'
export * from './EditableMetadataLinks'