@oceanprotocol/lib 3.0.0-next.0 → 3.0.0-next.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 +27 -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/dist/src/utils/ContractUtils.d.ts +2 -0
- 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,345 @@
|
|
|
1
|
+
[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / DfRewards
|
|
2
|
+
|
|
3
|
+
# Class: DfRewards
|
|
4
|
+
|
|
5
|
+
Provides an interface for DFRewards contract
|
|
6
|
+
|
|
7
|
+
## Hierarchy
|
|
8
|
+
|
|
9
|
+
- [`SmartContractWithAddress`](SmartContractWithAddress.md)
|
|
10
|
+
|
|
11
|
+
↳ **`DfRewards`**
|
|
12
|
+
|
|
13
|
+
## Table of contents
|
|
14
|
+
|
|
15
|
+
### Constructors
|
|
16
|
+
|
|
17
|
+
- [constructor](DfRewards.md#constructor)
|
|
18
|
+
|
|
19
|
+
### Properties
|
|
20
|
+
|
|
21
|
+
- [abi](DfRewards.md#abi)
|
|
22
|
+
- [address](DfRewards.md#address)
|
|
23
|
+
- [config](DfRewards.md#config)
|
|
24
|
+
- [contract](DfRewards.md#contract)
|
|
25
|
+
- [signer](DfRewards.md#signer)
|
|
26
|
+
|
|
27
|
+
### Methods
|
|
28
|
+
|
|
29
|
+
- [allocateRewards](DfRewards.md#allocaterewards)
|
|
30
|
+
- [amountToUnits](DfRewards.md#amounttounits)
|
|
31
|
+
- [claimRewards](DfRewards.md#claimrewards)
|
|
32
|
+
- [getAvailableRewards](DfRewards.md#getavailablerewards)
|
|
33
|
+
- [getContract](DfRewards.md#getcontract)
|
|
34
|
+
- [getDefaultAbi](DfRewards.md#getdefaultabi)
|
|
35
|
+
- [getFairGasPrice](DfRewards.md#getfairgasprice)
|
|
36
|
+
- [unitsToAmount](DfRewards.md#unitstoamount)
|
|
37
|
+
|
|
38
|
+
## Constructors
|
|
39
|
+
|
|
40
|
+
### constructor
|
|
41
|
+
|
|
42
|
+
• **new DfRewards**(`address`, `signer`, `network?`, `config?`, `abi?`)
|
|
43
|
+
|
|
44
|
+
Instantiate the smart contract.
|
|
45
|
+
|
|
46
|
+
#### Parameters
|
|
47
|
+
|
|
48
|
+
| Name | Type | Description |
|
|
49
|
+
| :------ | :------ | :------ |
|
|
50
|
+
| `address` | `string` | The address of the contract. |
|
|
51
|
+
| `signer` | `Signer` | The signer object. |
|
|
52
|
+
| `network?` | `string` \| `number` | Network id or name |
|
|
53
|
+
| `config?` | [`Config`](Config.md) | The configuration object. |
|
|
54
|
+
| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract |
|
|
55
|
+
|
|
56
|
+
#### Inherited from
|
|
57
|
+
|
|
58
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[constructor](SmartContractWithAddress.md#constructor)
|
|
59
|
+
|
|
60
|
+
#### Defined in
|
|
61
|
+
|
|
62
|
+
[contracts/SmartContractWithAddress.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L17)
|
|
63
|
+
|
|
64
|
+
## Properties
|
|
65
|
+
|
|
66
|
+
### abi
|
|
67
|
+
|
|
68
|
+
• **abi**: [`AbiItem`](../interfaces/AbiItem.md)[]
|
|
69
|
+
|
|
70
|
+
#### Inherited from
|
|
71
|
+
|
|
72
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[abi](SmartContractWithAddress.md#abi)
|
|
73
|
+
|
|
74
|
+
#### Defined in
|
|
75
|
+
|
|
76
|
+
[contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14)
|
|
77
|
+
|
|
78
|
+
___
|
|
79
|
+
|
|
80
|
+
### address
|
|
81
|
+
|
|
82
|
+
• **address**: `string`
|
|
83
|
+
|
|
84
|
+
#### Inherited from
|
|
85
|
+
|
|
86
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[address](SmartContractWithAddress.md#address)
|
|
87
|
+
|
|
88
|
+
#### Defined in
|
|
89
|
+
|
|
90
|
+
[contracts/SmartContractWithAddress.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L6)
|
|
91
|
+
|
|
92
|
+
___
|
|
93
|
+
|
|
94
|
+
### config
|
|
95
|
+
|
|
96
|
+
• **config**: [`Config`](Config.md)
|
|
97
|
+
|
|
98
|
+
#### Inherited from
|
|
99
|
+
|
|
100
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[config](SmartContractWithAddress.md#config)
|
|
101
|
+
|
|
102
|
+
#### Defined in
|
|
103
|
+
|
|
104
|
+
[contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13)
|
|
105
|
+
|
|
106
|
+
___
|
|
107
|
+
|
|
108
|
+
### contract
|
|
109
|
+
|
|
110
|
+
• **contract**: `Contract`
|
|
111
|
+
|
|
112
|
+
#### Inherited from
|
|
113
|
+
|
|
114
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[contract](SmartContractWithAddress.md#contract)
|
|
115
|
+
|
|
116
|
+
#### Defined in
|
|
117
|
+
|
|
118
|
+
[contracts/SmartContractWithAddress.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L7)
|
|
119
|
+
|
|
120
|
+
___
|
|
121
|
+
|
|
122
|
+
### signer
|
|
123
|
+
|
|
124
|
+
• **signer**: `Signer`
|
|
125
|
+
|
|
126
|
+
#### Inherited from
|
|
127
|
+
|
|
128
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[signer](SmartContractWithAddress.md#signer)
|
|
129
|
+
|
|
130
|
+
#### Defined in
|
|
131
|
+
|
|
132
|
+
[contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12)
|
|
133
|
+
|
|
134
|
+
## Methods
|
|
135
|
+
|
|
136
|
+
### allocateRewards
|
|
137
|
+
|
|
138
|
+
▸ **allocateRewards**<`G`\>(`userAddresses`, `amounts`, `tokenAddress`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
139
|
+
|
|
140
|
+
allocate rewards to address. An approve must exist before calling this function.
|
|
141
|
+
|
|
142
|
+
#### Type parameters
|
|
143
|
+
|
|
144
|
+
| Name | Type |
|
|
145
|
+
| :------ | :------ |
|
|
146
|
+
| `G` | extends `boolean` = ``false`` |
|
|
147
|
+
|
|
148
|
+
#### Parameters
|
|
149
|
+
|
|
150
|
+
| Name | Type | Description |
|
|
151
|
+
| :------ | :------ | :------ |
|
|
152
|
+
| `userAddresses` | `string`[] | array of users that will receive rewards |
|
|
153
|
+
| `amounts` | `string`[] | array of amounts |
|
|
154
|
+
| `tokenAddress` | `string` | token address |
|
|
155
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
156
|
+
|
|
157
|
+
#### Returns
|
|
158
|
+
|
|
159
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
160
|
+
|
|
161
|
+
#### Defined in
|
|
162
|
+
|
|
163
|
+
[contracts/df/DfRewards.ts:64](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/df/DfRewards.ts#L64)
|
|
164
|
+
|
|
165
|
+
___
|
|
166
|
+
|
|
167
|
+
### amountToUnits
|
|
168
|
+
|
|
169
|
+
▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\>
|
|
170
|
+
|
|
171
|
+
Converts an amount of tokens to units
|
|
172
|
+
|
|
173
|
+
#### Parameters
|
|
174
|
+
|
|
175
|
+
| Name | Type | Description |
|
|
176
|
+
| :------ | :------ | :------ |
|
|
177
|
+
| `token` | `string` | The token to convert |
|
|
178
|
+
| `amount` | `string` | The amount of tokens to convert |
|
|
179
|
+
| `tokenDecimals?` | `number` | The number of decimals of the token |
|
|
180
|
+
|
|
181
|
+
#### Returns
|
|
182
|
+
|
|
183
|
+
`Promise`<`string`\>
|
|
184
|
+
|
|
185
|
+
- The converted amount in units
|
|
186
|
+
|
|
187
|
+
#### Inherited from
|
|
188
|
+
|
|
189
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[amountToUnits](SmartContractWithAddress.md#amounttounits)
|
|
190
|
+
|
|
191
|
+
#### Defined in
|
|
192
|
+
|
|
193
|
+
[contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43)
|
|
194
|
+
|
|
195
|
+
___
|
|
196
|
+
|
|
197
|
+
### claimRewards
|
|
198
|
+
|
|
199
|
+
▸ **claimRewards**<`G`\>(`userAddress`, `tokenAddress`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
200
|
+
|
|
201
|
+
claim rewards for any address
|
|
202
|
+
|
|
203
|
+
#### Type parameters
|
|
204
|
+
|
|
205
|
+
| Name | Type |
|
|
206
|
+
| :------ | :------ |
|
|
207
|
+
| `G` | extends `boolean` = ``false`` |
|
|
208
|
+
|
|
209
|
+
#### Parameters
|
|
210
|
+
|
|
211
|
+
| Name | Type | Description |
|
|
212
|
+
| :------ | :------ | :------ |
|
|
213
|
+
| `userAddress` | `string` | user address to claim |
|
|
214
|
+
| `tokenAddress` | `string` | token address |
|
|
215
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
216
|
+
|
|
217
|
+
#### Returns
|
|
218
|
+
|
|
219
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
220
|
+
|
|
221
|
+
#### Defined in
|
|
222
|
+
|
|
223
|
+
[contracts/df/DfRewards.ts:36](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/df/DfRewards.ts#L36)
|
|
224
|
+
|
|
225
|
+
___
|
|
226
|
+
|
|
227
|
+
### getAvailableRewards
|
|
228
|
+
|
|
229
|
+
▸ **getAvailableRewards**(`userAddress`, `tokenAddress`): `Promise`<`string`\>
|
|
230
|
+
|
|
231
|
+
Get available DF Rewards for a token
|
|
232
|
+
|
|
233
|
+
#### Parameters
|
|
234
|
+
|
|
235
|
+
| Name | Type | Description |
|
|
236
|
+
| :------ | :------ | :------ |
|
|
237
|
+
| `userAddress` | `string` | user address |
|
|
238
|
+
| `tokenAddress` | `string` | token address |
|
|
239
|
+
|
|
240
|
+
#### Returns
|
|
241
|
+
|
|
242
|
+
`Promise`<`string`\>
|
|
243
|
+
|
|
244
|
+
#### Defined in
|
|
245
|
+
|
|
246
|
+
[contracts/df/DfRewards.ts:19](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/df/DfRewards.ts#L19)
|
|
247
|
+
|
|
248
|
+
___
|
|
249
|
+
|
|
250
|
+
### getContract
|
|
251
|
+
|
|
252
|
+
▸ `Protected` **getContract**(`address`, `abi?`): `Contract`
|
|
253
|
+
|
|
254
|
+
Returns a contract instance for the given address
|
|
255
|
+
|
|
256
|
+
#### Parameters
|
|
257
|
+
|
|
258
|
+
| Name | Type | Description |
|
|
259
|
+
| :------ | :------ | :------ |
|
|
260
|
+
| `address` | `string` | The address of the contract |
|
|
261
|
+
| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract |
|
|
262
|
+
|
|
263
|
+
#### Returns
|
|
264
|
+
|
|
265
|
+
`Contract`
|
|
266
|
+
|
|
267
|
+
- The contract instance
|
|
268
|
+
|
|
269
|
+
#### Inherited from
|
|
270
|
+
|
|
271
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[getContract](SmartContractWithAddress.md#getcontract)
|
|
272
|
+
|
|
273
|
+
#### Defined in
|
|
274
|
+
|
|
275
|
+
[contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80)
|
|
276
|
+
|
|
277
|
+
___
|
|
278
|
+
|
|
279
|
+
### getDefaultAbi
|
|
280
|
+
|
|
281
|
+
▸ **getDefaultAbi**(): [`AbiItem`](../interfaces/AbiItem.md)[]
|
|
282
|
+
|
|
283
|
+
#### Returns
|
|
284
|
+
|
|
285
|
+
[`AbiItem`](../interfaces/AbiItem.md)[]
|
|
286
|
+
|
|
287
|
+
#### Overrides
|
|
288
|
+
|
|
289
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[getDefaultAbi](SmartContractWithAddress.md#getdefaultabi)
|
|
290
|
+
|
|
291
|
+
#### Defined in
|
|
292
|
+
|
|
293
|
+
[contracts/df/DfRewards.ts:10](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/df/DfRewards.ts#L10)
|
|
294
|
+
|
|
295
|
+
___
|
|
296
|
+
|
|
297
|
+
### getFairGasPrice
|
|
298
|
+
|
|
299
|
+
▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\>
|
|
300
|
+
|
|
301
|
+
Retruns the gas price
|
|
302
|
+
|
|
303
|
+
#### Returns
|
|
304
|
+
|
|
305
|
+
`Promise`<`string`\>
|
|
306
|
+
|
|
307
|
+
- The fair gas price
|
|
308
|
+
|
|
309
|
+
#### Inherited from
|
|
310
|
+
|
|
311
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[getFairGasPrice](SmartContractWithAddress.md#getfairgasprice)
|
|
312
|
+
|
|
313
|
+
#### Defined in
|
|
314
|
+
|
|
315
|
+
[contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70)
|
|
316
|
+
|
|
317
|
+
___
|
|
318
|
+
|
|
319
|
+
### unitsToAmount
|
|
320
|
+
|
|
321
|
+
▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\>
|
|
322
|
+
|
|
323
|
+
Converts an amount of units to tokens
|
|
324
|
+
|
|
325
|
+
#### Parameters
|
|
326
|
+
|
|
327
|
+
| Name | Type | Description |
|
|
328
|
+
| :------ | :------ | :------ |
|
|
329
|
+
| `token` | `string` | The token to convert |
|
|
330
|
+
| `amount` | `string` | The amount of units to convert |
|
|
331
|
+
| `tokenDecimals?` | `number` | The number of decimals in the token |
|
|
332
|
+
|
|
333
|
+
#### Returns
|
|
334
|
+
|
|
335
|
+
`Promise`<`string`\>
|
|
336
|
+
|
|
337
|
+
- The converted amount in tokens
|
|
338
|
+
|
|
339
|
+
#### Inherited from
|
|
340
|
+
|
|
341
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[unitsToAmount](SmartContractWithAddress.md#unitstoamount)
|
|
342
|
+
|
|
343
|
+
#### Defined in
|
|
344
|
+
|
|
345
|
+
[contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58)
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / DfStrategyV1
|
|
2
|
+
|
|
3
|
+
# Class: DfStrategyV1
|
|
4
|
+
|
|
5
|
+
Provides an interface for dfStrategyV1 contract
|
|
6
|
+
|
|
7
|
+
## Hierarchy
|
|
8
|
+
|
|
9
|
+
- [`SmartContractWithAddress`](SmartContractWithAddress.md)
|
|
10
|
+
|
|
11
|
+
↳ **`DfStrategyV1`**
|
|
12
|
+
|
|
13
|
+
## Table of contents
|
|
14
|
+
|
|
15
|
+
### Constructors
|
|
16
|
+
|
|
17
|
+
- [constructor](DfStrategyV1.md#constructor)
|
|
18
|
+
|
|
19
|
+
### Properties
|
|
20
|
+
|
|
21
|
+
- [abi](DfStrategyV1.md#abi)
|
|
22
|
+
- [address](DfStrategyV1.md#address)
|
|
23
|
+
- [config](DfStrategyV1.md#config)
|
|
24
|
+
- [contract](DfStrategyV1.md#contract)
|
|
25
|
+
- [signer](DfStrategyV1.md#signer)
|
|
26
|
+
|
|
27
|
+
### Methods
|
|
28
|
+
|
|
29
|
+
- [amountToUnits](DfStrategyV1.md#amounttounits)
|
|
30
|
+
- [claimMultipleRewards](DfStrategyV1.md#claimmultiplerewards)
|
|
31
|
+
- [getContract](DfStrategyV1.md#getcontract)
|
|
32
|
+
- [getDefaultAbi](DfStrategyV1.md#getdefaultabi)
|
|
33
|
+
- [getFairGasPrice](DfStrategyV1.md#getfairgasprice)
|
|
34
|
+
- [getMultipleAvailableRewards](DfStrategyV1.md#getmultipleavailablerewards)
|
|
35
|
+
- [unitsToAmount](DfStrategyV1.md#unitstoamount)
|
|
36
|
+
|
|
37
|
+
## Constructors
|
|
38
|
+
|
|
39
|
+
### constructor
|
|
40
|
+
|
|
41
|
+
• **new DfStrategyV1**(`address`, `signer`, `network?`, `config?`, `abi?`)
|
|
42
|
+
|
|
43
|
+
Instantiate the smart contract.
|
|
44
|
+
|
|
45
|
+
#### Parameters
|
|
46
|
+
|
|
47
|
+
| Name | Type | Description |
|
|
48
|
+
| :------ | :------ | :------ |
|
|
49
|
+
| `address` | `string` | The address of the contract. |
|
|
50
|
+
| `signer` | `Signer` | The signer object. |
|
|
51
|
+
| `network?` | `string` \| `number` | Network id or name |
|
|
52
|
+
| `config?` | [`Config`](Config.md) | The configuration object. |
|
|
53
|
+
| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract |
|
|
54
|
+
|
|
55
|
+
#### Inherited from
|
|
56
|
+
|
|
57
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[constructor](SmartContractWithAddress.md#constructor)
|
|
58
|
+
|
|
59
|
+
#### Defined in
|
|
60
|
+
|
|
61
|
+
[contracts/SmartContractWithAddress.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L17)
|
|
62
|
+
|
|
63
|
+
## Properties
|
|
64
|
+
|
|
65
|
+
### abi
|
|
66
|
+
|
|
67
|
+
• **abi**: [`AbiItem`](../interfaces/AbiItem.md)[]
|
|
68
|
+
|
|
69
|
+
#### Inherited from
|
|
70
|
+
|
|
71
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[abi](SmartContractWithAddress.md#abi)
|
|
72
|
+
|
|
73
|
+
#### Defined in
|
|
74
|
+
|
|
75
|
+
[contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14)
|
|
76
|
+
|
|
77
|
+
___
|
|
78
|
+
|
|
79
|
+
### address
|
|
80
|
+
|
|
81
|
+
• **address**: `string`
|
|
82
|
+
|
|
83
|
+
#### Inherited from
|
|
84
|
+
|
|
85
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[address](SmartContractWithAddress.md#address)
|
|
86
|
+
|
|
87
|
+
#### Defined in
|
|
88
|
+
|
|
89
|
+
[contracts/SmartContractWithAddress.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L6)
|
|
90
|
+
|
|
91
|
+
___
|
|
92
|
+
|
|
93
|
+
### config
|
|
94
|
+
|
|
95
|
+
• **config**: [`Config`](Config.md)
|
|
96
|
+
|
|
97
|
+
#### Inherited from
|
|
98
|
+
|
|
99
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[config](SmartContractWithAddress.md#config)
|
|
100
|
+
|
|
101
|
+
#### Defined in
|
|
102
|
+
|
|
103
|
+
[contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13)
|
|
104
|
+
|
|
105
|
+
___
|
|
106
|
+
|
|
107
|
+
### contract
|
|
108
|
+
|
|
109
|
+
• **contract**: `Contract`
|
|
110
|
+
|
|
111
|
+
#### Inherited from
|
|
112
|
+
|
|
113
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[contract](SmartContractWithAddress.md#contract)
|
|
114
|
+
|
|
115
|
+
#### Defined in
|
|
116
|
+
|
|
117
|
+
[contracts/SmartContractWithAddress.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L7)
|
|
118
|
+
|
|
119
|
+
___
|
|
120
|
+
|
|
121
|
+
### signer
|
|
122
|
+
|
|
123
|
+
• **signer**: `Signer`
|
|
124
|
+
|
|
125
|
+
#### Inherited from
|
|
126
|
+
|
|
127
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[signer](SmartContractWithAddress.md#signer)
|
|
128
|
+
|
|
129
|
+
#### Defined in
|
|
130
|
+
|
|
131
|
+
[contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12)
|
|
132
|
+
|
|
133
|
+
## Methods
|
|
134
|
+
|
|
135
|
+
### amountToUnits
|
|
136
|
+
|
|
137
|
+
▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\>
|
|
138
|
+
|
|
139
|
+
Converts an amount of tokens to units
|
|
140
|
+
|
|
141
|
+
#### Parameters
|
|
142
|
+
|
|
143
|
+
| Name | Type | Description |
|
|
144
|
+
| :------ | :------ | :------ |
|
|
145
|
+
| `token` | `string` | The token to convert |
|
|
146
|
+
| `amount` | `string` | The amount of tokens to convert |
|
|
147
|
+
| `tokenDecimals?` | `number` | The number of decimals of the token |
|
|
148
|
+
|
|
149
|
+
#### Returns
|
|
150
|
+
|
|
151
|
+
`Promise`<`string`\>
|
|
152
|
+
|
|
153
|
+
- The converted amount in units
|
|
154
|
+
|
|
155
|
+
#### Inherited from
|
|
156
|
+
|
|
157
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[amountToUnits](SmartContractWithAddress.md#amounttounits)
|
|
158
|
+
|
|
159
|
+
#### Defined in
|
|
160
|
+
|
|
161
|
+
[contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43)
|
|
162
|
+
|
|
163
|
+
___
|
|
164
|
+
|
|
165
|
+
### claimMultipleRewards
|
|
166
|
+
|
|
167
|
+
▸ **claimMultipleRewards**<`G`\>(`userAddress`, `tokenAddresses`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
168
|
+
|
|
169
|
+
claim multiple token rewards for any address
|
|
170
|
+
|
|
171
|
+
#### Type parameters
|
|
172
|
+
|
|
173
|
+
| Name | Type |
|
|
174
|
+
| :------ | :------ |
|
|
175
|
+
| `G` | extends `boolean` = ``false`` |
|
|
176
|
+
|
|
177
|
+
#### Parameters
|
|
178
|
+
|
|
179
|
+
| Name | Type | Description |
|
|
180
|
+
| :------ | :------ | :------ |
|
|
181
|
+
| `userAddress` | `string` | user address to claim |
|
|
182
|
+
| `tokenAddresses` | `string`[] | array of tokens |
|
|
183
|
+
| `estimateGas?` | `G` | - |
|
|
184
|
+
|
|
185
|
+
#### Returns
|
|
186
|
+
|
|
187
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
188
|
+
|
|
189
|
+
#### Defined in
|
|
190
|
+
|
|
191
|
+
[contracts/df/DfStrategyV1.ts:36](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/df/DfStrategyV1.ts#L36)
|
|
192
|
+
|
|
193
|
+
___
|
|
194
|
+
|
|
195
|
+
### getContract
|
|
196
|
+
|
|
197
|
+
▸ `Protected` **getContract**(`address`, `abi?`): `Contract`
|
|
198
|
+
|
|
199
|
+
Returns a contract instance for the given address
|
|
200
|
+
|
|
201
|
+
#### Parameters
|
|
202
|
+
|
|
203
|
+
| Name | Type | Description |
|
|
204
|
+
| :------ | :------ | :------ |
|
|
205
|
+
| `address` | `string` | The address of the contract |
|
|
206
|
+
| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract |
|
|
207
|
+
|
|
208
|
+
#### Returns
|
|
209
|
+
|
|
210
|
+
`Contract`
|
|
211
|
+
|
|
212
|
+
- The contract instance
|
|
213
|
+
|
|
214
|
+
#### Inherited from
|
|
215
|
+
|
|
216
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[getContract](SmartContractWithAddress.md#getcontract)
|
|
217
|
+
|
|
218
|
+
#### Defined in
|
|
219
|
+
|
|
220
|
+
[contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80)
|
|
221
|
+
|
|
222
|
+
___
|
|
223
|
+
|
|
224
|
+
### getDefaultAbi
|
|
225
|
+
|
|
226
|
+
▸ **getDefaultAbi**(): [`AbiItem`](../interfaces/AbiItem.md)[]
|
|
227
|
+
|
|
228
|
+
#### Returns
|
|
229
|
+
|
|
230
|
+
[`AbiItem`](../interfaces/AbiItem.md)[]
|
|
231
|
+
|
|
232
|
+
#### Overrides
|
|
233
|
+
|
|
234
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[getDefaultAbi](SmartContractWithAddress.md#getdefaultabi)
|
|
235
|
+
|
|
236
|
+
#### Defined in
|
|
237
|
+
|
|
238
|
+
[contracts/df/DfStrategyV1.ts:9](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/df/DfStrategyV1.ts#L9)
|
|
239
|
+
|
|
240
|
+
___
|
|
241
|
+
|
|
242
|
+
### getFairGasPrice
|
|
243
|
+
|
|
244
|
+
▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\>
|
|
245
|
+
|
|
246
|
+
Retruns the gas price
|
|
247
|
+
|
|
248
|
+
#### Returns
|
|
249
|
+
|
|
250
|
+
`Promise`<`string`\>
|
|
251
|
+
|
|
252
|
+
- The fair gas price
|
|
253
|
+
|
|
254
|
+
#### Inherited from
|
|
255
|
+
|
|
256
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[getFairGasPrice](SmartContractWithAddress.md#getfairgasprice)
|
|
257
|
+
|
|
258
|
+
#### Defined in
|
|
259
|
+
|
|
260
|
+
[contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70)
|
|
261
|
+
|
|
262
|
+
___
|
|
263
|
+
|
|
264
|
+
### getMultipleAvailableRewards
|
|
265
|
+
|
|
266
|
+
▸ **getMultipleAvailableRewards**(`userAddress`, `tokenAddresses`): `Promise`<`string`[]\>
|
|
267
|
+
|
|
268
|
+
Get available DF Rewards for multiple tokens
|
|
269
|
+
|
|
270
|
+
#### Parameters
|
|
271
|
+
|
|
272
|
+
| Name | Type | Description |
|
|
273
|
+
| :------ | :------ | :------ |
|
|
274
|
+
| `userAddress` | `string` | user address |
|
|
275
|
+
| `tokenAddresses` | `string`[] | array of tokens |
|
|
276
|
+
|
|
277
|
+
#### Returns
|
|
278
|
+
|
|
279
|
+
`Promise`<`string`[]\>
|
|
280
|
+
|
|
281
|
+
#### Defined in
|
|
282
|
+
|
|
283
|
+
[contracts/df/DfStrategyV1.ts:18](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/df/DfStrategyV1.ts#L18)
|
|
284
|
+
|
|
285
|
+
___
|
|
286
|
+
|
|
287
|
+
### unitsToAmount
|
|
288
|
+
|
|
289
|
+
▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\>
|
|
290
|
+
|
|
291
|
+
Converts an amount of units to tokens
|
|
292
|
+
|
|
293
|
+
#### Parameters
|
|
294
|
+
|
|
295
|
+
| Name | Type | Description |
|
|
296
|
+
| :------ | :------ | :------ |
|
|
297
|
+
| `token` | `string` | The token to convert |
|
|
298
|
+
| `amount` | `string` | The amount of units to convert |
|
|
299
|
+
| `tokenDecimals?` | `number` | The number of decimals in the token |
|
|
300
|
+
|
|
301
|
+
#### Returns
|
|
302
|
+
|
|
303
|
+
`Promise`<`string`\>
|
|
304
|
+
|
|
305
|
+
- The converted amount in tokens
|
|
306
|
+
|
|
307
|
+
#### Inherited from
|
|
308
|
+
|
|
309
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[unitsToAmount](SmartContractWithAddress.md#unitstoamount)
|
|
310
|
+
|
|
311
|
+
#### Defined in
|
|
312
|
+
|
|
313
|
+
[contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58)
|