@oceanprotocol/lib 5.0.4 → 5.0.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.
- package/CHANGELOG.md +55 -3
- package/Cheatsheet.md +2 -2
- package/CodeExamples.md +1 -1
- package/ComputeExamples.md +1 -1
- package/README.md +33 -7
- package/dist/lib.cjs +1 -1
- package/dist/lib.cjs.map +1 -1
- package/dist/lib.modern.js +1 -1
- package/dist/lib.modern.js.map +1 -1
- package/dist/lib.module.mjs +1 -1
- package/dist/lib.module.mjs.map +1 -1
- package/dist/lib.umd.js +1 -1
- package/dist/lib.umd.js.map +1 -1
- package/dist/types/config/Config.d.ts +6 -0
- package/dist/types/contracts/EnterpriseFeeCollector.d.ts +33 -0
- package/dist/types/contracts/index.d.ts +1 -0
- package/dist/types/services/Provider.d.ts +4 -2
- package/dist/types/utils/index.d.ts +1 -0
- package/docs/README.md +10 -7
- package/docs/classes/Escrow.md +285 -0
- package/docs/classes/Provider.md +75 -10
- package/docs/interfaces/ComputeEnvironment.md +68 -75
- package/docs/interfaces/ComputeJob.md +34 -1
- package/docs/interfaces/ComputeResourcesRequest.md +6 -2
- package/docs/interfaces/ProviderComputeInitializeResults.md +14 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -4,12 +4,47 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
#### [v5.0.6](https://github.com/oceanprotocol/ocean.js/compare/v5.0.5...v5.0.6)
|
|
8
|
+
|
|
9
|
+
- chore: add support for others token decimals that are not 18 [`#2024`](https://github.com/oceanprotocol/ocean.js/pull/2024)
|
|
10
|
+
- Revert "chore: test deposit withdraw token 6 decimals" [`#2026`](https://github.com/oceanprotocol/ocean.js/pull/2026)
|
|
11
|
+
- chore: test deposit withdraw token 6 decimals [`#2025`](https://github.com/oceanprotocol/ocean.js/pull/2025)
|
|
12
|
+
- Bump typedoc-plugin-markdown from 3.17.1 to 4.0.3 [`#2020`](https://github.com/oceanprotocol/ocean.js/pull/2020)
|
|
13
|
+
- Bump @typescript-eslint/eslint-plugin from 6.21.0 to 7.0.0 [`#2021`](https://github.com/oceanprotocol/ocean.js/pull/2021)
|
|
14
|
+
- Bump chai from 5.2.1 to 6.2.2 [`#2022`](https://github.com/oceanprotocol/ocean.js/pull/2022)
|
|
15
|
+
- add n8n flow [`#2023`](https://github.com/oceanprotocol/ocean.js/pull/2023)
|
|
16
|
+
- Bump tsx from 4.20.3 to 4.20.6 [`#1997`](https://github.com/oceanprotocol/ocean.js/pull/1997)
|
|
17
|
+
- Bump mocha from 11.7.1 to 11.7.3 [`#1999`](https://github.com/oceanprotocol/ocean.js/pull/1999)
|
|
18
|
+
- Bump min-document from 2.19.0 to 2.19.2 [`#2012`](https://github.com/oceanprotocol/ocean.js/pull/2012)
|
|
19
|
+
- Bump js-yaml from 3.14.1 to 3.14.2 [`#2015`](https://github.com/oceanprotocol/ocean.js/pull/2015)
|
|
20
|
+
- Bump jws from 3.2.2 to 3.2.3 [`#2019`](https://github.com/oceanprotocol/ocean.js/pull/2019)
|
|
21
|
+
- more checks [`43029b1`](https://github.com/oceanprotocol/ocean.js/commit/43029b10ec2e83c68bada4b8529226b64f94b0fb)
|
|
22
|
+
- chore: call amountToUnits from smart contract to detect decimals [`306edf7`](https://github.com/oceanprotocol/ocean.js/commit/306edf777d3345bebd3073634d0e0eeb11ab6d36)
|
|
23
|
+
- remove check [`d42a8ad`](https://github.com/oceanprotocol/ocean.js/commit/d42a8ad3f10d7bfea74513ca0598274d4491f4b2)
|
|
24
|
+
|
|
25
|
+
#### [v5.0.5](https://github.com/oceanprotocol/ocean.js/compare/v5.0.4...v5.0.5)
|
|
26
|
+
|
|
27
|
+
> 24 November 2025
|
|
28
|
+
|
|
29
|
+
- Deps/bump_contracts_to_2_5_0 [`#2016`](https://github.com/oceanprotocol/ocean.js/pull/2016)
|
|
30
|
+
- export addrs functions [`#2018`](https://github.com/oceanprotocol/ocean.js/pull/2018)
|
|
31
|
+
- Feature/fix enterprise fee [`#2014`](https://github.com/oceanprotocol/ocean.js/pull/2014)
|
|
32
|
+
- Feature/add enterprisefee getters [`#2010`](https://github.com/oceanprotocol/ocean.js/pull/2010)
|
|
33
|
+
- fix resources & add queue [`#2009`](https://github.com/oceanprotocol/ocean.js/pull/2009)
|
|
34
|
+
- add escrow address to config [`#2008`](https://github.com/oceanprotocol/ocean.js/pull/2008)
|
|
35
|
+
- Update docs [`#2006`](https://github.com/oceanprotocol/ocean.js/pull/2006)
|
|
36
|
+
- update codeowners [`#2005`](https://github.com/oceanprotocol/ocean.js/pull/2005)
|
|
37
|
+
- Release 5.0.5 [`bada383`](https://github.com/oceanprotocol/ocean.js/commit/bada383843f05bf73816216e710da55d4ce40607)
|
|
38
|
+
|
|
7
39
|
#### [v5.0.4](https://github.com/oceanprotocol/ocean.js/compare/v5.0.3...v5.0.4)
|
|
8
40
|
|
|
41
|
+
> 17 October 2025
|
|
42
|
+
|
|
9
43
|
- add envs and termination details [`#2004`](https://github.com/oceanprotocol/ocean.js/pull/2004)
|
|
10
44
|
- Add Cheatsheet. [`#2001`](https://github.com/oceanprotocol/ocean.js/pull/2001)
|
|
11
45
|
- Add support for BASE network. [`#2002`](https://github.com/oceanprotocol/ocean.js/pull/2002)
|
|
12
46
|
- Bump ddo.js to 0.1.4. [`#1996`](https://github.com/oceanprotocol/ocean.js/pull/1996)
|
|
47
|
+
- Release 5.0.4 [`59f305b`](https://github.com/oceanprotocol/ocean.js/commit/59f305b906c02f9d7dad7863733e0d516f8d6f9e)
|
|
13
48
|
|
|
14
49
|
#### [v5.0.3](https://github.com/oceanprotocol/ocean.js/compare/v5.0.2...v5.0.3)
|
|
15
50
|
|
|
@@ -71,7 +106,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
71
106
|
- Feature/contracts_240 [`#1979`](https://github.com/oceanprotocol/ocean.js/pull/1979)
|
|
72
107
|
- Release 5.0.0-next.2 [`fedd4c2`](https://github.com/oceanprotocol/ocean.js/commit/fedd4c273d86fb3f85990d7a289be4c3a4270832)
|
|
73
108
|
|
|
74
|
-
#### [v5.0.0-next.1](https://github.com/oceanprotocol/ocean.js/compare/v4.3.
|
|
109
|
+
#### [v5.0.0-next.1](https://github.com/oceanprotocol/ocean.js/compare/v4.3.7...v5.0.0-next.1)
|
|
75
110
|
|
|
76
111
|
> 1 August 2025
|
|
77
112
|
|
|
@@ -82,12 +117,29 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
82
117
|
- Feature/update ethers [`#1969`](https://github.com/oceanprotocol/ocean.js/pull/1969)
|
|
83
118
|
- Release 5.0.0-next.1 [`cf92038`](https://github.com/oceanprotocol/ocean.js/commit/cf92038208679177ab6af112526f5547feb0f11e)
|
|
84
119
|
|
|
85
|
-
#### [v4.3.
|
|
120
|
+
#### [v4.3.7](https://github.com/oceanprotocol/ocean.js/compare/v4.3.6...v4.3.7)
|
|
86
121
|
|
|
87
|
-
>
|
|
122
|
+
> 2 December 2025
|
|
123
|
+
|
|
124
|
+
- Release 4.3.7 [`46a157f`](https://github.com/oceanprotocol/ocean.js/commit/46a157fc93d0d0cb4aca29fa529ea5ddd70648d8)
|
|
125
|
+
- bump contracts to 2.5.0 [`7799229`](https://github.com/oceanprotocol/ocean.js/commit/7799229b0e2c6221884afe13420ef6454bc5898f)
|
|
126
|
+
|
|
127
|
+
#### [v4.3.6](https://github.com/oceanprotocol/ocean.js/compare/v4.3.5...v4.3.6)
|
|
128
|
+
|
|
129
|
+
> 24 November 2025
|
|
130
|
+
|
|
131
|
+
- export util addrs functions [`#2017`](https://github.com/oceanprotocol/ocean.js/pull/2017)
|
|
132
|
+
- Release 4.3.6 [`b28db44`](https://github.com/oceanprotocol/ocean.js/commit/b28db446144939e9ed864cc11559f718104d094b)
|
|
133
|
+
|
|
134
|
+
#### [v4.3.5](https://github.com/oceanprotocol/ocean.js/compare/v4.3.2...v4.3.5)
|
|
135
|
+
|
|
136
|
+
> 17 November 2025
|
|
88
137
|
|
|
138
|
+
- V4/feature/enterprise fee collector [`#2011`](https://github.com/oceanprotocol/ocean.js/pull/2011)
|
|
89
139
|
- add policy server endpoints [`#1974`](https://github.com/oceanprotocol/ocean.js/pull/1974)
|
|
140
|
+
- Release 4.3.5 [`2953f4a`](https://github.com/oceanprotocol/ocean.js/commit/2953f4ac49d56ac8b066ad8fa7a71b6bbc0df005)
|
|
90
141
|
- Release 4.3.3 [`6d6d4cf`](https://github.com/oceanprotocol/ocean.js/commit/6d6d4cfe57f2a3dee73b4957ff2f144c0e7ff9d7)
|
|
142
|
+
- remove typo [`f199f4a`](https://github.com/oceanprotocol/ocean.js/commit/f199f4af809eb85249fe0c59303fcc3207d8e7a7)
|
|
91
143
|
|
|
92
144
|
#### [v4.3.2](https://github.com/oceanprotocol/ocean.js/compare/v4.3.1...v4.3.2)
|
|
93
145
|
|
package/Cheatsheet.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
npm init
|
|
13
|
-
npm install @oceanprotocol/lib crypto-js ethers
|
|
13
|
+
npm install @oceanprotocol/lib crypto-js ethers typescript @types/node ts-node
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
### Configuration
|
|
@@ -224,7 +224,7 @@ const resources: ComputeResourceRequest[] = [
|
|
|
224
224
|
},
|
|
225
225
|
{
|
|
226
226
|
id: 'ram',
|
|
227
|
-
amount:
|
|
227
|
+
amount: 2
|
|
228
228
|
},
|
|
229
229
|
{
|
|
230
230
|
id: 'disk',
|
package/CodeExamples.md
CHANGED
|
@@ -45,7 +45,7 @@ We start by initializing the services. To do this, we clone the Barge repository
|
|
|
45
45
|
```bash
|
|
46
46
|
git clone https://github.com/oceanprotocol/barge.git
|
|
47
47
|
cd barge/
|
|
48
|
-
./start_ocean.sh
|
|
48
|
+
./start_ocean.sh
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
## 2. Create a new node.js project
|
package/ComputeExamples.md
CHANGED
|
@@ -35,7 +35,7 @@ We start by initializing the services. To do this, we clone the Barge repository
|
|
|
35
35
|
```bash
|
|
36
36
|
git clone https://github.com/oceanprotocol/barge.git
|
|
37
37
|
cd barge/
|
|
38
|
-
./start_ocean.sh
|
|
38
|
+
./start_ocean.sh
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
## 2. Create a new Node.js project with TypeScript
|
package/README.md
CHANGED
|
@@ -13,9 +13,11 @@
|
|
|
13
13
|
|
|
14
14
|
With ocean.js, you can:
|
|
15
15
|
|
|
16
|
-
- **Publish** data services: downloadable files or compute-to-data. Create an ERC721 **data NFT** for each service, and ERC20 **datatoken** for access (1.0 datatokens to access).
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
16
|
+
- **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).
|
|
17
|
+
- **Consume** data: download files or run compute-to-data jobs on datasets while preserving data privacy.
|
|
18
|
+
- **Sell** datatokens via fixed-rate exchanges or dispense them for free.
|
|
19
|
+
- **Manage pricing**: create fixed-rate exchanges, dispensers, or use dynamic pricing mechanisms for your assets.
|
|
20
|
+
- **Compute-to-Data**: run algorithms on the ocean network.
|
|
19
21
|
|
|
20
22
|
ocean.js is part of the [Ocean Protocol](https://oceanprotocol.com) toolset.
|
|
21
23
|
|
|
@@ -23,6 +25,7 @@ This is in alpha state. If you run into problems, please open up a [new issue](h
|
|
|
23
25
|
|
|
24
26
|
- [📚 Prerequisites](#-prerequisites)
|
|
25
27
|
- [🏗 Installation & Usage](#-installation--usage)
|
|
28
|
+
- [📖 Documentation](#-documentation)
|
|
26
29
|
- [🦑 Development](#-development)
|
|
27
30
|
- [✨ Code Style](#-code-style)
|
|
28
31
|
- [👩🔬 Testing](#-testing)
|
|
@@ -46,7 +49,7 @@ This is in alpha state. If you run into problems, please open up a [new issue](h
|
|
|
46
49
|
npm install @oceanprotocol/lib
|
|
47
50
|
```
|
|
48
51
|
|
|
49
|
-
- Checkout our [code examples](CodeExamples.md)
|
|
52
|
+
- 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.
|
|
50
53
|
- Refer to the [Ocean Protocol documentation](https://docs.oceanprotocol.com/) for more guides and tutorials.
|
|
51
54
|
- Visit the [Ocean Protocol website](https://docs.oceanprotocol.com/) for general information about Ocean Protocol.
|
|
52
55
|
- 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).
|
|
@@ -61,6 +64,29 @@ npm install @oceanprotocol/lib
|
|
|
61
64
|
```
|
|
62
65
|
- If using Next.js, they may need "moduleResolution": "bundler" for better compatibility.
|
|
63
66
|
|
|
67
|
+
## 📖 Documentation
|
|
68
|
+
|
|
69
|
+
### Quick Start Guides
|
|
70
|
+
|
|
71
|
+
- **[Code Examples](CodeExamples.md)**: Complete walkthrough of publishing and consuming datasets
|
|
72
|
+
- Creating Data NFTs and Datatokens
|
|
73
|
+
- Setting up fixed-rate exchanges and dispensers
|
|
74
|
+
- Buying and consuming data assets
|
|
75
|
+
- Using ERC725 key-value store
|
|
76
|
+
|
|
77
|
+
- **[Compute-to-Data Examples](ComputeExamples.md)**: Comprehensive guide to C2D features
|
|
78
|
+
- Publishing datasets and algorithms for compute
|
|
79
|
+
- Starting free compute jobs
|
|
80
|
+
- Running paid compute jobs with custom resources
|
|
81
|
+
- Checking compute status and retrieving results
|
|
82
|
+
|
|
83
|
+
- **[Cheatsheet](Cheatsheet.md)**: Quick reference for common operations
|
|
84
|
+
- Publishing datasets
|
|
85
|
+
- Consuming data
|
|
86
|
+
- Free and paid compute workflows
|
|
87
|
+
- Getting compute job status
|
|
88
|
+
|
|
89
|
+
|
|
64
90
|
## 🦑 Development
|
|
65
91
|
|
|
66
92
|
The project is authored with TypeScript and compiled with `tsc`.
|
|
@@ -88,13 +114,13 @@ npm run format
|
|
|
88
114
|
|
|
89
115
|
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.
|
|
90
116
|
|
|
91
|
-
Running all tests requires running Ocean Protocol components beforehand with [Barge](https://github.com/oceanprotocol/barge), which also runs a
|
|
117
|
+
Running all tests requires running Ocean Protocol components beforehand with [Barge](https://github.com/oceanprotocol/barge), which also runs a local blockchain instance:
|
|
92
118
|
|
|
93
119
|
```bash
|
|
94
120
|
git clone https://github.com/oceanprotocol/barge
|
|
95
121
|
cd barge
|
|
96
122
|
|
|
97
|
-
./start_ocean.sh
|
|
123
|
+
./start_ocean.sh
|
|
98
124
|
```
|
|
99
125
|
|
|
100
126
|
You can then proceed to run in another terminal.
|
|
@@ -199,7 +225,7 @@ Further releases afterwards can be done with `npm run release` again and selecti
|
|
|
199
225
|
## 🏛 License
|
|
200
226
|
|
|
201
227
|
```
|
|
202
|
-
Copyright ((C))
|
|
228
|
+
Copyright ((C)) 2025 Ocean Protocol Foundation
|
|
203
229
|
|
|
204
230
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
205
231
|
you may not use this file except in compliance with the License.
|