1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

added created attribute on DDO

This commit is contained in:
Pedro Gutiérrez 2019-02-13 14:31:33 +01:00 committed by Pedro Gutiérrez
parent 2d4cd891b3
commit 05efcc3ff1

View File

@ -38,13 +38,15 @@ export class DDO {
* DID, descentralized ID. * DID, descentralized ID.
* @type {string} * @type {string}
*/ */
public id: string id: string
public publicKey: PublicKey[] created: string
public authentication: Authentication[] publicKey: PublicKey[]
public service: Service[] authentication: Authentication[]
public proof: Proof service: Service[]
proof: Proof
public constructor(ddo?: Partial<DDO>) { public constructor(ddo?: Partial<DDO>) {
this.created = (ddo && ddo.created) || new Date(Date.now()).toISOString().replace(/\.[0-9]{3}/, "")
this.authentication = (ddo && ddo.authentication) || [] this.authentication = (ddo && ddo.authentication) || []
this.id = (ddo && ddo.id) || null this.id = (ddo && ddo.id) || null
this.publicKey = (ddo && ddo.publicKey) || [] this.publicKey = (ddo && ddo.publicKey) || []