@oceanprotocol/lib 3.0.0-next.1 → 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.
Files changed (96) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/CodeExamples.md +1 -1
  3. package/dist/lib.js +1 -1
  4. package/dist/lib.js.map +1 -1
  5. package/dist/lib.modern.js +1 -1
  6. package/dist/lib.modern.js.map +1 -1
  7. package/dist/lib.module.js +1 -1
  8. package/dist/lib.module.js.map +1 -1
  9. package/dist/lib.umd.js +1 -1
  10. package/dist/lib.umd.js.map +1 -1
  11. package/docs/.nojekyll +1 -0
  12. package/docs/README.md +192 -0
  13. package/docs/classes/Aquarius.md +171 -0
  14. package/docs/classes/Config.md +481 -0
  15. package/docs/classes/ConfigHelper.md +66 -0
  16. package/docs/classes/Datatoken.md +1123 -0
  17. package/docs/classes/DfRewards.md +345 -0
  18. package/docs/classes/DfStrategyV1.md +313 -0
  19. package/docs/classes/Dispenser.md +502 -0
  20. package/docs/classes/FixedRateExchange.md +1068 -0
  21. package/docs/classes/Logger.md +191 -0
  22. package/docs/classes/Nft.md +970 -0
  23. package/docs/classes/NftFactory.md +861 -0
  24. package/docs/classes/Provider.md +628 -0
  25. package/docs/classes/Router.md +645 -0
  26. package/docs/classes/SmartContract.md +193 -0
  27. package/docs/classes/SmartContractWithAddress.md +268 -0
  28. package/docs/classes/VeAllocate.md +372 -0
  29. package/docs/classes/VeFeeDistributor.md +325 -0
  30. package/docs/classes/VeFeeEstimate.md +281 -0
  31. package/docs/classes/VeOcean.md +513 -0
  32. package/docs/enums/LogLevel.md +63 -0
  33. package/docs/interfaces/AbiInput.md +63 -0
  34. package/docs/interfaces/AbiItem.md +107 -0
  35. package/docs/interfaces/AbiOutput.md +52 -0
  36. package/docs/interfaces/Arweave.md +32 -0
  37. package/docs/interfaces/Asset.md +227 -0
  38. package/docs/interfaces/AssetDatatoken.md +60 -0
  39. package/docs/interfaces/AssetLastEvent.md +63 -0
  40. package/docs/interfaces/AssetNft.md +105 -0
  41. package/docs/interfaces/AssetPrice.md +47 -0
  42. package/docs/interfaces/ComputeAlgorithm.md +82 -0
  43. package/docs/interfaces/ComputeAsset.md +56 -0
  44. package/docs/interfaces/ComputeEnvironment.md +173 -0
  45. package/docs/interfaces/ComputeJob.md +140 -0
  46. package/docs/interfaces/ComputeOutput.md +118 -0
  47. package/docs/interfaces/ComputeResult.md +52 -0
  48. package/docs/interfaces/ConsumeMarketFee.md +41 -0
  49. package/docs/interfaces/Credential.md +30 -0
  50. package/docs/interfaces/Credentials.md +30 -0
  51. package/docs/interfaces/DDO.md +137 -0
  52. package/docs/interfaces/DatatokenCreateParams.md +107 -0
  53. package/docs/interfaces/DatatokenRoles.md +30 -0
  54. package/docs/interfaces/DispenserCreationParams.md +63 -0
  55. package/docs/interfaces/DispenserParams.md +52 -0
  56. package/docs/interfaces/DispenserToken.md +85 -0
  57. package/docs/interfaces/DownloadResponse.md +30 -0
  58. package/docs/interfaces/Event.md +73 -0
  59. package/docs/interfaces/FeesInfo.md +74 -0
  60. package/docs/interfaces/FileInfo.md +118 -0
  61. package/docs/interfaces/Files.md +41 -0
  62. package/docs/interfaces/FixedPriceExchange.md +162 -0
  63. package/docs/interfaces/FreCreationParams.md +118 -0
  64. package/docs/interfaces/FreOrderParams.md +85 -0
  65. package/docs/interfaces/GraphqlQuery.md +69 -0
  66. package/docs/interfaces/Ipfs.md +32 -0
  67. package/docs/interfaces/Metadata.md +193 -0
  68. package/docs/interfaces/MetadataAlgorithm.md +69 -0
  69. package/docs/interfaces/MetadataAndTokenURI.md +107 -0
  70. package/docs/interfaces/MetadataProof.md +52 -0
  71. package/docs/interfaces/NftCreateData.md +74 -0
  72. package/docs/interfaces/NftRoles.md +52 -0
  73. package/docs/interfaces/Operation.md +145 -0
  74. package/docs/interfaces/OrderParams.md +52 -0
  75. package/docs/interfaces/PriceAndFees.md +52 -0
  76. package/docs/interfaces/ProviderComputeInitialize.md +41 -0
  77. package/docs/interfaces/ProviderComputeInitializeResults.md +30 -0
  78. package/docs/interfaces/ProviderFees.md +96 -0
  79. package/docs/interfaces/ProviderInitialize.md +52 -0
  80. package/docs/interfaces/PublisherTrustedAlgorithm.md +47 -0
  81. package/docs/interfaces/PublishingMarketFee.md +41 -0
  82. package/docs/interfaces/Purgatory.md +34 -0
  83. package/docs/interfaces/SearchQuery.md +67 -0
  84. package/docs/interfaces/Service.md +138 -0
  85. package/docs/interfaces/ServiceComputeOptions.md +63 -0
  86. package/docs/interfaces/ServiceEndpoint.md +41 -0
  87. package/docs/interfaces/Smartcontract-1.md +58 -0
  88. package/docs/interfaces/Stats.md +47 -0
  89. package/docs/interfaces/Template.md +30 -0
  90. package/docs/interfaces/TokenOrder.md +63 -0
  91. package/docs/interfaces/UrlFile.md +71 -0
  92. package/docs/interfaces/UserCustomParameters.md +7 -0
  93. package/docs/interfaces/ValidateMetadata.md +52 -0
  94. package/docs/modules.md +856 -0
  95. package/package.json +7 -8
  96. package/typedoc.json +4 -0
@@ -0,0 +1,1123 @@
1
+ [@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Datatoken
2
+
3
+ # Class: Datatoken
4
+
5
+ ## Hierarchy
6
+
7
+ - [`SmartContract`](SmartContract.md)
8
+
9
+ ↳ **`Datatoken`**
10
+
11
+ ## Table of contents
12
+
13
+ ### Constructors
14
+
15
+ - [constructor](Datatoken.md#constructor)
16
+
17
+ ### Properties
18
+
19
+ - [abi](Datatoken.md#abi)
20
+ - [abiEnterprise](Datatoken.md#abienterprise)
21
+ - [config](Datatoken.md#config)
22
+ - [nft](Datatoken.md#nft)
23
+ - [signer](Datatoken.md#signer)
24
+
25
+ ### Methods
26
+
27
+ - [addMinter](Datatoken.md#addminter)
28
+ - [addPaymentManager](Datatoken.md#addpaymentmanager)
29
+ - [amountToUnits](Datatoken.md#amounttounits)
30
+ - [approve](Datatoken.md#approve)
31
+ - [balance](Datatoken.md#balance)
32
+ - [buyFromDispenserAndOrder](Datatoken.md#buyfromdispenserandorder)
33
+ - [buyFromFreAndOrder](Datatoken.md#buyfromfreandorder)
34
+ - [cleanPermissions](Datatoken.md#cleanpermissions)
35
+ - [createDispenser](Datatoken.md#createdispenser)
36
+ - [createFixedRate](Datatoken.md#createfixedrate)
37
+ - [getCap](Datatoken.md#getcap)
38
+ - [getContract](Datatoken.md#getcontract)
39
+ - [getDecimals](Datatoken.md#getdecimals)
40
+ - [getDefaultAbi](Datatoken.md#getdefaultabi)
41
+ - [getFairGasPrice](Datatoken.md#getfairgasprice)
42
+ - [getFreOrderParams](Datatoken.md#getfreorderparams)
43
+ - [getNFTAddress](Datatoken.md#getnftaddress)
44
+ - [getName](Datatoken.md#getname)
45
+ - [getPaymentCollector](Datatoken.md#getpaymentcollector)
46
+ - [getPermissions](Datatoken.md#getpermissions)
47
+ - [getPublishingMarketFee](Datatoken.md#getpublishingmarketfee)
48
+ - [getSymbol](Datatoken.md#getsymbol)
49
+ - [isDatatokenDeployer](Datatoken.md#isdatatokendeployer)
50
+ - [mint](Datatoken.md#mint)
51
+ - [removeMinter](Datatoken.md#removeminter)
52
+ - [removePaymentManager](Datatoken.md#removepaymentmanager)
53
+ - [reuseOrder](Datatoken.md#reuseorder)
54
+ - [setData](Datatoken.md#setdata)
55
+ - [setPaymentCollector](Datatoken.md#setpaymentcollector)
56
+ - [setPublishingMarketFee](Datatoken.md#setpublishingmarketfee)
57
+ - [startOrder](Datatoken.md#startorder)
58
+ - [transfer](Datatoken.md#transfer)
59
+ - [transferWei](Datatoken.md#transferwei)
60
+ - [unitsToAmount](Datatoken.md#unitstoamount)
61
+
62
+ ## Constructors
63
+
64
+ ### constructor
65
+
66
+ • **new Datatoken**(`signer`, `network?`, `config?`, `abi?`, `abiEnterprise?`)
67
+
68
+ Instantiate Datatoken class
69
+
70
+ #### Parameters
71
+
72
+ | Name | Type | Description |
73
+ | :------ | :------ | :------ |
74
+ | `signer` | `Signer` | The signer object. |
75
+ | `network?` | `string` \| `number` | Network id or name |
76
+ | `config?` | [`Config`](Config.md) | The configuration object. |
77
+ | `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract |
78
+ | `abiEnterprise?` | [`AbiItem`](../interfaces/AbiItem.md)[] | Enterprise ABI array of the smart contract |
79
+
80
+ #### Overrides
81
+
82
+ [SmartContract](SmartContract.md).[constructor](SmartContract.md#constructor)
83
+
84
+ #### Defined in
85
+
86
+ [contracts/Datatoken.ts:38](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L38)
87
+
88
+ ## Properties
89
+
90
+ ### abi
91
+
92
+ • **abi**: [`AbiItem`](../interfaces/AbiItem.md)[]
93
+
94
+ #### Inherited from
95
+
96
+ [SmartContract](SmartContract.md).[abi](SmartContract.md#abi)
97
+
98
+ #### Defined in
99
+
100
+ [contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14)
101
+
102
+ ___
103
+
104
+ ### abiEnterprise
105
+
106
+ • **abiEnterprise**: [`AbiItem`](../interfaces/AbiItem.md)[]
107
+
108
+ #### Defined in
109
+
110
+ [contracts/Datatoken.ts:23](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L23)
111
+
112
+ ___
113
+
114
+ ### config
115
+
116
+ • **config**: [`Config`](Config.md)
117
+
118
+ #### Inherited from
119
+
120
+ [SmartContract](SmartContract.md).[config](SmartContract.md#config)
121
+
122
+ #### Defined in
123
+
124
+ [contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13)
125
+
126
+ ___
127
+
128
+ ### nft
129
+
130
+ • **nft**: [`Nft`](Nft.md)
131
+
132
+ #### Defined in
133
+
134
+ [contracts/Datatoken.ts:24](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L24)
135
+
136
+ ___
137
+
138
+ ### signer
139
+
140
+ • **signer**: `Signer`
141
+
142
+ #### Inherited from
143
+
144
+ [SmartContract](SmartContract.md).[signer](SmartContract.md#signer)
145
+
146
+ #### Defined in
147
+
148
+ [contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12)
149
+
150
+ ## Methods
151
+
152
+ ### addMinter
153
+
154
+ ▸ **addMinter**<`G`\>(`dtAddress`, `address`, `minter`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
155
+
156
+ Add Minter for an ERC20 Datatoken
157
+ only DatatokenDeployer can succeed
158
+
159
+ #### Type parameters
160
+
161
+ | Name | Type |
162
+ | :------ | :------ |
163
+ | `G` | extends `boolean` = ``false`` |
164
+
165
+ #### Parameters
166
+
167
+ | Name | Type | Description |
168
+ | :------ | :------ | :------ |
169
+ | `dtAddress` | `string` | Datatoken address |
170
+ | `address` | `string` | caller address |
171
+ | `minter` | `string` | address which is going to be a Minter |
172
+ | `estimateGas?` | `G` | if True, return gas estimate |
173
+
174
+ #### Returns
175
+
176
+ `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
177
+
178
+ transactionId
179
+
180
+ #### Defined in
181
+
182
+ [contracts/Datatoken.ts:252](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L252)
183
+
184
+ ___
185
+
186
+ ### addPaymentManager
187
+
188
+ ▸ **addPaymentManager**<`G`\>(`dtAddress`, `address`, `paymentManager`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
189
+
190
+ Adds a payment manager on a datatoken to a desired address.(can set who's going to collect fee when consuming orders)
191
+ only DatatokenDeployer can succeed
192
+
193
+ #### Type parameters
194
+
195
+ | Name | Type |
196
+ | :------ | :------ |
197
+ | `G` | extends `boolean` = ``false`` |
198
+
199
+ #### Parameters
200
+
201
+ | Name | Type | Description |
202
+ | :------ | :------ | :------ |
203
+ | `dtAddress` | `string` | Datatoken address |
204
+ | `address` | `string` | Caller address |
205
+ | `paymentManager` | `string` | The address of the payment manager |
206
+ | `estimateGas?` | `G` | if True, return gas estimate |
207
+
208
+ #### Returns
209
+
210
+ `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
211
+
212
+ transactionId
213
+
214
+ #### Defined in
215
+
216
+ [contracts/Datatoken.ts:322](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L322)
217
+
218
+ ___
219
+
220
+ ### amountToUnits
221
+
222
+ ▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\>
223
+
224
+ Converts an amount of tokens to units
225
+
226
+ #### Parameters
227
+
228
+ | Name | Type | Description |
229
+ | :------ | :------ | :------ |
230
+ | `token` | `string` | The token to convert |
231
+ | `amount` | `string` | The amount of tokens to convert |
232
+ | `tokenDecimals?` | `number` | The number of decimals of the token |
233
+
234
+ #### Returns
235
+
236
+ `Promise`<`string`\>
237
+
238
+ - The converted amount in units
239
+
240
+ #### Inherited from
241
+
242
+ [SmartContract](SmartContract.md).[amountToUnits](SmartContract.md#amounttounits)
243
+
244
+ #### Defined in
245
+
246
+ [contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43)
247
+
248
+ ___
249
+
250
+ ### approve
251
+
252
+ ▸ **approve**<`G`\>(`dtAddress`, `spender`, `amount`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
253
+
254
+ Approves a spender to spend a certain amount of datatokens.
255
+
256
+ #### Type parameters
257
+
258
+ | Name | Type |
259
+ | :------ | :------ |
260
+ | `G` | extends `boolean` = ``false`` |
261
+
262
+ #### Parameters
263
+
264
+ | Name | Type | Description |
265
+ | :------ | :------ | :------ |
266
+ | `dtAddress` | `string` | Datatoken address |
267
+ | `spender` | `string` | Spender address |
268
+ | `amount` | `string` | Number of datatokens, as number. Will be converted to wei |
269
+ | `estimateGas?` | `G` | if True, return gas estimate |
270
+
271
+ #### Returns
272
+
273
+ `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
274
+
275
+ #### Defined in
276
+
277
+ [contracts/Datatoken.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L58)
278
+
279
+ ___
280
+
281
+ ### balance
282
+
283
+ ▸ **balance**(`datatokenAddress`, `address`): `Promise`<`string`\>
284
+
285
+ Get Address Balance for datatoken
286
+
287
+ #### Parameters
288
+
289
+ | Name | Type | Description |
290
+ | :------ | :------ | :------ |
291
+ | `datatokenAddress` | `string` | - |
292
+ | `address` | `string` | user adress |
293
+
294
+ #### Returns
295
+
296
+ `Promise`<`string`\>
297
+
298
+ balance Number of datatokens. Will be converted from wei
299
+
300
+ #### Defined in
301
+
302
+ [contracts/Datatoken.ts:791](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L791)
303
+
304
+ ___
305
+
306
+ ### buyFromDispenserAndOrder
307
+
308
+ ▸ **buyFromDispenserAndOrder**<`G`\>(`dtAddress`, `orderParams`, `dispenserContract`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
309
+
310
+ Gets 1 DT from dispenser and then startsOrder, while burning that DT
311
+
312
+ #### Type parameters
313
+
314
+ | Name | Type |
315
+ | :------ | :------ |
316
+ | `G` | extends `boolean` = ``false`` |
317
+
318
+ #### Parameters
319
+
320
+ | Name | Type | Description |
321
+ | :------ | :------ | :------ |
322
+ | `dtAddress` | `string` | Datatoken address |
323
+ | `orderParams` | [`OrderParams`](../interfaces/OrderParams.md) | The parameters required to place an order. |
324
+ | `dispenserContract` | `string` | dispenser address |
325
+ | `estimateGas?` | `G` | if True, return gas estimate |
326
+
327
+ #### Returns
328
+
329
+ `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
330
+
331
+ #### Defined in
332
+
333
+ [contracts/Datatoken.ts:610](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L610)
334
+
335
+ ___
336
+
337
+ ### buyFromFreAndOrder
338
+
339
+ ▸ **buyFromFreAndOrder**<`G`\>(`dtAddress`, `orderParams`, `freParams`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
340
+
341
+ Buys 1 DT from the FRE and then startsOrder, while burning that DT
342
+
343
+ #### Type parameters
344
+
345
+ | Name | Type |
346
+ | :------ | :------ |
347
+ | `G` | extends `boolean` = ``false`` |
348
+
349
+ #### Parameters
350
+
351
+ | Name | Type | Description |
352
+ | :------ | :------ | :------ |
353
+ | `dtAddress` | `string` | Datatoken address |
354
+ | `orderParams` | [`OrderParams`](../interfaces/OrderParams.md) | The parameters required to place an order. |
355
+ | `freParams` | [`FreOrderParams`](../interfaces/FreOrderParams.md) | The parameters required to buy from a fixed-rate exchange. |
356
+ | `estimateGas?` | `G` | if True, return gas estimate |
357
+
358
+ #### Returns
359
+
360
+ `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
361
+
362
+ #### Defined in
363
+
364
+ [contracts/Datatoken.ts:575](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L575)
365
+
366
+ ___
367
+
368
+ ### cleanPermissions
369
+
370
+ ▸ **cleanPermissions**<`G`\>(`dtAddress`, `address`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
371
+
372
+ Clean Datatoken level Permissions (minters, paymentManager and reset the paymentCollector) for an ERC20 Datatoken
373
+ Only NFT Owner (at 721 level) can call it.
374
+
375
+ #### Type parameters
376
+
377
+ | Name | Type |
378
+ | :------ | :------ |
379
+ | `G` | extends `boolean` = ``false`` |
380
+
381
+ #### Parameters
382
+
383
+ | Name | Type | Description |
384
+ | :------ | :------ | :------ |
385
+ | `dtAddress` | `string` | Datatoken address where we want to clean permissions |
386
+ | `address` | `string` | User adress |
387
+ | `estimateGas?` | `G` | if True, return gas estimate |
388
+
389
+ #### Returns
390
+
391
+ `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
392
+
393
+ transactionId
394
+
395
+ #### Defined in
396
+
397
+ [contracts/Datatoken.ts:680](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L680)
398
+
399
+ ___
400
+
401
+ ### createDispenser
402
+
403
+ ▸ **createDispenser**<`G`\>(`dtAddress`, `address`, `dispenserAddress`, `dispenserParams`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
404
+
405
+ Creates a new Dispenser
406
+
407
+ #### Type parameters
408
+
409
+ | Name | Type |
410
+ | :------ | :------ |
411
+ | `G` | extends `boolean` = ``false`` |
412
+
413
+ #### Parameters
414
+
415
+ | Name | Type | Description |
416
+ | :------ | :------ | :------ |
417
+ | `dtAddress` | `string` | Datatoken address |
418
+ | `address` | `string` | Caller address |
419
+ | `dispenserAddress` | `string` | Dispenser contract address |
420
+ | `dispenserParams` | [`DispenserParams`](../interfaces/DispenserParams.md) | The parameters required to create a dispenser contract. |
421
+ | `estimateGas?` | `G` | if True, return gas estimate |
422
+
423
+ #### Returns
424
+
425
+ `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
426
+
427
+ transactionId
428
+
429
+ #### Defined in
430
+
431
+ [contracts/Datatoken.ts:157](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L157)
432
+
433
+ ___
434
+
435
+ ### createFixedRate
436
+
437
+ ▸ **createFixedRate**<`G`\>(`dtAddress`, `address`, `fixedRateParams`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
438
+
439
+ Creates a new FixedRateExchange setup.
440
+
441
+ #### Type parameters
442
+
443
+ | Name | Type |
444
+ | :------ | :------ |
445
+ | `G` | extends `boolean` = ``false`` |
446
+
447
+ #### Parameters
448
+
449
+ | Name | Type | Description |
450
+ | :------ | :------ | :------ |
451
+ | `dtAddress` | `string` | Datatoken address |
452
+ | `address` | `string` | Caller address |
453
+ | `fixedRateParams` | [`FreCreationParams`](../interfaces/FreCreationParams.md) | The parameters required to create a fixed-rate exchange contract. |
454
+ | `estimateGas?` | `G` | if True, return gas estimate |
455
+
456
+ #### Returns
457
+
458
+ `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
459
+
460
+ #### Defined in
461
+
462
+ [contracts/Datatoken.ts:91](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L91)
463
+
464
+ ___
465
+
466
+ ### getCap
467
+
468
+ ▸ **getCap**(`dtAddress`): `Promise`<`string`\>
469
+
470
+ Returns the Datatoken cap
471
+
472
+ #### Parameters
473
+
474
+ | Name | Type | Description |
475
+ | :------ | :------ | :------ |
476
+ | `dtAddress` | `string` | Datatoken adress |
477
+
478
+ #### Returns
479
+
480
+ `Promise`<`string`\>
481
+
482
+ #### Defined in
483
+
484
+ [contracts/Datatoken.ts:723](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L723)
485
+
486
+ ___
487
+
488
+ ### getContract
489
+
490
+ ▸ `Protected` **getContract**(`address`, `abi?`): `Contract`
491
+
492
+ Returns a contract instance for the given address
493
+
494
+ #### Parameters
495
+
496
+ | Name | Type | Description |
497
+ | :------ | :------ | :------ |
498
+ | `address` | `string` | The address of the contract |
499
+ | `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract |
500
+
501
+ #### Returns
502
+
503
+ `Contract`
504
+
505
+ - The contract instance
506
+
507
+ #### Inherited from
508
+
509
+ [SmartContract](SmartContract.md).[getContract](SmartContract.md#getcontract)
510
+
511
+ #### Defined in
512
+
513
+ [contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80)
514
+
515
+ ___
516
+
517
+ ### getDecimals
518
+
519
+ ▸ **getDecimals**(`dtAddress`): `Promise`<`number`\>
520
+
521
+ It returns the token decimals, how many supported decimal points
522
+
523
+ #### Parameters
524
+
525
+ | Name | Type | Description |
526
+ | :------ | :------ | :------ |
527
+ | `dtAddress` | `string` | Datatoken adress |
528
+
529
+ #### Returns
530
+
531
+ `Promise`<`number`\>
532
+
533
+ #### Defined in
534
+
535
+ [contracts/Datatoken.ts:734](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L734)
536
+
537
+ ___
538
+
539
+ ### getDefaultAbi
540
+
541
+ ▸ **getDefaultAbi**(): [`AbiItem`](../interfaces/AbiItem.md)[]
542
+
543
+ #### Returns
544
+
545
+ [`AbiItem`](../interfaces/AbiItem.md)[]
546
+
547
+ #### Overrides
548
+
549
+ [SmartContract](SmartContract.md).[getDefaultAbi](SmartContract.md#getdefaultabi)
550
+
551
+ #### Defined in
552
+
553
+ [contracts/Datatoken.ts:26](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L26)
554
+
555
+ ___
556
+
557
+ ### getFairGasPrice
558
+
559
+ ▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\>
560
+
561
+ Retruns the gas price
562
+
563
+ #### Returns
564
+
565
+ `Promise`<`string`\>
566
+
567
+ - The fair gas price
568
+
569
+ #### Inherited from
570
+
571
+ [SmartContract](SmartContract.md).[getFairGasPrice](SmartContract.md#getfairgasprice)
572
+
573
+ #### Defined in
574
+
575
+ [contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70)
576
+
577
+ ___
578
+
579
+ ### getFreOrderParams
580
+
581
+ ▸ `Private` **getFreOrderParams**(`freParams`): `Promise`<`any`\>
582
+
583
+ #### Parameters
584
+
585
+ | Name | Type |
586
+ | :------ | :------ |
587
+ | `freParams` | [`FreOrderParams`](../interfaces/FreOrderParams.md) |
588
+
589
+ #### Returns
590
+
591
+ `Promise`<`any`\>
592
+
593
+ #### Defined in
594
+
595
+ [contracts/Datatoken.ts:859](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L859)
596
+
597
+ ___
598
+
599
+ ### getNFTAddress
600
+
601
+ ▸ **getNFTAddress**(`dtAddress`): `Promise`<`string`\>
602
+
603
+ It returns the token decimals, how many supported decimal points
604
+
605
+ #### Parameters
606
+
607
+ | Name | Type | Description |
608
+ | :------ | :------ | :------ |
609
+ | `dtAddress` | `string` | Datatoken adress |
610
+
611
+ #### Returns
612
+
613
+ `Promise`<`string`\>
614
+
615
+ #### Defined in
616
+
617
+ [contracts/Datatoken.ts:767](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L767)
618
+
619
+ ___
620
+
621
+ ### getName
622
+
623
+ ▸ **getName**(`dtAddress`): `Promise`<`string`\>
624
+
625
+ It returns the name of the token
626
+
627
+ #### Parameters
628
+
629
+ | Name | Type | Description |
630
+ | :------ | :------ | :------ |
631
+ | `dtAddress` | `string` | Datatoken adress |
632
+
633
+ #### Returns
634
+
635
+ `Promise`<`string`\>
636
+
637
+ #### Defined in
638
+
639
+ [contracts/Datatoken.ts:756](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L756)
640
+
641
+ ___
642
+
643
+ ### getPaymentCollector
644
+
645
+ ▸ **getPaymentCollector**(`dtAddress`): `Promise`<`string`\>
646
+
647
+ getPaymentCollector - It returns the current paymentCollector
648
+
649
+ #### Parameters
650
+
651
+ | Name | Type | Description |
652
+ | :------ | :------ | :------ |
653
+ | `dtAddress` | `string` | datatoken address |
654
+
655
+ #### Returns
656
+
657
+ `Promise`<`string`\>
658
+
659
+ #### Defined in
660
+
661
+ [contracts/Datatoken.ts:429](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L429)
662
+
663
+ ___
664
+
665
+ ### getPermissions
666
+
667
+ ▸ **getPermissions**(`dtAddress`, `address`): `Promise`<[`DatatokenRoles`](../interfaces/DatatokenRoles.md)\>
668
+
669
+ Returns ERC20 Datatoken user's permissions for a datatoken
670
+
671
+ #### Parameters
672
+
673
+ | Name | Type | Description |
674
+ | :------ | :------ | :------ |
675
+ | `dtAddress` | `string` | Datatoken adress |
676
+ | `address` | `string` | user adress |
677
+
678
+ #### Returns
679
+
680
+ `Promise`<[`DatatokenRoles`](../interfaces/DatatokenRoles.md)\>
681
+
682
+ #### Defined in
683
+
684
+ [contracts/Datatoken.ts:709](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L709)
685
+
686
+ ___
687
+
688
+ ### getPublishingMarketFee
689
+
690
+ ▸ **getPublishingMarketFee**(`datatokenAddress`): `Promise`<[`PublishingMarketFee`](../interfaces/PublishingMarketFee.md)\>
691
+
692
+ Returns the current fee set by the publishing market
693
+
694
+ #### Parameters
695
+
696
+ | Name | Type | Description |
697
+ | :------ | :------ | :------ |
698
+ | `datatokenAddress` | `string` | Datatoken adress |
699
+
700
+ #### Returns
701
+
702
+ `Promise`<[`PublishingMarketFee`](../interfaces/PublishingMarketFee.md)\>
703
+
704
+ Current fee set by the publishing market
705
+
706
+ #### Defined in
707
+
708
+ [contracts/Datatoken.ts:845](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L845)
709
+
710
+ ___
711
+
712
+ ### getSymbol
713
+
714
+ ▸ **getSymbol**(`dtAddress`): `Promise`<`string`\>
715
+
716
+ It returns the token symbol
717
+
718
+ #### Parameters
719
+
720
+ | Name | Type | Description |
721
+ | :------ | :------ | :------ |
722
+ | `dtAddress` | `string` | Datatoken adress |
723
+
724
+ #### Returns
725
+
726
+ `Promise`<`string`\>
727
+
728
+ #### Defined in
729
+
730
+ [contracts/Datatoken.ts:745](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L745)
731
+
732
+ ___
733
+
734
+ ### isDatatokenDeployer
735
+
736
+ ▸ **isDatatokenDeployer**(`dtAddress`, `address`): `Promise`<`boolean`\>
737
+
738
+ Returns true if address has deployERC20 role
739
+
740
+ #### Parameters
741
+
742
+ | Name | Type | Description |
743
+ | :------ | :------ | :------ |
744
+ | `dtAddress` | `string` | Datatoken adress |
745
+ | `address` | `string` | - |
746
+
747
+ #### Returns
748
+
749
+ `Promise`<`boolean`\>
750
+
751
+ #### Defined in
752
+
753
+ [contracts/Datatoken.ts:779](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L779)
754
+
755
+ ___
756
+
757
+ ### mint
758
+
759
+ ▸ **mint**<`G`\>(`dtAddress`, `address`, `amount`, `toAddress?`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
760
+
761
+ Mints datatokens
762
+
763
+ #### Type parameters
764
+
765
+ | Name | Type |
766
+ | :------ | :------ |
767
+ | `G` | extends `boolean` = ``false`` |
768
+
769
+ #### Parameters
770
+
771
+ | Name | Type | Description |
772
+ | :------ | :------ | :------ |
773
+ | `dtAddress` | `string` | Datatoken address |
774
+ | `address` | `string` | Minter address |
775
+ | `amount` | `string` | Number of datatokens, as number. Will be converted to wei |
776
+ | `toAddress?` | `string` | only if toAddress is different from the minter |
777
+ | `estimateGas?` | `G` | if True, return gas estimate |
778
+
779
+ #### Returns
780
+
781
+ `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
782
+
783
+ transactionId
784
+
785
+ #### Defined in
786
+
787
+ [contracts/Datatoken.ts:208](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L208)
788
+
789
+ ___
790
+
791
+ ### removeMinter
792
+
793
+ ▸ **removeMinter**<`G`\>(`dtAddress`, `address`, `minter`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
794
+
795
+ Revoke Minter permission for an ERC20 Datatoken
796
+ only DatatokenDeployer can succeed
797
+
798
+ #### Type parameters
799
+
800
+ | Name | Type |
801
+ | :------ | :------ |
802
+ | `G` | extends `boolean` = ``false`` |
803
+
804
+ #### Parameters
805
+
806
+ | Name | Type | Description |
807
+ | :------ | :------ | :------ |
808
+ | `dtAddress` | `string` | Datatoken address |
809
+ | `address` | `string` | caller address |
810
+ | `minter` | `string` | address which will have removed the Minter permission |
811
+ | `estimateGas?` | `G` | if True, return gas estimate |
812
+
813
+ #### Returns
814
+
815
+ `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
816
+
817
+ #### Defined in
818
+
819
+ [contracts/Datatoken.ts:287](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L287)
820
+
821
+ ___
822
+
823
+ ### removePaymentManager
824
+
825
+ ▸ **removePaymentManager**<`G`\>(`dtAddress`, `address`, `paymentManager`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
826
+
827
+ Revoke paymentManager permission for an ERC20 Datatoken
828
+ only DatatokenDeployer can succeed
829
+
830
+ #### Type parameters
831
+
832
+ | Name | Type |
833
+ | :------ | :------ |
834
+ | `G` | extends `boolean` = ``false`` |
835
+
836
+ #### Parameters
837
+
838
+ | Name | Type | Description |
839
+ | :------ | :------ | :------ |
840
+ | `dtAddress` | `string` | Datatoken address |
841
+ | `address` | `string` | User address |
842
+ | `paymentManager` | `string` | User which will be removed from paymentManager permission |
843
+ | `estimateGas?` | `G` | if True, return gas estimate |
844
+
845
+ #### Returns
846
+
847
+ `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
848
+
849
+ trxReceipt
850
+
851
+ #### Defined in
852
+
853
+ [contracts/Datatoken.ts:357](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L357)
854
+
855
+ ___
856
+
857
+ ### reuseOrder
858
+
859
+ ▸ **reuseOrder**<`G`\>(`dtAddress`, `orderTxId`, `providerFees`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
860
+
861
+ Reuse Order: called by payer or consumer having a valid order, but with expired provider access.
862
+ Pays the provider fee again, but it will not require a new datatoken payment
863
+ Requires previous approval of provider fee.
864
+
865
+ #### Type parameters
866
+
867
+ | Name | Type |
868
+ | :------ | :------ |
869
+ | `G` | extends `boolean` = ``false`` |
870
+
871
+ #### Parameters
872
+
873
+ | Name | Type | Description |
874
+ | :------ | :------ | :------ |
875
+ | `dtAddress` | `string` | Datatoken address |
876
+ | `orderTxId` | `string` | previous valid order |
877
+ | `providerFees` | [`ProviderFees`](../interfaces/ProviderFees.md) | provider fees |
878
+ | `estimateGas?` | `G` | if True, return gas estimate |
879
+
880
+ #### Returns
881
+
882
+ `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
883
+
884
+ string
885
+
886
+ #### Defined in
887
+
888
+ [contracts/Datatoken.ts:545](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L545)
889
+
890
+ ___
891
+
892
+ ### setData
893
+
894
+ ▸ **setData**<`G`\>(`dtAddress`, `address`, `value`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
895
+
896
+ setData
897
+ This function allows to store data with a preset key (keccak256(dtAddress)) into NFT 725 Store
898
+ only DatatokenDeployer can succeed
899
+
900
+ #### Type parameters
901
+
902
+ | Name | Type |
903
+ | :------ | :------ |
904
+ | `G` | extends `boolean` = ``false`` |
905
+
906
+ #### Parameters
907
+
908
+ | Name | Type | Description |
909
+ | :------ | :------ | :------ |
910
+ | `dtAddress` | `string` | Datatoken address |
911
+ | `address` | `string` | User address |
912
+ | `value` | `string` | Data to be stored into 725Y standard |
913
+ | `estimateGas?` | `G` | if True, return gas estimate |
914
+
915
+ #### Returns
916
+
917
+ `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
918
+
919
+ transactionId
920
+
921
+ #### Defined in
922
+
923
+ [contracts/Datatoken.ts:644](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L644)
924
+
925
+ ___
926
+
927
+ ### setPaymentCollector
928
+
929
+ ▸ **setPaymentCollector**<`G`\>(`dtAddress`, `address`, `paymentCollector`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
930
+
931
+ This function allows to set a new PaymentCollector (receives DT when consuming)
932
+ If not set the paymentCollector is the NFT Owner
933
+ only NFT owner can call
934
+
935
+ #### Type parameters
936
+
937
+ | Name | Type |
938
+ | :------ | :------ |
939
+ | `G` | extends `boolean` = ``false`` |
940
+
941
+ #### Parameters
942
+
943
+ | Name | Type | Description |
944
+ | :------ | :------ | :------ |
945
+ | `dtAddress` | `string` | Datatoken address |
946
+ | `address` | `string` | Caller address |
947
+ | `paymentCollector` | `string` | User to be set as new payment collector |
948
+ | `estimateGas?` | `G` | if True, return gas estimate |
949
+
950
+ #### Returns
951
+
952
+ `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
953
+
954
+ trxReceipt
955
+
956
+ #### Defined in
957
+
958
+ [contracts/Datatoken.ts:393](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L393)
959
+
960
+ ___
961
+
962
+ ### setPublishingMarketFee
963
+
964
+ ▸ **setPublishingMarketFee**<`G`\>(`datatokenAddress`, `publishMarketFeeAddress`, `publishMarketFeeToken`, `publishMarketFeeAmount`, `address`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
965
+
966
+ Allows to set the fee required by the publisherMarket
967
+ only publishMarketFeeAddress can call it
968
+
969
+ #### Type parameters
970
+
971
+ | Name | Type |
972
+ | :------ | :------ |
973
+ | `G` | extends `boolean` = ``false`` |
974
+
975
+ #### Parameters
976
+
977
+ | Name | Type | Description |
978
+ | :------ | :------ | :------ |
979
+ | `datatokenAddress` | `string` | Datatoken adress |
980
+ | `publishMarketFeeAddress` | `string` | new publish Market Fee Address |
981
+ | `publishMarketFeeToken` | `string` | new publish Market Fee Token |
982
+ | `publishMarketFeeAmount` | `string` | new fee amount |
983
+ | `address` | `string` | user adress |
984
+ | `estimateGas?` | `G` | if True, return gas estimate |
985
+
986
+ #### Returns
987
+
988
+ `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
989
+
990
+ #### Defined in
991
+
992
+ [contracts/Datatoken.ts:807](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L807)
993
+
994
+ ___
995
+
996
+ ### startOrder
997
+
998
+ ▸ **startOrder**<`G`\>(`dtAddress`, `consumer`, `serviceIndex`, `providerFees`, `consumeMarketFee?`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
999
+
1000
+ Start Order: called by payer or consumer prior ordering a service consume on a marketplace.
1001
+
1002
+ #### Type parameters
1003
+
1004
+ | Name | Type |
1005
+ | :------ | :------ |
1006
+ | `G` | extends `boolean` = ``false`` |
1007
+
1008
+ #### Parameters
1009
+
1010
+ | Name | Type | Description |
1011
+ | :------ | :------ | :------ |
1012
+ | `dtAddress` | `string` | Datatoken address |
1013
+ | `consumer` | `string` | Consumer Address |
1014
+ | `serviceIndex` | `number` | Service index in the metadata |
1015
+ | `providerFees` | [`ProviderFees`](../interfaces/ProviderFees.md) | provider fees |
1016
+ | `consumeMarketFee?` | [`ConsumeMarketFee`](../interfaces/ConsumeMarketFee.md) | - |
1017
+ | `estimateGas?` | `G` | if True, return gas estimate |
1018
+
1019
+ #### Returns
1020
+
1021
+ `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
1022
+
1023
+ string
1024
+
1025
+ #### Defined in
1026
+
1027
+ [contracts/Datatoken.ts:497](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L497)
1028
+
1029
+ ___
1030
+
1031
+ ### transfer
1032
+
1033
+ ▸ **transfer**<`G`\>(`dtAddress`, `toAddress`, `amount`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
1034
+
1035
+ Transfer tokens(as number) from address to toAddress
1036
+
1037
+ #### Type parameters
1038
+
1039
+ | Name | Type |
1040
+ | :------ | :------ |
1041
+ | `G` | extends `boolean` = ``false`` |
1042
+
1043
+ #### Parameters
1044
+
1045
+ | Name | Type | Description |
1046
+ | :------ | :------ | :------ |
1047
+ | `dtAddress` | `string` | Datatoken address |
1048
+ | `toAddress` | `string` | Receiver address |
1049
+ | `amount` | `string` | Number of datatokens, as number. Will be converted to wei. |
1050
+ | `estimateGas?` | `G` | if True, return gas estimate |
1051
+
1052
+ #### Returns
1053
+
1054
+ `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
1055
+
1056
+ transactionId
1057
+
1058
+ #### Defined in
1059
+
1060
+ [contracts/Datatoken.ts:443](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L443)
1061
+
1062
+ ___
1063
+
1064
+ ### transferWei
1065
+
1066
+ ▸ **transferWei**<`G`\>(`dtAddress`, `toAddress`, `amount`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
1067
+
1068
+ Transfer in wei from address to toAddress
1069
+
1070
+ #### Type parameters
1071
+
1072
+ | Name | Type |
1073
+ | :------ | :------ |
1074
+ | `G` | extends `boolean` = ``false`` |
1075
+
1076
+ #### Parameters
1077
+
1078
+ | Name | Type | Description |
1079
+ | :------ | :------ | :------ |
1080
+ | `dtAddress` | `string` | Datatoken address |
1081
+ | `toAddress` | `string` | Receiver address |
1082
+ | `amount` | `string` | Number of datatokens (number) expressed as wei |
1083
+ | `estimateGas?` | `G` | if True, return gas estimate |
1084
+
1085
+ #### Returns
1086
+
1087
+ `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
1088
+
1089
+ transactionId
1090
+
1091
+ #### Defined in
1092
+
1093
+ [contracts/Datatoken.ts:465](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L465)
1094
+
1095
+ ___
1096
+
1097
+ ### unitsToAmount
1098
+
1099
+ ▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\>
1100
+
1101
+ Converts an amount of units to tokens
1102
+
1103
+ #### Parameters
1104
+
1105
+ | Name | Type | Description |
1106
+ | :------ | :------ | :------ |
1107
+ | `token` | `string` | The token to convert |
1108
+ | `amount` | `string` | The amount of units to convert |
1109
+ | `tokenDecimals?` | `number` | The number of decimals in the token |
1110
+
1111
+ #### Returns
1112
+
1113
+ `Promise`<`string`\>
1114
+
1115
+ - The converted amount in tokens
1116
+
1117
+ #### Inherited from
1118
+
1119
+ [SmartContract](SmartContract.md).[unitsToAmount](SmartContract.md#unitstoamount)
1120
+
1121
+ #### Defined in
1122
+
1123
+ [contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58)