@oceanprotocol/lib 3.4.1 → 3.4.2
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 +72 -8
- package/CodeExamples.md +30 -10
- package/ComputeExamples.md +5 -1
- package/dist/lib.js +1 -1
- package/dist/lib.js.map +1 -1
- package/dist/lib.modern.js +1 -1
- package/dist/lib.modern.js.map +1 -1
- package/dist/lib.module.js +1 -1
- package/dist/lib.module.js.map +1 -1
- package/dist/lib.umd.js +1 -1
- package/dist/lib.umd.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,11 +4,18 @@ 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
|
+
#### [v3.4.2](https://github.com/oceanprotocol/ocean.js/compare/v3.4.1...v3.4.2)
|
|
8
|
+
|
|
9
|
+
- Add confidential EVM flag when creating a datatoken 4 in NFT class [`#1859`](https://github.com/oceanprotocol/ocean.js/pull/1859)
|
|
10
|
+
|
|
7
11
|
#### [v3.4.1](https://github.com/oceanprotocol/ocean.js/compare/v3.4.0...v3.4.1)
|
|
8
12
|
|
|
13
|
+
> 9 October 2024
|
|
14
|
+
|
|
9
15
|
- Updating oasis exports [`#1860`](https://github.com/oceanprotocol/ocean.js/pull/1860)
|
|
10
16
|
- Fix ipfs CID. [`#1851`](https://github.com/oceanprotocol/ocean.js/pull/1851)
|
|
11
17
|
- chore: get router factory address from config [`#1858`](https://github.com/oceanprotocol/ocean.js/pull/1858)
|
|
18
|
+
- Release 3.4.1 [`cc91e1d`](https://github.com/oceanprotocol/ocean.js/commit/cc91e1d376090137b7f92214a2085ea9b24a974e)
|
|
12
19
|
|
|
13
20
|
#### [v3.4.0](https://github.com/oceanprotocol/ocean.js/compare/v3.3.4-next.0...v3.4.0)
|
|
14
21
|
|
|
@@ -140,15 +147,29 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
140
147
|
- make sure we increment a number when working with nonces [`#1781`](https://github.com/oceanprotocol/ocean.js/pull/1781)
|
|
141
148
|
- Release 3.1.4 [`b2e2cf2`](https://github.com/oceanprotocol/ocean.js/commit/b2e2cf24293af07f597c25e3a3e392db9caa381a)
|
|
142
149
|
|
|
143
|
-
#### [v3.1.3](https://github.com/oceanprotocol/ocean.js/compare/v3.1.
|
|
150
|
+
#### [v3.1.3](https://github.com/oceanprotocol/ocean.js/compare/v3.1.3-next.1...v3.1.3)
|
|
144
151
|
|
|
145
152
|
> 16 October 2023
|
|
146
153
|
|
|
147
154
|
- fix fs use & error handling [`#1777`](https://github.com/oceanprotocol/ocean.js/pull/1777)
|
|
148
155
|
- Bump postcss from 8.4.5 to 8.4.31 [`#1778`](https://github.com/oceanprotocol/ocean.js/pull/1778)
|
|
156
|
+
- Release 3.1.3 [`1bc5a39`](https://github.com/oceanprotocol/ocean.js/commit/1bc5a39fda217c91cf5c44f41c6275acd20740de)
|
|
157
|
+
|
|
158
|
+
#### [v3.1.3-next.1](https://github.com/oceanprotocol/ocean.js/compare/v3.1.3-next.0...v3.1.3-next.1)
|
|
159
|
+
|
|
160
|
+
> 11 October 2023
|
|
161
|
+
|
|
162
|
+
- update error handling [`aada8e9`](https://github.com/oceanprotocol/ocean.js/commit/aada8e92af9273ccc20e86dc00ea73bcb7e8dfdf)
|
|
163
|
+
- Release 3.1.3-next.1 [`40c22b9`](https://github.com/oceanprotocol/ocean.js/commit/40c22b9b1fa147fd4295da1bdd6248d7714a2b30)
|
|
164
|
+
|
|
165
|
+
#### [v3.1.3-next.0](https://github.com/oceanprotocol/ocean.js/compare/v3.1.2...v3.1.3-next.0)
|
|
166
|
+
|
|
167
|
+
> 6 October 2023
|
|
168
|
+
|
|
149
169
|
- Bump @types/crypto-js from 4.1.1 to 4.1.2 [`#1774`](https://github.com/oceanprotocol/ocean.js/pull/1774)
|
|
150
170
|
- Bump @types/chai-spies from 1.0.3 to 1.0.4 [`#1776`](https://github.com/oceanprotocol/ocean.js/pull/1776)
|
|
151
|
-
-
|
|
171
|
+
- fix fs use [`735dc2f`](https://github.com/oceanprotocol/ocean.js/commit/735dc2f62b976be683bc9fcd7f8940e715b18519)
|
|
172
|
+
- Release 3.1.3-next.0 [`5ac5d1f`](https://github.com/oceanprotocol/ocean.js/commit/5ac5d1f44a637b5d8d285757941b0393bb3a7983)
|
|
152
173
|
|
|
153
174
|
#### [v3.1.2](https://github.com/oceanprotocol/ocean.js/compare/v3.1.1...v3.1.2)
|
|
154
175
|
|
|
@@ -207,13 +228,21 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
207
228
|
- Merge 8699e4a8bb30b3ecb7ee894412ebe85267fddd67 into ae2ff1ccde53ace9841844c316a855de271f9a3f [`9da0268`](https://github.com/oceanprotocol/ocean.js/commit/9da0268be6ddfb1e4f110ee48725e8c9a492f6fb)
|
|
208
229
|
- Adding tests to check if the number of decimals is correct for the publishMarketFee [`8699e4a`](https://github.com/oceanprotocol/ocean.js/commit/8699e4a8bb30b3ecb7ee894412ebe85267fddd67)
|
|
209
230
|
|
|
210
|
-
#### [v3.0.1](https://github.com/oceanprotocol/ocean.js/compare/v3.0.0...v3.0.1)
|
|
231
|
+
#### [v3.0.1](https://github.com/oceanprotocol/ocean.js/compare/v3.0.1-next.0...v3.0.1)
|
|
211
232
|
|
|
212
233
|
> 6 June 2023
|
|
213
234
|
|
|
214
235
|
- set min gas fee 30 gwei on priority fees for polygon and mumbai as well [`#1736`](https://github.com/oceanprotocol/ocean.js/pull/1736)
|
|
215
236
|
- Release 3.0.1 [`ae2ff1c`](https://github.com/oceanprotocol/ocean.js/commit/ae2ff1ccde53ace9841844c316a855de271f9a3f)
|
|
216
237
|
|
|
238
|
+
#### [v3.0.1-next.0](https://github.com/oceanprotocol/ocean.js/compare/v3.0.0...v3.0.1-next.0)
|
|
239
|
+
|
|
240
|
+
> 31 May 2023
|
|
241
|
+
|
|
242
|
+
- Release 3.0.1-next.0 [`b670073`](https://github.com/oceanprotocol/ocean.js/commit/b67007363a8e2a3b640411c3b6471edeacdf5d19)
|
|
243
|
+
- Merge 04deabccd3ffbc8d3620e42a8b1bc4a2d5019e54 into 543f71f7cda1b3d0099cc26975d34b89bead7452 [`c33663c`](https://github.com/oceanprotocol/ocean.js/commit/c33663cfdbf501c407d3e1e17f56b17761f9e556)
|
|
244
|
+
- set min gas fee 30 gwei on priority fees for polygon and mumbai as well [`04deabc`](https://github.com/oceanprotocol/ocean.js/commit/04deabccd3ffbc8d3620e42a8b1bc4a2d5019e54)
|
|
245
|
+
|
|
217
246
|
#### [v3.0.0](https://github.com/oceanprotocol/ocean.js/compare/v3.0.0-next.5...v3.0.0)
|
|
218
247
|
|
|
219
248
|
> 29 May 2023
|
|
@@ -283,7 +312,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
283
312
|
- more cleanup and jsdoc updates [`967f664`](https://github.com/oceanprotocol/ocean.js/commit/967f6642fb1a0cf9c20d4f4fa28d36527d8e43ba)
|
|
284
313
|
- Updating CodeExamples.md [`815ee37`](https://github.com/oceanprotocol/ocean.js/commit/815ee37c52f9aa64f2cac4948fb137f447d1c6b4)
|
|
285
314
|
|
|
286
|
-
#### [v2.7.0](https://github.com/oceanprotocol/ocean.js/compare/v2.
|
|
315
|
+
#### [v2.7.0](https://github.com/oceanprotocol/ocean.js/compare/v2.7.0-next.2...v2.7.0)
|
|
287
316
|
|
|
288
317
|
> 20 March 2023
|
|
289
318
|
|
|
@@ -294,6 +323,29 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
294
323
|
- Updated copyright year. [`#1700`](https://github.com/oceanprotocol/ocean.js/pull/1700)
|
|
295
324
|
- Release 2.7.0 [`a2e9901`](https://github.com/oceanprotocol/ocean.js/commit/a2e9901697b32c6aaaa489c3bec1a19fcfa185ab)
|
|
296
325
|
|
|
326
|
+
#### [v2.7.0-next.2](https://github.com/oceanprotocol/ocean.js/compare/v2.7.0-next.1...v2.7.0-next.2)
|
|
327
|
+
|
|
328
|
+
> 22 February 2023
|
|
329
|
+
|
|
330
|
+
- Release 2.7.0-next.2 [`2687751`](https://github.com/oceanprotocol/ocean.js/commit/26877517ff8a7537729e37cf6c68260ca3b3bcf4)
|
|
331
|
+
- fix isValid provider method [`010306c`](https://github.com/oceanprotocol/ocean.js/commit/010306c92e003021b08df0b8b8ad6743ae6b240c)
|
|
332
|
+
|
|
333
|
+
#### [v2.7.0-next.1](https://github.com/oceanprotocol/ocean.js/compare/v2.7.0-next.0...v2.7.0-next.1)
|
|
334
|
+
|
|
335
|
+
> 22 February 2023
|
|
336
|
+
|
|
337
|
+
- Release 2.7.0-next.0 [`500062b`](https://github.com/oceanprotocol/ocean.js/commit/500062beb575b21ab7210a675bdf5174d11842c8)
|
|
338
|
+
- Updating CodeExamples.md [`6cc891a`](https://github.com/oceanprotocol/ocean.js/commit/6cc891a5da9e4042e3eee243b651e8a7188d1786)
|
|
339
|
+
- Release 2.7.0-next.1 [`ba27412`](https://github.com/oceanprotocol/ocean.js/commit/ba2741296167de4c112560f2807b1a45e86eba94)
|
|
340
|
+
|
|
341
|
+
#### [v2.7.0-next.0](https://github.com/oceanprotocol/ocean.js/compare/v2.6.3...v2.7.0-next.0)
|
|
342
|
+
|
|
343
|
+
> 21 February 2023
|
|
344
|
+
|
|
345
|
+
- add needed multichain provider changes [`95551ee`](https://github.com/oceanprotocol/ocean.js/commit/95551eeb669395357149dd923ecec304955add14)
|
|
346
|
+
- Release 2.7.0-next.0 [`95886a1`](https://github.com/oceanprotocol/ocean.js/commit/95886a184faadd4a13e857e285e016ef4c20966f)
|
|
347
|
+
- fix code example [`c4a00e4`](https://github.com/oceanprotocol/ocean.js/commit/c4a00e45848ace6a4fe3d4fa1a2aeac518aa44ce)
|
|
348
|
+
|
|
297
349
|
#### [v2.6.3](https://github.com/oceanprotocol/ocean.js/compare/v2.6.2...v2.6.3)
|
|
298
350
|
|
|
299
351
|
> 13 February 2023
|
|
@@ -595,7 +647,21 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
595
647
|
- Bump typedoc from 0.22.15 to 0.22.17 [`#1514`](https://github.com/oceanprotocol/ocean.js/pull/1514)
|
|
596
648
|
- Release 1.1.3 [`7772e93`](https://github.com/oceanprotocol/ocean.js/commit/7772e9387ef9d63f98ea80cfd4eefbea963dd0ad)
|
|
597
649
|
|
|
598
|
-
#### [v1.1.2](https://github.com/oceanprotocol/ocean.js/compare/v1.
|
|
650
|
+
#### [v1.1.2](https://github.com/oceanprotocol/ocean.js/compare/v1.1.1...v1.1.2)
|
|
651
|
+
|
|
652
|
+
> 15 June 2022
|
|
653
|
+
|
|
654
|
+
- Release 1.1.2 [`85bf271`](https://github.com/oceanprotocol/ocean.js/commit/85bf2716e26d8691aeb9d5504e563d557419dc2e)
|
|
655
|
+
- manual bump fix [`5674a54`](https://github.com/oceanprotocol/ocean.js/commit/5674a547d1d367ce88b3595f0be8ebbf12274266)
|
|
656
|
+
|
|
657
|
+
#### [v1.1.1](https://github.com/oceanprotocol/ocean.js/compare/v1.1.0...v1.1.1)
|
|
658
|
+
|
|
659
|
+
> 15 June 2022
|
|
660
|
+
|
|
661
|
+
- Release 1.1.1 [`ea48e01`](https://github.com/oceanprotocol/ocean.js/commit/ea48e015ac8299f71d57a929f8f30c5d1a8446e7)
|
|
662
|
+
- manual bump fix [`a362410`](https://github.com/oceanprotocol/ocean.js/commit/a36241004b1d9578ec5c02d9d6e64d9750c53a7b)
|
|
663
|
+
|
|
664
|
+
#### [v1.1.0](https://github.com/oceanprotocol/ocean.js/compare/v1.0.0...v1.1.0)
|
|
599
665
|
|
|
600
666
|
> 15 June 2022
|
|
601
667
|
|
|
@@ -603,9 +669,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
603
669
|
- Bump @types/node from 17.0.35 to 17.0.44 [`#1513`](https://github.com/oceanprotocol/ocean.js/pull/1513)
|
|
604
670
|
- Bump eslint-config-oceanprotocol from 1.5.0 to 2.0.1 [`#1466`](https://github.com/oceanprotocol/ocean.js/pull/1466)
|
|
605
671
|
- update to new schema & compute fixes [`#1510`](https://github.com/oceanprotocol/ocean.js/pull/1510)
|
|
606
|
-
- Release 1.1.
|
|
607
|
-
- manual bump fix [`5674a54`](https://github.com/oceanprotocol/ocean.js/commit/5674a547d1d367ce88b3595f0be8ebbf12274266)
|
|
608
|
-
- manual bump fix [`a362410`](https://github.com/oceanprotocol/ocean.js/commit/a36241004b1d9578ec5c02d9d6e64d9750c53a7b)
|
|
672
|
+
- Release 1.1.0 [`112c27e`](https://github.com/oceanprotocol/ocean.js/commit/112c27edab58ef0681ea3e87fb09978411924753)
|
|
609
673
|
|
|
610
674
|
#### [v1.0.0](https://github.com/oceanprotocol/ocean.js/compare/v1.0.0-next.45...v1.0.0)
|
|
611
675
|
|
package/CodeExamples.md
CHANGED
|
@@ -289,7 +289,11 @@ you need to mint oceans to mentioned accounts only if you are using barge to tes
|
|
|
289
289
|
|
|
290
290
|
### 6.1 Publish a dataset (create NFT + Datatoken) with a fixed rate exchange
|
|
291
291
|
```Typescript
|
|
292
|
-
const factory = new NftFactory(
|
|
292
|
+
const factory = new NftFactory(
|
|
293
|
+
addresses.ERC721Factory,
|
|
294
|
+
publisherAccount,
|
|
295
|
+
await publisherAccount.getChainId()
|
|
296
|
+
)
|
|
293
297
|
|
|
294
298
|
const nftParams: NftCreateData = {
|
|
295
299
|
name: FRE_NFT_NAME,
|
|
@@ -409,7 +413,11 @@ Now let's console log the DID to check everything is working
|
|
|
409
413
|
|
|
410
414
|
### 6.3 Marketplace displays fixed rate asset for sale
|
|
411
415
|
```Typescript
|
|
412
|
-
const fixedRate = new FixedRateExchange(
|
|
416
|
+
const fixedRate = new FixedRateExchange(
|
|
417
|
+
freAddress,
|
|
418
|
+
publisherAccount,
|
|
419
|
+
await publisherAccount.getChainId()
|
|
420
|
+
)
|
|
413
421
|
const oceanAmount = await (
|
|
414
422
|
await fixedRate.calcBaseInGivenDatatokensOut(freId, '1')
|
|
415
423
|
).baseTokenAmount
|
|
@@ -424,7 +432,7 @@ Now that the market has fetched those values it can display the asset on the fro
|
|
|
424
432
|
|
|
425
433
|
### 7.1 Consumer buys a fixed rate asset data asset, and downloads it
|
|
426
434
|
```Typescript
|
|
427
|
-
datatoken = new Datatoken(publisherAccount)
|
|
435
|
+
datatoken = new Datatoken(publisherAccount, await publisherAccount.getChainId())
|
|
428
436
|
const DATATOKEN_AMOUNT = '10000'
|
|
429
437
|
|
|
430
438
|
await datatoken.mint(
|
|
@@ -473,7 +481,11 @@ Before we call the contract we have to call `approve` so that the contract can m
|
|
|
473
481
|
DATATOKEN_AMOUNT
|
|
474
482
|
)
|
|
475
483
|
|
|
476
|
-
const fixedRate = new FixedRateExchange(
|
|
484
|
+
const fixedRate = new FixedRateExchange(
|
|
485
|
+
freAddress,
|
|
486
|
+
consumerAccount,
|
|
487
|
+
await consumerAccount.getChainId()
|
|
488
|
+
)
|
|
477
489
|
```
|
|
478
490
|
Now we can make the contract call
|
|
479
491
|
```Typescript
|
|
@@ -517,7 +529,7 @@ Next, we need to initialize the provider
|
|
|
517
529
|
validUntil: initializeData.providerFee.validUntil
|
|
518
530
|
}
|
|
519
531
|
|
|
520
|
-
datatoken = new Datatoken(consumerAccount)
|
|
532
|
+
datatoken = new Datatoken(consumerAccount, await consumerAccount.getChainId())
|
|
521
533
|
|
|
522
534
|
```
|
|
523
535
|
Lets now make the payment
|
|
@@ -574,7 +586,11 @@ Lets check that the download URL was successfully received
|
|
|
574
586
|
|
|
575
587
|
### 8.1 Publish a dataset (create NFT + Datatoken) with a dispenser
|
|
576
588
|
```Typescript
|
|
577
|
-
const factory = new NftFactory(
|
|
589
|
+
const factory = new NftFactory(
|
|
590
|
+
addresses.ERC721Factory,
|
|
591
|
+
publisherAccount,
|
|
592
|
+
await publisherAccount.getChainId()
|
|
593
|
+
)
|
|
578
594
|
|
|
579
595
|
const nftParams: NftCreateData = {
|
|
580
596
|
name: DISP_NFT_NAME,
|
|
@@ -679,8 +695,12 @@ Now we need to encrypt file(s) using provider
|
|
|
679
695
|
|
|
680
696
|
### 9.1 Consumer gets a dispenser data asset, and downloads it
|
|
681
697
|
```Typescript
|
|
682
|
-
datatoken = new Datatoken(publisherAccount)
|
|
683
|
-
const dispenser = new Dispenser(
|
|
698
|
+
datatoken = new Datatoken(publisherAccount, await publisherAccount.getChainId())
|
|
699
|
+
const dispenser = new Dispenser(
|
|
700
|
+
addresses.Dispenser,
|
|
701
|
+
consumerAccount,
|
|
702
|
+
await consumerAccount.getChainId()
|
|
703
|
+
)
|
|
684
704
|
|
|
685
705
|
let consumerDTBalance = await balance(
|
|
686
706
|
consumerAccount,
|
|
@@ -709,7 +729,7 @@ Now we need to encrypt file(s) using provider
|
|
|
709
729
|
const resolvedDDO = await aquarius.waitForAqua(fixedDDO.id)
|
|
710
730
|
assert(resolvedDDO, 'Cannot fetch DDO from Aquarius')
|
|
711
731
|
|
|
712
|
-
datatoken = new Datatoken(consumerAccount)
|
|
732
|
+
datatoken = new Datatoken(consumerAccount, await consumerAccount.getChainId())
|
|
713
733
|
|
|
714
734
|
```
|
|
715
735
|
At this point we need to encrypt file(s) using provider
|
|
@@ -791,7 +811,7 @@ Here are the steps:
|
|
|
791
811
|
### 10.1 Add key-value pair to data NFT
|
|
792
812
|
Let's start by using the `setData` method to update the nft key value store with some data
|
|
793
813
|
```Typescript
|
|
794
|
-
const nft = new Nft(publisherAccount)
|
|
814
|
+
const nft = new Nft(publisherAccount, await publisherAccount.getChainId())
|
|
795
815
|
const data = 'SomeData'
|
|
796
816
|
try {
|
|
797
817
|
await nft.setData(
|
package/ComputeExamples.md
CHANGED
|
@@ -293,7 +293,11 @@ async function createAsset(
|
|
|
293
293
|
) {
|
|
294
294
|
const nft = new Nft(owner, (await owner.provider.getNetwork()).chainId)
|
|
295
295
|
|
|
296
|
-
const nftFactory = new NftFactory(
|
|
296
|
+
const nftFactory = new NftFactory(
|
|
297
|
+
addresses.ERC721Factory,
|
|
298
|
+
owner,
|
|
299
|
+
await owner.getChainId()
|
|
300
|
+
)
|
|
297
301
|
|
|
298
302
|
const chain = (await owner.provider.getNetwork()).chainId
|
|
299
303
|
|