@oceanprotocol/lib 3.0.0-next.1 → 3.0.0-next.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 +28 -0
- package/CodeExamples.md +1 -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/docs/.nojekyll +1 -0
- package/docs/README.md +192 -0
- package/docs/classes/Aquarius.md +171 -0
- package/docs/classes/Config.md +481 -0
- package/docs/classes/ConfigHelper.md +66 -0
- package/docs/classes/Datatoken.md +1123 -0
- package/docs/classes/DfRewards.md +345 -0
- package/docs/classes/DfStrategyV1.md +313 -0
- package/docs/classes/Dispenser.md +502 -0
- package/docs/classes/FixedRateExchange.md +1068 -0
- package/docs/classes/Logger.md +191 -0
- package/docs/classes/Nft.md +970 -0
- package/docs/classes/NftFactory.md +861 -0
- package/docs/classes/Provider.md +628 -0
- package/docs/classes/Router.md +645 -0
- package/docs/classes/SmartContract.md +193 -0
- package/docs/classes/SmartContractWithAddress.md +268 -0
- package/docs/classes/VeAllocate.md +372 -0
- package/docs/classes/VeFeeDistributor.md +325 -0
- package/docs/classes/VeFeeEstimate.md +281 -0
- package/docs/classes/VeOcean.md +513 -0
- package/docs/enums/LogLevel.md +63 -0
- package/docs/interfaces/AbiInput.md +63 -0
- package/docs/interfaces/AbiItem.md +107 -0
- package/docs/interfaces/AbiOutput.md +52 -0
- package/docs/interfaces/Arweave.md +32 -0
- package/docs/interfaces/Asset.md +227 -0
- package/docs/interfaces/AssetDatatoken.md +60 -0
- package/docs/interfaces/AssetLastEvent.md +63 -0
- package/docs/interfaces/AssetNft.md +105 -0
- package/docs/interfaces/AssetPrice.md +47 -0
- package/docs/interfaces/ComputeAlgorithm.md +82 -0
- package/docs/interfaces/ComputeAsset.md +56 -0
- package/docs/interfaces/ComputeEnvironment.md +173 -0
- package/docs/interfaces/ComputeJob.md +140 -0
- package/docs/interfaces/ComputeOutput.md +118 -0
- package/docs/interfaces/ComputeResult.md +52 -0
- package/docs/interfaces/ConsumeMarketFee.md +41 -0
- package/docs/interfaces/Credential.md +30 -0
- package/docs/interfaces/Credentials.md +30 -0
- package/docs/interfaces/DDO.md +137 -0
- package/docs/interfaces/DatatokenCreateParams.md +107 -0
- package/docs/interfaces/DatatokenRoles.md +30 -0
- package/docs/interfaces/DispenserCreationParams.md +63 -0
- package/docs/interfaces/DispenserParams.md +52 -0
- package/docs/interfaces/DispenserToken.md +85 -0
- package/docs/interfaces/DownloadResponse.md +30 -0
- package/docs/interfaces/Event.md +73 -0
- package/docs/interfaces/FeesInfo.md +74 -0
- package/docs/interfaces/FileInfo.md +118 -0
- package/docs/interfaces/Files.md +41 -0
- package/docs/interfaces/FixedPriceExchange.md +162 -0
- package/docs/interfaces/FreCreationParams.md +118 -0
- package/docs/interfaces/FreOrderParams.md +85 -0
- package/docs/interfaces/GraphqlQuery.md +69 -0
- package/docs/interfaces/Ipfs.md +32 -0
- package/docs/interfaces/Metadata.md +193 -0
- package/docs/interfaces/MetadataAlgorithm.md +69 -0
- package/docs/interfaces/MetadataAndTokenURI.md +107 -0
- package/docs/interfaces/MetadataProof.md +52 -0
- package/docs/interfaces/NftCreateData.md +74 -0
- package/docs/interfaces/NftRoles.md +52 -0
- package/docs/interfaces/Operation.md +145 -0
- package/docs/interfaces/OrderParams.md +52 -0
- package/docs/interfaces/PriceAndFees.md +52 -0
- package/docs/interfaces/ProviderComputeInitialize.md +41 -0
- package/docs/interfaces/ProviderComputeInitializeResults.md +30 -0
- package/docs/interfaces/ProviderFees.md +96 -0
- package/docs/interfaces/ProviderInitialize.md +52 -0
- package/docs/interfaces/PublisherTrustedAlgorithm.md +47 -0
- package/docs/interfaces/PublishingMarketFee.md +41 -0
- package/docs/interfaces/Purgatory.md +34 -0
- package/docs/interfaces/SearchQuery.md +67 -0
- package/docs/interfaces/Service.md +138 -0
- package/docs/interfaces/ServiceComputeOptions.md +63 -0
- package/docs/interfaces/ServiceEndpoint.md +41 -0
- package/docs/interfaces/Smartcontract-1.md +58 -0
- package/docs/interfaces/Stats.md +47 -0
- package/docs/interfaces/Template.md +30 -0
- package/docs/interfaces/TokenOrder.md +63 -0
- package/docs/interfaces/UrlFile.md +71 -0
- package/docs/interfaces/UserCustomParameters.md +7 -0
- package/docs/interfaces/ValidateMetadata.md +52 -0
- package/docs/modules.md +856 -0
- package/package.json +7 -8
- package/typedoc.json +4 -0
|
@@ -0,0 +1,513 @@
|
|
|
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)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / LogLevel
|
|
2
|
+
|
|
3
|
+
# Enumeration: LogLevel
|
|
4
|
+
|
|
5
|
+
## Table of contents
|
|
6
|
+
|
|
7
|
+
### Enumeration Members
|
|
8
|
+
|
|
9
|
+
- [Error](LogLevel.md#error)
|
|
10
|
+
- [Log](LogLevel.md#log)
|
|
11
|
+
- [None](LogLevel.md#none)
|
|
12
|
+
- [Verbose](LogLevel.md#verbose)
|
|
13
|
+
- [Warn](LogLevel.md#warn)
|
|
14
|
+
|
|
15
|
+
## Enumeration Members
|
|
16
|
+
|
|
17
|
+
### Error
|
|
18
|
+
|
|
19
|
+
• **Error** = ``0``
|
|
20
|
+
|
|
21
|
+
#### Defined in
|
|
22
|
+
|
|
23
|
+
[utils/Logger.ts:4](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L4)
|
|
24
|
+
|
|
25
|
+
___
|
|
26
|
+
|
|
27
|
+
### Log
|
|
28
|
+
|
|
29
|
+
• **Log** = ``2``
|
|
30
|
+
|
|
31
|
+
#### Defined in
|
|
32
|
+
|
|
33
|
+
[utils/Logger.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L6)
|
|
34
|
+
|
|
35
|
+
___
|
|
36
|
+
|
|
37
|
+
### None
|
|
38
|
+
|
|
39
|
+
• **None** = ``-1``
|
|
40
|
+
|
|
41
|
+
#### Defined in
|
|
42
|
+
|
|
43
|
+
[utils/Logger.ts:3](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L3)
|
|
44
|
+
|
|
45
|
+
___
|
|
46
|
+
|
|
47
|
+
### Verbose
|
|
48
|
+
|
|
49
|
+
• **Verbose** = ``3``
|
|
50
|
+
|
|
51
|
+
#### Defined in
|
|
52
|
+
|
|
53
|
+
[utils/Logger.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L7)
|
|
54
|
+
|
|
55
|
+
___
|
|
56
|
+
|
|
57
|
+
### Warn
|
|
58
|
+
|
|
59
|
+
• **Warn** = ``1``
|
|
60
|
+
|
|
61
|
+
#### Defined in
|
|
62
|
+
|
|
63
|
+
[utils/Logger.ts:5](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L5)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / AbiInput
|
|
2
|
+
|
|
3
|
+
# Interface: AbiInput
|
|
4
|
+
|
|
5
|
+
## Table of contents
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
- [components](AbiInput.md#components)
|
|
10
|
+
- [indexed](AbiInput.md#indexed)
|
|
11
|
+
- [internalType](AbiInput.md#internaltype)
|
|
12
|
+
- [name](AbiInput.md#name)
|
|
13
|
+
- [type](AbiInput.md#type)
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### components
|
|
18
|
+
|
|
19
|
+
• `Optional` **components**: [`AbiInput`](AbiInput.md)[]
|
|
20
|
+
|
|
21
|
+
#### Defined in
|
|
22
|
+
|
|
23
|
+
[@types/Contracts.ts:8](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L8)
|
|
24
|
+
|
|
25
|
+
___
|
|
26
|
+
|
|
27
|
+
### indexed
|
|
28
|
+
|
|
29
|
+
• `Optional` **indexed**: `boolean`
|
|
30
|
+
|
|
31
|
+
#### Defined in
|
|
32
|
+
|
|
33
|
+
[@types/Contracts.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L7)
|
|
34
|
+
|
|
35
|
+
___
|
|
36
|
+
|
|
37
|
+
### internalType
|
|
38
|
+
|
|
39
|
+
• `Optional` **internalType**: `string`
|
|
40
|
+
|
|
41
|
+
#### Defined in
|
|
42
|
+
|
|
43
|
+
[@types/Contracts.ts:9](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L9)
|
|
44
|
+
|
|
45
|
+
___
|
|
46
|
+
|
|
47
|
+
### name
|
|
48
|
+
|
|
49
|
+
• **name**: `string`
|
|
50
|
+
|
|
51
|
+
#### Defined in
|
|
52
|
+
|
|
53
|
+
[@types/Contracts.ts:5](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L5)
|
|
54
|
+
|
|
55
|
+
___
|
|
56
|
+
|
|
57
|
+
### type
|
|
58
|
+
|
|
59
|
+
• **type**: `string`
|
|
60
|
+
|
|
61
|
+
#### Defined in
|
|
62
|
+
|
|
63
|
+
[@types/Contracts.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L6)
|