@oceanprotocol/lib 7.0.0-next.1 → 7.0.0-next.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/lib.cjs +4 -3
  2. package/dist/lib.module.mjs +4 -3
  3. package/dist/lib.umd.js +4 -3
  4. package/dist/types/@types/Compute.d.ts +21 -0
  5. package/dist/types/@types/Provider.d.ts +39 -0
  6. package/dist/types/services/providers/BaseProvider.d.ts +34 -32
  7. package/dist/types/services/providers/HttpProvider.d.ts +4 -2
  8. package/dist/types/services/providers/P2pProvider.d.ts +38 -32
  9. package/package.json +27 -21
  10. package/.mocharc.json +0 -8
  11. package/.nvmrc +0 -1
  12. package/CHANGELOG.md +0 -3234
  13. package/Cheatsheet.md +0 -326
  14. package/CodeExamples.md +0 -881
  15. package/ComputeExamples.md +0 -941
  16. package/dist/lib.cjs.map +0 -1
  17. package/dist/lib.modern.js +0 -4
  18. package/dist/lib.modern.js.map +0 -1
  19. package/dist/lib.module.mjs.map +0 -1
  20. package/dist/lib.umd.js.map +0 -1
  21. package/docs/.nojekyll +0 -1
  22. package/docs/README.md +0 -195
  23. package/docs/classes/Aquarius.md +0 -175
  24. package/docs/classes/Config.md +0 -481
  25. package/docs/classes/ConfigHelper.md +0 -66
  26. package/docs/classes/Datatoken.md +0 -1123
  27. package/docs/classes/Dispenser.md +0 -502
  28. package/docs/classes/Escrow.md +0 -285
  29. package/docs/classes/FixedRateExchange.md +0 -1068
  30. package/docs/classes/Logger.md +0 -191
  31. package/docs/classes/Nft.md +0 -970
  32. package/docs/classes/NftFactory.md +0 -861
  33. package/docs/classes/Provider.md +0 -727
  34. package/docs/classes/Router.md +0 -645
  35. package/docs/classes/SmartContract.md +0 -193
  36. package/docs/classes/SmartContractWithAddress.md +0 -268
  37. package/docs/enums/LogLevel.md +0 -63
  38. package/docs/interfaces/AbiInput.md +0 -63
  39. package/docs/interfaces/AbiItem.md +0 -107
  40. package/docs/interfaces/AbiOutput.md +0 -52
  41. package/docs/interfaces/Arweave.md +0 -32
  42. package/docs/interfaces/Asset.md +0 -227
  43. package/docs/interfaces/AssetDatatoken.md +0 -60
  44. package/docs/interfaces/AssetLastEvent.md +0 -63
  45. package/docs/interfaces/AssetNft.md +0 -105
  46. package/docs/interfaces/AssetPrice.md +0 -47
  47. package/docs/interfaces/ComputeAlgorithm.md +0 -82
  48. package/docs/interfaces/ComputeAsset.md +0 -56
  49. package/docs/interfaces/ComputeEnvFees.md +0 -30
  50. package/docs/interfaces/ComputeEnvFeesStructure.md +0 -20
  51. package/docs/interfaces/ComputeEnvironment.md +0 -177
  52. package/docs/interfaces/ComputeJob.md +0 -173
  53. package/docs/interfaces/ComputeOutput.md +0 -118
  54. package/docs/interfaces/ComputeResourcesPricingInfo.md +0 -30
  55. package/docs/interfaces/ComputeResourcesRequest.md +0 -34
  56. package/docs/interfaces/ComputeResult.md +0 -52
  57. package/docs/interfaces/ConsumeMarketFee.md +0 -41
  58. package/docs/interfaces/Credential.md +0 -30
  59. package/docs/interfaces/Credentials.md +0 -30
  60. package/docs/interfaces/DDO.md +0 -137
  61. package/docs/interfaces/DatatokenCreateParams.md +0 -107
  62. package/docs/interfaces/DatatokenRoles.md +0 -30
  63. package/docs/interfaces/DispenserCreationParams.md +0 -63
  64. package/docs/interfaces/DispenserParams.md +0 -52
  65. package/docs/interfaces/DispenserToken.md +0 -85
  66. package/docs/interfaces/DownloadResponse.md +0 -30
  67. package/docs/interfaces/Event.md +0 -73
  68. package/docs/interfaces/FeesInfo.md +0 -74
  69. package/docs/interfaces/FileInfo.md +0 -118
  70. package/docs/interfaces/Files.md +0 -41
  71. package/docs/interfaces/FixedPriceExchange.md +0 -162
  72. package/docs/interfaces/FreCreationParams.md +0 -118
  73. package/docs/interfaces/FreOrderParams.md +0 -85
  74. package/docs/interfaces/GraphqlQuery.md +0 -69
  75. package/docs/interfaces/Ipfs.md +0 -32
  76. package/docs/interfaces/Metadata.md +0 -193
  77. package/docs/interfaces/MetadataAlgorithm.md +0 -69
  78. package/docs/interfaces/MetadataAndTokenURI.md +0 -107
  79. package/docs/interfaces/MetadataProof.md +0 -52
  80. package/docs/interfaces/NftCreateData.md +0 -74
  81. package/docs/interfaces/NftRoles.md +0 -52
  82. package/docs/interfaces/Operation.md +0 -145
  83. package/docs/interfaces/OrderParams.md +0 -52
  84. package/docs/interfaces/PriceAndFees.md +0 -52
  85. package/docs/interfaces/ProviderComputeInitialize.md +0 -41
  86. package/docs/interfaces/ProviderComputeInitializeResults.md +0 -43
  87. package/docs/interfaces/ProviderFees.md +0 -96
  88. package/docs/interfaces/ProviderInitialize.md +0 -52
  89. package/docs/interfaces/PublisherTrustedAlgorithm.md +0 -47
  90. package/docs/interfaces/PublishingMarketFee.md +0 -41
  91. package/docs/interfaces/Purgatory.md +0 -34
  92. package/docs/interfaces/RunningPlatform.md +0 -30
  93. package/docs/interfaces/SearchQuery.md +0 -67
  94. package/docs/interfaces/Service.md +0 -138
  95. package/docs/interfaces/ServiceComputeOptions.md +0 -63
  96. package/docs/interfaces/ServiceEndpoint.md +0 -41
  97. package/docs/interfaces/Smartcontract-1.md +0 -58
  98. package/docs/interfaces/Stats.md +0 -47
  99. package/docs/interfaces/Template.md +0 -30
  100. package/docs/interfaces/TokenOrder.md +0 -63
  101. package/docs/interfaces/UrlFile.md +0 -71
  102. package/docs/interfaces/UserCustomParameters.md +0 -7
  103. package/docs/interfaces/ValidateMetadata.md +0 -52
  104. package/docs/modules.md +0 -850
  105. package/typedoc.json +0 -4
@@ -1,727 +0,0 @@
1
- [@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Provider
2
-
3
- # Class: Provider
4
-
5
- ## Table of contents
6
-
7
- ### Constructors
8
-
9
- - [constructor](Provider.md#constructor)
10
-
11
- ### Methods
12
-
13
- - [checkDidFiles](Provider.md#checkdidfiles)
14
- - [computeDelete](Provider.md#computedelete)
15
- - [computeStart](Provider.md#computestart)
16
- - [computeStatus](Provider.md#computestatus)
17
- - [computeStop](Provider.md#computestop)
18
- - [freeComputeStart](Provider.md#freecomputestart)
19
- - [getComputeStartRoutes](Provider.md#getcomputestartroutes)
20
- - [encrypt](Provider.md#encrypt)
21
- - [getComputeEnvironments](Provider.md#getcomputeenvironments)
22
- - [getComputeResultUrl](Provider.md#getcomputeresulturl)
23
- - [getData](Provider.md#getdata)
24
- - [getDownloadUrl](Provider.md#getdownloadurl)
25
- - [getEndpointURL](Provider.md#getendpointurl)
26
- - [getEndpoints](Provider.md#getendpoints)
27
- - [getFileInfo](Provider.md#getfileinfo)
28
- - [getNonce](Provider.md#getnonce)
29
- - [getServiceEndpoints](Provider.md#getserviceendpoints)
30
- - [initialize](Provider.md#initialize)
31
- - [initializeCompute](Provider.md#initializecompute)
32
- - [inputMatch](Provider.md#inputmatch)
33
- - [isValidProvider](Provider.md#isvalidprovider)
34
- - [noZeroX](Provider.md#nozerox)
35
- - [signProviderRequest](Provider.md#signproviderrequest)
36
- - [zeroXTransformer](Provider.md#zeroxtransformer)
37
-
38
- ## Constructors
39
-
40
- ### constructor
41
-
42
- • **new Provider**()
43
-
44
- ## Methods
45
-
46
- ### checkDidFiles
47
-
48
- ▸ **checkDidFiles**(`did`, `serviceId`, `providerUri`, `withChecksum?`, `signal?`): `Promise`<[`FileInfo`](../interfaces/FileInfo.md)[]\>
49
-
50
- Get file details for a given DID and service ID.
51
-
52
- #### Parameters
53
-
54
- | Name | Type | Default value | Description |
55
- | :------ | :------ | :------ | :------ |
56
- | `did` | `string` | `undefined` | The DID to check. |
57
- | `serviceId` | `string` | `undefined` | The service ID to check. |
58
- | `providerUri` | `string` | `undefined` | The URI of the provider. |
59
- | `withChecksum?` | `boolean` | `false` | Whether or not to include a checksum. |
60
- | `signal?` | `AbortSignal` | `undefined` | An optional abort signal. |
61
-
62
- #### Returns
63
-
64
- `Promise`<[`FileInfo`](../interfaces/FileInfo.md)[]\>
65
-
66
- A promise that resolves with an array of file info objects.
67
-
68
- #### Defined in
69
-
70
- [services/Provider.ts:181](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L181)
71
-
72
- ___
73
-
74
- ### computeDelete
75
-
76
- ▸ **computeDelete**(`did`, `consumer`, `jobId`, `providerUri`, `signal?`): `Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\>
77
-
78
- Deletes a compute job.
79
-
80
- #### Parameters
81
-
82
- | Name | Type | Description |
83
- | :------ | :------ | :------ |
84
- | `did` | `string` | asset did |
85
- | `consumer` | `Signer` | consumer Signer wallet object |
86
- | `jobId` | `string` | the compute job ID |
87
- | `providerUri` | `string` | The URI of the provider we want to query |
88
- | `signal?` | `AbortSignal` | abort signal |
89
-
90
- #### Returns
91
-
92
- `Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\>
93
-
94
- #### Defined in
95
-
96
- [services/Provider.ts:764](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L764)
97
-
98
- ___
99
-
100
- ### computeStart
101
-
102
- ▸ **computeStart**(`providerUri`, `signerOrAuthToken`, `computeEnv`, `datasets`, `algorithm`, `maxJobDuration`, `token`, `resources`, `chainId`, `metadata?`, `additionalViewers?`, `output?`, `policyServer?`, `signal?`): `Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\>
103
-
104
- Instruct the provider to start a PAID compute job (C2D V2)
105
-
106
- #### Parameters
107
-
108
- | Name | Type | Description |
109
- | :------ | :------ | :------ |
110
- | `providerUri` | `string` | The provider URI. |
111
- | `signerOrAuthToken` | `Signer` \| `string` | The consumer signer object or auth token |
112
- | `computeEnv` | `string` | The compute environment ID. |
113
- | `datasets` | [`ComputeAsset`](../interfaces/ComputeAsset.md)[] | The datasets to start compute on (including additional datasets) |
114
- | `algorithm` | [`ComputeAlgorithm`](../interfaces/ComputeAlgorithm.md) | The algorithm to start compute with. |
115
- | `maxJobDuration` | `number` | The compute job max execution time. |
116
- | `token` | `string` | The token address for compute payment. |
117
- | `resources` | [`ComputeResourceRequest`](../interfaces/ComputeResourcesRequest.md)[] | The resources to start compute job with. |
118
- | `chainId` | `number` | The chain ID used for payments |
119
- | `metadata?` | `ComputeJobMetadata` | Additional metadata to be stored in the database. |
120
- | `additionalViewers?` | `string[]` | Additional addresses that can view the compute job results. |
121
- | `output?` | [`ComputeOutput`](../interfaces/ComputeOutput.md) | The compute job output settings. |
122
- | `policyServer?` | `any` | Policy server data. |
123
- | `signal?` | `AbortSignal` | Abort signal |
124
-
125
- #### Returns
126
-
127
- `Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\>
128
-
129
- The compute job or jobs.
130
-
131
- #### Defined in
132
-
133
- [services/Provider.ts:772](https://github.com/oceanprotocol/ocean.js/blob/main/src/services/Provider.ts#L772)
134
-
135
- ___
136
-
137
- ### computeStatus
138
-
139
- ▸ **computeStatus**(`providerUri`, `consumerAddress`, `jobId?`, `agreementId?`, `signal?`): `Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\>
140
-
141
- Get compute status for a specific jobId/agreementId/owner.
142
-
143
- #### Parameters
144
-
145
- | Name | Type | Description |
146
- | :------ | :------ | :------ |
147
- | `providerUri` | `string` | The URI of the provider we want to query |
148
- | `consumerAddress` | `string` | The consumer ethereum address |
149
- | `jobId?` | `string` | The ID of a compute job. |
150
- | `agreementId?` | `string` | The ID of service agreement |
151
- | `signal?` | `AbortSignal` | abort signal |
152
-
153
- #### Returns
154
-
155
- `Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\>
156
-
157
- #### Defined in
158
-
159
- [services/Provider.ts:662](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L662)
160
-
161
- ___
162
-
163
- ### computeStop
164
-
165
- ▸ **computeStop**(`did`, `consumerAddress`, `jobId`, `providerUri`, `signer`, `signal?`, `agreementId?`): `Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\>
166
-
167
- Instruct the provider to Stop the execution of a to stop a compute job.
168
-
169
- #### Parameters
170
-
171
- | Name | Type | Description |
172
- | :------ | :------ | :------ |
173
- | `did` | `string` | the asset did |
174
- | `consumerAddress` | `string` | The consumer address. |
175
- | `jobId` | `string` | the compute job id |
176
- | `providerUri` | `string` | The provider URI. |
177
- | `signer` | `Signer` | The consumer signer object. |
178
- | `signal?` | `AbortSignal` | abort signal |
179
- | `agreementId?` | `string` | service agreement id |
180
-
181
- #### Returns
182
-
183
- `Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\>
184
-
185
- #### Defined in
186
-
187
- [services/Provider.ts:587](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L587)
188
-
189
- ___
190
-
191
- ### freeComputeStart
192
-
193
- ▸ **freeComputeStart**(`providerUri`, `signerOrAuthToken`, `computeEnv`, `datasets`, `algorithm`, `resources?`, `metadata?`, `additionalViewers?`, `output?`, `policyServer?`, `signal?`): `Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\>
194
-
195
- Instruct the provider to start a FREE compute job (C2D V2)
196
-
197
- #### Parameters
198
-
199
- | Name | Type | Description |
200
- | :------ | :------ | :------ |
201
- | `providerUri` | `string` | The provider URI. |
202
- | `signerOrAuthToken` | `Signer` \| `string` | The consumer signer object or auth token |
203
- | `computeEnv` | `string` | The compute environment ID. |
204
- | `datasets` | [`ComputeAsset`](../interfaces/ComputeAsset.md)[] | The datasets to start compute on (including additional datasets) |
205
- | `algorithm` | [`ComputeAlgorithm`](../interfaces/ComputeAlgorithm.md) | The algorithm to start compute with. |
206
- | `resources?` | [`ComputeResourceRequest`](../interfaces/ComputeResourcesRequest.md)[] | The resources to start compute job with. |
207
- | `metadata?` | `ComputeJobMetadata` | Additional metadata to be stored in the database. |
208
- | `additionalViewers?` | `string[]` | Additional addresses that can view the compute job results. |
209
- | `output?` | [`ComputeOutput`](../interfaces/ComputeOutput.md) | The compute job output settings. |
210
- | `policyServer?` | `any` | Policy server data. |
211
- | `signal?` | `AbortSignal` | Abort signal |
212
-
213
- #### Returns
214
-
215
- `Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\>
216
-
217
- The compute job or jobs.
218
-
219
- #### Defined in
220
-
221
- [services/Provider.ts:892](https://github.com/oceanprotocol/ocean.js/blob/main/src/services/Provider.ts#L892)
222
-
223
- ___
224
-
225
- ### getComputeStartRoutes
226
-
227
- ▸ **getComputeStartRoutes**(`providerUri`, `isFreeCompute?`): `Promise`<`string` \| `null`\>
228
-
229
- Get the compute start route path for either free or paid compute
230
-
231
- #### Parameters
232
-
233
- | Name | Type | Default value | Description |
234
- | :------ | :------ | :------ | :------ |
235
- | `providerUri` | `string` | `undefined` | The provider URI. |
236
- | `isFreeCompute` | `boolean` | `false` | Whether to get the free compute route (true) or paid compute route (false). |
237
-
238
- #### Returns
239
-
240
- `Promise`<`string` \| `null`\>
241
-
242
- The compute start route path or null if not available.
243
-
244
- #### Defined in
245
-
246
- [services/Provider.ts:1071](https://github.com/oceanprotocol/ocean.js/blob/main/src/services/Provider.ts#L1071)
247
-
248
- ___
249
-
250
- ### encrypt
251
-
252
- ▸ **encrypt**(`data`, `chainId`, `providerUri`, `signal?`): `Promise`<`string`\>
253
-
254
- Encrypt data using the Provider's own symmetric key
255
-
256
- #### Parameters
257
-
258
- | Name | Type | Description |
259
- | :------ | :------ | :------ |
260
- | `data` | `any` | data in json format that needs to be sent , it can either be a DDO or a File array |
261
- | `chainId` | `number` | network's id so provider can choose the corresponding Signer object |
262
- | `providerUri` | `string` | provider uri address |
263
- | `signal?` | `AbortSignal` | abort signal |
264
-
265
- #### Returns
266
-
267
- `Promise`<`string`\>
268
-
269
- urlDetails
270
-
271
- #### Defined in
272
-
273
- [services/Provider.ts:142](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L142)
274
-
275
- ___
276
-
277
- ### getComputeEnvironments
278
-
279
- ▸ **getComputeEnvironments**(`providerUri`, `signal?`): `Promise`<{ `[chainId: number]`: [`ComputeEnvironment`](../interfaces/ComputeEnvironment.md)[]; }\>
280
-
281
- Returns compute environments from a provider.
282
-
283
- #### Parameters
284
-
285
- | Name | Type | Description |
286
- | :------ | :------ | :------ |
287
- | `providerUri` | `string` | The URI of the provider. |
288
- | `signal?` | `AbortSignal` | An optional abort signal. |
289
-
290
- #### Returns
291
-
292
- `Promise`<{ `[chainId: number]`: [`ComputeEnvironment`](../interfaces/ComputeEnvironment.md)[]; }\>
293
-
294
- A promise that resolves with an object containing compute environments for each chain ID.
295
-
296
- #### Defined in
297
-
298
- [services/Provider.ts:290](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L290)
299
-
300
- ___
301
-
302
- ### getComputeResultUrl
303
-
304
- ▸ **getComputeResultUrl**(`providerUri`, `consumer`, `jobId`, `index`): `Promise`<`string`\>
305
-
306
- Get compute result url
307
-
308
- #### Parameters
309
-
310
- | Name | Type | Description |
311
- | :------ | :------ | :------ |
312
- | `providerUri` | `string` | The URI of the provider we want to query |
313
- | `consumer` | `Signer` | consumer Signer wallet object |
314
- | `jobId` | `string` | The ID of a compute job. |
315
- | `index` | `number` | Result index |
316
-
317
- #### Returns
318
-
319
- `Promise`<`string`\>
320
-
321
- #### Defined in
322
-
323
- [services/Provider.ts:725](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L725)
324
-
325
- ___
326
-
327
- ### getData
328
-
329
- ▸ `Private` **getData**(`url`): `Promise`<`Response`\>
330
-
331
- Private method that fetches data from a URL using the GET method.
332
-
333
- #### Parameters
334
-
335
- | Name | Type | Description |
336
- | :------ | :------ | :------ |
337
- | `url` | `string` | The URL to fetch data from. |
338
-
339
- #### Returns
340
-
341
- `Promise`<`Response`\>
342
-
343
- A Promise that resolves to a Response object.
344
-
345
- #### Defined in
346
-
347
- [services/Provider.ts:906](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L906)
348
-
349
- ___
350
-
351
- ### getDownloadUrl
352
-
353
- ▸ **getDownloadUrl**(`did`, `serviceId`, `fileIndex`, `transferTxId`, `providerUri`, `signer`, `policyServer?` `userCustomParameters?`): `Promise`<`any`\>
354
-
355
- Gets the download URL.
356
-
357
- #### Parameters
358
-
359
- | Name | Type | Description |
360
- | :------ | :------ | :------ |
361
- | `did` | `string` | The DID. |
362
- | `serviceId` | `string` | The service ID. |
363
- | `fileIndex` | `number` | The file index. |
364
- | `transferTxId` | `string` | The transfer transaction ID. |
365
- | `providerUri` | `string` | The provider URI. |
366
- | `signer` | `Signer` | The signer. |
367
- | `policyServer` | `any` | The policy server (if any to be used). |
368
- | `userCustomParameters?` | [`UserCustomParameters`](../interfaces/UserCustomParameters.md) | The user custom parameters. |
369
-
370
- #### Returns
371
-
372
- `Promise`<`any`\>
373
-
374
- The download URL.
375
-
376
- #### Defined in
377
-
378
- [services/Provider.ts:472](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L472)
379
-
380
- ___
381
-
382
- ### getEndpointURL
383
-
384
- ▸ **getEndpointURL**(`servicesEndpoints`, `serviceName`): [`ServiceEndpoint`](../interfaces/ServiceEndpoint.md)
385
-
386
- This function returns the endpoint URL for a given service name.
387
-
388
- #### Parameters
389
-
390
- | Name | Type | Description |
391
- | :------ | :------ | :------ |
392
- | `servicesEndpoints` | [`ServiceEndpoint`](../interfaces/ServiceEndpoint.md)[] | The array of service endpoints |
393
- | `serviceName` | `string` | The name of the service |
394
-
395
- #### Returns
396
-
397
- [`ServiceEndpoint`](../interfaces/ServiceEndpoint.md)
398
-
399
- The endpoint URL for the given service name
400
-
401
- #### Defined in
402
-
403
- [services/Provider.ts:44](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L44)
404
-
405
- ___
406
-
407
- ### getEndpoints
408
-
409
- ▸ **getEndpoints**(`providerUri`): `Promise`<`any`\>
410
-
411
- Returns the provider endpoints
412
-
413
- #### Parameters
414
-
415
- | Name | Type | Description |
416
- | :------ | :------ | :------ |
417
- | `providerUri` | `string` | the provider url |
418
-
419
- #### Returns
420
-
421
- `Promise`<`any`\>
422
-
423
- #### Defined in
424
-
425
- [services/Provider.ts:28](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L28)
426
-
427
- ___
428
-
429
- ### getFileInfo
430
-
431
- ▸ **getFileInfo**(`file`, `providerUri`, `withChecksum?`, `signal?`): `Promise`<[`FileInfo`](../interfaces/FileInfo.md)[]\>
432
-
433
- Get File details (if possible)
434
-
435
- #### Parameters
436
-
437
- | Name | Type | Default value | Description |
438
- | :------ | :------ | :------ | :------ |
439
- | `file` | [`UrlFile`](../interfaces/UrlFile.md) \| [`GraphqlQuery`](../interfaces/GraphqlQuery.md) \| [`Arweave`](../interfaces/Arweave.md) \| [`Ipfs`](../interfaces/Ipfs.md) \| [`Smartcontract`](../interfaces/Smartcontract-1.md) | `undefined` | one of the supported file structures |
440
- | `providerUri` | `string` | `undefined` | uri of the provider that will be used to check the file |
441
- | `withChecksum?` | `boolean` | `false` | Whether or not to include a checksum. |
442
- | `signal?` | `AbortSignal` | `undefined` | An optional abort signal. |
443
-
444
- #### Returns
445
-
446
- `Promise`<[`FileInfo`](../interfaces/FileInfo.md)[]\>
447
-
448
- A promise that resolves with an array of file info objects.
449
-
450
- #### Defined in
451
-
452
- [services/Provider.ts:237](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L237)
453
-
454
- ___
455
-
456
- ### getNonce
457
-
458
- ▸ **getNonce**(`providerUri`, `consumerAddress`, `signal?`, `providerEndpoints?`, `serviceEndpoints?`): `Promise`<`string`\>
459
-
460
- Get current nonce from the provider.
461
-
462
- #### Parameters
463
-
464
- | Name | Type | Description |
465
- | :------ | :------ | :------ |
466
- | `providerUri` | `string` | provider uri address |
467
- | `consumerAddress` | `string` | Publisher address |
468
- | `signal?` | `AbortSignal` | abort signal |
469
- | `providerEndpoints?` | `any` | Identifier of the asset to be registered in ocean |
470
- | `serviceEndpoints?` | [`ServiceEndpoint`](../interfaces/ServiceEndpoint.md)[] | document description object (DDO)= |
471
-
472
- #### Returns
473
-
474
- `Promise`<`string`\>
475
-
476
- urlDetails
477
-
478
- #### Defined in
479
-
480
- [services/Provider.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L80)
481
-
482
- ___
483
-
484
- ### getServiceEndpoints
485
-
486
- ▸ **getServiceEndpoints**(`providerEndpoint`, `endpoints`): `Promise`<[`ServiceEndpoint`](../interfaces/ServiceEndpoint.md)[]\>
487
-
488
- This function returns an array of service endpoints for a given provider endpoint.
489
-
490
- #### Parameters
491
-
492
- | Name | Type | Description |
493
- | :------ | :------ | :------ |
494
- | `providerEndpoint` | `string` | The provider endpoint |
495
- | `endpoints` | `any` | The endpoints object |
496
-
497
- #### Returns
498
-
499
- `Promise`<[`ServiceEndpoint`](../interfaces/ServiceEndpoint.md)[]\>
500
-
501
- An array of service endpoints
502
-
503
- #### Defined in
504
-
505
- [services/Provider.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L58)
506
-
507
- ___
508
-
509
- ### initialize
510
-
511
- ▸ **initialize**(`did`, `serviceId`, `fileIndex`, `consumerAddress`, `providerUri`, `signal?`, `userCustomParameters?`, `computeEnv?`, `validUntil?`): `Promise`<[`ProviderInitialize`](../interfaces/ProviderInitialize.md)\>
512
-
513
- Initializes the provider for a service request.
514
-
515
- #### Parameters
516
-
517
- | Name | Type | Description |
518
- | :------ | :------ | :------ |
519
- | `did` | `string` | The asset DID . |
520
- | `serviceId` | `string` | The asset service ID. |
521
- | `fileIndex` | `number` | The file index. |
522
- | `consumerAddress` | `string` | The consumer address. |
523
- | `providerUri` | `string` | The URI of the provider. |
524
- | `signal?` | `AbortSignal` | The abort signal if any. |
525
- | `userCustomParameters?` | [`UserCustomParameters`](../interfaces/UserCustomParameters.md) | The custom parameters if any. |
526
- | `computeEnv?` | `string` | The compute environment if any. |
527
- | `validUntil?` | `number` | The validity time if any. |
528
-
529
- #### Returns
530
-
531
- `Promise`<[`ProviderInitialize`](../interfaces/ProviderInitialize.md)\>
532
-
533
- A promise that resolves with ProviderInitialize response.
534
-
535
- #### Defined in
536
-
537
- [services/Provider.ts:344](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L344)
538
-
539
- ___
540
-
541
- ### initializeCompute
542
-
543
- ▸ **initializeCompute**(`assets`, `algorithm`, `computeEnv`, `validUntil`, `providerUri`, `accountId`, `signal?`): `Promise`<[`ProviderComputeInitializeResults`](../interfaces/ProviderComputeInitializeResults.md)\>
544
-
545
- Initializes the provider for a compute request.
546
-
547
- #### Parameters
548
-
549
- | Name | Type | Description |
550
- | :------ | :------ | :------ |
551
- | `assets` | [`ComputeAsset`](../interfaces/ComputeAsset.md)[] | The datasets array to initialize compute request. |
552
- | `algorithm` | [`ComputeAlgorithm`](../interfaces/ComputeAlgorithm.md) | The algorithm to use. |
553
- | `computeEnv` | `string` | The compute environment. |
554
- | `validUntil` | `number` | The job expiration date. |
555
- | `providerUri` | `string` | The provider URI. |
556
- | `signer` | `Signer` | caller account |
557
- | `signal?` | `AbortSignal` | abort signal |
558
-
559
- #### Returns
560
-
561
- `Promise`<[`ProviderComputeInitializeResults`](../interfaces/ProviderComputeInitializeResults.md)\>
562
-
563
- ProviderComputeInitialize data
564
-
565
- #### Defined in
566
-
567
- [services/Provider.ts:409](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L409)
568
-
569
- ___
570
-
571
-
572
- ### computeStreamableLogs
573
-
574
- ▸ **computeStreamableLogs**(`providerUri`, `signer`, `jobId`, `signal?`): `Promise`<`any`\>
575
-
576
- Gets the streamable compute logs.
577
-
578
- #### Parameters
579
-
580
- | Name | Type | Description |
581
- | :------ | :------ | :------ |
582
- | `providerUri` | `string` | The provider URI. |
583
- | `signer` | `Signer` | The signer. |
584
- | `jobId` | `string` | The Job Id. |
585
- | `signal?` | `AbortSignal` | The abort signal. |
586
-
587
-
588
- #### Returns
589
-
590
- `Promise`<`any`\>
591
-
592
- The compute logs.
593
-
594
- #### Defined in
595
-
596
- [services/Provider.ts:908](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L908)
597
-
598
- ___
599
-
600
-
601
- ### inputMatch
602
-
603
- ▸ `Private` **inputMatch**(`input`, `regexp`, `conversorName`): `Object`
604
-
605
- Private method that matches an input string against a regular expression and returns the first capture group.
606
-
607
- #### Parameters
608
-
609
- | Name | Type | Description |
610
- | :------ | :------ | :------ |
611
- | `input` | `string` | The input string to match. |
612
- | `regexp` | `RegExp` | The regular expression to match against. |
613
- | `conversorName` | `string` | The name of the method calling this function. |
614
-
615
- #### Returns
616
-
617
- `Object`
618
-
619
- An object with two properties: `valid` (a boolean indicating whether the input matched the regular expression) and `output` (the first capture group of the match, or the original input if there was no match).
620
-
621
- | Name | Type |
622
- | :------ | :------ |
623
- | `output` | `string` |
624
- | `valid` | `boolean` |
625
-
626
- #### Defined in
627
-
628
- [services/Provider.ts:883](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L883)
629
-
630
- ___
631
-
632
- ### isValidProvider
633
-
634
- ▸ **isValidProvider**(`url`, `signal?`): `Promise`<`boolean`\>
635
-
636
- Check for a valid provider at URL
637
-
638
- #### Parameters
639
-
640
- | Name | Type | Description |
641
- | :------ | :------ | :------ |
642
- | `url` | `string` | provider uri address |
643
- | `signal?` | `AbortSignal` | abort signal |
644
-
645
- #### Returns
646
-
647
- `Promise`<`boolean`\>
648
-
649
- valid or not
650
-
651
- #### Defined in
652
-
653
- [services/Provider.ts:834](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L834)
654
-
655
- ___
656
-
657
- ### noZeroX
658
-
659
- ▸ `Private` **noZeroX**(`input`): `string`
660
-
661
- Private method that removes the leading 0x from a string.
662
-
663
- #### Parameters
664
-
665
- | Name | Type | Description |
666
- | :------ | :------ | :------ |
667
- | `input` | `string` | The input string. |
668
-
669
- #### Returns
670
-
671
- `string`
672
-
673
- The transformed string.
674
-
675
- #### Defined in
676
-
677
- [services/Provider.ts:857](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L857)
678
-
679
- ___
680
-
681
- ### signProviderRequest
682
-
683
- ▸ **signProviderRequest**(`signer`, `message`): `Promise`<`string`\>
684
-
685
- Sign a provider request with a signer.
686
-
687
- #### Parameters
688
-
689
- | Name | Type | Description |
690
- | :------ | :------ | :------ |
691
- | `signer` | `Signer` | The signer to use. |
692
- | `message` | `string` | The message to sign. |
693
-
694
- #### Returns
695
-
696
- `Promise`<`string`\>
697
-
698
- A promise that resolves with the signature.
699
-
700
- #### Defined in
701
-
702
- [services/Provider.ts:116](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L116)
703
-
704
- ___
705
-
706
- ### zeroXTransformer
707
-
708
- ▸ `Private` **zeroXTransformer**(`input?`, `zeroOutput`): `string`
709
-
710
- Private method that removes the leading 0x from a string.
711
-
712
- #### Parameters
713
-
714
- | Name | Type | Default value | Description |
715
- | :------ | :------ | :------ | :------ |
716
- | `input` | `string` | `''` | The input string. |
717
- | `zeroOutput` | `boolean` | `undefined` | Whether to include 0x in the output if the input is valid and zeroOutput is true. |
718
-
719
- #### Returns
720
-
721
- `string`
722
-
723
- The transformed string.
724
-
725
- #### Defined in
726
-
727
- [services/Provider.ts:867](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L867)