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

linter fixes

This commit is contained in:
Pedro Gutiérrez 2019-02-14 11:30:03 +01:00 committed by Pedro Gutiérrez
parent cfda1e6130
commit 879921ec0a
2 changed files with 14 additions and 12 deletions

View File

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

View File

@ -1,11 +1,14 @@
import AquariusProvider from "../aquarius/AquariusProvider" import AquariusProvider from "../aquarius/AquariusProvider"
import BrizoProvider from "../brizo/BrizoProvider"
import Account from "./Account" import Account from "./Account"
import DID from "./DID" import DID from "./DID"
import ServiceAgreement from "./ServiceAgreements/ServiceAgreement"
import IdGenerator from "./IdGenerator" import IdGenerator from "./IdGenerator"
import BrizoProvider from "../brizo/BrizoProvider" import ServiceAgreement from "./ServiceAgreements/ServiceAgreement"
export type agreementPreparionResult = {agreementId: string, signature: string} export interface AgreementPreparionResult {
agreementId: string
signature: string
}
/** /**
* Agreements submodule of Ocean Protocol. * Agreements submodule of Ocean Protocol.
@ -35,13 +38,13 @@ export default class OceanAgreements {
* @param {string} did Decentralized ID. * @param {string} did Decentralized ID.
* @param {string} serviceDefinitionId Service definition ID. * @param {string} serviceDefinitionId Service definition ID.
* @param {Account} consumer Consumer account. * @param {Account} consumer Consumer account.
* @return {Promise<agreementPreparionResult>} Agreement ID and signaturee. * @return {Promise<AgreementPreparionResult>} Agreement ID and signaturee.
*/ */
public async prepare( public async prepare(
did: string, did: string,
serviceDefinitionId: string, serviceDefinitionId: string,
consumer: Account, consumer: Account,
): Promise<agreementPreparionResult> { ): Promise<AgreementPreparionResult> {
const d: DID = DID.parse(did as string) const d: DID = DID.parse(did as string)
const ddo = await AquariusProvider.getAquarius().retrieveDDO(d) const ddo = await AquariusProvider.getAquarius().retrieveDDO(d)
@ -52,7 +55,6 @@ export default class OceanAgreements {
return {agreementId, signature} return {agreementId, signature}
} }
/** /**
* Submit a service agreement to the publisher to create the agreement on-chain. * Submit a service agreement to the publisher to create the agreement on-chain.
* @param {string} did Decentralized ID. * @param {string} did Decentralized ID.