@oceanprotocol/lib 2.0.0-next.2 → 2.0.1

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 CHANGED
@@ -4,8 +4,40 @@ 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.0.1](https://github.com/oceanprotocol/ocean.js/compare/v2.0.0...v2.0.1)
8
+
9
+ - Bump microbundle from 0.14.2 to 0.15.1 [`#1600`](https://github.com/oceanprotocol/ocean.js/pull/1600)
10
+ - Bump @truffle/hdwallet-provider from 2.0.10 to 2.0.14 [`#1609`](https://github.com/oceanprotocol/ocean.js/pull/1609)
11
+ - Bump mock-local-storage from 1.1.21 to 1.1.23 [`#1610`](https://github.com/oceanprotocol/ocean.js/pull/1610)
12
+ - Bump @types/node from 18.0.1 to 18.7.16 [`#1608`](https://github.com/oceanprotocol/ocean.js/pull/1608)
13
+ - Put back missing c2d test flows [`#1604`](https://github.com/oceanprotocol/ocean.js/pull/1604)
14
+ - Feature/add ve fee estimate [`#1606`](https://github.com/oceanprotocol/ocean.js/pull/1606)
15
+ - Bump eslint from 8.19.0 to 8.23.0 [`#1602`](https://github.com/oceanprotocol/ocean.js/pull/1602)
16
+ - Bump @typescript-eslint/eslint-plugin from 5.33.1 to 5.36.2 [`#1601`](https://github.com/oceanprotocol/ocean.js/pull/1601)
17
+ - Bump decimal.js from 10.3.1 to 10.4.0 [`#1598`](https://github.com/oceanprotocol/ocean.js/pull/1598)
18
+ - fixed approve methods [`#1603`](https://github.com/oceanprotocol/ocean.js/pull/1603)
19
+ - debug [`ebe15f9`](https://github.com/oceanprotocol/ocean.js/commit/ebe15f9dcf6d60b863da2552a154e0d180510dff)
20
+ - put back paid env test [`219d4b4`](https://github.com/oceanprotocol/ocean.js/commit/219d4b4a1e1a2bba04cfaa2e26808b0f4a1fa717)
21
+ - update asset timeouts [`9fc8a8e`](https://github.com/oceanprotocol/ocean.js/commit/9fc8a8ebb316d0aefcce6d38f83aeb6f4fc5734d)
22
+
23
+ #### [v2.0.0](https://github.com/oceanprotocol/ocean.js/compare/v2.0.0-next.3...v2.0.0)
24
+
25
+ > 7 September 2022
26
+
27
+ - Release 2.0.0 [`197a75a`](https://github.com/oceanprotocol/ocean.js/commit/197a75a2f95caa44d70e48deb62c482ef855d892)
28
+
29
+ #### [v2.0.0-next.3](https://github.com/oceanprotocol/ocean.js/compare/v2.0.0-next.2...v2.0.0-next.3)
30
+
31
+ > 6 September 2022
32
+
33
+ - add DataFarming contract support [`#1596`](https://github.com/oceanprotocol/ocean.js/pull/1596)
34
+ - Release 2.0.0-next.3 [`00aaf37`](https://github.com/oceanprotocol/ocean.js/commit/00aaf3797ab66c7bd8e4c5449e200ae6d280e776)
35
+
7
36
  #### [v2.0.0-next.2](https://github.com/oceanprotocol/ocean.js/compare/v2.0.0-next.1...v2.0.0-next.2)
8
37
 
38
+ > 6 September 2022
39
+
40
+ - Release 2.0.0-next.2 [`647096a`](https://github.com/oceanprotocol/ocean.js/commit/647096a9af4f05d9b2481732a4fb110fa15ff63b)
9
41
  - bump package version [`c90ebb0`](https://github.com/oceanprotocol/ocean.js/commit/c90ebb0df8d08d1dae3086b64748a9abec83504e)
10
42
 
11
43
  #### [v2.0.0-next.1](https://github.com/oceanprotocol/ocean.js/compare/v2.0.0-next.0...v2.0.0-next.1)
@@ -116,7 +148,21 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
116
148
  - Bump typedoc from 0.22.15 to 0.22.17 [`#1514`](https://github.com/oceanprotocol/ocean.js/pull/1514)
117
149
  - Release 1.1.3 [`7772e93`](https://github.com/oceanprotocol/ocean.js/commit/7772e9387ef9d63f98ea80cfd4eefbea963dd0ad)
118
150
 
119
- #### [v1.1.2](https://github.com/oceanprotocol/ocean.js/compare/v1.0.0...v1.1.2)
151
+ #### [v1.1.2](https://github.com/oceanprotocol/ocean.js/compare/v1.1.1...v1.1.2)
152
+
153
+ > 15 June 2022
154
+
155
+ - Release 1.1.2 [`85bf271`](https://github.com/oceanprotocol/ocean.js/commit/85bf2716e26d8691aeb9d5504e563d557419dc2e)
156
+ - manual bump fix [`5674a54`](https://github.com/oceanprotocol/ocean.js/commit/5674a547d1d367ce88b3595f0be8ebbf12274266)
157
+
158
+ #### [v1.1.1](https://github.com/oceanprotocol/ocean.js/compare/v1.1.0...v1.1.1)
159
+
160
+ > 15 June 2022
161
+
162
+ - Release 1.1.1 [`ea48e01`](https://github.com/oceanprotocol/ocean.js/commit/ea48e015ac8299f71d57a929f8f30c5d1a8446e7)
163
+ - manual bump fix [`a362410`](https://github.com/oceanprotocol/ocean.js/commit/a36241004b1d9578ec5c02d9d6e64d9750c53a7b)
164
+
165
+ #### [v1.1.0](https://github.com/oceanprotocol/ocean.js/compare/v1.0.0...v1.1.0)
120
166
 
121
167
  > 15 June 2022
122
168
 
@@ -124,9 +170,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
124
170
  - Bump @types/node from 17.0.35 to 17.0.44 [`#1513`](https://github.com/oceanprotocol/ocean.js/pull/1513)
125
171
  - Bump eslint-config-oceanprotocol from 1.5.0 to 2.0.1 [`#1466`](https://github.com/oceanprotocol/ocean.js/pull/1466)
126
172
  - update to new schema & compute fixes [`#1510`](https://github.com/oceanprotocol/ocean.js/pull/1510)
127
- - Release 1.1.2 [`85bf271`](https://github.com/oceanprotocol/ocean.js/commit/85bf2716e26d8691aeb9d5504e563d557419dc2e)
128
- - manual bump fix [`5674a54`](https://github.com/oceanprotocol/ocean.js/commit/5674a547d1d367ce88b3595f0be8ebbf12274266)
129
- - manual bump fix [`a362410`](https://github.com/oceanprotocol/ocean.js/commit/a36241004b1d9578ec5c02d9d6e64d9750c53a7b)
173
+ - Release 1.1.0 [`112c27e`](https://github.com/oceanprotocol/ocean.js/commit/112c27edab58ef0681ea3e87fb09978411924753)
130
174
 
131
175
  #### [v1.0.0](https://github.com/oceanprotocol/ocean.js/compare/v1.0.0-next.45...v1.0.0)
132
176
 
package/CodeExamples.md CHANGED
@@ -85,6 +85,7 @@ Start by importing all of the necessary dependencies
85
85
 
86
86
  ```Typescript
87
87
 
88
+ import { AbiItem } from 'web3-utils'
88
89
  import { SHA256 } from 'crypto-js'
89
90
  import {
90
91
  approve,
@@ -106,7 +107,9 @@ import {
106
107
  ProviderFees,
107
108
  ProviderInstance,
108
109
  transfer,
109
- ZERO_ADDRESS
110
+ ZERO_ADDRESS,
111
+ calculateEstimatedGas,
112
+ sendTx
110
113
  } from '../../src'
111
114
  import { getAddresses, getTestConfig, web3 } from '../config'
112
115
  ```
@@ -202,7 +205,13 @@ As we go along it's a good idea to console log the values so that you check they
202
205
  ```
203
206
 
204
207
  ## 5. Initialize accounts and deploy contracts
205
- ### 5.1 Initialize accounts
208
+ ### 5.1 Next, lets get the address of the deployed contracts
209
+ ```Typescript
210
+ addresses = getAddresses()
211
+
212
+ ```
213
+
214
+ ### 5.2 Initialize accounts
206
215
  ```Typescript
207
216
  const accounts = await web3.eth.getAccounts()
208
217
  publisherAccount = accounts[0]
@@ -214,6 +223,39 @@ Again, lets console log the values so that we can check that they have been save
214
223
  console.log(`Publisher account address: ${publisherAccount}`)
215
224
  console.log(`Consumer account address: ${consumerAccount}`)
216
225
  console.log(`Staker account address: ${stakerAccount}`)
226
+ <!--
227
+ // mint ocean to publisherAccount
228
+ const minAbi = [
229
+ {
230
+ constant: false,
231
+ inputs: [
232
+ { name: 'to', type: 'address' },
233
+ { name: 'value', type: 'uint256' }
234
+ ],
235
+ name: 'mint',
236
+ outputs: [{ name: '', type: 'bool' }],
237
+ payable: false,
238
+ stateMutability: 'nonpayable',
239
+ type: 'function'
240
+ }
241
+ ] as AbiItem[]
242
+ const tokenContract = new web3.eth.Contract(minAbi, addresses.Ocean)
243
+ const estGas = await calculateEstimatedGas(
244
+ publisherAccount,
245
+ tokenContract.methods.mint,
246
+ publisherAccount,
247
+ web3.utils.toWei('1000')
248
+ )
249
+ await sendTx(
250
+ publisherAccount,
251
+ estGas,
252
+ web3,
253
+ 1,
254
+ tokenContract.methods.mint,
255
+ publisherAccount,
256
+ web3.utils.toWei('1000')
257
+ )
258
+ -->
217
259
 
218
260
  ```
219
261