@oceanprotocol/lib 3.0.0-next.1 → 3.0.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/CodeExamples.md +1 -1
- package/dist/lib.js +1 -1
- package/dist/lib.js.map +1 -1
- package/dist/lib.modern.js +1 -1
- package/dist/lib.modern.js.map +1 -1
- package/dist/lib.module.js +1 -1
- package/dist/lib.module.js.map +1 -1
- package/dist/lib.umd.js +1 -1
- package/dist/lib.umd.js.map +1 -1
- package/docs/.nojekyll +1 -0
- package/docs/README.md +192 -0
- package/docs/classes/Aquarius.md +171 -0
- package/docs/classes/Config.md +481 -0
- package/docs/classes/ConfigHelper.md +66 -0
- package/docs/classes/Datatoken.md +1123 -0
- package/docs/classes/DfRewards.md +345 -0
- package/docs/classes/DfStrategyV1.md +313 -0
- package/docs/classes/Dispenser.md +502 -0
- package/docs/classes/FixedRateExchange.md +1068 -0
- package/docs/classes/Logger.md +191 -0
- package/docs/classes/Nft.md +970 -0
- package/docs/classes/NftFactory.md +861 -0
- package/docs/classes/Provider.md +628 -0
- package/docs/classes/Router.md +645 -0
- package/docs/classes/SmartContract.md +193 -0
- package/docs/classes/SmartContractWithAddress.md +268 -0
- package/docs/classes/VeAllocate.md +372 -0
- package/docs/classes/VeFeeDistributor.md +325 -0
- package/docs/classes/VeFeeEstimate.md +281 -0
- package/docs/classes/VeOcean.md +513 -0
- package/docs/enums/LogLevel.md +63 -0
- package/docs/interfaces/AbiInput.md +63 -0
- package/docs/interfaces/AbiItem.md +107 -0
- package/docs/interfaces/AbiOutput.md +52 -0
- package/docs/interfaces/Arweave.md +32 -0
- package/docs/interfaces/Asset.md +227 -0
- package/docs/interfaces/AssetDatatoken.md +60 -0
- package/docs/interfaces/AssetLastEvent.md +63 -0
- package/docs/interfaces/AssetNft.md +105 -0
- package/docs/interfaces/AssetPrice.md +47 -0
- package/docs/interfaces/ComputeAlgorithm.md +82 -0
- package/docs/interfaces/ComputeAsset.md +56 -0
- package/docs/interfaces/ComputeEnvironment.md +173 -0
- package/docs/interfaces/ComputeJob.md +140 -0
- package/docs/interfaces/ComputeOutput.md +118 -0
- package/docs/interfaces/ComputeResult.md +52 -0
- package/docs/interfaces/ConsumeMarketFee.md +41 -0
- package/docs/interfaces/Credential.md +30 -0
- package/docs/interfaces/Credentials.md +30 -0
- package/docs/interfaces/DDO.md +137 -0
- package/docs/interfaces/DatatokenCreateParams.md +107 -0
- package/docs/interfaces/DatatokenRoles.md +30 -0
- package/docs/interfaces/DispenserCreationParams.md +63 -0
- package/docs/interfaces/DispenserParams.md +52 -0
- package/docs/interfaces/DispenserToken.md +85 -0
- package/docs/interfaces/DownloadResponse.md +30 -0
- package/docs/interfaces/Event.md +73 -0
- package/docs/interfaces/FeesInfo.md +74 -0
- package/docs/interfaces/FileInfo.md +118 -0
- package/docs/interfaces/Files.md +41 -0
- package/docs/interfaces/FixedPriceExchange.md +162 -0
- package/docs/interfaces/FreCreationParams.md +118 -0
- package/docs/interfaces/FreOrderParams.md +85 -0
- package/docs/interfaces/GraphqlQuery.md +69 -0
- package/docs/interfaces/Ipfs.md +32 -0
- package/docs/interfaces/Metadata.md +193 -0
- package/docs/interfaces/MetadataAlgorithm.md +69 -0
- package/docs/interfaces/MetadataAndTokenURI.md +107 -0
- package/docs/interfaces/MetadataProof.md +52 -0
- package/docs/interfaces/NftCreateData.md +74 -0
- package/docs/interfaces/NftRoles.md +52 -0
- package/docs/interfaces/Operation.md +145 -0
- package/docs/interfaces/OrderParams.md +52 -0
- package/docs/interfaces/PriceAndFees.md +52 -0
- package/docs/interfaces/ProviderComputeInitialize.md +41 -0
- package/docs/interfaces/ProviderComputeInitializeResults.md +30 -0
- package/docs/interfaces/ProviderFees.md +96 -0
- package/docs/interfaces/ProviderInitialize.md +52 -0
- package/docs/interfaces/PublisherTrustedAlgorithm.md +47 -0
- package/docs/interfaces/PublishingMarketFee.md +41 -0
- package/docs/interfaces/Purgatory.md +34 -0
- package/docs/interfaces/SearchQuery.md +67 -0
- package/docs/interfaces/Service.md +138 -0
- package/docs/interfaces/ServiceComputeOptions.md +63 -0
- package/docs/interfaces/ServiceEndpoint.md +41 -0
- package/docs/interfaces/Smartcontract-1.md +58 -0
- package/docs/interfaces/Stats.md +47 -0
- package/docs/interfaces/Template.md +30 -0
- package/docs/interfaces/TokenOrder.md +63 -0
- package/docs/interfaces/UrlFile.md +71 -0
- package/docs/interfaces/UserCustomParameters.md +7 -0
- package/docs/interfaces/ValidateMetadata.md +52 -0
- package/docs/modules.md +856 -0
- package/package.json +7 -8
- package/typedoc.json +4 -0
|
@@ -0,0 +1,970 @@
|
|
|
1
|
+
[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Nft
|
|
2
|
+
|
|
3
|
+
# Class: Nft
|
|
4
|
+
|
|
5
|
+
## Hierarchy
|
|
6
|
+
|
|
7
|
+
- [`SmartContract`](SmartContract.md)
|
|
8
|
+
|
|
9
|
+
↳ **`Nft`**
|
|
10
|
+
|
|
11
|
+
## Table of contents
|
|
12
|
+
|
|
13
|
+
### Constructors
|
|
14
|
+
|
|
15
|
+
- [constructor](Nft.md#constructor)
|
|
16
|
+
|
|
17
|
+
### Properties
|
|
18
|
+
|
|
19
|
+
- [abi](Nft.md#abi)
|
|
20
|
+
- [config](Nft.md#config)
|
|
21
|
+
- [signer](Nft.md#signer)
|
|
22
|
+
|
|
23
|
+
### Methods
|
|
24
|
+
|
|
25
|
+
- [addDatatokenDeployer](Nft.md#adddatatokendeployer)
|
|
26
|
+
- [addManager](Nft.md#addmanager)
|
|
27
|
+
- [addMetadataUpdater](Nft.md#addmetadataupdater)
|
|
28
|
+
- [addStoreUpdater](Nft.md#addstoreupdater)
|
|
29
|
+
- [amountToUnits](Nft.md#amounttounits)
|
|
30
|
+
- [cleanPermissions](Nft.md#cleanpermissions)
|
|
31
|
+
- [createDatatoken](Nft.md#createdatatoken)
|
|
32
|
+
- [getContract](Nft.md#getcontract)
|
|
33
|
+
- [getData](Nft.md#getdata)
|
|
34
|
+
- [getDefaultAbi](Nft.md#getdefaultabi)
|
|
35
|
+
- [getFairGasPrice](Nft.md#getfairgasprice)
|
|
36
|
+
- [getMetadata](Nft.md#getmetadata)
|
|
37
|
+
- [getNftOwner](Nft.md#getnftowner)
|
|
38
|
+
- [getNftPermissions](Nft.md#getnftpermissions)
|
|
39
|
+
- [getTokenURI](Nft.md#gettokenuri)
|
|
40
|
+
- [isDatatokenDeployer](Nft.md#isdatatokendeployer)
|
|
41
|
+
- [removeDatatokenDeployer](Nft.md#removedatatokendeployer)
|
|
42
|
+
- [removeManager](Nft.md#removemanager)
|
|
43
|
+
- [removeMetadataUpdater](Nft.md#removemetadataupdater)
|
|
44
|
+
- [removeStoreUpdater](Nft.md#removestoreupdater)
|
|
45
|
+
- [safeTransferNft](Nft.md#safetransfernft)
|
|
46
|
+
- [setData](Nft.md#setdata)
|
|
47
|
+
- [setMetadata](Nft.md#setmetadata)
|
|
48
|
+
- [setMetadataAndTokenURI](Nft.md#setmetadataandtokenuri)
|
|
49
|
+
- [setMetadataState](Nft.md#setmetadatastate)
|
|
50
|
+
- [setTokenURI](Nft.md#settokenuri)
|
|
51
|
+
- [transferNft](Nft.md#transfernft)
|
|
52
|
+
- [unitsToAmount](Nft.md#unitstoamount)
|
|
53
|
+
|
|
54
|
+
## Constructors
|
|
55
|
+
|
|
56
|
+
### constructor
|
|
57
|
+
|
|
58
|
+
• **new Nft**(`signer`, `network?`, `config?`, `abi?`)
|
|
59
|
+
|
|
60
|
+
Instantiate the smart contract.
|
|
61
|
+
|
|
62
|
+
#### Parameters
|
|
63
|
+
|
|
64
|
+
| Name | Type | Description |
|
|
65
|
+
| :------ | :------ | :------ |
|
|
66
|
+
| `signer` | `Signer` | The signer object. |
|
|
67
|
+
| `network?` | `string` \| `number` | Network id or name |
|
|
68
|
+
| `config?` | [`Config`](Config.md) | The configuration object. |
|
|
69
|
+
| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract |
|
|
70
|
+
|
|
71
|
+
#### Inherited from
|
|
72
|
+
|
|
73
|
+
[SmartContract](SmartContract.md).[constructor](SmartContract.md#constructor)
|
|
74
|
+
|
|
75
|
+
#### Defined in
|
|
76
|
+
|
|
77
|
+
[contracts/SmartContract.ts:25](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L25)
|
|
78
|
+
|
|
79
|
+
## Properties
|
|
80
|
+
|
|
81
|
+
### abi
|
|
82
|
+
|
|
83
|
+
• **abi**: [`AbiItem`](../interfaces/AbiItem.md)[]
|
|
84
|
+
|
|
85
|
+
#### Inherited from
|
|
86
|
+
|
|
87
|
+
[SmartContract](SmartContract.md).[abi](SmartContract.md#abi)
|
|
88
|
+
|
|
89
|
+
#### Defined in
|
|
90
|
+
|
|
91
|
+
[contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14)
|
|
92
|
+
|
|
93
|
+
___
|
|
94
|
+
|
|
95
|
+
### config
|
|
96
|
+
|
|
97
|
+
• **config**: [`Config`](Config.md)
|
|
98
|
+
|
|
99
|
+
#### Inherited from
|
|
100
|
+
|
|
101
|
+
[SmartContract](SmartContract.md).[config](SmartContract.md#config)
|
|
102
|
+
|
|
103
|
+
#### Defined in
|
|
104
|
+
|
|
105
|
+
[contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13)
|
|
106
|
+
|
|
107
|
+
___
|
|
108
|
+
|
|
109
|
+
### signer
|
|
110
|
+
|
|
111
|
+
• **signer**: `Signer`
|
|
112
|
+
|
|
113
|
+
#### Inherited from
|
|
114
|
+
|
|
115
|
+
[SmartContract](SmartContract.md).[signer](SmartContract.md#signer)
|
|
116
|
+
|
|
117
|
+
#### Defined in
|
|
118
|
+
|
|
119
|
+
[contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12)
|
|
120
|
+
|
|
121
|
+
## Methods
|
|
122
|
+
|
|
123
|
+
### addDatatokenDeployer
|
|
124
|
+
|
|
125
|
+
▸ **addDatatokenDeployer**<`G`\>(`nftAddress`, `address`, `datatokenDeployer`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
126
|
+
|
|
127
|
+
Add DatatokenDeployer permission - only Manager can succeed
|
|
128
|
+
|
|
129
|
+
#### Type parameters
|
|
130
|
+
|
|
131
|
+
| Name | Type |
|
|
132
|
+
| :------ | :------ |
|
|
133
|
+
| `G` | extends `boolean` = ``false`` |
|
|
134
|
+
|
|
135
|
+
#### Parameters
|
|
136
|
+
|
|
137
|
+
| Name | Type | Description |
|
|
138
|
+
| :------ | :------ | :------ |
|
|
139
|
+
| `nftAddress` | `string` | NFT contract address |
|
|
140
|
+
| `address` | `string` | NFT Manager adress |
|
|
141
|
+
| `datatokenDeployer` | `string` | User adress which is going to have DatatokenDeployer permission |
|
|
142
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
143
|
+
|
|
144
|
+
#### Returns
|
|
145
|
+
|
|
146
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
147
|
+
|
|
148
|
+
trxReceipt
|
|
149
|
+
|
|
150
|
+
#### Defined in
|
|
151
|
+
|
|
152
|
+
[contracts/NFT.ts:169](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L169)
|
|
153
|
+
|
|
154
|
+
___
|
|
155
|
+
|
|
156
|
+
### addManager
|
|
157
|
+
|
|
158
|
+
▸ **addManager**<`G`\>(`nftAddress`, `address`, `manager`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
159
|
+
|
|
160
|
+
Add Manager for NFT Contract (only NFT Owner can succeed)
|
|
161
|
+
|
|
162
|
+
#### Type parameters
|
|
163
|
+
|
|
164
|
+
| Name | Type |
|
|
165
|
+
| :------ | :------ |
|
|
166
|
+
| `G` | extends `boolean` = ``false`` |
|
|
167
|
+
|
|
168
|
+
#### Parameters
|
|
169
|
+
|
|
170
|
+
| Name | Type | Description |
|
|
171
|
+
| :------ | :------ | :------ |
|
|
172
|
+
| `nftAddress` | `string` | NFT contract address |
|
|
173
|
+
| `address` | `string` | NFT Owner adress |
|
|
174
|
+
| `manager` | `string` | User adress which is going to be assing manager |
|
|
175
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
176
|
+
|
|
177
|
+
#### Returns
|
|
178
|
+
|
|
179
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
180
|
+
|
|
181
|
+
trxReceipt
|
|
182
|
+
|
|
183
|
+
#### Defined in
|
|
184
|
+
|
|
185
|
+
[contracts/NFT.ts:101](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L101)
|
|
186
|
+
|
|
187
|
+
___
|
|
188
|
+
|
|
189
|
+
### addMetadataUpdater
|
|
190
|
+
|
|
191
|
+
▸ **addMetadataUpdater**<`G`\>(`nftAddress`, `address`, `metadataUpdater`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
192
|
+
|
|
193
|
+
Add Metadata Updater permission - only Manager can succeed
|
|
194
|
+
|
|
195
|
+
#### Type parameters
|
|
196
|
+
|
|
197
|
+
| Name | Type |
|
|
198
|
+
| :------ | :------ |
|
|
199
|
+
| `G` | extends `boolean` = ``false`` |
|
|
200
|
+
|
|
201
|
+
#### Parameters
|
|
202
|
+
|
|
203
|
+
| Name | Type | Description |
|
|
204
|
+
| :------ | :------ | :------ |
|
|
205
|
+
| `nftAddress` | `string` | NFT contract address |
|
|
206
|
+
| `address` | `string` | NFT Manager adress |
|
|
207
|
+
| `metadataUpdater` | `string` | User adress which is going to have Metadata Updater permission |
|
|
208
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
209
|
+
|
|
210
|
+
#### Returns
|
|
211
|
+
|
|
212
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
213
|
+
|
|
214
|
+
trxReceipt
|
|
215
|
+
|
|
216
|
+
#### Defined in
|
|
217
|
+
|
|
218
|
+
[contracts/NFT.ts:243](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L243)
|
|
219
|
+
|
|
220
|
+
___
|
|
221
|
+
|
|
222
|
+
### addStoreUpdater
|
|
223
|
+
|
|
224
|
+
▸ **addStoreUpdater**<`G`\>(`nftAddress`, `address`, `storeUpdater`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
225
|
+
|
|
226
|
+
Add Store Updater permission - only Manager can succeed
|
|
227
|
+
|
|
228
|
+
#### Type parameters
|
|
229
|
+
|
|
230
|
+
| Name | Type |
|
|
231
|
+
| :------ | :------ |
|
|
232
|
+
| `G` | extends `boolean` = ``false`` |
|
|
233
|
+
|
|
234
|
+
#### Parameters
|
|
235
|
+
|
|
236
|
+
| Name | Type | Description |
|
|
237
|
+
| :------ | :------ | :------ |
|
|
238
|
+
| `nftAddress` | `string` | NFT contract address |
|
|
239
|
+
| `address` | `string` | NFT Manager adress |
|
|
240
|
+
| `storeUpdater` | `string` | User adress which is going to have Store Updater permission |
|
|
241
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
242
|
+
|
|
243
|
+
#### Returns
|
|
244
|
+
|
|
245
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
246
|
+
|
|
247
|
+
trxReceipt
|
|
248
|
+
|
|
249
|
+
#### Defined in
|
|
250
|
+
|
|
251
|
+
[contracts/NFT.ts:313](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L313)
|
|
252
|
+
|
|
253
|
+
___
|
|
254
|
+
|
|
255
|
+
### amountToUnits
|
|
256
|
+
|
|
257
|
+
▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\>
|
|
258
|
+
|
|
259
|
+
Converts an amount of tokens to units
|
|
260
|
+
|
|
261
|
+
#### Parameters
|
|
262
|
+
|
|
263
|
+
| Name | Type | Description |
|
|
264
|
+
| :------ | :------ | :------ |
|
|
265
|
+
| `token` | `string` | The token to convert |
|
|
266
|
+
| `amount` | `string` | The amount of tokens to convert |
|
|
267
|
+
| `tokenDecimals?` | `number` | The number of decimals of the token |
|
|
268
|
+
|
|
269
|
+
#### Returns
|
|
270
|
+
|
|
271
|
+
`Promise`<`string`\>
|
|
272
|
+
|
|
273
|
+
- The converted amount in units
|
|
274
|
+
|
|
275
|
+
#### Inherited from
|
|
276
|
+
|
|
277
|
+
[SmartContract](SmartContract.md).[amountToUnits](SmartContract.md#amounttounits)
|
|
278
|
+
|
|
279
|
+
#### Defined in
|
|
280
|
+
|
|
281
|
+
[contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43)
|
|
282
|
+
|
|
283
|
+
___
|
|
284
|
+
|
|
285
|
+
### cleanPermissions
|
|
286
|
+
|
|
287
|
+
▸ **cleanPermissions**<`G`\>(`nftAddress`, `address`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
288
|
+
|
|
289
|
+
This function allows to remove all ROLES at NFT level: Managers, DatatokenDeployer, MetadataUpdater, StoreUpdater
|
|
290
|
+
Even NFT Owner has to readd himself as Manager
|
|
291
|
+
Permissions at Datatoken level stay.
|
|
292
|
+
Only NFT Owner can call it.
|
|
293
|
+
|
|
294
|
+
#### Type parameters
|
|
295
|
+
|
|
296
|
+
| Name | Type |
|
|
297
|
+
| :------ | :------ |
|
|
298
|
+
| `G` | extends `boolean` = ``false`` |
|
|
299
|
+
|
|
300
|
+
#### Parameters
|
|
301
|
+
|
|
302
|
+
| Name | Type | Description |
|
|
303
|
+
| :------ | :------ | :------ |
|
|
304
|
+
| `nftAddress` | `string` | NFT contract address |
|
|
305
|
+
| `address` | `string` | NFT Owner adress |
|
|
306
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
307
|
+
|
|
308
|
+
#### Returns
|
|
309
|
+
|
|
310
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
311
|
+
|
|
312
|
+
trxReceipt
|
|
313
|
+
|
|
314
|
+
#### Defined in
|
|
315
|
+
|
|
316
|
+
[contracts/NFT.ts:387](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L387)
|
|
317
|
+
|
|
318
|
+
___
|
|
319
|
+
|
|
320
|
+
### createDatatoken
|
|
321
|
+
|
|
322
|
+
▸ **createDatatoken**<`G`\>(`nftAddress`, `address`, `minter`, `paymentCollector`, `mpFeeAddress`, `feeToken`, `feeAmount`, `cap`, `name?`, `symbol?`, `templateIndex?`, `estimateGas?`): `Promise`<`G` extends ``false`` ? `string` : `BigNumber`\>
|
|
323
|
+
|
|
324
|
+
Create new ERC20 Datatoken - only user with DatatokenDeployer permission can succeed
|
|
325
|
+
|
|
326
|
+
#### Type parameters
|
|
327
|
+
|
|
328
|
+
| Name | Type |
|
|
329
|
+
| :------ | :------ |
|
|
330
|
+
| `G` | extends `boolean` = ``false`` |
|
|
331
|
+
|
|
332
|
+
#### Parameters
|
|
333
|
+
|
|
334
|
+
| Name | Type | Description |
|
|
335
|
+
| :------ | :------ | :------ |
|
|
336
|
+
| `nftAddress` | `string` | NFT address |
|
|
337
|
+
| `address` | `string` | User address |
|
|
338
|
+
| `minter` | `string` | User set as initial minter for the Datatoken |
|
|
339
|
+
| `paymentCollector` | `string` | initial paymentCollector for this DT |
|
|
340
|
+
| `mpFeeAddress` | `string` | Consume marketplace fee address |
|
|
341
|
+
| `feeToken` | `string` | address of the token marketplace wants to add fee on top |
|
|
342
|
+
| `feeAmount` | `string` | amount of feeToken to be transferred to mpFeeAddress on top, will be converted to WEI |
|
|
343
|
+
| `cap` | `string` | Maximum cap (Number) - will be converted to wei |
|
|
344
|
+
| `name?` | `string` | Token name |
|
|
345
|
+
| `symbol?` | `string` | Token symbol |
|
|
346
|
+
| `templateIndex?` | `number` | NFT template index |
|
|
347
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
348
|
+
|
|
349
|
+
#### Returns
|
|
350
|
+
|
|
351
|
+
`Promise`<`G` extends ``false`` ? `string` : `BigNumber`\>
|
|
352
|
+
|
|
353
|
+
ERC20 Datatoken address
|
|
354
|
+
|
|
355
|
+
#### Defined in
|
|
356
|
+
|
|
357
|
+
[contracts/NFT.ts:34](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L34)
|
|
358
|
+
|
|
359
|
+
___
|
|
360
|
+
|
|
361
|
+
### getContract
|
|
362
|
+
|
|
363
|
+
▸ `Protected` **getContract**(`address`, `abi?`): `Contract`
|
|
364
|
+
|
|
365
|
+
Returns a contract instance for the given address
|
|
366
|
+
|
|
367
|
+
#### Parameters
|
|
368
|
+
|
|
369
|
+
| Name | Type | Description |
|
|
370
|
+
| :------ | :------ | :------ |
|
|
371
|
+
| `address` | `string` | The address of the contract |
|
|
372
|
+
| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract |
|
|
373
|
+
|
|
374
|
+
#### Returns
|
|
375
|
+
|
|
376
|
+
`Contract`
|
|
377
|
+
|
|
378
|
+
- The contract instance
|
|
379
|
+
|
|
380
|
+
#### Inherited from
|
|
381
|
+
|
|
382
|
+
[SmartContract](SmartContract.md).[getContract](SmartContract.md#getcontract)
|
|
383
|
+
|
|
384
|
+
#### Defined in
|
|
385
|
+
|
|
386
|
+
[contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80)
|
|
387
|
+
|
|
388
|
+
___
|
|
389
|
+
|
|
390
|
+
### getData
|
|
391
|
+
|
|
392
|
+
▸ **getData**(`nftAddress`, `key`): `Promise`<`string`\>
|
|
393
|
+
|
|
394
|
+
Gets stored data at a given `key` in an NFT
|
|
395
|
+
|
|
396
|
+
#### Parameters
|
|
397
|
+
|
|
398
|
+
| Name | Type | Description |
|
|
399
|
+
| :------ | :------ | :------ |
|
|
400
|
+
| `nftAddress` | `string` | The address of the NFT. |
|
|
401
|
+
| `key` | `string` | The key of the data to get. |
|
|
402
|
+
|
|
403
|
+
#### Returns
|
|
404
|
+
|
|
405
|
+
`Promise`<`string`\>
|
|
406
|
+
|
|
407
|
+
The data stored at the key
|
|
408
|
+
|
|
409
|
+
#### Defined in
|
|
410
|
+
|
|
411
|
+
[contracts/NFT.ts:753](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L753)
|
|
412
|
+
|
|
413
|
+
___
|
|
414
|
+
|
|
415
|
+
### getDefaultAbi
|
|
416
|
+
|
|
417
|
+
▸ **getDefaultAbi**(): [`AbiItem`](../interfaces/AbiItem.md)[]
|
|
418
|
+
|
|
419
|
+
#### Returns
|
|
420
|
+
|
|
421
|
+
[`AbiItem`](../interfaces/AbiItem.md)[]
|
|
422
|
+
|
|
423
|
+
#### Overrides
|
|
424
|
+
|
|
425
|
+
[SmartContract](SmartContract.md).[getDefaultAbi](SmartContract.md#getdefaultabi)
|
|
426
|
+
|
|
427
|
+
#### Defined in
|
|
428
|
+
|
|
429
|
+
[contracts/NFT.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L14)
|
|
430
|
+
|
|
431
|
+
___
|
|
432
|
+
|
|
433
|
+
### getFairGasPrice
|
|
434
|
+
|
|
435
|
+
▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\>
|
|
436
|
+
|
|
437
|
+
Retruns the gas price
|
|
438
|
+
|
|
439
|
+
#### Returns
|
|
440
|
+
|
|
441
|
+
`Promise`<`string`\>
|
|
442
|
+
|
|
443
|
+
- The fair gas price
|
|
444
|
+
|
|
445
|
+
#### Inherited from
|
|
446
|
+
|
|
447
|
+
[SmartContract](SmartContract.md).[getFairGasPrice](SmartContract.md#getfairgasprice)
|
|
448
|
+
|
|
449
|
+
#### Defined in
|
|
450
|
+
|
|
451
|
+
[contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70)
|
|
452
|
+
|
|
453
|
+
___
|
|
454
|
+
|
|
455
|
+
### getMetadata
|
|
456
|
+
|
|
457
|
+
▸ **getMetadata**(`nftAddress`): `Promise`<`Object`\>
|
|
458
|
+
|
|
459
|
+
Returns Metadata details for an NFT
|
|
460
|
+
|
|
461
|
+
#### Parameters
|
|
462
|
+
|
|
463
|
+
| Name | Type | Description |
|
|
464
|
+
| :------ | :------ | :------ |
|
|
465
|
+
| `nftAddress` | `string` | NFT contract address |
|
|
466
|
+
|
|
467
|
+
#### Returns
|
|
468
|
+
|
|
469
|
+
`Promise`<`Object`\>
|
|
470
|
+
|
|
471
|
+
#### Defined in
|
|
472
|
+
|
|
473
|
+
[contracts/NFT.ts:687](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L687)
|
|
474
|
+
|
|
475
|
+
___
|
|
476
|
+
|
|
477
|
+
### getNftOwner
|
|
478
|
+
|
|
479
|
+
▸ **getNftOwner**(`nftAddress`): `Promise`<`string`\>
|
|
480
|
+
|
|
481
|
+
Get NFT Owner
|
|
482
|
+
|
|
483
|
+
#### Parameters
|
|
484
|
+
|
|
485
|
+
| Name | Type | Description |
|
|
486
|
+
| :------ | :------ | :------ |
|
|
487
|
+
| `nftAddress` | `string` | NFT contract address |
|
|
488
|
+
|
|
489
|
+
#### Returns
|
|
490
|
+
|
|
491
|
+
`Promise`<`string`\>
|
|
492
|
+
|
|
493
|
+
string
|
|
494
|
+
|
|
495
|
+
#### Defined in
|
|
496
|
+
|
|
497
|
+
[contracts/NFT.ts:664](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L664)
|
|
498
|
+
|
|
499
|
+
___
|
|
500
|
+
|
|
501
|
+
### getNftPermissions
|
|
502
|
+
|
|
503
|
+
▸ **getNftPermissions**(`nftAddress`, `address`): `Promise`<[`NftRoles`](../interfaces/NftRoles.md)\>
|
|
504
|
+
|
|
505
|
+
Gets NFT Permissions for a specified user
|
|
506
|
+
|
|
507
|
+
#### Parameters
|
|
508
|
+
|
|
509
|
+
| Name | Type | Description |
|
|
510
|
+
| :------ | :------ | :------ |
|
|
511
|
+
| `nftAddress` | `string` | NFT contract address |
|
|
512
|
+
| `address` | `string` | user adress |
|
|
513
|
+
|
|
514
|
+
#### Returns
|
|
515
|
+
|
|
516
|
+
`Promise`<[`NftRoles`](../interfaces/NftRoles.md)\>
|
|
517
|
+
|
|
518
|
+
#### Defined in
|
|
519
|
+
|
|
520
|
+
[contracts/NFT.ts:676](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L676)
|
|
521
|
+
|
|
522
|
+
___
|
|
523
|
+
|
|
524
|
+
### getTokenURI
|
|
525
|
+
|
|
526
|
+
▸ **getTokenURI**(`nftAddress`, `id`): `Promise`<`string`\>
|
|
527
|
+
|
|
528
|
+
Gets the token URI of an NFT.
|
|
529
|
+
|
|
530
|
+
#### Parameters
|
|
531
|
+
|
|
532
|
+
| Name | Type | Description |
|
|
533
|
+
| :------ | :------ | :------ |
|
|
534
|
+
| `nftAddress` | `string` | The address of the NFT. |
|
|
535
|
+
| `id` | `number` | The ID of the token. |
|
|
536
|
+
|
|
537
|
+
#### Returns
|
|
538
|
+
|
|
539
|
+
`Promise`<`string`\>
|
|
540
|
+
|
|
541
|
+
#### Defined in
|
|
542
|
+
|
|
543
|
+
[contracts/NFT.ts:766](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L766)
|
|
544
|
+
|
|
545
|
+
___
|
|
546
|
+
|
|
547
|
+
### isDatatokenDeployer
|
|
548
|
+
|
|
549
|
+
▸ **isDatatokenDeployer**(`nftAddress`, `address`): `Promise`<`boolean`\>
|
|
550
|
+
|
|
551
|
+
Checks if user has DatatokenDeployer role
|
|
552
|
+
|
|
553
|
+
#### Parameters
|
|
554
|
+
|
|
555
|
+
| Name | Type | Description |
|
|
556
|
+
| :------ | :------ | :------ |
|
|
557
|
+
| `nftAddress` | `string` | NFT contract address |
|
|
558
|
+
| `address` | `string` | user adress |
|
|
559
|
+
|
|
560
|
+
#### Returns
|
|
561
|
+
|
|
562
|
+
`Promise`<`boolean`\>
|
|
563
|
+
|
|
564
|
+
#### Defined in
|
|
565
|
+
|
|
566
|
+
[contracts/NFT.ts:698](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L698)
|
|
567
|
+
|
|
568
|
+
___
|
|
569
|
+
|
|
570
|
+
### removeDatatokenDeployer
|
|
571
|
+
|
|
572
|
+
▸ **removeDatatokenDeployer**<`G`\>(`nftAddress`, `address`, `datatokenDeployer`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
573
|
+
|
|
574
|
+
Remove DatatokenDeployer permission - only Manager can succeed
|
|
575
|
+
|
|
576
|
+
#### Type parameters
|
|
577
|
+
|
|
578
|
+
| Name | Type |
|
|
579
|
+
| :------ | :------ |
|
|
580
|
+
| `G` | extends `boolean` = ``false`` |
|
|
581
|
+
|
|
582
|
+
#### Parameters
|
|
583
|
+
|
|
584
|
+
| Name | Type | Description |
|
|
585
|
+
| :------ | :------ | :------ |
|
|
586
|
+
| `nftAddress` | `string` | NFT contract address |
|
|
587
|
+
| `address` | `string` | NFT Manager adress |
|
|
588
|
+
| `datatokenDeployer` | `string` | Address of the user to be revoked DatatokenDeployer Permission |
|
|
589
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
590
|
+
|
|
591
|
+
#### Returns
|
|
592
|
+
|
|
593
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
594
|
+
|
|
595
|
+
trxReceipt
|
|
596
|
+
|
|
597
|
+
#### Defined in
|
|
598
|
+
|
|
599
|
+
[contracts/NFT.ts:204](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L204)
|
|
600
|
+
|
|
601
|
+
___
|
|
602
|
+
|
|
603
|
+
### removeManager
|
|
604
|
+
|
|
605
|
+
▸ **removeManager**<`G`\>(`nftAddress`, `address`, `manager`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
606
|
+
|
|
607
|
+
Removes a specific manager for NFT Contract (only NFT Owner can succeed)
|
|
608
|
+
|
|
609
|
+
#### Type parameters
|
|
610
|
+
|
|
611
|
+
| Name | Type |
|
|
612
|
+
| :------ | :------ |
|
|
613
|
+
| `G` | extends `boolean` = ``false`` |
|
|
614
|
+
|
|
615
|
+
#### Parameters
|
|
616
|
+
|
|
617
|
+
| Name | Type | Description |
|
|
618
|
+
| :------ | :------ | :------ |
|
|
619
|
+
| `nftAddress` | `string` | NFT contract address |
|
|
620
|
+
| `address` | `string` | NFT Owner adress |
|
|
621
|
+
| `manager` | `string` | User adress which is going to be removed as manager |
|
|
622
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
623
|
+
|
|
624
|
+
#### Returns
|
|
625
|
+
|
|
626
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
627
|
+
|
|
628
|
+
trxReceipt
|
|
629
|
+
|
|
630
|
+
#### Defined in
|
|
631
|
+
|
|
632
|
+
[contracts/NFT.ts:135](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L135)
|
|
633
|
+
|
|
634
|
+
___
|
|
635
|
+
|
|
636
|
+
### removeMetadataUpdater
|
|
637
|
+
|
|
638
|
+
▸ **removeMetadataUpdater**<`G`\>(`nftAddress`, `address`, `metadataUpdater`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
639
|
+
|
|
640
|
+
Remove Metadata Updater permission - only Manager can succeed
|
|
641
|
+
|
|
642
|
+
#### Type parameters
|
|
643
|
+
|
|
644
|
+
| Name | Type |
|
|
645
|
+
| :------ | :------ |
|
|
646
|
+
| `G` | extends `boolean` = ``false`` |
|
|
647
|
+
|
|
648
|
+
#### Parameters
|
|
649
|
+
|
|
650
|
+
| Name | Type | Description |
|
|
651
|
+
| :------ | :------ | :------ |
|
|
652
|
+
| `nftAddress` | `string` | NFT contract address |
|
|
653
|
+
| `address` | `string` | NFT Manager adress |
|
|
654
|
+
| `metadataUpdater` | `string` | Address of the user to be revoked Metadata updater Permission |
|
|
655
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
656
|
+
|
|
657
|
+
#### Returns
|
|
658
|
+
|
|
659
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
660
|
+
|
|
661
|
+
trxReceipt
|
|
662
|
+
|
|
663
|
+
#### Defined in
|
|
664
|
+
|
|
665
|
+
[contracts/NFT.ts:276](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L276)
|
|
666
|
+
|
|
667
|
+
___
|
|
668
|
+
|
|
669
|
+
### removeStoreUpdater
|
|
670
|
+
|
|
671
|
+
▸ **removeStoreUpdater**<`G`\>(`nftAddress`, `address`, `storeUpdater`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
672
|
+
|
|
673
|
+
Remove Store Updater permission - only Manager can succeed
|
|
674
|
+
|
|
675
|
+
#### Type parameters
|
|
676
|
+
|
|
677
|
+
| Name | Type |
|
|
678
|
+
| :------ | :------ |
|
|
679
|
+
| `G` | extends `boolean` = ``false`` |
|
|
680
|
+
|
|
681
|
+
#### Parameters
|
|
682
|
+
|
|
683
|
+
| Name | Type | Description |
|
|
684
|
+
| :------ | :------ | :------ |
|
|
685
|
+
| `nftAddress` | `string` | NFT contract address |
|
|
686
|
+
| `address` | `string` | NFT Manager adress |
|
|
687
|
+
| `storeUpdater` | `string` | Address of the user to be revoked Store Updater Permission |
|
|
688
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
689
|
+
|
|
690
|
+
#### Returns
|
|
691
|
+
|
|
692
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
693
|
+
|
|
694
|
+
trxReceipt
|
|
695
|
+
|
|
696
|
+
#### Defined in
|
|
697
|
+
|
|
698
|
+
[contracts/NFT.ts:347](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L347)
|
|
699
|
+
|
|
700
|
+
___
|
|
701
|
+
|
|
702
|
+
### safeTransferNft
|
|
703
|
+
|
|
704
|
+
▸ **safeTransferNft**<`G`\>(`nftAddress`, `nftOwner`, `nftReceiver`, `tokenId?`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
705
|
+
|
|
706
|
+
safeTransferNFT Used for transferring the NFT, can be used by an approved relayer
|
|
707
|
+
will clean all permissions both on NFT and Datatoken level.
|
|
708
|
+
|
|
709
|
+
#### Type parameters
|
|
710
|
+
|
|
711
|
+
| Name | Type |
|
|
712
|
+
| :------ | :------ |
|
|
713
|
+
| `G` | extends `boolean` = ``false`` |
|
|
714
|
+
|
|
715
|
+
#### Parameters
|
|
716
|
+
|
|
717
|
+
| Name | Type | Description |
|
|
718
|
+
| :------ | :------ | :------ |
|
|
719
|
+
| `nftAddress` | `string` | NFT contract address |
|
|
720
|
+
| `nftOwner` | `string` | Current NFT Owner adress |
|
|
721
|
+
| `nftReceiver` | `string` | User which will receive the NFT, will also be set as Manager |
|
|
722
|
+
| `tokenId?` | `number` | The id of the token to be transfered |
|
|
723
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
724
|
+
|
|
725
|
+
#### Returns
|
|
726
|
+
|
|
727
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
728
|
+
|
|
729
|
+
trxReceipt
|
|
730
|
+
|
|
731
|
+
#### Defined in
|
|
732
|
+
|
|
733
|
+
[contracts/NFT.ts:466](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L466)
|
|
734
|
+
|
|
735
|
+
___
|
|
736
|
+
|
|
737
|
+
### setData
|
|
738
|
+
|
|
739
|
+
▸ **setData**<`G`\>(`nftAddress`, `address`, `key`, `value`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
740
|
+
|
|
741
|
+
Allows users to store data with a preset key (keccak256(ERC20Address)) into NFT 725 Store
|
|
742
|
+
only ERC20Deployer can succeed
|
|
743
|
+
|
|
744
|
+
#### Type parameters
|
|
745
|
+
|
|
746
|
+
| Name | Type |
|
|
747
|
+
| :------ | :------ |
|
|
748
|
+
| `G` | extends `boolean` = ``false`` |
|
|
749
|
+
|
|
750
|
+
#### Parameters
|
|
751
|
+
|
|
752
|
+
| Name | Type | Description |
|
|
753
|
+
| :------ | :------ | :------ |
|
|
754
|
+
| `nftAddress` | `string` | Nft datatoken adress |
|
|
755
|
+
| `address` | `string` | User adress |
|
|
756
|
+
| `key` | `string` | Key of the data to be stored into 725Y standard |
|
|
757
|
+
| `value` | `string` | Data to be stored into 725Y standard |
|
|
758
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
759
|
+
|
|
760
|
+
#### Returns
|
|
761
|
+
|
|
762
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
763
|
+
|
|
764
|
+
transactionId
|
|
765
|
+
|
|
766
|
+
#### Defined in
|
|
767
|
+
|
|
768
|
+
[contracts/NFT.ts:717](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L717)
|
|
769
|
+
|
|
770
|
+
___
|
|
771
|
+
|
|
772
|
+
### setMetadata
|
|
773
|
+
|
|
774
|
+
▸ **setMetadata**<`G`\>(`nftAddress`, `address`, `metadataState`, `metadataDecryptorUrl`, `metadataDecryptorAddress`, `flags`, `data`, `metadataHash`, `metadataProofs?`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
775
|
+
|
|
776
|
+
Creates or update Metadata cached by Aquarius. Also, updates the METADATA_DECRYPTOR key
|
|
777
|
+
|
|
778
|
+
#### Type parameters
|
|
779
|
+
|
|
780
|
+
| Name | Type |
|
|
781
|
+
| :------ | :------ |
|
|
782
|
+
| `G` | extends `boolean` = ``false`` |
|
|
783
|
+
|
|
784
|
+
#### Parameters
|
|
785
|
+
|
|
786
|
+
| Name | Type | Description |
|
|
787
|
+
| :------ | :------ | :------ |
|
|
788
|
+
| `nftAddress` | `string` | NFT contract address |
|
|
789
|
+
| `address` | `string` | Caller address NFT Owner adress |
|
|
790
|
+
| `metadataState` | `number` | |
|
|
791
|
+
| `metadataDecryptorUrl` | `string` | |
|
|
792
|
+
| `metadataDecryptorAddress` | `string` | |
|
|
793
|
+
| `flags` | `string` | |
|
|
794
|
+
| `data` | `string` | |
|
|
795
|
+
| `metadataHash` | `string` | |
|
|
796
|
+
| `metadataProofs?` | [`MetadataProof`](../interfaces/MetadataProof.md)[] | |
|
|
797
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
798
|
+
|
|
799
|
+
#### Returns
|
|
800
|
+
|
|
801
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
802
|
+
|
|
803
|
+
trxReceipt
|
|
804
|
+
|
|
805
|
+
#### Defined in
|
|
806
|
+
|
|
807
|
+
[contracts/NFT.ts:515](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L515)
|
|
808
|
+
|
|
809
|
+
___
|
|
810
|
+
|
|
811
|
+
### setMetadataAndTokenURI
|
|
812
|
+
|
|
813
|
+
▸ **setMetadataAndTokenURI**<`G`\>(`nftAddress`, `metadataUpdater`, `metadataAndTokenURI`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
814
|
+
|
|
815
|
+
Helper function to improve UX sets both MetaData & TokenURI in one tx
|
|
816
|
+
|
|
817
|
+
#### Type parameters
|
|
818
|
+
|
|
819
|
+
| Name | Type |
|
|
820
|
+
| :------ | :------ |
|
|
821
|
+
| `G` | extends `boolean` = ``false`` |
|
|
822
|
+
|
|
823
|
+
#### Parameters
|
|
824
|
+
|
|
825
|
+
| Name | Type | Description |
|
|
826
|
+
| :------ | :------ | :------ |
|
|
827
|
+
| `nftAddress` | `string` | NFT contract address |
|
|
828
|
+
| `metadataUpdater` | `string` | - |
|
|
829
|
+
| `metadataAndTokenURI` | [`MetadataAndTokenURI`](../interfaces/MetadataAndTokenURI.md) | metaDataAndTokenURI object |
|
|
830
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
831
|
+
|
|
832
|
+
#### Returns
|
|
833
|
+
|
|
834
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
835
|
+
|
|
836
|
+
trxReceipt
|
|
837
|
+
|
|
838
|
+
#### Defined in
|
|
839
|
+
|
|
840
|
+
[contracts/NFT.ts:568](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L568)
|
|
841
|
+
|
|
842
|
+
___
|
|
843
|
+
|
|
844
|
+
### setMetadataState
|
|
845
|
+
|
|
846
|
+
▸ **setMetadataState**<`G`\>(`nftAddress`, `address`, `metadataState`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
847
|
+
|
|
848
|
+
setMetadataState Used for updating the metadata State
|
|
849
|
+
|
|
850
|
+
#### Type parameters
|
|
851
|
+
|
|
852
|
+
| Name | Type |
|
|
853
|
+
| :------ | :------ |
|
|
854
|
+
| `G` | extends `boolean` = ``false`` |
|
|
855
|
+
|
|
856
|
+
#### Parameters
|
|
857
|
+
|
|
858
|
+
| Name | Type | Description |
|
|
859
|
+
| :------ | :------ | :------ |
|
|
860
|
+
| `nftAddress` | `string` | NFT contract address |
|
|
861
|
+
| `address` | `string` | Caller address => metadata updater |
|
|
862
|
+
| `metadataState` | `number` | new metadata state |
|
|
863
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
864
|
+
|
|
865
|
+
#### Returns
|
|
866
|
+
|
|
867
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
868
|
+
|
|
869
|
+
trxReceipt
|
|
870
|
+
|
|
871
|
+
#### Defined in
|
|
872
|
+
|
|
873
|
+
[contracts/NFT.ts:606](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L606)
|
|
874
|
+
|
|
875
|
+
___
|
|
876
|
+
|
|
877
|
+
### setTokenURI
|
|
878
|
+
|
|
879
|
+
▸ **setTokenURI**<`G`\>(`nftAddress`, `data`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
880
|
+
|
|
881
|
+
set TokenURI on an nft
|
|
882
|
+
|
|
883
|
+
#### Type parameters
|
|
884
|
+
|
|
885
|
+
| Name | Type |
|
|
886
|
+
| :------ | :------ |
|
|
887
|
+
| `G` | extends `boolean` = ``false`` |
|
|
888
|
+
|
|
889
|
+
#### Parameters
|
|
890
|
+
|
|
891
|
+
| Name | Type | Description |
|
|
892
|
+
| :------ | :------ | :------ |
|
|
893
|
+
| `nftAddress` | `string` | NFT contract address |
|
|
894
|
+
| `data` | `string` | input data for TokenURI |
|
|
895
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
896
|
+
|
|
897
|
+
#### Returns
|
|
898
|
+
|
|
899
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
900
|
+
|
|
901
|
+
transaction receipt
|
|
902
|
+
|
|
903
|
+
#### Defined in
|
|
904
|
+
|
|
905
|
+
[contracts/NFT.ts:638](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L638)
|
|
906
|
+
|
|
907
|
+
___
|
|
908
|
+
|
|
909
|
+
### transferNft
|
|
910
|
+
|
|
911
|
+
▸ **transferNft**<`G`\>(`nftAddress`, `nftOwner`, `nftReceiver`, `tokenId?`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
912
|
+
|
|
913
|
+
Transfers the NFT
|
|
914
|
+
will clean all permissions both on NFT and Datatoken level.
|
|
915
|
+
|
|
916
|
+
#### Type parameters
|
|
917
|
+
|
|
918
|
+
| Name | Type |
|
|
919
|
+
| :------ | :------ |
|
|
920
|
+
| `G` | extends `boolean` = ``false`` |
|
|
921
|
+
|
|
922
|
+
#### Parameters
|
|
923
|
+
|
|
924
|
+
| Name | Type | Description |
|
|
925
|
+
| :------ | :------ | :------ |
|
|
926
|
+
| `nftAddress` | `string` | NFT contract address |
|
|
927
|
+
| `nftOwner` | `string` | Current NFT Owner adress |
|
|
928
|
+
| `nftReceiver` | `string` | User which will receive the NFT, will also be set as Manager |
|
|
929
|
+
| `tokenId?` | `number` | The id of the token to be transfered |
|
|
930
|
+
| `estimateGas?` | `G` | if True, return gas estimate |
|
|
931
|
+
|
|
932
|
+
#### Returns
|
|
933
|
+
|
|
934
|
+
`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
|
|
935
|
+
|
|
936
|
+
trxReceipt
|
|
937
|
+
|
|
938
|
+
#### Defined in
|
|
939
|
+
|
|
940
|
+
[contracts/NFT.ts:421](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L421)
|
|
941
|
+
|
|
942
|
+
___
|
|
943
|
+
|
|
944
|
+
### unitsToAmount
|
|
945
|
+
|
|
946
|
+
▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\>
|
|
947
|
+
|
|
948
|
+
Converts an amount of units to tokens
|
|
949
|
+
|
|
950
|
+
#### Parameters
|
|
951
|
+
|
|
952
|
+
| Name | Type | Description |
|
|
953
|
+
| :------ | :------ | :------ |
|
|
954
|
+
| `token` | `string` | The token to convert |
|
|
955
|
+
| `amount` | `string` | The amount of units to convert |
|
|
956
|
+
| `tokenDecimals?` | `number` | The number of decimals in the token |
|
|
957
|
+
|
|
958
|
+
#### Returns
|
|
959
|
+
|
|
960
|
+
`Promise`<`string`\>
|
|
961
|
+
|
|
962
|
+
- The converted amount in tokens
|
|
963
|
+
|
|
964
|
+
#### Inherited from
|
|
965
|
+
|
|
966
|
+
[SmartContract](SmartContract.md).[unitsToAmount](SmartContract.md#unitstoamount)
|
|
967
|
+
|
|
968
|
+
#### Defined in
|
|
969
|
+
|
|
970
|
+
[contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58)
|