@oceanprotocol/lib 2.6.0 → 2.6.3
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 +39 -16
- package/CodeExamples.md +47 -0
- package/README.md +2 -0
- 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,8 +4,42 @@ 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
|
+
#### [v2.6.3](https://github.com/oceanprotocol/ocean.js/compare/v2.6.2...v2.6.3)
|
|
8
|
+
|
|
9
|
+
- add macOS readme message [`#1697`](https://github.com/oceanprotocol/ocean.js/pull/1697)
|
|
10
|
+
|
|
11
|
+
#### [v2.6.2](https://github.com/oceanprotocol/ocean.js/compare/v2.6.1...v2.6.2)
|
|
12
|
+
|
|
13
|
+
> 7 February 2023
|
|
14
|
+
|
|
15
|
+
- Bump @truffle/hdwallet-provider from 2.1.4 to 2.1.5 [`#1689`](https://github.com/oceanprotocol/ocean.js/pull/1689)
|
|
16
|
+
- Bump http-cache-semantics from 4.1.0 to 4.1.1 [`#1691`](https://github.com/oceanprotocol/ocean.js/pull/1691)
|
|
17
|
+
- Set withMint default to true [`#1693`](https://github.com/oceanprotocol/ocean.js/pull/1693)
|
|
18
|
+
- Bump decimal.js from 10.4.2 to 10.4.3 [`#1687`](https://github.com/oceanprotocol/ocean.js/pull/1687)
|
|
19
|
+
- Bump mocha from 10.1.0 to 10.2.0 [`#1690`](https://github.com/oceanprotocol/ocean.js/pull/1690)
|
|
20
|
+
- Bump json5 from 1.0.1 to 1.0.2 [`#1681`](https://github.com/oceanprotocol/ocean.js/pull/1681)
|
|
21
|
+
- Release 2.6.2 [`956a000`](https://github.com/oceanprotocol/ocean.js/commit/956a0009c78739f0d8dda56707ffbbeb9eea1cc3)
|
|
22
|
+
|
|
23
|
+
#### [v2.6.1](https://github.com/oceanprotocol/ocean.js/compare/v2.6.0...v2.6.1)
|
|
24
|
+
|
|
25
|
+
> 6 January 2023
|
|
26
|
+
|
|
27
|
+
- Fix download when content disposition header missing [`#1680`](https://github.com/oceanprotocol/ocean.js/pull/1680)
|
|
28
|
+
- Bump prettier from 2.7.1 to 2.8.1 [`#1676`](https://github.com/oceanprotocol/ocean.js/pull/1676)
|
|
29
|
+
- Bump @types/node from 18.8.0 to 18.11.18 [`#1675`](https://github.com/oceanprotocol/ocean.js/pull/1675)
|
|
30
|
+
- Bump release-it from 15.5.0 to 15.6.0 [`#1674`](https://github.com/oceanprotocol/ocean.js/pull/1674)
|
|
31
|
+
- Bump @truffle/hdwallet-provider from 2.1.2 to 2.1.4 [`#1677`](https://github.com/oceanprotocol/ocean.js/pull/1677)
|
|
32
|
+
- Bump @typescript-eslint/eslint-plugin from 5.45.0 to 5.47.1 [`#1678`](https://github.com/oceanprotocol/ocean.js/pull/1678)
|
|
33
|
+
- Adding instructions on how to use ERC725 in the CodeExamples file [`#1672`](https://github.com/oceanprotocol/ocean.js/pull/1672)
|
|
34
|
+
- Min 30gwei polygon main and mumbai fees [`#1671`](https://github.com/oceanprotocol/ocean.js/pull/1671)
|
|
35
|
+
- Combining tests and checking that the data received is correct [`39ac4a4`](https://github.com/oceanprotocol/ocean.js/commit/39ac4a40462938c5f1b1f482eaf05bce2812c360)
|
|
36
|
+
- Updating assertion failure messages [`5d3bcde`](https://github.com/oceanprotocol/ocean.js/commit/5d3bcde5bd66588f18efdacc7cd1aafe1c158f0e)
|
|
37
|
+
- Updating guide and formatting [`726e34c`](https://github.com/oceanprotocol/ocean.js/commit/726e34c8fc013523d7db6bad7a86687c9a462f2d)
|
|
38
|
+
|
|
7
39
|
#### [v2.6.0](https://github.com/oceanprotocol/ocean.js/compare/v2.5.2...v2.6.0)
|
|
8
40
|
|
|
41
|
+
> 19 December 2022
|
|
42
|
+
|
|
9
43
|
- Add missing symbol and name helper on datatoken [`#1667`](https://github.com/oceanprotocol/ocean.js/pull/1667)
|
|
10
44
|
- add headers [`#1665`](https://github.com/oceanprotocol/ocean.js/pull/1665)
|
|
11
45
|
- Compute Example Readme flow [`#1615`](https://github.com/oceanprotocol/ocean.js/pull/1615)
|
|
@@ -15,6 +49,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
15
49
|
- Bump @typescript-eslint/eslint-plugin from 5.38.1 to 5.45.0 [`#1657`](https://github.com/oceanprotocol/ocean.js/pull/1657)
|
|
16
50
|
- Bump @truffle/hdwallet-provider from 2.1.0 to 2.1.2 [`#1656`](https://github.com/oceanprotocol/ocean.js/pull/1656)
|
|
17
51
|
- Bump web3 from 1.8.0 to 1.8.1 [`#1659`](https://github.com/oceanprotocol/ocean.js/pull/1659)
|
|
52
|
+
- Release 2.6.0 [`94fd276`](https://github.com/oceanprotocol/ocean.js/commit/94fd276d6b34b3e4d620871d06e7e23271be6868)
|
|
18
53
|
|
|
19
54
|
#### [v2.5.2](https://github.com/oceanprotocol/ocean.js/compare/v2.5.1...v2.5.2)
|
|
20
55
|
|
|
@@ -267,21 +302,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
267
302
|
- Bump typedoc from 0.22.15 to 0.22.17 [`#1514`](https://github.com/oceanprotocol/ocean.js/pull/1514)
|
|
268
303
|
- Release 1.1.3 [`7772e93`](https://github.com/oceanprotocol/ocean.js/commit/7772e9387ef9d63f98ea80cfd4eefbea963dd0ad)
|
|
269
304
|
|
|
270
|
-
#### [v1.1.2](https://github.com/oceanprotocol/ocean.js/compare/v1.
|
|
271
|
-
|
|
272
|
-
> 15 June 2022
|
|
273
|
-
|
|
274
|
-
- Release 1.1.2 [`85bf271`](https://github.com/oceanprotocol/ocean.js/commit/85bf2716e26d8691aeb9d5504e563d557419dc2e)
|
|
275
|
-
- manual bump fix [`5674a54`](https://github.com/oceanprotocol/ocean.js/commit/5674a547d1d367ce88b3595f0be8ebbf12274266)
|
|
276
|
-
|
|
277
|
-
#### [v1.1.1](https://github.com/oceanprotocol/ocean.js/compare/v1.1.0...v1.1.1)
|
|
278
|
-
|
|
279
|
-
> 15 June 2022
|
|
280
|
-
|
|
281
|
-
- Release 1.1.1 [`ea48e01`](https://github.com/oceanprotocol/ocean.js/commit/ea48e015ac8299f71d57a929f8f30c5d1a8446e7)
|
|
282
|
-
- manual bump fix [`a362410`](https://github.com/oceanprotocol/ocean.js/commit/a36241004b1d9578ec5c02d9d6e64d9750c53a7b)
|
|
283
|
-
|
|
284
|
-
#### [v1.1.0](https://github.com/oceanprotocol/ocean.js/compare/v1.0.0...v1.1.0)
|
|
305
|
+
#### [v1.1.2](https://github.com/oceanprotocol/ocean.js/compare/v1.0.0...v1.1.2)
|
|
285
306
|
|
|
286
307
|
> 15 June 2022
|
|
287
308
|
|
|
@@ -289,7 +310,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
289
310
|
- Bump @types/node from 17.0.35 to 17.0.44 [`#1513`](https://github.com/oceanprotocol/ocean.js/pull/1513)
|
|
290
311
|
- Bump eslint-config-oceanprotocol from 1.5.0 to 2.0.1 [`#1466`](https://github.com/oceanprotocol/ocean.js/pull/1466)
|
|
291
312
|
- update to new schema & compute fixes [`#1510`](https://github.com/oceanprotocol/ocean.js/pull/1510)
|
|
292
|
-
- Release 1.1.
|
|
313
|
+
- Release 1.1.2 [`85bf271`](https://github.com/oceanprotocol/ocean.js/commit/85bf2716e26d8691aeb9d5504e563d557419dc2e)
|
|
314
|
+
- manual bump fix [`5674a54`](https://github.com/oceanprotocol/ocean.js/commit/5674a547d1d367ce88b3595f0be8ebbf12274266)
|
|
315
|
+
- manual bump fix [`a362410`](https://github.com/oceanprotocol/ocean.js/commit/a36241004b1d9578ec5c02d9d6e64d9750c53a7b)
|
|
293
316
|
|
|
294
317
|
#### [v1.0.0](https://github.com/oceanprotocol/ocean.js/compare/v1.0.0-next.45...v1.0.0)
|
|
295
318
|
|
package/CodeExamples.md
CHANGED
|
@@ -677,6 +677,53 @@ Let's check we received the download URL ok
|
|
|
677
677
|
|
|
678
678
|
```
|
|
679
679
|
|
|
680
|
+
## 8. Using ERC725 Key-Value Store
|
|
681
|
+
|
|
682
|
+
Data NFTs can store arbitrary key-value pairs on-chain. This opens up their usage for a broad variety of applications, such as comments & ratings, attestations, and privately sharing data (when the value is encrypted).
|
|
683
|
+
|
|
684
|
+
Let's see how!
|
|
685
|
+
|
|
686
|
+
Here are the steps:
|
|
687
|
+
|
|
688
|
+
1. Setup (same as above)
|
|
689
|
+
2. Publish data NFT (same as above)
|
|
690
|
+
3. Add key-value pair to data NFT (use the `setData` method)
|
|
691
|
+
4. Retrieve value from data NFT (use the `getData` method)
|
|
692
|
+
|
|
693
|
+
### 8.1 Add key-value pair to data NFT
|
|
694
|
+
Let's start by using the `setData` method to update the nft key value store with some data
|
|
695
|
+
```Typescript
|
|
696
|
+
const nft = new Nft(web3)
|
|
697
|
+
const data = 'SomeData'
|
|
698
|
+
try {
|
|
699
|
+
await nft.setData(freNftAddress, publisherAccount, '1', data)
|
|
700
|
+
} catch (e) {
|
|
701
|
+
assert.fail('Failed to set data in NFT ERC725 key value store', e)
|
|
702
|
+
}
|
|
703
|
+
```
|
|
704
|
+
|
|
705
|
+
Under the hood, this uses [ERC725](https://erc725alliance.org/), which augments ERC721 with a well-defined way to set and get key-value pairs.
|
|
706
|
+
|
|
707
|
+
### 8.2 get the key-value pair data from the NFT'
|
|
708
|
+
|
|
709
|
+
Use the `getData` method to get the data stored in the nft key value store
|
|
710
|
+
|
|
711
|
+
```Typescript
|
|
712
|
+
try {
|
|
713
|
+
const response = await nft.getData(freNftAddress, '1')
|
|
714
|
+
console.log('getData response: ', response)
|
|
715
|
+
assert(
|
|
716
|
+
response === data,
|
|
717
|
+
'Wrong data received when getting data from NFT ERC725 key value store'
|
|
718
|
+
)
|
|
719
|
+
} catch (e) {
|
|
720
|
+
assert.fail('Failed to get data from NFT ERC725 key value store', e)
|
|
721
|
+
}
|
|
722
|
+
```
|
|
723
|
+
|
|
724
|
+
That's it! Note the simplicity. All data was stored and retrieved from on-chain. We don't need Ocean Provider or Ocean Aquarius for these use cases (though the latter can help for fast querying & retrieval).
|
|
725
|
+
|
|
726
|
+
|
|
680
727
|
|
|
681
728
|
## Editing this file
|
|
682
729
|
Please note that CodeExamples.md is an autogenerated file, you should not edit it directly.
|
package/README.md
CHANGED
|
@@ -128,6 +128,8 @@ npm run test:integration
|
|
|
128
128
|
npm run test:integration:cover
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
+
> 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()`.
|
|
132
|
+
|
|
131
133
|
## 🛳 Production
|
|
132
134
|
|
|
133
135
|
To create a production build, run from the root of the project:
|