@oceanprotocol/lib 5.0.6 → 5.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 +25 -4
- package/CodeExamples.md +8 -4
- package/ComputeExamples.md +4 -2
- 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 +0 -8
- package/dist/types/contracts/Dispenser.d.ts +1 -1
- package/dist/types/contracts/EnterpriseFeeCollector.d.ts +2 -1
- package/dist/types/contracts/Escrow.d.ts +12 -9
- package/dist/types/contracts/FixedRateExchange.d.ts +0 -1
- package/dist/types/contracts/NFT.d.ts +1 -1
- package/dist/types/contracts/index.d.ts +0 -6
- package/dist/types/services/Aquarius.d.ts +3 -2
- package/dist/types/services/Provider.d.ts +5 -3
- package/dist/types/utils/Assets.d.ts +2 -1
- package/dist/types/utils/TokenUtils.d.ts +2 -1
- package/docs/modules.md +0 -6
- package/package.json +2 -2
- package/dist/types/contracts/df/DfRewards.d.ts +0 -31
- package/dist/types/contracts/df/DfStrategyV1.d.ts +0 -21
- package/dist/types/contracts/ve/VeAllocate.d.ts +0 -38
- package/dist/types/contracts/ve/VeFeeDistributor.d.ts +0 -29
- package/dist/types/contracts/ve/VeFeeEstimate.d.ts +0 -14
- package/dist/types/contracts/ve/VeOcean.d.ts +0 -68
- package/docs/classes/DfRewards.md +0 -345
- package/docs/classes/DfStrategyV1.md +0 -313
- package/docs/classes/VeAllocate.md +0 -372
- package/docs/classes/VeFeeDistributor.md +0 -325
- package/docs/classes/VeFeeEstimate.md +0 -281
- package/docs/classes/VeOcean.md +0 -513
package/docs/classes/VeOcean.md
DELETED
|
@@ -1,513 +0,0 @@
|
|
|
1
|
-
[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / VeOcean
|
|
2
|
-
|
|
3
|
-
# Class: VeOcean
|
|
4
|
-
|
|
5
|
-
Provides an interface for veOcean contract
|
|
6
|
-
|
|
7
|
-
## Hierarchy
|
|
8
|
-
|
|
9
|
-
- [`SmartContractWithAddress`](SmartContractWithAddress.md)
|
|
10
|
-
|
|
11
|
-
↳ **`VeOcean`**
|
|
12
|
-
|
|
13
|
-
## Table of contents
|
|
14
|
-
|
|
15
|
-
### Constructors
|
|
16
|
-
|
|
17
|
-
- [constructor](VeOcean.md#constructor)
|
|
18
|
-
|
|
19
|
-
### Properties
|
|
20
|
-
|
|
21
|
-
- [abi](VeOcean.md#abi)
|
|
22
|
-
- [address](VeOcean.md#address)
|
|
23
|
-
- [config](VeOcean.md#config)
|
|
24
|
-
- [contract](VeOcean.md#contract)
|
|
25
|
-
- [signer](VeOcean.md#signer)
|
|
26
|
-
|
|
27
|
-
### Methods
|
|
28
|
-
|
|
29
|
-
- [amountToUnits](VeOcean.md#amounttounits)
|
|
30
|
-
- [depositFor](VeOcean.md#depositfor)
|
|
31
|
-
- [getContract](VeOcean.md#getcontract)
|
|
32
|
-
- [getDefaultAbi](VeOcean.md#getdefaultabi)
|
|
33
|
-
- [getFairGasPrice](VeOcean.md#getfairgasprice)
|
|
34
|
-
- [getLockedAmount](VeOcean.md#getlockedamount)
|
|
35
|
-
- [getToken](VeOcean.md#gettoken)
|
|
36
|
-
- [getVotingPower](VeOcean.md#getvotingpower)
|
|
37
|
-
- [increaseAmount](VeOcean.md#increaseamount)
|
|
38
|
-
- [increaseUnlockTime](VeOcean.md#increaseunlocktime)
|
|
39
|
-
- [lockEnd](VeOcean.md#lockend)
|
|
40
|
-
- [lockTokens](VeOcean.md#locktokens)
|
|
41
|
-
- [totalSupply](VeOcean.md#totalsupply)
|
|
42
|
-
- [unitsToAmount](VeOcean.md#unitstoamount)
|
|
43
|
-
- [withdraw](VeOcean.md#withdraw)
|
|
44
|
-
|
|
45
|
-
## Constructors
|
|
46
|
-
|
|
47
|
-
### constructor
|
|
48
|
-
|
|
49
|
-
• **new VeOcean**(`address`, `signer`, `network?`, `config?`, `abi?`)
|
|
50
|
-
|
|
51
|
-
Instantiate the smart contract.
|
|
52
|
-
|
|
53
|
-
#### Parameters
|
|
54
|
-
|
|
55
|
-
| Name | Type | Description |
|
|
56
|
-
| :------ | :------ | :------ |
|
|
57
|
-
| `address` | `string` | The address of the contract. |
|
|
58
|
-
| `signer` | `Signer` | The signer object. |
|
|
59
|
-
| `network?` | `string` \| `number` | Network id or name |
|
|
60
|
-
| `config?` | [`Config`](Config.md) | The configuration object. |
|
|
61
|
-
| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract |
|
|
62
|
-
|
|
63
|
-
#### Inherited from
|
|
64
|
-
|
|
65
|
-
[SmartContractWithAddress](SmartContractWithAddress.md).[constructor](SmartContractWithAddress.md#constructor)
|
|
66
|
-
|
|
67
|
-
#### Defined in
|
|
68
|
-
|
|
69
|
-
[contracts/SmartContractWithAddress.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L17)
|
|
70
|
-
|
|
71
|
-
## Properties
|
|
72
|
-
|
|
73
|
-
### abi
|
|
74
|
-
|
|
75
|
-
• **abi**: [`AbiItem`](../interfaces/AbiItem.md)[]
|
|
76
|
-
|
|
77
|
-
#### Inherited from
|
|
78
|
-
|
|
79
|
-
[SmartContractWithAddress](SmartContractWithAddress.md).[abi](SmartContractWithAddress.md#abi)
|
|
80
|
-
|
|
81
|
-
#### Defined in
|
|
82
|
-
|
|
83
|
-
[contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14)
|
|
84
|
-
|
|
85
|
-
___
|
|
86
|
-
|
|
87
|
-
### address
|
|
88
|
-
|
|
89
|
-
• **address**: `string`
|
|
90
|
-
|
|
91
|
-
#### Inherited from
|
|
92
|
-
|
|
93
|
-
[SmartContractWithAddress](SmartContractWithAddress.md).[address](SmartContractWithAddress.md#address)
|
|
94
|
-
|
|
95
|
-
#### Defined in
|
|
96
|
-
|
|
97
|
-
[contracts/SmartContractWithAddress.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L6)
|
|
98
|
-
|
|
99
|
-
___
|
|
100
|
-
|
|
101
|
-
### config
|
|
102
|
-
|
|
103
|
-
• **config**: [`Config`](Config.md)
|
|
104
|
-
|
|
105
|
-
#### Inherited from
|
|
106
|
-
|
|
107
|
-
[SmartContractWithAddress](SmartContractWithAddress.md).[config](SmartContractWithAddress.md#config)
|
|
108
|
-
|
|
109
|
-
#### Defined in
|
|
110
|
-
|
|
111
|
-
[contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13)
|
|
112
|
-
|
|
113
|
-
___
|
|
114
|
-
|
|
115
|
-
### contract
|
|
116
|
-
|
|
117
|
-
• **contract**: `Contract`
|
|
118
|
-
|
|
119
|
-
#### Inherited from
|
|
120
|
-
|
|
121
|
-
[SmartContractWithAddress](SmartContractWithAddress.md).[contract](SmartContractWithAddress.md#contract)
|
|
122
|
-
|
|
123
|
-
#### Defined in
|
|
124
|
-
|
|
125
|
-
[contracts/SmartContractWithAddress.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L7)
|
|
126
|
-
|
|
127
|
-
___
|
|
128
|
-
|
|
129
|
-
### signer
|
|
130
|
-
|
|
131
|
-
• **signer**: `Signer`
|
|
132
|
-
|
|
133
|
-
#### Inherited from
|
|
134
|
-
|
|
135
|
-
[SmartContractWithAddress](SmartContractWithAddress.md).[signer](SmartContractWithAddress.md#signer)
|
|
136
|
-
|
|
137
|
-
#### Defined in
|
|
138
|
-
|
|
139
|
-
[contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12)
|
|
140
|
-
|
|
141
|
-
## Methods
|
|
142
|
-
|
|
143
|
-
### amountToUnits
|
|
144
|
-
|
|
145
|
-
▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\>
|
|
146
|
-
|
|
147
|
-
Converts an amount of tokens to units
|
|
148
|
-
|
|
149
|
-
#### Parameters
|
|
150
|
-
|
|
151
|
-
| Name | Type | Description |
|
|
152
|
-
| :------ | :------ | :------ |
|
|
153
|
-
| `token` | `string` | The token to convert |
|
|
154
|
-
| `amount` | `string` | The amount of tokens to convert |
|
|
155
|
-
| `tokenDecimals?` | `number` | The number of decimals of the token |
|
|
156
|
-
|
|
157
|
-
#### Returns
|
|
158
|
-
|
|
159
|
-
`Promise`<`string`\>
|
|
160
|
-
|
|
161
|
-
- The converted amount in units
|
|
162
|
-
|
|
163
|
-
#### Inherited from
|
|
164
|
-
|
|
165
|
-
[SmartContractWithAddress](SmartContractWithAddress.md).[amountToUnits](SmartContractWithAddress.md#amounttounits)
|
|
166
|
-
|
|
167
|
-
#### Defined in
|
|
168
|
-
|
|
169
|
-
[contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43)
|
|
170
|
-
|
|
171
|
-
___
|
|
172
|
-
|
|
173
|
-
### depositFor
|
|
174
|
-
|
|
175
|
-
▸ **depositFor**<`G`\>(`toAddress`, `amount`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
176
|
-
|
|
177
|
-
Deposit `amount` tokens for `toAddress` and add to the existing lock
|
|
178
|
-
Anyone (even a smart contract) can deposit for someone else, but cannot extend their locktime and deposit for a brand new user
|
|
179
|
-
|
|
180
|
-
#### Type parameters
|
|
181
|
-
|
|
182
|
-
| Name | Type |
|
|
183
|
-
| :------ | :------ |
|
|
184
|
-
| `G` | extends `boolean` = ``false`` |
|
|
185
|
-
|
|
186
|
-
#### Parameters
|
|
187
|
-
|
|
188
|
-
| Name | Type | Description |
|
|
189
|
-
| :------ | :------ | :------ |
|
|
190
|
-
| `toAddress` | `string` | user address to deposit for |
|
|
191
|
-
| `amount` | `string` | Amount of tokens to be locked |
|
|
192
|
-
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
193
|
-
|
|
194
|
-
#### Returns
|
|
195
|
-
|
|
196
|
-
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
197
|
-
|
|
198
|
-
#### Defined in
|
|
199
|
-
|
|
200
|
-
[contracts/ve/VeOcean.ts:52](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L52)
|
|
201
|
-
|
|
202
|
-
___
|
|
203
|
-
|
|
204
|
-
### getContract
|
|
205
|
-
|
|
206
|
-
▸ `Protected` **getContract**(`address`, `abi?`): `Contract`
|
|
207
|
-
|
|
208
|
-
Returns a contract instance for the given address
|
|
209
|
-
|
|
210
|
-
#### Parameters
|
|
211
|
-
|
|
212
|
-
| Name | Type | Description |
|
|
213
|
-
| :------ | :------ | :------ |
|
|
214
|
-
| `address` | `string` | The address of the contract |
|
|
215
|
-
| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract |
|
|
216
|
-
|
|
217
|
-
#### Returns
|
|
218
|
-
|
|
219
|
-
`Contract`
|
|
220
|
-
|
|
221
|
-
- The contract instance
|
|
222
|
-
|
|
223
|
-
#### Inherited from
|
|
224
|
-
|
|
225
|
-
[SmartContractWithAddress](SmartContractWithAddress.md).[getContract](SmartContractWithAddress.md#getcontract)
|
|
226
|
-
|
|
227
|
-
#### Defined in
|
|
228
|
-
|
|
229
|
-
[contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80)
|
|
230
|
-
|
|
231
|
-
___
|
|
232
|
-
|
|
233
|
-
### getDefaultAbi
|
|
234
|
-
|
|
235
|
-
▸ **getDefaultAbi**(): [`AbiItem`](../interfaces/AbiItem.md)[]
|
|
236
|
-
|
|
237
|
-
#### Returns
|
|
238
|
-
|
|
239
|
-
[`AbiItem`](../interfaces/AbiItem.md)[]
|
|
240
|
-
|
|
241
|
-
#### Overrides
|
|
242
|
-
|
|
243
|
-
[SmartContractWithAddress](SmartContractWithAddress.md).[getDefaultAbi](SmartContractWithAddress.md#getdefaultabi)
|
|
244
|
-
|
|
245
|
-
#### Defined in
|
|
246
|
-
|
|
247
|
-
[contracts/ve/VeOcean.ts:9](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L9)
|
|
248
|
-
|
|
249
|
-
___
|
|
250
|
-
|
|
251
|
-
### getFairGasPrice
|
|
252
|
-
|
|
253
|
-
▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\>
|
|
254
|
-
|
|
255
|
-
Retruns the gas price
|
|
256
|
-
|
|
257
|
-
#### Returns
|
|
258
|
-
|
|
259
|
-
`Promise`<`string`\>
|
|
260
|
-
|
|
261
|
-
- The fair gas price
|
|
262
|
-
|
|
263
|
-
#### Inherited from
|
|
264
|
-
|
|
265
|
-
[SmartContractWithAddress](SmartContractWithAddress.md).[getFairGasPrice](SmartContractWithAddress.md#getfairgasprice)
|
|
266
|
-
|
|
267
|
-
#### Defined in
|
|
268
|
-
|
|
269
|
-
[contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70)
|
|
270
|
-
|
|
271
|
-
___
|
|
272
|
-
|
|
273
|
-
### getLockedAmount
|
|
274
|
-
|
|
275
|
-
▸ **getLockedAmount**(`userAddress`): `Promise`<`string`\>
|
|
276
|
-
|
|
277
|
-
Get locked balance
|
|
278
|
-
|
|
279
|
-
#### Parameters
|
|
280
|
-
|
|
281
|
-
| Name | Type | Description |
|
|
282
|
-
| :------ | :------ | :------ |
|
|
283
|
-
| `userAddress` | `string` | user address |
|
|
284
|
-
|
|
285
|
-
#### Returns
|
|
286
|
-
|
|
287
|
-
`Promise`<`string`\>
|
|
288
|
-
|
|
289
|
-
#### Defined in
|
|
290
|
-
|
|
291
|
-
[contracts/ve/VeOcean.ts:156](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L156)
|
|
292
|
-
|
|
293
|
-
___
|
|
294
|
-
|
|
295
|
-
### getToken
|
|
296
|
-
|
|
297
|
-
▸ **getToken**(): `Promise`<`string`\>
|
|
298
|
-
|
|
299
|
-
Get token
|
|
300
|
-
|
|
301
|
-
#### Returns
|
|
302
|
-
|
|
303
|
-
`Promise`<`string`\>
|
|
304
|
-
|
|
305
|
-
#### Defined in
|
|
306
|
-
|
|
307
|
-
[contracts/ve/VeOcean.ts:189](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L189)
|
|
308
|
-
|
|
309
|
-
___
|
|
310
|
-
|
|
311
|
-
### getVotingPower
|
|
312
|
-
|
|
313
|
-
▸ **getVotingPower**(`userAddress`): `Promise`<`number`\>
|
|
314
|
-
|
|
315
|
-
Get voting power for address
|
|
316
|
-
|
|
317
|
-
#### Parameters
|
|
318
|
-
|
|
319
|
-
| Name | Type | Description |
|
|
320
|
-
| :------ | :------ | :------ |
|
|
321
|
-
| `userAddress` | `string` | user address |
|
|
322
|
-
|
|
323
|
-
#### Returns
|
|
324
|
-
|
|
325
|
-
`Promise`<`number`\>
|
|
326
|
-
|
|
327
|
-
#### Defined in
|
|
328
|
-
|
|
329
|
-
[contracts/ve/VeOcean.ts:147](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L147)
|
|
330
|
-
|
|
331
|
-
___
|
|
332
|
-
|
|
333
|
-
### increaseAmount
|
|
334
|
-
|
|
335
|
-
▸ **increaseAmount**<`G`\>(`amount`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
336
|
-
|
|
337
|
-
Deposit `amount` additional tokens for `userAddress` without modifying the unlock time
|
|
338
|
-
|
|
339
|
-
#### Type parameters
|
|
340
|
-
|
|
341
|
-
| Name | Type |
|
|
342
|
-
| :------ | :------ |
|
|
343
|
-
| `G` | extends `boolean` = ``false`` |
|
|
344
|
-
|
|
345
|
-
#### Parameters
|
|
346
|
-
|
|
347
|
-
| Name | Type | Description |
|
|
348
|
-
| :------ | :------ | :------ |
|
|
349
|
-
| `amount` | `string` | Amount of tokens to be locked |
|
|
350
|
-
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
351
|
-
|
|
352
|
-
#### Returns
|
|
353
|
-
|
|
354
|
-
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
355
|
-
|
|
356
|
-
#### Defined in
|
|
357
|
-
|
|
358
|
-
[contracts/ve/VeOcean.ts:79](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L79)
|
|
359
|
-
|
|
360
|
-
___
|
|
361
|
-
|
|
362
|
-
### increaseUnlockTime
|
|
363
|
-
|
|
364
|
-
▸ **increaseUnlockTime**<`G`\>(`unlockTime`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
365
|
-
|
|
366
|
-
Extend the unlock time for `userAddress` to `unlockTime`
|
|
367
|
-
|
|
368
|
-
#### Type parameters
|
|
369
|
-
|
|
370
|
-
| Name | Type |
|
|
371
|
-
| :------ | :------ |
|
|
372
|
-
| `G` | extends `boolean` = ``false`` |
|
|
373
|
-
|
|
374
|
-
#### Parameters
|
|
375
|
-
|
|
376
|
-
| Name | Type | Description |
|
|
377
|
-
| :------ | :------ | :------ |
|
|
378
|
-
| `unlockTime` | `number` | Timestamp for new unlock time |
|
|
379
|
-
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
380
|
-
|
|
381
|
-
#### Returns
|
|
382
|
-
|
|
383
|
-
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
384
|
-
|
|
385
|
-
#### Defined in
|
|
386
|
-
|
|
387
|
-
[contracts/ve/VeOcean.ts:104](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L104)
|
|
388
|
-
|
|
389
|
-
___
|
|
390
|
-
|
|
391
|
-
### lockEnd
|
|
392
|
-
|
|
393
|
-
▸ **lockEnd**(`userAddress`): `Promise`<`number`\>
|
|
394
|
-
|
|
395
|
-
Get untilLock for address
|
|
396
|
-
|
|
397
|
-
#### Parameters
|
|
398
|
-
|
|
399
|
-
| Name | Type | Description |
|
|
400
|
-
| :------ | :------ | :------ |
|
|
401
|
-
| `userAddress` | `string` | user address |
|
|
402
|
-
|
|
403
|
-
#### Returns
|
|
404
|
-
|
|
405
|
-
`Promise`<`number`\>
|
|
406
|
-
|
|
407
|
-
#### Defined in
|
|
408
|
-
|
|
409
|
-
[contracts/ve/VeOcean.ts:170](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L170)
|
|
410
|
-
|
|
411
|
-
___
|
|
412
|
-
|
|
413
|
-
### lockTokens
|
|
414
|
-
|
|
415
|
-
▸ **lockTokens**<`G`\>(`amount`, `unlockTime`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
416
|
-
|
|
417
|
-
Deposit `amount` tokens for `userAddress` and lock until `unlockTime`
|
|
418
|
-
|
|
419
|
-
#### Type parameters
|
|
420
|
-
|
|
421
|
-
| Name | Type |
|
|
422
|
-
| :------ | :------ |
|
|
423
|
-
| `G` | extends `boolean` = ``false`` |
|
|
424
|
-
|
|
425
|
-
#### Parameters
|
|
426
|
-
|
|
427
|
-
| Name | Type | Description |
|
|
428
|
-
| :------ | :------ | :------ |
|
|
429
|
-
| `amount` | `string` | Amount of tokens to be locked |
|
|
430
|
-
| `unlockTime` | `number` | Timestamp for unlock |
|
|
431
|
-
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
432
|
-
|
|
433
|
-
#### Returns
|
|
434
|
-
|
|
435
|
-
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
436
|
-
|
|
437
|
-
#### Defined in
|
|
438
|
-
|
|
439
|
-
[contracts/ve/VeOcean.ts:20](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L20)
|
|
440
|
-
|
|
441
|
-
___
|
|
442
|
-
|
|
443
|
-
### totalSupply
|
|
444
|
-
|
|
445
|
-
▸ **totalSupply**(): `Promise`<`string`\>
|
|
446
|
-
|
|
447
|
-
Get total supply
|
|
448
|
-
|
|
449
|
-
#### Returns
|
|
450
|
-
|
|
451
|
-
`Promise`<`string`\>
|
|
452
|
-
|
|
453
|
-
#### Defined in
|
|
454
|
-
|
|
455
|
-
[contracts/ve/VeOcean.ts:178](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L178)
|
|
456
|
-
|
|
457
|
-
___
|
|
458
|
-
|
|
459
|
-
### unitsToAmount
|
|
460
|
-
|
|
461
|
-
▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\>
|
|
462
|
-
|
|
463
|
-
Converts an amount of units to tokens
|
|
464
|
-
|
|
465
|
-
#### Parameters
|
|
466
|
-
|
|
467
|
-
| Name | Type | Description |
|
|
468
|
-
| :------ | :------ | :------ |
|
|
469
|
-
| `token` | `string` | The token to convert |
|
|
470
|
-
| `amount` | `string` | The amount of units to convert |
|
|
471
|
-
| `tokenDecimals?` | `number` | The number of decimals in the token |
|
|
472
|
-
|
|
473
|
-
#### Returns
|
|
474
|
-
|
|
475
|
-
`Promise`<`string`\>
|
|
476
|
-
|
|
477
|
-
- The converted amount in tokens
|
|
478
|
-
|
|
479
|
-
#### Inherited from
|
|
480
|
-
|
|
481
|
-
[SmartContractWithAddress](SmartContractWithAddress.md).[unitsToAmount](SmartContractWithAddress.md#unitstoamount)
|
|
482
|
-
|
|
483
|
-
#### Defined in
|
|
484
|
-
|
|
485
|
-
[contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58)
|
|
486
|
-
|
|
487
|
-
___
|
|
488
|
-
|
|
489
|
-
### withdraw
|
|
490
|
-
|
|
491
|
-
▸ **withdraw**<`G`\>(`estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
492
|
-
|
|
493
|
-
Withdraw all tokens for `userAddress`
|
|
494
|
-
|
|
495
|
-
#### Type parameters
|
|
496
|
-
|
|
497
|
-
| Name | Type |
|
|
498
|
-
| :------ | :------ |
|
|
499
|
-
| `G` | extends `boolean` = ``false`` |
|
|
500
|
-
|
|
501
|
-
#### Parameters
|
|
502
|
-
|
|
503
|
-
| Name | Type | Description |
|
|
504
|
-
| :------ | :------ | :------ |
|
|
505
|
-
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
506
|
-
|
|
507
|
-
#### Returns
|
|
508
|
-
|
|
509
|
-
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
510
|
-
|
|
511
|
-
#### Defined in
|
|
512
|
-
|
|
513
|
-
[contracts/ve/VeOcean.ts:127](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L127)
|