1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00
This commit is contained in:
Sebastian Gerske 2018-11-14 15:56:12 +01:00
parent 56c54faae5
commit 3a392eb4fe

View File

@ -1,6 +1,7 @@
import DDO from "../ddo/DDO" import DDO from "../ddo/DDO"
import MetaData from "../ddo/MetaData" import MetaData from "../ddo/MetaData"
import MetaDataBase from "../ddo/MetaDataBase" import MetaDataBase from "../ddo/MetaDataBase"
import Service from "../ddo/Service"
import IdGenerator from "../ocean/IdGenerator" import IdGenerator from "../ocean/IdGenerator"
import {Account, Logger, Ocean, ServiceAgreement} from "../squid" import {Account, Logger, Ocean, ServiceAgreement} from "../squid"
@ -56,8 +57,10 @@ import {Account, Logger, Ocean, ServiceAgreement} from "../squid"
const serviceAgreementSignature: string = await ocean.signServiceAgreement(ddo.id, serviceAgreementId, consumer) const serviceAgreementSignature: string = await ocean.signServiceAgreement(ddo.id, serviceAgreementId, consumer)
Logger.log("ServiceAgreement Signature:", serviceAgreementSignature) Logger.log("ServiceAgreement Signature:", serviceAgreementSignature)
const serviceAgreement: ServiceAgreement = await ocean.executeServiceAgreement(ddo.id, serviceAgreementId, const service: Service = ddo.findServiceByType("Access")
serviceAgreementSignature, consumer, publisher)
const serviceAgreement: ServiceAgreement = await ocean.executeServiceAgreement(ddo.id, service.serviceDefinitionId,
serviceAgreementId, serviceAgreementSignature, consumer, publisher)
Logger.log("ServiceAgreement Id:", serviceAgreement.getId()) Logger.log("ServiceAgreement Id:", serviceAgreement.getId())
})() })()