@oceanprotocol/lib 7.0.0-next.5 → 7.0.0-next.6

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 (95) hide show
  1. package/package.json +7 -1
  2. package/.mocharc.json +0 -8
  3. package/.nvmrc +0 -1
  4. package/CHANGELOG.md +0 -3263
  5. package/Cheatsheet.md +0 -326
  6. package/CodeExamples.md +0 -881
  7. package/ComputeExamples.md +0 -941
  8. package/dist/lib.cjs.map +0 -1
  9. package/dist/lib.module.mjs.map +0 -1
  10. package/dist/lib.umd.js.map +0 -1
  11. package/docs/.nojekyll +0 -1
  12. package/docs/README.md +0 -195
  13. package/docs/classes/Aquarius.md +0 -175
  14. package/docs/classes/Config.md +0 -481
  15. package/docs/classes/ConfigHelper.md +0 -66
  16. package/docs/classes/Datatoken.md +0 -1123
  17. package/docs/classes/Dispenser.md +0 -502
  18. package/docs/classes/Escrow.md +0 -285
  19. package/docs/classes/FixedRateExchange.md +0 -1068
  20. package/docs/classes/Logger.md +0 -191
  21. package/docs/classes/Nft.md +0 -970
  22. package/docs/classes/NftFactory.md +0 -861
  23. package/docs/classes/Provider.md +0 -727
  24. package/docs/classes/Router.md +0 -645
  25. package/docs/classes/SmartContract.md +0 -193
  26. package/docs/classes/SmartContractWithAddress.md +0 -268
  27. package/docs/enums/LogLevel.md +0 -63
  28. package/docs/interfaces/AbiInput.md +0 -63
  29. package/docs/interfaces/AbiItem.md +0 -107
  30. package/docs/interfaces/AbiOutput.md +0 -52
  31. package/docs/interfaces/Arweave.md +0 -32
  32. package/docs/interfaces/Asset.md +0 -227
  33. package/docs/interfaces/AssetDatatoken.md +0 -60
  34. package/docs/interfaces/AssetLastEvent.md +0 -63
  35. package/docs/interfaces/AssetNft.md +0 -105
  36. package/docs/interfaces/AssetPrice.md +0 -47
  37. package/docs/interfaces/ComputeAlgorithm.md +0 -82
  38. package/docs/interfaces/ComputeAsset.md +0 -56
  39. package/docs/interfaces/ComputeEnvFees.md +0 -30
  40. package/docs/interfaces/ComputeEnvFeesStructure.md +0 -20
  41. package/docs/interfaces/ComputeEnvironment.md +0 -177
  42. package/docs/interfaces/ComputeJob.md +0 -173
  43. package/docs/interfaces/ComputeOutput.md +0 -118
  44. package/docs/interfaces/ComputeResourcesPricingInfo.md +0 -30
  45. package/docs/interfaces/ComputeResourcesRequest.md +0 -34
  46. package/docs/interfaces/ComputeResult.md +0 -52
  47. package/docs/interfaces/ConsumeMarketFee.md +0 -41
  48. package/docs/interfaces/Credential.md +0 -30
  49. package/docs/interfaces/Credentials.md +0 -30
  50. package/docs/interfaces/DDO.md +0 -137
  51. package/docs/interfaces/DatatokenCreateParams.md +0 -107
  52. package/docs/interfaces/DatatokenRoles.md +0 -30
  53. package/docs/interfaces/DispenserCreationParams.md +0 -63
  54. package/docs/interfaces/DispenserParams.md +0 -52
  55. package/docs/interfaces/DispenserToken.md +0 -85
  56. package/docs/interfaces/DownloadResponse.md +0 -30
  57. package/docs/interfaces/Event.md +0 -73
  58. package/docs/interfaces/FeesInfo.md +0 -74
  59. package/docs/interfaces/FileInfo.md +0 -118
  60. package/docs/interfaces/Files.md +0 -41
  61. package/docs/interfaces/FixedPriceExchange.md +0 -162
  62. package/docs/interfaces/FreCreationParams.md +0 -118
  63. package/docs/interfaces/FreOrderParams.md +0 -85
  64. package/docs/interfaces/GraphqlQuery.md +0 -69
  65. package/docs/interfaces/Ipfs.md +0 -32
  66. package/docs/interfaces/Metadata.md +0 -193
  67. package/docs/interfaces/MetadataAlgorithm.md +0 -69
  68. package/docs/interfaces/MetadataAndTokenURI.md +0 -107
  69. package/docs/interfaces/MetadataProof.md +0 -52
  70. package/docs/interfaces/NftCreateData.md +0 -74
  71. package/docs/interfaces/NftRoles.md +0 -52
  72. package/docs/interfaces/Operation.md +0 -145
  73. package/docs/interfaces/OrderParams.md +0 -52
  74. package/docs/interfaces/PriceAndFees.md +0 -52
  75. package/docs/interfaces/ProviderComputeInitialize.md +0 -41
  76. package/docs/interfaces/ProviderComputeInitializeResults.md +0 -43
  77. package/docs/interfaces/ProviderFees.md +0 -96
  78. package/docs/interfaces/ProviderInitialize.md +0 -52
  79. package/docs/interfaces/PublisherTrustedAlgorithm.md +0 -47
  80. package/docs/interfaces/PublishingMarketFee.md +0 -41
  81. package/docs/interfaces/Purgatory.md +0 -34
  82. package/docs/interfaces/RunningPlatform.md +0 -30
  83. package/docs/interfaces/SearchQuery.md +0 -67
  84. package/docs/interfaces/Service.md +0 -138
  85. package/docs/interfaces/ServiceComputeOptions.md +0 -63
  86. package/docs/interfaces/ServiceEndpoint.md +0 -41
  87. package/docs/interfaces/Smartcontract-1.md +0 -58
  88. package/docs/interfaces/Stats.md +0 -47
  89. package/docs/interfaces/Template.md +0 -30
  90. package/docs/interfaces/TokenOrder.md +0 -63
  91. package/docs/interfaces/UrlFile.md +0 -71
  92. package/docs/interfaces/UserCustomParameters.md +0 -7
  93. package/docs/interfaces/ValidateMetadata.md +0 -52
  94. package/docs/modules.md +0 -850
  95. package/typedoc.json +0 -4
package/docs/.nojekyll DELETED
@@ -1 +0,0 @@
1
- TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
package/docs/README.md DELETED
@@ -1,195 +0,0 @@
1
- @oceanprotocol/lib / [Exports](modules.md)
2
-
3
- [![banner](https://raw.githubusercontent.com/oceanprotocol/art/master/github/repo-banner%402x.png)](https://oceanprotocol.com)
4
-
5
- <h1 align="center">ocean.js</h1>
6
-
7
- > JavaScript library to privately & securely publish, exchange, and consume data.
8
-
9
- [![npm](https://img.shields.io/npm/v/@oceanprotocol/lib.svg)](https://www.npmjs.com/package/@oceanprotocol/lib)
10
- [![Build Status](https://github.com/oceanprotocol/ocean.js/workflows/CI/badge.svg)](https://github.com/oceanprotocol/ocean.js/actions)
11
- [![Maintainability](https://api.codeclimate.com/v1/badges/6381c81b8ac568a53537/maintainability)](https://codeclimate.com/github/oceanprotocol/ocean.js/maintainability)
12
- [![Test Coverage](https://api.codeclimate.com/v1/badges/6381c81b8ac568a53537/test_coverage)](https://codeclimate.com/github/oceanprotocol/ocean.js/test_coverage)
13
- [![code style: prettier](https://img.shields.io/badge/code_style-prettier-7b1173.svg?style=flat-square)](https://github.com/prettier/prettier)
14
- [![js oceanprotocol](https://img.shields.io/badge/js-oceanprotocol-7b1173.svg)](https://github.com/oceanprotocol/eslint-config-oceanprotocol)
15
-
16
- With ocean.js, you can:
17
-
18
- - **Publish** data services: downloadable files or compute-to-data (C2D). Create an ERC721 **data NFT** for each service, and ERC20 **datatoken** for access (1.0 datatokens to access).
19
- - **Consume** data: download files or run compute-to-data jobs on datasets while preserving data privacy.
20
- - **Sell** datatokens via fixed-rate exchanges or dispense them for free.
21
- - **Manage pricing**: create fixed-rate exchanges, dispensers, or use dynamic pricing mechanisms for your assets.
22
- - **Compute-to-Data**: run algorithms on the ocean network.
23
- - **Transfer** data NFTs & datatokens to another owner, and **all other ERC721 & ERC20 actions** using ethers.js.
24
-
25
- ocean.js is part of the [Ocean Protocol](https://oceanprotocol.com) toolset.
26
-
27
- This is in alpha state. If you run into problems, please open up a [new issue](https://github.com/oceanprotocol/ocean.js/issues/new?assignees=&labels=bug&template=bug_report.md&title=).
28
-
29
- - [📚 Prerequisites](#-prerequisites)
30
- - [🏗 Installation & Usage](#-installation--usage)
31
- - [🦑 Development](#-development)
32
- - [✨ Code Style](#-code-style)
33
- - [👩‍🔬 Testing](#-testing)
34
- - [Unit Tests](#unit-tests)
35
- - [Integration Tests](#integration-tests)
36
- - [🛳 Production](#-production)
37
- - [⬆️ Releases](#️-releases)
38
- - [Production](#production)
39
- - [Pre-Releases](#pre-releases)
40
- - [🏛 License](#-license)
41
-
42
- ## 📚 Prerequisites
43
-
44
- - node.js ([Install from here](https://nodejs.org/en/download/))
45
- - Docker ([Managed as a non-root user](https://docs.docker.com/engine/install/linux-postinstall/))
46
- - A Unix based operating system (Mac or Linux)
47
-
48
- ## 🏗 Installation & Usage
49
-
50
- ```bash
51
- npm install @oceanprotocol/lib
52
- ```
53
-
54
- - Checkout our [code examples](CodeExamples.md), [compute-to-data examples](ComputeExamples.md), or [quick reference cheatsheet](Cheatsheet.md) to see how you can use ocean.js.
55
- - Refer to the [Ocean Protocol documentation](https://docs.oceanprotocol.com/) for more guides and tutorials.
56
- - Visit the [Ocean Protocol website](https://docs.oceanprotocol.com/) for general information about Ocean Protocol.
57
- - If you have any difficulties or if you have further questions about how to use ocean.js please reach out to us on [Discord](https://discord.gg/TnXjkR5).
58
- - If you notice any bugs or issues with ocean.js please [open an issue on github](https://github.com/oceanprotocol/ocean.js/issues/new?assignees=&labels=bug&template=bug_report.md&title=).
59
-
60
- ## 🦑 Development
61
-
62
- The project is authored with TypeScript and compiled with `tsc`.
63
-
64
- To start compiler in watch mode:
65
-
66
- ```bash
67
- npm install
68
- npm start
69
- ```
70
-
71
- ## ✨ Code Style
72
-
73
- For linting and auto-formatting you can use from the root of the project:
74
-
75
- ```bash
76
- # lint all js with eslint
77
- npm run lint
78
-
79
- # auto format all js & css with prettier, taking all configs into account
80
- npm run format
81
- ```
82
-
83
- ## 👩‍🔬 Testing
84
-
85
- Test suite for unit & integration tests is setup with [Mocha](https://mochajs.org) as test runner, and [nyc](https://github.com/istanbuljs/nyc) for coverage reporting. A combined coverage report is sent to CodeClimate via the `coverage` GitHub Actions job.
86
-
87
- Running all tests requires running Ocean Protocol components beforehand with [Barge](https://github.com/oceanprotocol/barge), which also runs a local blockchain instance:
88
-
89
- ```bash
90
- git clone https://github.com/oceanprotocol/barge
91
- cd barge
92
-
93
- ./start_ocean.sh
94
- ```
95
-
96
- You can then proceed to run in another terminal.
97
-
98
- Let ocean.js know where to pickup the smart contract addresses, which has been written out by Barge in this location:
99
-
100
- ```
101
- export ADDRESS_FILE="${HOME}/.ocean/ocean-contracts/artifacts/address.json"
102
- ```
103
-
104
- Build metadata:
105
-
106
- ```
107
- npm run build:metadata
108
- ```
109
-
110
- Executing linting, type checking, unit, and integration tests with coverage reporting all in one go:
111
-
112
- ```bash
113
- npm test
114
- ```
115
-
116
- ### Unit Tests
117
-
118
- You can execute the unit tests individually with:
119
-
120
- ```bash
121
- npm run test:unit
122
- # same thing, but with coverage reporting
123
- npm run test:unit:cover
124
- ```
125
-
126
- ### Integration Tests
127
-
128
- You can execute the integration tests individually with:
129
-
130
- ```bash
131
- npm run test:integration
132
- # same thing, but with coverage reporting
133
- npm run test:integration:cover
134
- ```
135
-
136
- > Note: On macOS, changes to the `provider`, `metadataCache` and `subgraph` URLs are required, as their default `barge` IPs can not be accessed due to network constraints on macOS. Instead use `http://127.0.0.1` for each direct call to the mentioned services, but keep the internal `provider` URL (`http://172.15.0.4:8030`) hardcoded inside all DDO's `serviceEndpoint`, and when calling `nft.setMetadata()`.
137
-
138
- ## 🛳 Production
139
-
140
- To create a production build, run from the root of the project:
141
-
142
- ```bash
143
- npm run build
144
- ```
145
-
146
- ## ⬆️ Releases
147
-
148
- Releases are managed semi-automatically. They are always manually triggered from a developer's machine with release scripts.
149
-
150
- ### Production
151
-
152
- From a clean `main` branch you can run the release task bumping the version accordingly based on semantic versioning:
153
-
154
- ```bash
155
- npm run release
156
- ```
157
-
158
- The task does the following:
159
-
160
- - bumps the project version in `package.json`, `package-lock.json`
161
- - auto-generates and updates the CHANGELOG.md file from commit messages
162
- - creates a Git tag
163
- - commits and pushes everything
164
- - creates a GitHub release with commit messages as description
165
- - Git tag push will trigger a GitHub Action workflow to do a npm release
166
-
167
- For the GitHub releases steps a GitHub personal access token, exported as `GITHUB_TOKEN` is required. [Setup](https://github.com/release-it/release-it#github-releases)
168
-
169
- ### Pre-Releases
170
-
171
- For pre-releases, this is required for the first one like `v0.18.0-next.0`:
172
-
173
- ```bash
174
- ./node_modules/.bin/release-it major|minor|patch --preRelease=next
175
- ```
176
-
177
- Further releases afterwards can be done with `npm run release` again and selecting the appropriate next version, in this case `v0.18.0-next.1` and so on.
178
-
179
- ## 🏛 License
180
-
181
- ```
182
- Copyright ((C)) 2025 Ocean Protocol Foundation
183
-
184
- Licensed under the Apache License, Version 2.0 (the "License");
185
- you may not use this file except in compliance with the License.
186
- You may obtain a copy of the License at
187
-
188
- http://www.apache.org/licenses/LICENSE-2.0
189
-
190
- Unless required by applicable law or agreed to in writing, software
191
- distributed under the License is distributed on an "AS IS" BASIS,
192
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
193
- See the License for the specific language governing permissions and
194
- limitations under the License.
195
- ```
@@ -1,175 +0,0 @@
1
- [@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Aquarius
2
-
3
- # Class: Aquarius
4
-
5
- ## Table of contents
6
-
7
- ### Constructors
8
-
9
- - [constructor](Aquarius.md#constructor)
10
-
11
- ### Properties
12
-
13
- - [aquariusURL](Aquarius.md#aquariusurl)
14
-
15
- ### Methods
16
-
17
- - [getAssetMetadata](Aquarius.md#getassetmetadata)
18
- - [querySearch](Aquarius.md#querysearch)
19
- - [resolve](Aquarius.md#resolve)
20
- - [validate](Aquarius.md#validate)
21
- - [waitForIndexer](Aquarius.md#waitForIndexer)
22
-
23
- ## Constructors
24
-
25
- ### constructor
26
-
27
- • **new Aquarius**(`aquariusURL`)
28
-
29
- Instantiate Aquarius
30
-
31
- #### Parameters
32
-
33
- | Name | Type |
34
- | :------ | :------ |
35
- | `aquariusURL` | `string` |
36
-
37
- #### Defined in
38
-
39
- [services/Aquarius.ts:21](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Aquarius.ts#L21)
40
-
41
- ## Properties
42
-
43
- ### aquariusURL
44
-
45
- • **aquariusURL**: `string`
46
-
47
- #### Defined in
48
-
49
- [services/Aquarius.ts:15](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Aquarius.ts#L15)
50
-
51
- ## Methods
52
-
53
- ### getAssetMetadata
54
-
55
- ▸ **getAssetMetadata**(`did`, `signal?`): `Promise`<`any`\>
56
-
57
- Search over the DDOs using a query.
58
-
59
- #### Parameters
60
-
61
- | Name | Type | Description |
62
- | :------ | :------ | :------ |
63
- | `did` | `string` | DID of the asset |
64
- | `signal?` | `AbortSignal` | abort signal |
65
-
66
- #### Returns
67
-
68
- `Promise`<`any`\>
69
-
70
- #### Defined in
71
-
72
- [services/Aquarius.ts:135](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Aquarius.ts#L135)
73
-
74
- ___
75
-
76
- ### querySearch
77
-
78
- ▸ **querySearch**(`query`, `signal?`): `Promise`<`any`\>
79
-
80
- Search over the DDOs using a query.
81
-
82
- #### Parameters
83
-
84
- | Name | Type | Description |
85
- | :------ | :------ | :------ |
86
- | `query` | [`SearchQuery`](../interfaces/SearchQuery.md) | Query to filter the DDOs. |
87
- | `signal?` | `AbortSignal` | abort signal |
88
-
89
- #### Returns
90
-
91
- `Promise`<`any`\>
92
-
93
- #### Defined in
94
-
95
- [services/Aquarius.ts:166](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Aquarius.ts#L166)
96
-
97
- ___
98
-
99
- ### resolve
100
-
101
- ▸ **resolve**(`did`, `signal?`): `Promise`<[`Asset`](../interfaces/Asset.md)\>
102
-
103
- Resolves a DID
104
-
105
- #### Parameters
106
-
107
- | Name | Type | Description |
108
- | :------ | :------ | :------ |
109
- | `did` | `string` | DID of the asset. |
110
- | `signal?` | `AbortSignal` | abort signal |
111
-
112
- #### Returns
113
-
114
- `Promise`<[`Asset`](../interfaces/Asset.md)\>
115
-
116
- Asset
117
-
118
- #### Defined in
119
-
120
- [services/Aquarius.ts:30](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Aquarius.ts#L30)
121
-
122
- ___
123
-
124
- ### validate
125
-
126
- ▸ **validate**(`ddo`, `signal?`,`signer?`,`providerUrl?`): `Promise`<[`ValidateMetadata`](../interfaces/ValidateMetadata.md)\>
127
-
128
- Validate DDO content
129
-
130
- #### Parameters
131
-
132
- | Name | Type | Description |
133
- | :------ | :------ | :------ |
134
- | `ddo` | [`DDO`](../interfaces/DDO.md) | DID Descriptor Object content. |
135
- | `signer?` | `Signer` | publisher account (for signature). |
136
- | `providerUrl?` | `string` | Provider url (to get nonce) |
137
- | `signal?` | `AbortSignal` | abort signal |
138
-
139
- #### Returns
140
-
141
- `Promise`<[`ValidateMetadata`](../interfaces/ValidateMetadata.md)\>
142
-
143
- .
144
-
145
- #### Defined in
146
-
147
- [services/Aquarius.ts:94](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Aquarius.ts#L94)
148
-
149
- ___
150
-
151
- ### waitForIndexer
152
-
153
- ▸ **waitForIndexer**(`did`, `txid?`, `signal?`, `interval=3000`,`maxRetries=100`): `Promise`<[`Asset`](../interfaces/Asset.md)\>
154
-
155
- Blocks until Indexer will cache the did (or the update for that did) or timeouts
156
-
157
- #### Parameters
158
-
159
- | Name | Type | Description |
160
- | :------ | :------ | :------ |
161
- | `did` | `string` | DID of the asset. |
162
- | `txid?` | `string` | used when the did exists and we expect an update with that txid. |
163
- | `signal?` | `AbortSignal` | abort signal |
164
- | `interval` | `number` | retry interval in milliseconds. Default is 3000 |
165
- | `maxRetries` | `number` | max number of retries. Default is 100 |
166
-
167
- #### Returns
168
-
169
- `Promise`<[`Asset`](../interfaces/Asset.md)\>
170
-
171
- DDO of the asset.
172
-
173
- #### Defined in
174
-
175
- [services/Aquarius.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Aquarius.ts#L58)