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

Adding event to DDO (#965)

This commit is contained in:
Jamie Hewitt 2021-08-13 09:26:06 +02:00 committed by GitHub
parent e3dfca6768
commit b72ff97c63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import { BestPrice } from './interfaces/BestPrice'
import { DataTokenInfo } from './interfaces/DataTokenInfo'
import { PurgatoryData } from './interfaces/PurgatoryData'
import { Credentials } from './interfaces/Credentials'
import { Event } from './interfaces/Event'
/**
* DID Descriptor Object.
* Contains all the data related to an asset.
@ -67,6 +68,8 @@ export class DDO {
public chainId?: number
public event?: Event
public constructor(ddo: Partial<DDO> = {}) {
Object.assign(this, ddo, {
created: (ddo && ddo.created) || new Date().toISOString().replace(/\.[0-9]{3}/, '')

7
src/ddo/interfaces/Event.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
export interface Event {
blockNo: number
contract: string
from: string
txid: string
update: boolean
}