@oceanprotocol/lib 2.7.0-next.2 → 3.0.0-next.0

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 (50) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/CodeExamples.md +273 -166
  3. package/ComputeExamples.md +109 -102
  4. package/README.md +1 -1
  5. package/dist/lib.js +1 -1
  6. package/dist/lib.js.map +1 -1
  7. package/dist/lib.modern.js +1 -1
  8. package/dist/lib.modern.js.map +1 -1
  9. package/dist/lib.module.js +1 -1
  10. package/dist/lib.module.js.map +1 -1
  11. package/dist/lib.umd.js +1 -1
  12. package/dist/lib.umd.js.map +1 -1
  13. package/dist/src/@types/Contracts.d.ts +26 -0
  14. package/dist/src/@types/DDO/Metadata.d.ts +2 -2
  15. package/dist/src/@types/File.d.ts +1 -1
  16. package/dist/src/@types/ReturnTypes.d.ts +3 -2
  17. package/dist/src/@types/index.d.ts +1 -0
  18. package/dist/src/config/Config.d.ts +1 -1
  19. package/dist/src/config/ConfigHelper.d.ts +6 -0
  20. package/dist/src/contracts/Datatoken.d.ts +90 -72
  21. package/dist/src/contracts/Dispenser.d.ts +27 -27
  22. package/dist/src/contracts/FixedRateExchange.d.ts +57 -60
  23. package/dist/src/contracts/NFT.d.ts +57 -34
  24. package/dist/src/contracts/NFTFactory.d.ts +78 -57
  25. package/dist/src/contracts/Router.d.ts +33 -18
  26. package/dist/src/contracts/SmartContract.d.ts +35 -12
  27. package/dist/src/contracts/SmartContractWithAddress.d.ts +7 -8
  28. package/dist/src/contracts/df/DfRewards.d.ts +6 -7
  29. package/dist/src/contracts/df/DfStrategyV1.d.ts +3 -5
  30. package/dist/src/contracts/ve/VeAllocate.d.ts +4 -7
  31. package/dist/src/contracts/ve/VeFeeDistributor.d.ts +6 -7
  32. package/dist/src/contracts/ve/VeFeeEstimate.d.ts +2 -2
  33. package/dist/src/contracts/ve/VeOcean.d.ts +12 -13
  34. package/dist/src/services/Aquarius.d.ts +3 -4
  35. package/dist/src/services/Provider.d.ts +124 -76
  36. package/dist/src/utils/ContractUtils.d.ts +34 -16
  37. package/dist/src/utils/DatatokenName.d.ts +5 -2
  38. package/dist/src/utils/DdoHelpers.d.ts +11 -0
  39. package/dist/src/utils/FetchHelper.d.ts +11 -0
  40. package/dist/src/utils/General.d.ts +1 -0
  41. package/dist/src/utils/ProviderErrors.d.ts +1 -0
  42. package/dist/src/utils/SignatureUtils.d.ts +8 -2
  43. package/dist/src/utils/TokenUtils.d.ts +43 -43
  44. package/dist/src/utils/index.d.ts +1 -0
  45. package/dist/src/utils/minAbi.d.ts +38 -2
  46. package/dist/test/config.d.ts +17 -3
  47. package/dist/test/integration/helpers.d.ts +7 -0
  48. package/package.json +10 -5
  49. package/dist/test/TestContractHandler.d.ts +0 -16
  50. /package/dist/test/integration/{SimplePublishConsumeFlow.test.d.ts → PublishEditConsume.test.d.ts} +0 -0
@@ -1,8 +1,7 @@
1
- import { AbiItem } from 'web3-utils/types';
2
- import { PriceAndFees, FeesInfo, FixedPriceExchange, ReceiptOrEstimate } from '../@types';
1
+ import { PriceAndFees, FeesInfo, FixedPriceExchange, ReceiptOrEstimate, AbiItem } from '../@types';
3
2
  import { SmartContractWithAddress } from './SmartContractWithAddress';
4
3
  export declare class FixedRateExchange extends SmartContractWithAddress {
5
- getDefaultAbi(): AbiItem | AbiItem[];
4
+ getDefaultAbi(): AbiItem[];
6
5
  /**
7
6
  * Creates unique exchange identifier.
8
7
  * @param {String} baseToken baseToken contract address
@@ -15,95 +14,93 @@ export declare class FixedRateExchange extends SmartContractWithAddress {
15
14
  * @param {String} exchangeId ExchangeId
16
15
  * @param {String} datatokenAmount Amount of datatokens
17
16
  * @param {String} maxBaseTokenAmount max amount of baseToken we want to pay for datatokenAmount
18
- * @param {String} address User address
19
17
  * @param {String} consumeMarketAddress consumeMarketAddress
20
18
  * @param {String} consumeMarketFee consumeMarketFee in fraction
19
+ * @param {Boolean} estimateGas if True, return gas estimate
21
20
  * @return {Promise<ReceiptOrEstimate>} transaction receipt
22
21
  */
23
- buyDatatokens<G extends boolean = false>(address: string, exchangeId: string, datatokenAmount: string, maxBaseTokenAmount: string, consumeMarketAddress?: string, consumeMarketFee?: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
22
+ buyDatatokens<G extends boolean = false>(exchangeId: string, datatokenAmount: string, maxBaseTokenAmount: string, consumeMarketAddress?: string, consumeMarketFee?: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
24
23
  /**
25
24
  * Sell datatokenAmount while expecting at least minBaseTokenAmount
26
25
  * @param {String} exchangeId ExchangeId
27
26
  * @param {String} datatokenAmount Amount of datatokens
28
27
  * @param {String} minBaseTokenAmount min amount of baseToken we want to receive back
29
- * @param {String} address User address
30
28
  * @param {String} consumeMarketAddress consumeMarketAddress
31
29
  * @param {String} consumeMarketFee consumeMarketFee in fraction
30
+ * @param {Boolean} estimateGas if True, return gas estimate
32
31
  * @return {Promise<ReceiptOrEstimate>} transaction receipt
33
32
  */
34
- sellDatatokens<G extends boolean = false>(address: string, exchangeId: string, datatokenAmount: string, minBaseTokenAmount: string, consumeMarketAddress?: string, consumeMarketFee?: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
33
+ sellDatatokens<G extends boolean = false>(exchangeId: string, datatokenAmount: string, minBaseTokenAmount: string, consumeMarketAddress?: string, consumeMarketFee?: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
35
34
  /**
36
35
  * Gets total number of exchanges
37
- * @param {String} exchangeId ExchangeId
38
- * @param {Number} datatokenAmount Amount of datatokens
39
36
  * @return {Promise<Number>} no of available exchanges
40
37
  */
41
38
  getNumberOfExchanges(): Promise<number>;
42
39
  /**
43
40
  * Set new rate
44
- * @param {String} exchangeId ExchangeId
41
+ * @param {String} exchangeId Exchange ID
45
42
  * @param {String} newRate New rate
46
- * @param {String} address User account
43
+ * @param {Boolean} estimateGas if True, return gas estimate
47
44
  * @return {Promise<ReceiptOrEstimate>} transaction receipt
48
45
  */
49
- setRate<G extends boolean = false>(address: string, exchangeId: string, newRate: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
46
+ setRate<G extends boolean = false>(exchangeId: string, newRate: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
50
47
  /**
51
48
  * Sets a new allowedSwapper
52
- * @param {String} exchangeId ExchangeId
53
- * @param {String} newAllowedSwapper newAllowedSwapper (set address zero if we want to remove allowed swapper)
54
- * @param {String} address User account
49
+ * @param {String} exchangeId Exchange ID
50
+ * @param {String} newAllowedSwapper The address of the new allowed swapper (set address zero if we want to remove allowed swapper)
51
+ * @param {Boolean} estimateGas if True, return gas estimate
55
52
  * @return {Promise<ReceiptOrEstimate>} transaction receipt
56
53
  */
57
- setAllowedSwapper<G extends boolean = false>(address: string, exchangeId: string, newAllowedSwapper: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
54
+ setAllowedSwapper<G extends boolean = false>(exchangeId: string, newAllowedSwapper: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
58
55
  /**
59
56
  * Activate an exchange
60
57
  * @param {String} exchangeId ExchangeId
61
- * @param {String} address User address
58
+ * @param {Boolean} estimateGas if True, return gas estimate
62
59
  * @return {Promise<ReceiptOrEstimate>} transaction receipt
63
60
  */
64
- activate<G extends boolean = false>(address: string, exchangeId: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
61
+ activate<G extends boolean = false>(exchangeId: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
65
62
  /**
66
63
  * Deactivate an exchange
67
64
  * @param {String} exchangeId ExchangeId
68
- * @param {String} address User address
65
+ * @param {Boolean} estimateGas if True, return gas estimate
69
66
  * @return {Promise<ReceiptOrEstimate>} transaction receipt
70
67
  */
71
- deactivate<G extends boolean = false>(address: string, exchangeId: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
68
+ deactivate<G extends boolean = false>(exchangeId: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
72
69
  /**
73
- * Get Rate
74
- * @param {String} exchangeId ExchangeId
70
+ * Get Exchange Rate
71
+ * @param {String} exchangeId Exchange ID
75
72
  * @return {Promise<string>} Rate (converted from wei)
76
73
  */
77
74
  getRate(exchangeId: string): Promise<string>;
78
75
  /**
79
76
  * Get Datatoken Supply in the exchange
80
- * @param {String} exchangeId ExchangeId
77
+ * @param {String} exchangeId Exchange Id
81
78
  * @return {Promise<string>} dt supply formatted
82
79
  */
83
80
  getDatatokenSupply(exchangeId: string): Promise<string>;
84
81
  /**
85
- * Get BaseToken Supply in the exchange
86
- * @param {String} exchangeId ExchangeId
82
+ * Returns basetoken supply in the exchange
83
+ * @param {String} exchangeId Exchange Id
87
84
  * @return {Promise<string>} dt supply formatted
88
85
  */
89
86
  getBasetokenSupply(exchangeId: string): Promise<string>;
90
87
  /**
91
88
  * Get Allower Swapper (if set this is the only account which can use this exchange, else is set at address(0))
92
- * @param {String} exchangeId ExchangeId
93
- * @return {Promise<string>} address of allowedSwapper
89
+ * @param {String} exchangeId Exchange Id
90
+ * @return {Promise<string>} address of allowed swapper
94
91
  */
95
92
  getAllowedSwapper(exchangeId: string): Promise<string>;
96
93
  /**
97
94
  * calcBaseInGivenDatatokensOut - Calculates how many base tokens are needed to get specified amount of datatokens
98
- * @param {String} exchangeId ExchangeId
95
+ * @param {String} exchangeId Exchange Id
99
96
  * @param {string} datatokenAmount Amount of datatokens user wants to buy
100
97
  * @param {String} consumeMarketFee consumeMarketFee in fraction
101
98
  * @return {Promise<PriceAndFees>} how many base tokens are needed and fees
102
99
  */
103
100
  calcBaseInGivenDatatokensOut(exchangeId: string, datatokenAmount: string, consumeMarketFee?: string): Promise<PriceAndFees>;
104
101
  /**
105
- * getBTOut - returns amount in baseToken that user will receive for datatokenAmount sold
106
- * @param {String} exchangeId ExchangeId
102
+ * Returns amount in baseToken that user will receive for datatokenAmount sold
103
+ * @param {String} exchangeId Exchange Id
107
104
  * @param {Number} datatokenAmount Amount of datatokens
108
105
  * @param {String} consumeMarketFee consumeMarketFee in fraction
109
106
  * @return {Promise<string>} Amount of baseTokens user will receive
@@ -111,72 +108,72 @@ export declare class FixedRateExchange extends SmartContractWithAddress {
111
108
  getAmountBasetokensOut(exchangeId: string, datatokenAmount: string, consumeMarketFee?: string): Promise<string>;
112
109
  /**
113
110
  * Get exchange details
114
- * @param {String} exchangeId ExchangeId
111
+ * @param {String} exchangeId Exchange Id
115
112
  * @return {Promise<FixedPricedExchange>} Exchange details
116
113
  */
117
114
  getExchange(exchangeId: string): Promise<FixedPriceExchange>;
118
115
  /**
119
116
  * Get fee details for an exchange
120
- * @param {String} exchangeId ExchangeId
121
- * @return {Promise<FixedPricedExchange>} Exchange details
117
+ * @param {String} exchangeId Exchange Id
118
+ * @return {Promise<FeesInfo>} Exchange details
122
119
  */
123
120
  getFeesInfo(exchangeId: string): Promise<FeesInfo>;
124
121
  /**
125
- * Get all exchanges
126
- * @param {String} exchangeId ExchangeId
122
+ * Returns all exchanges
123
+ * @param {String} exchangeId Exchang eId
127
124
  * @return {Promise<String[]>} Exchanges list
128
125
  */
129
126
  getExchanges(): Promise<string[]>;
130
127
  /**
131
128
  * Check if an exchange is active
132
129
  * @param {String} exchangeId ExchangeId
133
- * @return {Promise<Boolean>} Result
130
+ * @return {Promise<Boolean>}
134
131
  */
135
132
  isActive(exchangeId: string): Promise<boolean>;
136
133
  /**
137
134
  * Activate minting option for fixed rate contract
138
- * @param {String} exchangeId ExchangeId
139
- * @param {String} address User address
135
+ * @param {String} exchangeId Exchang eId
136
+ * @param {Boolean} estimateGas if True, return gas estimate
140
137
  * @return {Promise<ReceiptOrEstimate>} transaction receipt
141
138
  */
142
- activateMint<G extends boolean = false>(address: string, exchangeId: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
139
+ activateMint<G extends boolean = false>(exchangeId: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
143
140
  /**
144
141
  * Deactivate minting for fixed rate
145
142
  * @param {String} exchangeId ExchangeId
146
- * @param {String} address User address
143
+ * @param {Boolean} estimateGas if True, return gas estimate
147
144
  * @return {Promise<ReceiptOrEstimate>} transaction receipt
148
145
  */
149
- deactivateMint<G extends boolean = false>(address: string, exchangeId: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
146
+ deactivateMint<G extends boolean = false>(exchangeId: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
150
147
  /**
151
148
  * Collect BaseTokens in the contract (anyone can call this, funds are sent to Datatoken.paymentCollector)
152
- * @param {String} address User address
153
- * @param {String} exchangeId ExchangeId
149
+ * @param {String} exchangeId Exchange Id
154
150
  * @param {String} amount amount to be collected
151
+ * @param {Boolean} estimateGas if True, return gas estimate
155
152
  * @return {Promise<ReceiptOrEstimate>} transaction receipt
156
153
  */
157
- collectBasetokens<G extends boolean = false>(address: string, exchangeId: string, amount: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
154
+ collectBasetokens<G extends boolean = false>(exchangeId: string, amount: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
158
155
  /**
159
156
  * Collect datatokens in the contract (anyone can call this, funds are sent to Datatoken.paymentCollector)
160
- * @param {String} address User address
161
- * @param {String} exchangeId ExchangeId
157
+ * @param {String} exchangeId Exchange Id
162
158
  * @param {String} amount amount to be collected
159
+ * @param {Boolean} estimateGas if True, return gas estimate
163
160
  * @return {Promise<ReceiptOrEstimate>} transaction receipt
164
161
  */
165
- collectDatatokens<G extends boolean = false>(address: string, exchangeId: string, amount: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
162
+ collectDatatokens<G extends boolean = false>(exchangeId: string, amount: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
166
163
  /**
167
164
  * Collect market fee and send it to marketFeeCollector (anyone can call it)
168
- * @param {String} exchangeId ExchangeId
169
- * @param {String} address User address
165
+ * @param {String} exchangeId Exchange Id
166
+ * @param {Boolean} estimateGas if True, return gas estimate
170
167
  * @return {Promise<ReceiptOrEstimate>} transaction receipt
171
168
  */
172
- collectMarketFee<G extends boolean = false>(address: string, exchangeId: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
169
+ collectMarketFee<G extends boolean = false>(exchangeId: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
173
170
  /**
174
171
  * Collect ocean fee and send it to OPF collector (anyone can call it)
175
- * @param {String} exchangeId ExchangeId
176
- * @param {String} address User address
172
+ * @param {String} exchangeId Exchange Id
173
+ * @param {Boolean} estimateGas if True, return gas estimate
177
174
  * @return {Promise<ReceiptOrEstimate>} transaction receipt
178
175
  */
179
- collectOceanFee<G extends boolean = false>(address: string, exchangeId: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
176
+ collectOceanFee<G extends boolean = false>(exchangeId: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
180
177
  /**
181
178
  * Get OPF Collector of fixed rate contract
182
179
  * @return {String}
@@ -189,24 +186,24 @@ export declare class FixedRateExchange extends SmartContractWithAddress {
189
186
  getRouter(): Promise<string>;
190
187
  /**
191
188
  * Get Exchange Owner given an exchangeId
192
- * @param {String} exchangeId ExchangeId
189
+ * @param {String} exchangeId Exchange Id
193
190
  * @return {String} return exchange owner
194
191
  */
195
192
  getExchangeOwner(exchangeId: string): Promise<string>;
196
193
  /**
197
194
  * Set new market fee, only market fee collector can update it
198
- * @param {String} address user address
199
- * @param {String} exchangeId ExchangeId
195
+ * @param {String} exchangeId Exchange Id
200
196
  * @param {String} newMarketFee New market fee
197
+ * @param {Boolean} estimateGas if True, return gas estimate
201
198
  * @return {Promise<ReceiptOrEstimate>} transaction receipt
202
199
  */
203
- updateMarketFee<G extends boolean = false>(address: string, exchangeId: string, newMarketFee: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
200
+ updateMarketFee<G extends boolean = false>(exchangeId: string, newMarketFee: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
204
201
  /**
205
202
  * Set new market fee collector, only market fee collector can update it
206
- * @param {String} address user address
207
- * @param {String} exchangeId ExchangeId
203
+ * @param {String} exchangeId Exchange Id
208
204
  * @param {String} newMarketFeeCollector New market fee collector
205
+ * @param {Boolean} estimateGas if True, return gas estimate
209
206
  * @return {Promise<ReceiptOrEstimate>} transaction receipt
210
207
  */
211
- updateMarketFeeCollector<G extends boolean = false>(address: string, exchangeId: string, newMarketFeeCollector: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
208
+ updateMarketFeeCollector<G extends boolean = false>(exchangeId: string, newMarketFeeCollector: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
212
209
  }
@@ -1,9 +1,8 @@
1
- import { AbiItem } from 'web3-utils';
2
- import { TransactionReceipt } from 'web3-eth';
3
- import { MetadataProof, MetadataAndTokenURI, NftRoles, ReceiptOrEstimate } from '../@types';
1
+ import { BigNumber } from 'ethers';
2
+ import { MetadataProof, MetadataAndTokenURI, NftRoles, ReceiptOrEstimate, AbiItem } from '../@types';
4
3
  import { SmartContract } from './SmartContract';
5
4
  export declare class Nft extends SmartContract {
6
- getDefaultAbi(): AbiItem | AbiItem[];
5
+ getDefaultAbi(): AbiItem[];
7
6
  /**
8
7
  * Create new ERC20 Datatoken - only user with DatatokenDeployer permission can succeed
9
8
  * @param {String} nftAddress NFT address
@@ -17,14 +16,16 @@ export declare class Nft extends SmartContract {
17
16
  * @param {String} name Token name
18
17
  * @param {String} symbol Token symbol
19
18
  * @param {Number} templateIndex NFT template index
19
+ * @param {Boolean} estimateGas if True, return gas estimate
20
20
  * @return {Promise<string>} ERC20 Datatoken address
21
21
  */
22
- createDatatoken<G extends boolean = false>(nftAddress: string, address: string, minter: string, paymentCollector: string, mpFeeAddress: string, feeToken: string, feeAmount: string, cap: string, name?: string, symbol?: string, templateIndex?: number, estimateGas?: G): Promise<G extends false ? string : number>;
22
+ createDatatoken<G extends boolean = false>(nftAddress: string, address: string, minter: string, paymentCollector: string, mpFeeAddress: string, feeToken: string, feeAmount: string, cap: string, name?: string, symbol?: string, templateIndex?: number, estimateGas?: G): Promise<G extends false ? string : BigNumber>;
23
23
  /**
24
24
  * Add Manager for NFT Contract (only NFT Owner can succeed)
25
25
  * @param {String} nftAddress NFT contract address
26
26
  * @param {String} address NFT Owner adress
27
27
  * @param {String} manager User adress which is going to be assing manager
28
+ * @param {Boolean} [estimateGas] if True, return gas estimate
28
29
  * @return {Promise<ReceiptOrEstimate>} trxReceipt
29
30
  */
30
31
  addManager<G extends boolean = false>(nftAddress: string, address: string, manager: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
@@ -33,6 +34,7 @@ export declare class Nft extends SmartContract {
33
34
  * @param {String} nftAddress NFT contract address
34
35
  * @param {String} address NFT Owner adress
35
36
  * @param {String} manager User adress which is going to be removed as manager
37
+ * @param {Boolean} [estimateGas] if True, return gas estimate
36
38
  * @return {Promise<ReceiptOrEstimate>} trxReceipt
37
39
  */
38
40
  removeManager<G extends boolean = false>(nftAddress: string, address: string, manager: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
@@ -41,6 +43,7 @@ export declare class Nft extends SmartContract {
41
43
  * @param {String} nftAddress NFT contract address
42
44
  * @param {String} address NFT Manager adress
43
45
  * @param {String} datatokenDeployer User adress which is going to have DatatokenDeployer permission
46
+ * @param {Boolean} estimateGas if True, return gas estimate
44
47
  * @return {Promise<ReceiptOrEstimate>} trxReceipt
45
48
  */
46
49
  addDatatokenDeployer<G extends boolean = false>(nftAddress: string, address: string, datatokenDeployer: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
@@ -49,6 +52,7 @@ export declare class Nft extends SmartContract {
49
52
  * @param {String} nftAddress NFT contract address
50
53
  * @param {String} address NFT Manager adress
51
54
  * @param {String} datatokenDeployer Address of the user to be revoked DatatokenDeployer Permission
55
+ * @param {Boolean} estimateGas if True, return gas estimate
52
56
  * @return {Promise<ReceiptOrEstimate>} trxReceipt
53
57
  */
54
58
  removeDatatokenDeployer<G extends boolean = false>(nftAddress: string, address: string, datatokenDeployer: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
@@ -57,6 +61,7 @@ export declare class Nft extends SmartContract {
57
61
  * @param {String} nftAddress NFT contract address
58
62
  * @param {String} address NFT Manager adress
59
63
  * @param {String} metadataUpdater User adress which is going to have Metadata Updater permission
64
+ * @param {Boolean} estimateGas if True, return gas estimate
60
65
  * @return {Promise<ReceiptOrEstimate>} trxReceipt
61
66
  */
62
67
  addMetadataUpdater<G extends boolean = false>(nftAddress: string, address: string, metadataUpdater: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
@@ -65,6 +70,7 @@ export declare class Nft extends SmartContract {
65
70
  * @param {String} nftAddress NFT contract address
66
71
  * @param {String} address NFT Manager adress
67
72
  * @param {String} metadataUpdater Address of the user to be revoked Metadata updater Permission
73
+ * @param {Boolean} estimateGas if True, return gas estimate
68
74
  * @return {Promise<ReceiptOrEstimate>} trxReceipt
69
75
  */
70
76
  removeMetadataUpdater<G extends boolean = false>(nftAddress: string, address: string, metadataUpdater: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
@@ -73,6 +79,7 @@ export declare class Nft extends SmartContract {
73
79
  * @param {String} nftAddress NFT contract address
74
80
  * @param {String} address NFT Manager adress
75
81
  * @param {String} storeUpdater User adress which is going to have Store Updater permission
82
+ * @param {Boolean} estimateGas if True, return gas estimate
76
83
  * @return {Promise<ReceiptOrEstimate>} trxReceipt
77
84
  */
78
85
  addStoreUpdater<G extends boolean = false>(nftAddress: string, address: string, storeUpdater: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
@@ -81,6 +88,7 @@ export declare class Nft extends SmartContract {
81
88
  * @param {String} nftAddress NFT contract address
82
89
  * @param {String} address NFT Manager adress
83
90
  * @param {String} storeUpdater Address of the user to be revoked Store Updater Permission
91
+ * @param {Boolean} estimateGas if True, return gas estimate
84
92
  * @return {Promise<ReceiptOrEstimate>} trxReceipt
85
93
  */
86
94
  removeStoreUpdater<G extends boolean = false>(nftAddress: string, address: string, storeUpdater: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
@@ -91,6 +99,7 @@ export declare class Nft extends SmartContract {
91
99
  * Only NFT Owner can call it.
92
100
  * @param {String} nftAddress NFT contract address
93
101
  * @param {String} address NFT Owner adress
102
+ * @param {Boolean} estimateGas if True, return gas estimate
94
103
  * @return {Promise<ReceiptOrEstimate>} trxReceipt
95
104
  */
96
105
  cleanPermissions<G extends boolean = false>(nftAddress: string, address: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
@@ -101,6 +110,7 @@ export declare class Nft extends SmartContract {
101
110
  * @param {String} nftOwner Current NFT Owner adress
102
111
  * @param {String} nftReceiver User which will receive the NFT, will also be set as Manager
103
112
  * @param {Number} tokenId The id of the token to be transfered
113
+ * @param {Boolean} estimateGas if True, return gas estimate
104
114
  * @return {Promise<ReceiptOrEstimate>} trxReceipt
105
115
  */
106
116
  transferNft<G extends boolean = false>(nftAddress: string, nftOwner: string, nftReceiver: string, tokenId?: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
@@ -111,6 +121,7 @@ export declare class Nft extends SmartContract {
111
121
  * @param {String} nftOwner Current NFT Owner adress
112
122
  * @param {String} nftReceiver User which will receive the NFT, will also be set as Manager
113
123
  * @param {Number} tokenId The id of the token to be transfered
124
+ * @param {Boolean} estimateGas if True, return gas estimate
114
125
  * @return {Promise<ReceiptOrEstimate>} trxReceipt
115
126
  */
116
127
  safeTransferNft<G extends boolean = false>(nftAddress: string, nftOwner: string, nftReceiver: string, tokenId?: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
@@ -118,12 +129,14 @@ export declare class Nft extends SmartContract {
118
129
  * Creates or update Metadata cached by Aquarius. Also, updates the METADATA_DECRYPTOR key
119
130
  * @param {String} nftAddress NFT contract address
120
131
  * @param {String} address Caller address NFT Owner adress
121
- * @param {String} address Caller address NFT Owner adress
122
- * @param {String} address Caller address NFT Owner adress
123
- * @param {String} address Caller address NFT Owner adress
124
- * @param {String} address Caller address NFT Owner adress
125
- * @param {String} address Caller address NFT Owner adress
126
- * @param {String} address Caller address NFT Owner adress
132
+ * @param {Number} metadataState
133
+ * @param {String} metadataDecryptorUrl
134
+ * @param {String} metadataDecryptorAddress
135
+ * @param {String} flags
136
+ * @param {String} data
137
+ * @param {String} metadataHash
138
+ * @param {MetadataProof[]} metadataProofs
139
+ * @param {Boolean} estimateGas if True, return gas estimate
127
140
  * @return {Promise<ReceiptOrEstimate>} trxReceipt
128
141
  */
129
142
  setMetadata<G extends boolean = false>(nftAddress: string, address: string, metadataState: number, metadataDecryptorUrl: string, metadataDecryptorAddress: string, flags: string, data: string, metadataHash: string, metadataProofs?: MetadataProof[], estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
@@ -132,6 +145,7 @@ export declare class Nft extends SmartContract {
132
145
  * @param {String} nftAddress NFT contract address
133
146
  * @param {String} address Caller address
134
147
  * @param {MetadataAndTokenURI} metadataAndTokenURI metaDataAndTokenURI object
148
+ * @param {Boolean} estimateGas if True, return gas estimate
135
149
  * @return {Promise<ReceiptOrEstimate>} trxReceipt
136
150
  */
137
151
  setMetadataAndTokenURI<G extends boolean = false>(nftAddress: string, metadataUpdater: string, metadataAndTokenURI: MetadataAndTokenURI, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
@@ -140,58 +154,67 @@ export declare class Nft extends SmartContract {
140
154
  * @param {String} nftAddress NFT contract address
141
155
  * @param {String} address Caller address => metadata updater
142
156
  * @param {Number} metadataState new metadata state
157
+ * @param {Boolean} estimateGas if True, return gas estimate
143
158
  * @return {Promise<ReceiptOrEstimate>} trxReceipt
144
159
  */
145
160
  setMetadataState<G extends boolean = false>(nftAddress: string, address: string, metadataState: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
146
- /** set TokenURI on an nft
147
- * @param nftAddress NFT contract address
148
- * @param address user adress
149
- * @param data input data for TokenURI
161
+ /**
162
+ * set TokenURI on an nft
163
+ * @param {String} nftAddress NFT contract address
164
+ * @param {String} data input data for TokenURI
165
+ * @param {Boolean} estimateGas if True, return gas estimate
150
166
  * @return {Promise<ReceiptOrEstimate>} transaction receipt
151
167
  */
152
- setTokenURI<G extends boolean = false>(nftAddress: string, address: string, data: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
153
- /** Get Owner
168
+ setTokenURI<G extends boolean = false>(nftAddress: string, data: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
169
+ /**
170
+ * Get NFT Owner
154
171
  * @param {String} nftAddress NFT contract address
155
172
  * @return {Promise<string>} string
156
173
  */
157
174
  getNftOwner(nftAddress: string): Promise<string>;
158
- /** Get users NFT Permissions
175
+ /**
176
+ * Gets NFT Permissions for a specified user
159
177
  * @param {String} nftAddress NFT contract address
160
178
  * @param {String} address user adress
161
179
  * @return {Promise<NftRoles>}
162
180
  */
163
181
  getNftPermissions(nftAddress: string, address: string): Promise<NftRoles>;
164
- /** Get users Metadata, return Metadata details
182
+ /**
183
+ * Returns Metadata details for an NFT
165
184
  * @param {String} nftAddress NFT contract address
166
185
  * @return {Promise<Objecta>}
167
186
  */
168
187
  getMetadata(nftAddress: string): Promise<Object>;
169
- /** Get users DatatokenDeployer role
188
+ /**
189
+ * Checks if user has DatatokenDeployer role
170
190
  * @param {String} nftAddress NFT contract address
171
191
  * @param {String} address user adress
172
192
  * @return {Promise<boolean>}
173
193
  */
174
194
  isDatatokenDeployer(nftAddress: string, address: string): Promise<boolean>;
175
- /** setData
176
- * This function allows to store data with a preset key (keccak256(ERC20Address)) into NFT 725 Store
195
+ /**
196
+ * Allows users to store data with a preset key (keccak256(ERC20Address)) into NFT 725 Store
177
197
  * only ERC20Deployer can succeed
178
- * @param nftAddress erc721 contract adress
179
- * @param address user adress
180
- * @param key Key of the data to be stored into 725Y standard
181
- * @param value Data to be stored into 725Y standard
198
+ * @param {string} nftAddress Nft datatoken adress
199
+ * @param {string} address User adress
200
+ * @param {string} key Key of the data to be stored into 725Y standard
201
+ * @param {string} value Data to be stored into 725Y standard
202
+ * @param {boolean} estimateGas if True, return gas estimate
182
203
  * @return {Promise<ReceiptOrEstimate>} transactionId
183
204
  */
184
- setData(nftAddress: string, address: string, key: string, value: string): Promise<TransactionReceipt>;
185
- /** Gets data at a given `key`
186
- * @param {String} nftAddress NFT contract address
187
- * @param {String} key the key which value to retrieve
205
+ setData<G extends boolean = false>(nftAddress: string, address: string, key: string, value: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
206
+ /**
207
+ * Gets stored data at a given `key` in an NFT
208
+ * @param {string} nftAddress - The address of the NFT.
209
+ * @param {string} key - The key of the data to get.
188
210
  * @return {Promise<string>} The data stored at the key
189
211
  */
190
212
  getData(nftAddress: string, key: string): Promise<string>;
191
- /** Gets data at a given `key`
192
- * @param {String} nftAddress NFT contract address
193
- * @param {String} id
194
- * @return {Promise<string>} The data stored at the key
213
+ /**
214
+ * Gets the token URI of an NFT.
215
+ * @param {string} nftAddress - The address of the NFT.
216
+ * @param {number} id - The ID of the token.
217
+ * @returns {Promise&lt;string&gt;}
195
218
  */
196
219
  getTokenURI(nftAddress: string, id: number): Promise<string>;
197
220
  }