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

fix interface

This commit is contained in:
Ahmed Ali 2020-07-07 16:40:50 +02:00
parent c9bac697c3
commit 1b7fbe7ea3

View File

@ -141,7 +141,11 @@ export class Provider extends Instantiable {
algorithmDid?: string, algorithmDid?: string,
algorithmMeta?: MetadataAlgorithm, algorithmMeta?: MetadataAlgorithm,
jobId?: string, jobId?: string,
output?: Output output?: Output,
txId?: string,
serviceIndex?: string,
serviceType?: string,
tokenAddress?: string
): Promise<ComputeJob | ComputeJob[]> { ): Promise<ComputeJob | ComputeJob[]> {
const address = consumerAccount.getId() const address = consumerAccount.getId()
@ -156,15 +160,20 @@ export class Provider extends Instantiable {
// construct Brizo URL // construct Brizo URL
let url = this.getComputeEndpoint() let url = this.getComputeEndpoint()
url += `?signature=${signature}` url += `?signature=${signature}`
url += `&consumerAddress=${address}` url += `&documentId=${noZeroX(did)}`
url += `&did=${noZeroX(did)}` url += (output && `&output=${JSON.stringify(output)}`) || ''
url += (algorithmDid && `&algorithmDid=${algorithmDid}`) || '' url += (algorithmDid && `&algorithmDid=${algorithmDid}`) || ''
url += url +=
(algorithmMeta && (algorithmMeta &&
`&algorithmMeta=${encodeURIComponent(JSON.stringify(algorithmMeta))}`) || `&algorithmMeta=${encodeURIComponent(JSON.stringify(algorithmMeta))}`) ||
'' ''
url += (output && `&output=${JSON.stringify(output)}`) || ''
url += (jobId && `&jobId=${jobId}`) || '' url += (jobId && `&jobId=${jobId}`) || ''
url += `&consumerAddress=${address}`
url += `&transferTxId=${txId}` || ''
url += `&serviceId=${serviceIndex}` || ''
url += `&serviceType=${serviceType}` || ''
url += `&dataToken=${tokenAddress}` || ''
url += `&consumerAccount=${consumerAccount}` || ''
// switch fetch method // switch fetch method
let fetch let fetch