Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update DDO #340

Merged
merged 2 commits into from
Oct 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/ddo/DDO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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}/, '')
Expand Down
7 changes: 7 additions & 0 deletions src/ddo/interfaces/BestPrice.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface BestPrice {
type: 'pool' | 'exchange'
address: string
value: number
ocean?: number
datatoken?: number
}
1 change: 1 addition & 0 deletions src/ddo/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from './AdditionalInformation'
export * from './Authentication'
export * from './BestPrice'
export * from './Curation'
export * from './EditableMetadata'
export * from './EditableMetadataLinks'
Expand Down