@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.
- package/CHANGELOG.md +20 -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,861 @@
|
|
|
1
|
+
[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / NftFactory
|
|
2
|
+
|
|
3
|
+
# Class: NftFactory
|
|
4
|
+
|
|
5
|
+
Provides an interface for NFT Factory contract
|
|
6
|
+
|
|
7
|
+
## Hierarchy
|
|
8
|
+
|
|
9
|
+
- [`SmartContractWithAddress`](SmartContractWithAddress.md)
|
|
10
|
+
|
|
11
|
+
↳ **`NftFactory`**
|
|
12
|
+
|
|
13
|
+
## Table of contents
|
|
14
|
+
|
|
15
|
+
### Constructors
|
|
16
|
+
|
|
17
|
+
- [constructor](NftFactory.md#constructor)
|
|
18
|
+
|
|
19
|
+
### Properties
|
|
20
|
+
|
|
21
|
+
- [abi](NftFactory.md#abi)
|
|
22
|
+
- [address](NftFactory.md#address)
|
|
23
|
+
- [config](NftFactory.md#config)
|
|
24
|
+
- [contract](NftFactory.md#contract)
|
|
25
|
+
- [signer](NftFactory.md#signer)
|
|
26
|
+
|
|
27
|
+
### Methods
|
|
28
|
+
|
|
29
|
+
- [addNFTTemplate](NftFactory.md#addnfttemplate)
|
|
30
|
+
- [addTokenTemplate](NftFactory.md#addtokentemplate)
|
|
31
|
+
- [amountToUnits](NftFactory.md#amounttounits)
|
|
32
|
+
- [checkDatatoken](NftFactory.md#checkdatatoken)
|
|
33
|
+
- [checkNFT](NftFactory.md#checknft)
|
|
34
|
+
- [createNFT](NftFactory.md#createnft)
|
|
35
|
+
- [createNftWithDatatoken](NftFactory.md#createnftwithdatatoken)
|
|
36
|
+
- [createNftWithDatatokenWithDispenser](NftFactory.md#createnftwithdatatokenwithdispenser)
|
|
37
|
+
- [createNftWithDatatokenWithFixedRate](NftFactory.md#createnftwithdatatokenwithfixedrate)
|
|
38
|
+
- [disableNFTTemplate](NftFactory.md#disablenfttemplate)
|
|
39
|
+
- [disableTokenTemplate](NftFactory.md#disabletokentemplate)
|
|
40
|
+
- [getContract](NftFactory.md#getcontract)
|
|
41
|
+
- [getCurrentNFTCount](NftFactory.md#getcurrentnftcount)
|
|
42
|
+
- [getCurrentNFTTemplateCount](NftFactory.md#getcurrentnfttemplatecount)
|
|
43
|
+
- [getCurrentTokenCount](NftFactory.md#getcurrenttokencount)
|
|
44
|
+
- [getCurrentTokenTemplateCount](NftFactory.md#getcurrenttokentemplatecount)
|
|
45
|
+
- [getDefaultAbi](NftFactory.md#getdefaultabi)
|
|
46
|
+
- [getErcCreationParams](NftFactory.md#geterccreationparams)
|
|
47
|
+
- [getFairGasPrice](NftFactory.md#getfairgasprice)
|
|
48
|
+
- [getFreCreationParams](NftFactory.md#getfrecreationparams)
|
|
49
|
+
- [getNFTTemplate](NftFactory.md#getnfttemplate)
|
|
50
|
+
- [getOwner](NftFactory.md#getowner)
|
|
51
|
+
- [getTokenTemplate](NftFactory.md#gettokentemplate)
|
|
52
|
+
- [reactivateNFTTemplate](NftFactory.md#reactivatenfttemplate)
|
|
53
|
+
- [reactivateTokenTemplate](NftFactory.md#reactivatetokentemplate)
|
|
54
|
+
- [startMultipleTokenOrder](NftFactory.md#startmultipletokenorder)
|
|
55
|
+
- [unitsToAmount](NftFactory.md#unitstoamount)
|
|
56
|
+
|
|
57
|
+
## Constructors
|
|
58
|
+
|
|
59
|
+
### constructor
|
|
60
|
+
|
|
61
|
+
• **new NftFactory**(`address`, `signer`, `network?`, `config?`, `abi?`)
|
|
62
|
+
|
|
63
|
+
Instantiate the smart contract.
|
|
64
|
+
|
|
65
|
+
#### Parameters
|
|
66
|
+
|
|
67
|
+
| Name | Type | Description |
|
|
68
|
+
| :------ | :------ | :------ |
|
|
69
|
+
| `address` | `string` | The address of the contract. |
|
|
70
|
+
| `signer` | `Signer` | The signer object. |
|
|
71
|
+
| `network?` | `string` \| `number` | Network id or name |
|
|
72
|
+
| `config?` | [`Config`](Config.md) | The configuration object. |
|
|
73
|
+
| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract |
|
|
74
|
+
|
|
75
|
+
#### Inherited from
|
|
76
|
+
|
|
77
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[constructor](SmartContractWithAddress.md#constructor)
|
|
78
|
+
|
|
79
|
+
#### Defined in
|
|
80
|
+
|
|
81
|
+
[contracts/SmartContractWithAddress.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L17)
|
|
82
|
+
|
|
83
|
+
## Properties
|
|
84
|
+
|
|
85
|
+
### abi
|
|
86
|
+
|
|
87
|
+
• **abi**: [`AbiItem`](../interfaces/AbiItem.md)[]
|
|
88
|
+
|
|
89
|
+
#### Inherited from
|
|
90
|
+
|
|
91
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[abi](SmartContractWithAddress.md#abi)
|
|
92
|
+
|
|
93
|
+
#### Defined in
|
|
94
|
+
|
|
95
|
+
[contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14)
|
|
96
|
+
|
|
97
|
+
___
|
|
98
|
+
|
|
99
|
+
### address
|
|
100
|
+
|
|
101
|
+
• **address**: `string`
|
|
102
|
+
|
|
103
|
+
#### Inherited from
|
|
104
|
+
|
|
105
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[address](SmartContractWithAddress.md#address)
|
|
106
|
+
|
|
107
|
+
#### Defined in
|
|
108
|
+
|
|
109
|
+
[contracts/SmartContractWithAddress.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L6)
|
|
110
|
+
|
|
111
|
+
___
|
|
112
|
+
|
|
113
|
+
### config
|
|
114
|
+
|
|
115
|
+
• **config**: [`Config`](Config.md)
|
|
116
|
+
|
|
117
|
+
#### Inherited from
|
|
118
|
+
|
|
119
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[config](SmartContractWithAddress.md#config)
|
|
120
|
+
|
|
121
|
+
#### Defined in
|
|
122
|
+
|
|
123
|
+
[contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13)
|
|
124
|
+
|
|
125
|
+
___
|
|
126
|
+
|
|
127
|
+
### contract
|
|
128
|
+
|
|
129
|
+
• **contract**: `Contract`
|
|
130
|
+
|
|
131
|
+
#### Inherited from
|
|
132
|
+
|
|
133
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[contract](SmartContractWithAddress.md#contract)
|
|
134
|
+
|
|
135
|
+
#### Defined in
|
|
136
|
+
|
|
137
|
+
[contracts/SmartContractWithAddress.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L7)
|
|
138
|
+
|
|
139
|
+
___
|
|
140
|
+
|
|
141
|
+
### signer
|
|
142
|
+
|
|
143
|
+
• **signer**: `Signer`
|
|
144
|
+
|
|
145
|
+
#### Inherited from
|
|
146
|
+
|
|
147
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[signer](SmartContractWithAddress.md#signer)
|
|
148
|
+
|
|
149
|
+
#### Defined in
|
|
150
|
+
|
|
151
|
+
[contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12)
|
|
152
|
+
|
|
153
|
+
## Methods
|
|
154
|
+
|
|
155
|
+
### addNFTTemplate
|
|
156
|
+
|
|
157
|
+
▸ **addNFTTemplate**<`G`\>(`address`, `templateAddress`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
158
|
+
|
|
159
|
+
Add a new NFT token template - only factory Owner
|
|
160
|
+
|
|
161
|
+
#### Type parameters
|
|
162
|
+
|
|
163
|
+
| Name | Type |
|
|
164
|
+
| :------ | :------ |
|
|
165
|
+
| `G` | extends `boolean` = ``false`` |
|
|
166
|
+
|
|
167
|
+
#### Parameters
|
|
168
|
+
|
|
169
|
+
| Name | Type | Description |
|
|
170
|
+
| :------ | :------ | :------ |
|
|
171
|
+
| `address` | `string` | caller address |
|
|
172
|
+
| `templateAddress` | `string` | template address to add |
|
|
173
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
174
|
+
|
|
175
|
+
#### Returns
|
|
176
|
+
|
|
177
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
178
|
+
|
|
179
|
+
#### Defined in
|
|
180
|
+
|
|
181
|
+
[contracts/NFTFactory.ts:181](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L181)
|
|
182
|
+
|
|
183
|
+
___
|
|
184
|
+
|
|
185
|
+
### addTokenTemplate
|
|
186
|
+
|
|
187
|
+
▸ **addTokenTemplate**<`G`\>(`address`, `templateAddress`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
188
|
+
|
|
189
|
+
Add a new NFT token template - only factory Owner
|
|
190
|
+
|
|
191
|
+
#### Type parameters
|
|
192
|
+
|
|
193
|
+
| Name | Type |
|
|
194
|
+
| :------ | :------ |
|
|
195
|
+
| `G` | extends `boolean` = ``false`` |
|
|
196
|
+
|
|
197
|
+
#### Parameters
|
|
198
|
+
|
|
199
|
+
| Name | Type | Description |
|
|
200
|
+
| :------ | :------ | :------ |
|
|
201
|
+
| `address` | `string` | caller address |
|
|
202
|
+
| `templateAddress` | `string` | template address to add |
|
|
203
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
204
|
+
|
|
205
|
+
#### Returns
|
|
206
|
+
|
|
207
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
208
|
+
|
|
209
|
+
#### Defined in
|
|
210
|
+
|
|
211
|
+
[contracts/NFTFactory.ts:288](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L288)
|
|
212
|
+
|
|
213
|
+
___
|
|
214
|
+
|
|
215
|
+
### amountToUnits
|
|
216
|
+
|
|
217
|
+
▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\>
|
|
218
|
+
|
|
219
|
+
Converts an amount of tokens to units
|
|
220
|
+
|
|
221
|
+
#### Parameters
|
|
222
|
+
|
|
223
|
+
| Name | Type | Description |
|
|
224
|
+
| :------ | :------ | :------ |
|
|
225
|
+
| `token` | `string` | The token to convert |
|
|
226
|
+
| `amount` | `string` | The amount of tokens to convert |
|
|
227
|
+
| `tokenDecimals?` | `number` | The number of decimals of the token |
|
|
228
|
+
|
|
229
|
+
#### Returns
|
|
230
|
+
|
|
231
|
+
`Promise`<`string`\>
|
|
232
|
+
|
|
233
|
+
- The converted amount in units
|
|
234
|
+
|
|
235
|
+
#### Inherited from
|
|
236
|
+
|
|
237
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[amountToUnits](SmartContractWithAddress.md#amounttounits)
|
|
238
|
+
|
|
239
|
+
#### Defined in
|
|
240
|
+
|
|
241
|
+
[contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43)
|
|
242
|
+
|
|
243
|
+
___
|
|
244
|
+
|
|
245
|
+
### checkDatatoken
|
|
246
|
+
|
|
247
|
+
▸ **checkDatatoken**(`datatoken`): `Promise`<`Boolean`\>
|
|
248
|
+
|
|
249
|
+
Check if Datatoken is deployed from the factory
|
|
250
|
+
|
|
251
|
+
#### Parameters
|
|
252
|
+
|
|
253
|
+
| Name | Type | Description |
|
|
254
|
+
| :------ | :------ | :------ |
|
|
255
|
+
| `datatoken` | `string` | Datatoken address to check |
|
|
256
|
+
|
|
257
|
+
#### Returns
|
|
258
|
+
|
|
259
|
+
`Promise`<`Boolean`\>
|
|
260
|
+
|
|
261
|
+
return true if deployed from this factory
|
|
262
|
+
|
|
263
|
+
#### Defined in
|
|
264
|
+
|
|
265
|
+
[contracts/NFTFactory.ts:159](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L159)
|
|
266
|
+
|
|
267
|
+
___
|
|
268
|
+
|
|
269
|
+
### checkNFT
|
|
270
|
+
|
|
271
|
+
▸ **checkNFT**(`nftAddress`): `Promise`<`String`\>
|
|
272
|
+
|
|
273
|
+
Check if NFT is deployed from the factory
|
|
274
|
+
|
|
275
|
+
#### Parameters
|
|
276
|
+
|
|
277
|
+
| Name | Type | Description |
|
|
278
|
+
| :------ | :------ | :------ |
|
|
279
|
+
| `nftAddress` | `string` | nftAddress address to check |
|
|
280
|
+
|
|
281
|
+
#### Returns
|
|
282
|
+
|
|
283
|
+
`Promise`<`String`\>
|
|
284
|
+
|
|
285
|
+
return address(0) if it's not, or the nftAddress if true
|
|
286
|
+
|
|
287
|
+
#### Defined in
|
|
288
|
+
|
|
289
|
+
[contracts/NFTFactory.ts:169](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L169)
|
|
290
|
+
|
|
291
|
+
___
|
|
292
|
+
|
|
293
|
+
### createNFT
|
|
294
|
+
|
|
295
|
+
▸ **createNFT**<`G`\>(`nftData`, `estimateGas?`): `Promise`<`G` extends ``false`` ? `string` : `BigNumber`\>
|
|
296
|
+
|
|
297
|
+
Create new data NFT
|
|
298
|
+
|
|
299
|
+
#### Type parameters
|
|
300
|
+
|
|
301
|
+
| Name | Type |
|
|
302
|
+
| :------ | :------ |
|
|
303
|
+
| `G` | extends `boolean` = ``false`` |
|
|
304
|
+
|
|
305
|
+
#### Parameters
|
|
306
|
+
|
|
307
|
+
| Name | Type | Description |
|
|
308
|
+
| :------ | :------ | :------ |
|
|
309
|
+
| `nftData` | [`NftCreateData`](../interfaces/NftCreateData.md) | The data needed to create an NFT. |
|
|
310
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
311
|
+
|
|
312
|
+
#### Returns
|
|
313
|
+
|
|
314
|
+
`Promise`<`G` extends ``false`` ? `string` : `BigNumber`\>
|
|
315
|
+
|
|
316
|
+
The transaction hash or the gas estimate.
|
|
317
|
+
|
|
318
|
+
#### Defined in
|
|
319
|
+
|
|
320
|
+
[contracts/NFTFactory.ts:30](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L30)
|
|
321
|
+
|
|
322
|
+
___
|
|
323
|
+
|
|
324
|
+
### createNftWithDatatoken
|
|
325
|
+
|
|
326
|
+
▸ **createNftWithDatatoken**<`G`\>(`nftCreateData`, `dtParams`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
327
|
+
|
|
328
|
+
Creates a new NFT, then a datatoken,all in one call
|
|
329
|
+
|
|
330
|
+
#### Type parameters
|
|
331
|
+
|
|
332
|
+
| Name | Type |
|
|
333
|
+
| :------ | :------ |
|
|
334
|
+
| `G` | extends `boolean` = ``false`` |
|
|
335
|
+
|
|
336
|
+
#### Parameters
|
|
337
|
+
|
|
338
|
+
| Name | Type | Description |
|
|
339
|
+
| :------ | :------ | :------ |
|
|
340
|
+
| `nftCreateData` | [`NftCreateData`](../interfaces/NftCreateData.md) | The data required to create an NFT. |
|
|
341
|
+
| `dtParams` | [`DatatokenCreateParams`](../interfaces/DatatokenCreateParams.md) | The parameters required to create a datatoken. |
|
|
342
|
+
| `estimateGas?` | `G` | Whether to return only estimate gas or not. |
|
|
343
|
+
|
|
344
|
+
#### Returns
|
|
345
|
+
|
|
346
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
347
|
+
|
|
348
|
+
transaction receipt
|
|
349
|
+
|
|
350
|
+
#### Defined in
|
|
351
|
+
|
|
352
|
+
[contracts/NFTFactory.ts:434](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L434)
|
|
353
|
+
|
|
354
|
+
___
|
|
355
|
+
|
|
356
|
+
### createNftWithDatatokenWithDispenser
|
|
357
|
+
|
|
358
|
+
▸ **createNftWithDatatokenWithDispenser**<`G`\>(`nftCreateData`, `dtParams`, `dispenserParams`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
359
|
+
|
|
360
|
+
Creates an NFT with a datatoken with a dispenser in one call.
|
|
361
|
+
Be aware if Fixed Rate creation fails, you are still going to pay a lot of gas
|
|
362
|
+
|
|
363
|
+
#### Type parameters
|
|
364
|
+
|
|
365
|
+
| Name | Type |
|
|
366
|
+
| :------ | :------ |
|
|
367
|
+
| `G` | extends `boolean` = ``false`` |
|
|
368
|
+
|
|
369
|
+
#### Parameters
|
|
370
|
+
|
|
371
|
+
| Name | Type | Description |
|
|
372
|
+
| :------ | :------ | :------ |
|
|
373
|
+
| `nftCreateData` | [`NftCreateData`](../interfaces/NftCreateData.md) | The data required to create an NFT. |
|
|
374
|
+
| `dtParams` | [`DatatokenCreateParams`](../interfaces/DatatokenCreateParams.md) | The parameters required to create a datatoken. |
|
|
375
|
+
| `dispenserParams` | [`DispenserCreationParams`](../interfaces/DispenserCreationParams.md) | The parameters required to create a dispenser contract. |
|
|
376
|
+
| `estimateGas?` | `G` | Whether to estimate gas or not. |
|
|
377
|
+
|
|
378
|
+
#### Returns
|
|
379
|
+
|
|
380
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
381
|
+
|
|
382
|
+
#### Defined in
|
|
383
|
+
|
|
384
|
+
[contracts/NFTFactory.ts:505](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L505)
|
|
385
|
+
|
|
386
|
+
___
|
|
387
|
+
|
|
388
|
+
### createNftWithDatatokenWithFixedRate
|
|
389
|
+
|
|
390
|
+
▸ **createNftWithDatatokenWithFixedRate**<`G`\>(`nftCreateData`, `dtParams`, `freParams`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
391
|
+
|
|
392
|
+
Creates an NFT with a datatoken with a fixed rate all in one call.
|
|
393
|
+
be aware if Fixed Rate creation fails, you are still going to pay a lot of gas
|
|
394
|
+
|
|
395
|
+
#### Type parameters
|
|
396
|
+
|
|
397
|
+
| Name | Type |
|
|
398
|
+
| :------ | :------ |
|
|
399
|
+
| `G` | extends `boolean` = ``false`` |
|
|
400
|
+
|
|
401
|
+
#### Parameters
|
|
402
|
+
|
|
403
|
+
| Name | Type | Description |
|
|
404
|
+
| :------ | :------ | :------ |
|
|
405
|
+
| `nftCreateData` | [`NftCreateData`](../interfaces/NftCreateData.md) | The data required to create an NFT. |
|
|
406
|
+
| `dtParams` | [`DatatokenCreateParams`](../interfaces/DatatokenCreateParams.md) | The parameters required to create a datatoken. |
|
|
407
|
+
| `freParams` | [`FreCreationParams`](../interfaces/FreCreationParams.md) | The parameters required to create a fixed-rate exchange contract. |
|
|
408
|
+
| `estimateGas?` | `G` | Whether to return only estimate gas or not. |
|
|
409
|
+
|
|
410
|
+
#### Returns
|
|
411
|
+
|
|
412
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
413
|
+
|
|
414
|
+
#### Defined in
|
|
415
|
+
|
|
416
|
+
[contracts/NFTFactory.ts:467](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L467)
|
|
417
|
+
|
|
418
|
+
___
|
|
419
|
+
|
|
420
|
+
### disableNFTTemplate
|
|
421
|
+
|
|
422
|
+
▸ **disableNFTTemplate**<`G`\>(`address`, `templateIndex`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
423
|
+
|
|
424
|
+
Disable token template - only factory Owner
|
|
425
|
+
|
|
426
|
+
#### Type parameters
|
|
427
|
+
|
|
428
|
+
| Name | Type |
|
|
429
|
+
| :------ | :------ |
|
|
430
|
+
| `G` | extends `boolean` = ``false`` |
|
|
431
|
+
|
|
432
|
+
#### Parameters
|
|
433
|
+
|
|
434
|
+
| Name | Type | Description |
|
|
435
|
+
| :------ | :------ | :------ |
|
|
436
|
+
| `address` | `string` | |
|
|
437
|
+
| `templateIndex` | `number` | index of the template we want to disable |
|
|
438
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
439
|
+
|
|
440
|
+
#### Returns
|
|
441
|
+
|
|
442
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
443
|
+
|
|
444
|
+
current token template count
|
|
445
|
+
|
|
446
|
+
#### Defined in
|
|
447
|
+
|
|
448
|
+
[contracts/NFTFactory.ts:213](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L213)
|
|
449
|
+
|
|
450
|
+
___
|
|
451
|
+
|
|
452
|
+
### disableTokenTemplate
|
|
453
|
+
|
|
454
|
+
▸ **disableTokenTemplate**<`G`\>(`address`, `templateIndex`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
455
|
+
|
|
456
|
+
Disable token template - only factory Owner
|
|
457
|
+
|
|
458
|
+
#### Type parameters
|
|
459
|
+
|
|
460
|
+
| Name | Type |
|
|
461
|
+
| :------ | :------ |
|
|
462
|
+
| `G` | extends `boolean` = ``false`` |
|
|
463
|
+
|
|
464
|
+
#### Parameters
|
|
465
|
+
|
|
466
|
+
| Name | Type | Description |
|
|
467
|
+
| :------ | :------ | :------ |
|
|
468
|
+
| `address` | `string` | caller address |
|
|
469
|
+
| `templateIndex` | `number` | index of the template we want to disable |
|
|
470
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
471
|
+
|
|
472
|
+
#### Returns
|
|
473
|
+
|
|
474
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
475
|
+
|
|
476
|
+
current token template count
|
|
477
|
+
|
|
478
|
+
#### Defined in
|
|
479
|
+
|
|
480
|
+
[contracts/NFTFactory.ts:321](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L321)
|
|
481
|
+
|
|
482
|
+
___
|
|
483
|
+
|
|
484
|
+
### getContract
|
|
485
|
+
|
|
486
|
+
▸ `Protected` **getContract**(`address`, `abi?`): `Contract`
|
|
487
|
+
|
|
488
|
+
Returns a contract instance for the given address
|
|
489
|
+
|
|
490
|
+
#### Parameters
|
|
491
|
+
|
|
492
|
+
| Name | Type | Description |
|
|
493
|
+
| :------ | :------ | :------ |
|
|
494
|
+
| `address` | `string` | The address of the contract |
|
|
495
|
+
| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract |
|
|
496
|
+
|
|
497
|
+
#### Returns
|
|
498
|
+
|
|
499
|
+
`Contract`
|
|
500
|
+
|
|
501
|
+
- The contract instance
|
|
502
|
+
|
|
503
|
+
#### Inherited from
|
|
504
|
+
|
|
505
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[getContract](SmartContractWithAddress.md#getcontract)
|
|
506
|
+
|
|
507
|
+
#### Defined in
|
|
508
|
+
|
|
509
|
+
[contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80)
|
|
510
|
+
|
|
511
|
+
___
|
|
512
|
+
|
|
513
|
+
### getCurrentNFTCount
|
|
514
|
+
|
|
515
|
+
▸ **getCurrentNFTCount**(): `Promise`<`number`\>
|
|
516
|
+
|
|
517
|
+
Get Current NFT Count (NFT created)
|
|
518
|
+
|
|
519
|
+
#### Returns
|
|
520
|
+
|
|
521
|
+
`Promise`<`number`\>
|
|
522
|
+
|
|
523
|
+
Number of NFT created from this factory
|
|
524
|
+
|
|
525
|
+
#### Defined in
|
|
526
|
+
|
|
527
|
+
[contracts/NFTFactory.ts:86](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L86)
|
|
528
|
+
|
|
529
|
+
___
|
|
530
|
+
|
|
531
|
+
### getCurrentNFTTemplateCount
|
|
532
|
+
|
|
533
|
+
▸ **getCurrentNFTTemplateCount**(): `Promise`<`number`\>
|
|
534
|
+
|
|
535
|
+
Get Current NFT Template Count
|
|
536
|
+
|
|
537
|
+
#### Returns
|
|
538
|
+
|
|
539
|
+
`Promise`<`number`\>
|
|
540
|
+
|
|
541
|
+
Number of NFT Template added to this factory
|
|
542
|
+
|
|
543
|
+
#### Defined in
|
|
544
|
+
|
|
545
|
+
[contracts/NFTFactory.ts:113](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L113)
|
|
546
|
+
|
|
547
|
+
___
|
|
548
|
+
|
|
549
|
+
### getCurrentTokenCount
|
|
550
|
+
|
|
551
|
+
▸ **getCurrentTokenCount**(): `Promise`<`number`\>
|
|
552
|
+
|
|
553
|
+
Get Current Datatoken Count
|
|
554
|
+
|
|
555
|
+
#### Returns
|
|
556
|
+
|
|
557
|
+
`Promise`<`number`\>
|
|
558
|
+
|
|
559
|
+
Number of DTs created from this factory
|
|
560
|
+
|
|
561
|
+
#### Defined in
|
|
562
|
+
|
|
563
|
+
[contracts/NFTFactory.ts:95](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L95)
|
|
564
|
+
|
|
565
|
+
___
|
|
566
|
+
|
|
567
|
+
### getCurrentTokenTemplateCount
|
|
568
|
+
|
|
569
|
+
▸ **getCurrentTokenTemplateCount**(): `Promise`<`number`\>
|
|
570
|
+
|
|
571
|
+
Get Current Template Datatoken (ERC20) Count
|
|
572
|
+
|
|
573
|
+
#### Returns
|
|
574
|
+
|
|
575
|
+
`Promise`<`number`\>
|
|
576
|
+
|
|
577
|
+
Number of Datatoken Template added to this factory
|
|
578
|
+
|
|
579
|
+
#### Defined in
|
|
580
|
+
|
|
581
|
+
[contracts/NFTFactory.ts:122](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L122)
|
|
582
|
+
|
|
583
|
+
___
|
|
584
|
+
|
|
585
|
+
### getDefaultAbi
|
|
586
|
+
|
|
587
|
+
▸ **getDefaultAbi**(): [`AbiItem`](../interfaces/AbiItem.md)[]
|
|
588
|
+
|
|
589
|
+
#### Returns
|
|
590
|
+
|
|
591
|
+
[`AbiItem`](../interfaces/AbiItem.md)[]
|
|
592
|
+
|
|
593
|
+
#### Overrides
|
|
594
|
+
|
|
595
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[getDefaultAbi](SmartContractWithAddress.md#getdefaultabi)
|
|
596
|
+
|
|
597
|
+
#### Defined in
|
|
598
|
+
|
|
599
|
+
[contracts/NFTFactory.ts:20](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L20)
|
|
600
|
+
|
|
601
|
+
___
|
|
602
|
+
|
|
603
|
+
### getErcCreationParams
|
|
604
|
+
|
|
605
|
+
▸ `Private` **getErcCreationParams**(`dtParams`): `Promise`<`any`\>
|
|
606
|
+
|
|
607
|
+
Gets the parameters required to create an ERC20 token.
|
|
608
|
+
|
|
609
|
+
#### Parameters
|
|
610
|
+
|
|
611
|
+
| Name | Type | Description |
|
|
612
|
+
| :------ | :------ | :------ |
|
|
613
|
+
| `dtParams` | [`DatatokenCreateParams`](../interfaces/DatatokenCreateParams.md) | The parameters required to create a datatoken. |
|
|
614
|
+
|
|
615
|
+
#### Returns
|
|
616
|
+
|
|
617
|
+
`Promise`<`any`\>
|
|
618
|
+
|
|
619
|
+
#### Defined in
|
|
620
|
+
|
|
621
|
+
[contracts/NFTFactory.ts:550](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L550)
|
|
622
|
+
|
|
623
|
+
___
|
|
624
|
+
|
|
625
|
+
### getFairGasPrice
|
|
626
|
+
|
|
627
|
+
▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\>
|
|
628
|
+
|
|
629
|
+
Retruns the gas price
|
|
630
|
+
|
|
631
|
+
#### Returns
|
|
632
|
+
|
|
633
|
+
`Promise`<`string`\>
|
|
634
|
+
|
|
635
|
+
- The fair gas price
|
|
636
|
+
|
|
637
|
+
#### Inherited from
|
|
638
|
+
|
|
639
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[getFairGasPrice](SmartContractWithAddress.md#getfairgasprice)
|
|
640
|
+
|
|
641
|
+
#### Defined in
|
|
642
|
+
|
|
643
|
+
[contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70)
|
|
644
|
+
|
|
645
|
+
___
|
|
646
|
+
|
|
647
|
+
### getFreCreationParams
|
|
648
|
+
|
|
649
|
+
▸ `Private` **getFreCreationParams**(`freParams`): `Promise`<`any`\>
|
|
650
|
+
|
|
651
|
+
Gets the parameters required to create a fixed-rate exchange contract.
|
|
652
|
+
|
|
653
|
+
#### Parameters
|
|
654
|
+
|
|
655
|
+
| Name | Type | Description |
|
|
656
|
+
| :------ | :------ | :------ |
|
|
657
|
+
| `freParams` | [`FreCreationParams`](../interfaces/FreCreationParams.md) | The parameters required to create a fixed-rate exchange contract. |
|
|
658
|
+
|
|
659
|
+
#### Returns
|
|
660
|
+
|
|
661
|
+
`Promise`<`any`\>
|
|
662
|
+
|
|
663
|
+
#### Defined in
|
|
664
|
+
|
|
665
|
+
[contracts/NFTFactory.ts:578](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L578)
|
|
666
|
+
|
|
667
|
+
___
|
|
668
|
+
|
|
669
|
+
### getNFTTemplate
|
|
670
|
+
|
|
671
|
+
▸ **getNFTTemplate**(`index`): `Promise`<[`Template`](../interfaces/Template.md)\>
|
|
672
|
+
|
|
673
|
+
Get NFT Template
|
|
674
|
+
|
|
675
|
+
#### Parameters
|
|
676
|
+
|
|
677
|
+
| Name | Type | Description |
|
|
678
|
+
| :------ | :------ | :------ |
|
|
679
|
+
| `index` | `number` | Template index |
|
|
680
|
+
|
|
681
|
+
#### Returns
|
|
682
|
+
|
|
683
|
+
`Promise`<[`Template`](../interfaces/Template.md)\>
|
|
684
|
+
|
|
685
|
+
Number of Template added to this factory
|
|
686
|
+
|
|
687
|
+
#### Defined in
|
|
688
|
+
|
|
689
|
+
[contracts/NFTFactory.ts:132](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L132)
|
|
690
|
+
|
|
691
|
+
___
|
|
692
|
+
|
|
693
|
+
### getOwner
|
|
694
|
+
|
|
695
|
+
▸ **getOwner**(): `Promise`<`string`\>
|
|
696
|
+
|
|
697
|
+
Get Factory Owner
|
|
698
|
+
|
|
699
|
+
#### Returns
|
|
700
|
+
|
|
701
|
+
`Promise`<`string`\>
|
|
702
|
+
|
|
703
|
+
Factory Owner address
|
|
704
|
+
|
|
705
|
+
#### Defined in
|
|
706
|
+
|
|
707
|
+
[contracts/NFTFactory.ts:104](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L104)
|
|
708
|
+
|
|
709
|
+
___
|
|
710
|
+
|
|
711
|
+
### getTokenTemplate
|
|
712
|
+
|
|
713
|
+
▸ **getTokenTemplate**(`index`): `Promise`<[`Template`](../interfaces/Template.md)\>
|
|
714
|
+
|
|
715
|
+
Get Datatoken (ERC20) Template
|
|
716
|
+
|
|
717
|
+
#### Parameters
|
|
718
|
+
|
|
719
|
+
| Name | Type | Description |
|
|
720
|
+
| :------ | :------ | :------ |
|
|
721
|
+
| `index` | `number` | Template index |
|
|
722
|
+
|
|
723
|
+
#### Returns
|
|
724
|
+
|
|
725
|
+
`Promise`<[`Template`](../interfaces/Template.md)\>
|
|
726
|
+
|
|
727
|
+
DT Template info
|
|
728
|
+
|
|
729
|
+
#### Defined in
|
|
730
|
+
|
|
731
|
+
[contracts/NFTFactory.ts:149](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L149)
|
|
732
|
+
|
|
733
|
+
___
|
|
734
|
+
|
|
735
|
+
### reactivateNFTTemplate
|
|
736
|
+
|
|
737
|
+
▸ **reactivateNFTTemplate**<`G`\>(`address`, `templateIndex`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
738
|
+
|
|
739
|
+
Reactivate a previously disabled token template - only factory Owner
|
|
740
|
+
|
|
741
|
+
#### Type parameters
|
|
742
|
+
|
|
743
|
+
| Name | Type |
|
|
744
|
+
| :------ | :------ |
|
|
745
|
+
| `G` | extends `boolean` = ``false`` |
|
|
746
|
+
|
|
747
|
+
#### Parameters
|
|
748
|
+
|
|
749
|
+
| Name | Type | Description |
|
|
750
|
+
| :------ | :------ | :------ |
|
|
751
|
+
| `address` | `string` | |
|
|
752
|
+
| `templateIndex` | `number` | index of the template we want to reactivate |
|
|
753
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
754
|
+
|
|
755
|
+
#### Returns
|
|
756
|
+
|
|
757
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
758
|
+
|
|
759
|
+
current token template count
|
|
760
|
+
|
|
761
|
+
#### Defined in
|
|
762
|
+
|
|
763
|
+
[contracts/NFTFactory.ts:249](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L249)
|
|
764
|
+
|
|
765
|
+
___
|
|
766
|
+
|
|
767
|
+
### reactivateTokenTemplate
|
|
768
|
+
|
|
769
|
+
▸ **reactivateTokenTemplate**<`G`\>(`address`, `templateIndex`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
770
|
+
|
|
771
|
+
Reactivate a previously disabled token template - only factory Owner
|
|
772
|
+
|
|
773
|
+
#### Type parameters
|
|
774
|
+
|
|
775
|
+
| Name | Type |
|
|
776
|
+
| :------ | :------ |
|
|
777
|
+
| `G` | extends `boolean` = ``false`` |
|
|
778
|
+
|
|
779
|
+
#### Parameters
|
|
780
|
+
|
|
781
|
+
| Name | Type | Description |
|
|
782
|
+
| :------ | :------ | :------ |
|
|
783
|
+
| `address` | `string` | caller address |
|
|
784
|
+
| `templateIndex` | `number` | index of the template we want to reactivate |
|
|
785
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
786
|
+
|
|
787
|
+
#### Returns
|
|
788
|
+
|
|
789
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
790
|
+
|
|
791
|
+
current token template count
|
|
792
|
+
|
|
793
|
+
#### Defined in
|
|
794
|
+
|
|
795
|
+
[contracts/NFTFactory.ts:360](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L360)
|
|
796
|
+
|
|
797
|
+
___
|
|
798
|
+
|
|
799
|
+
### startMultipleTokenOrder
|
|
800
|
+
|
|
801
|
+
▸ **startMultipleTokenOrder**<`G`\>(`orders`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
802
|
+
|
|
803
|
+
Used as a proxy to order multiple services
|
|
804
|
+
Users can have inifinite approvals for fees for factory instead of having one approval/ Datatoken contract
|
|
805
|
+
Requires previous approval of all :
|
|
806
|
+
- consumeFeeTokens
|
|
807
|
+
- publishMarketFeeTokens
|
|
808
|
+
- ERC20 Datatokens
|
|
809
|
+
|
|
810
|
+
#### Type parameters
|
|
811
|
+
|
|
812
|
+
| Name | Type |
|
|
813
|
+
| :------ | :------ |
|
|
814
|
+
| `G` | extends `boolean` = ``false`` |
|
|
815
|
+
|
|
816
|
+
#### Parameters
|
|
817
|
+
|
|
818
|
+
| Name | Type | Description |
|
|
819
|
+
| :------ | :------ | :------ |
|
|
820
|
+
| `orders` | [`TokenOrder`](../interfaces/TokenOrder.md)[] | array of of orders |
|
|
821
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
822
|
+
|
|
823
|
+
#### Returns
|
|
824
|
+
|
|
825
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
826
|
+
|
|
827
|
+
transaction receipt
|
|
828
|
+
|
|
829
|
+
#### Defined in
|
|
830
|
+
|
|
831
|
+
[contracts/NFTFactory.ts:404](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L404)
|
|
832
|
+
|
|
833
|
+
___
|
|
834
|
+
|
|
835
|
+
### unitsToAmount
|
|
836
|
+
|
|
837
|
+
▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\>
|
|
838
|
+
|
|
839
|
+
Converts an amount of units to tokens
|
|
840
|
+
|
|
841
|
+
#### Parameters
|
|
842
|
+
|
|
843
|
+
| Name | Type | Description |
|
|
844
|
+
| :------ | :------ | :------ |
|
|
845
|
+
| `token` | `string` | The token to convert |
|
|
846
|
+
| `amount` | `string` | The amount of units to convert |
|
|
847
|
+
| `tokenDecimals?` | `number` | The number of decimals in the token |
|
|
848
|
+
|
|
849
|
+
#### Returns
|
|
850
|
+
|
|
851
|
+
`Promise`<`string`\>
|
|
852
|
+
|
|
853
|
+
- The converted amount in tokens
|
|
854
|
+
|
|
855
|
+
#### Inherited from
|
|
856
|
+
|
|
857
|
+
[SmartContractWithAddress](SmartContractWithAddress.md).[unitsToAmount](SmartContractWithAddress.md#unitstoamount)
|
|
858
|
+
|
|
859
|
+
#### Defined in
|
|
860
|
+
|
|
861
|
+
[contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58)
|