@oceanprotocol/lib 6.0.0 → 6.1.0
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 +11 -2
- package/ComputeExamples.md +20 -27
- 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/@types/Compute.d.ts +10 -41
- package/dist/types/@types/Datatoken.d.ts +7 -2
- package/dist/types/@types/File.d.ts +33 -40
- package/dist/types/services/Provider.d.ts +11 -22
- package/dist/types/utils/Assets.d.ts +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,16 @@ 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
|
-
#### [
|
|
7
|
+
#### [v6.1.0](https://github.com/oceanprotocol/ocean.js/compare/v6.0.0...v6.1.0)
|
|
8
|
+
|
|
9
|
+
- Bump decimal.js from 10.5.0 to 10.6.0 [`#2047`](https://github.com/oceanprotocol/ocean.js/pull/2047)
|
|
10
|
+
- Bump eslint-plugin-prettier from 4.2.1 to 4.2.5 [`#2049`](https://github.com/oceanprotocol/ocean.js/pull/2049)
|
|
11
|
+
- Bump svgo from 2.8.0 to 2.8.2 [`#2051`](https://github.com/oceanprotocol/ocean.js/pull/2051)
|
|
12
|
+
- Feature/storage updates [`#2052`](https://github.com/oceanprotocol/ocean.js/pull/2052)
|
|
13
|
+
|
|
14
|
+
### [v6.0.0](https://github.com/oceanprotocol/ocean.js/compare/5.2.0...v6.0.0)
|
|
15
|
+
|
|
16
|
+
> 27 February 2026
|
|
8
17
|
|
|
9
18
|
- refactor signatures + add private docker registry [`#2041`](https://github.com/oceanprotocol/ocean.js/pull/2041)
|
|
10
19
|
- Bump rollup from 2.79.2 to 2.80.0 [`#2046`](https://github.com/oceanprotocol/ocean.js/pull/2046)
|
|
@@ -14,9 +23,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
14
23
|
- Bump basic-ftp from 5.0.5 to 5.2.0 [`#2044`](https://github.com/oceanprotocol/ocean.js/pull/2044)
|
|
15
24
|
- use new escrow address [`#2045`](https://github.com/oceanprotocol/ocean.js/pull/2045)
|
|
16
25
|
- feat(logs): add downloadNodeLogs provider function [`#2038`](https://github.com/oceanprotocol/ocean.js/pull/2038)
|
|
26
|
+
- Release 6.0.0 [`c2a48da`](https://github.com/oceanprotocol/ocean.js/commit/c2a48daf8aad897a1f7ed797d65ea9f910cf3722)
|
|
17
27
|
- Release 5.1.3 [`cbf10ae`](https://github.com/oceanprotocol/ocean.js/commit/cbf10aeb59b67328d4bbd3a3c818985e2152a228)
|
|
18
28
|
- Release 5.1.1 [`c1dea5f`](https://github.com/oceanprotocol/ocean.js/commit/c1dea5f0df8c574e99721fa7444c4e87baf633ee)
|
|
19
|
-
- Release 5.1.2 [`0b8febb`](https://github.com/oceanprotocol/ocean.js/commit/0b8febb1603e38eb8adee04e2acc85f3437826ec)
|
|
20
29
|
|
|
21
30
|
#### [5.2.0](https://github.com/oceanprotocol/ocean.js/compare/v5.1.3...5.2.0)
|
|
22
31
|
|
package/ComputeExamples.md
CHANGED
|
@@ -137,7 +137,7 @@ import {
|
|
|
137
137
|
ComputeAlgorithm,
|
|
138
138
|
ComputeAsset,
|
|
139
139
|
Config,
|
|
140
|
-
|
|
140
|
+
StorageObject,
|
|
141
141
|
NftCreateData,
|
|
142
142
|
DatatokenCreateParams,
|
|
143
143
|
sendTx,
|
|
@@ -147,7 +147,8 @@ import {
|
|
|
147
147
|
amountToUnits,
|
|
148
148
|
isDefined,
|
|
149
149
|
ComputeResourceRequest,
|
|
150
|
-
unitsToAmount
|
|
150
|
+
unitsToAmount,
|
|
151
|
+
AssetFiles
|
|
151
152
|
} from '../../src/index.js'
|
|
152
153
|
import crypto from 'crypto-js'
|
|
153
154
|
import { DDO } from '@oceanprotocol/ddo-js'
|
|
@@ -160,29 +161,18 @@ const { SHA256 } = crypto
|
|
|
160
161
|
|
|
161
162
|
We will need two files to publish, one as dataset and one as algorithm, so here we define the files that we intend to publish.
|
|
162
163
|
```Typescript
|
|
163
|
-
const DATASET_ASSET_URL:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
{
|
|
168
|
-
type: 'url',
|
|
169
|
-
url: 'https://raw.githubusercontent.com/oceanprotocol/testdatasets/main/shs_dataset_test.txt',
|
|
170
|
-
method: 'GET'
|
|
171
|
-
}
|
|
172
|
-
]
|
|
164
|
+
const DATASET_ASSET_URL: StorageObject = {
|
|
165
|
+
type: 'url',
|
|
166
|
+
url: 'https://raw.githubusercontent.com/oceanprotocol/testdatasets/main/shs_dataset_test.txt',
|
|
167
|
+
method: 'GET'
|
|
173
168
|
}
|
|
174
169
|
|
|
175
|
-
const ALGORITHM_ASSET_URL:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
{
|
|
180
|
-
type: 'url',
|
|
181
|
-
url: 'https://raw.githubusercontent.com/oceanprotocol/testdatasets/main/shs_dataset_test.txt',
|
|
182
|
-
method: 'GET'
|
|
183
|
-
}
|
|
184
|
-
]
|
|
170
|
+
const ALGORITHM_ASSET_URL: StorageObject = {
|
|
171
|
+
type: 'url',
|
|
172
|
+
url: 'https://raw.githubusercontent.com/oceanprotocol/testdatasets/main/shs_dataset_test.txt',
|
|
173
|
+
method: 'GET'
|
|
185
174
|
}
|
|
175
|
+
|
|
186
176
|
```
|
|
187
177
|
|
|
188
178
|
Next, we define the metadata for the dataset and algorithm that will describe our data assets. This is what we call the DDOs
|
|
@@ -304,7 +294,7 @@ async function createAssetHelper(
|
|
|
304
294
|
name: string,
|
|
305
295
|
symbol: string,
|
|
306
296
|
owner: Signer,
|
|
307
|
-
|
|
297
|
+
assetFiles: StorageObject[],
|
|
308
298
|
ddo: DDO,
|
|
309
299
|
providerUrl: string
|
|
310
300
|
) {
|
|
@@ -345,8 +335,11 @@ async function createAssetHelper(
|
|
|
345
335
|
const nftAddress = nftCreatedEvent.args.newTokenAddress
|
|
346
336
|
const datatokenAddressAsset = tokenCreatedEvent.args.newTokenAddress
|
|
347
337
|
// create the files encrypted string
|
|
348
|
-
assetUrl
|
|
349
|
-
|
|
338
|
+
const assetUrl: AssetFiles = {
|
|
339
|
+
nftAddress,
|
|
340
|
+
datatokenAddress: datatokenAddressAsset,
|
|
341
|
+
files: assetFiles
|
|
342
|
+
}
|
|
350
343
|
ddo.services[0].files = await ProviderInstance.encrypt(
|
|
351
344
|
assetUrl,
|
|
352
345
|
Number(chainId),
|
|
@@ -533,7 +526,7 @@ you need to mint oceans to mentioned accounts only if you are using barge to tes
|
|
|
533
526
|
'D1Min',
|
|
534
527
|
'D1M',
|
|
535
528
|
publisherAccount,
|
|
536
|
-
DATASET_ASSET_URL,
|
|
529
|
+
[DATASET_ASSET_URL],
|
|
537
530
|
DATASET_DDO,
|
|
538
531
|
providerUrl
|
|
539
532
|
)
|
|
@@ -552,7 +545,7 @@ Now, let's check that we successfully published a dataset (create NFT + Datatoke
|
|
|
552
545
|
'D1Min',
|
|
553
546
|
'D1M',
|
|
554
547
|
publisherAccount,
|
|
555
|
-
ALGORITHM_ASSET_URL,
|
|
548
|
+
[ALGORITHM_ASSET_URL],
|
|
556
549
|
ALGORITHM_DDO,
|
|
557
550
|
providerUrl
|
|
558
551
|
)
|