@oceanprotocol/lib 1.0.0-next.10 → 1.0.0-next.14

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 (43) hide show
  1. package/CHANGELOG.md +48 -1
  2. package/dist/lib.js +1 -1
  3. package/dist/lib.js.map +1 -1
  4. package/dist/lib.modern.js +1 -1
  5. package/dist/lib.modern.js.map +1 -1
  6. package/dist/lib.module.js +1 -1
  7. package/dist/lib.module.js.map +1 -1
  8. package/dist/lib.umd.js +1 -1
  9. package/dist/lib.umd.js.map +1 -1
  10. package/dist/src/@types/Asset.d.ts +83 -0
  11. package/dist/src/@types/Compute.d.ts +17 -0
  12. package/dist/src/@types/DDO/DDO.d.ts +43 -0
  13. package/dist/src/@types/DDO/Event.d.ts +20 -0
  14. package/dist/src/@types/DDO/Metadata.d.ts +88 -0
  15. package/dist/src/@types/DDO/Service.d.ts +96 -0
  16. package/dist/src/{interfaces/DispenserInterface.d.ts → @types/Dispenser.d.ts} +0 -0
  17. package/dist/src/{interfaces/Erc20Interface.d.ts → @types/Erc20.d.ts} +0 -0
  18. package/dist/src/{interfaces/Erc721Interface.d.ts → @types/Erc721.d.ts} +1 -1
  19. package/dist/src/@types/FileMetadata.d.ts +29 -0
  20. package/dist/src/{interfaces/FixedRateInterface.d.ts → @types/FixedPrice.d.ts} +7 -1
  21. package/dist/src/{interfaces/PoolInterface.d.ts → @types/Pool.d.ts} +2 -2
  22. package/dist/src/@types/Router.d.ts +59 -0
  23. package/dist/src/@types/index.d.ts +6 -0
  24. package/dist/src/aquarius/Aquarius.d.ts +23 -1
  25. package/dist/src/factories/NFTFactory.d.ts +217 -10
  26. package/dist/src/index.d.ts +0 -1
  27. package/dist/src/models/Config.d.ts +128 -0
  28. package/dist/src/pools/Router.d.ts +183 -1
  29. package/dist/src/pools/balancer/Pool.d.ts +307 -12
  30. package/dist/src/pools/dispenser/Dispenser.d.ts +108 -0
  31. package/dist/src/pools/fixedRate/FixedRateExchange.d.ts +281 -1
  32. package/dist/src/pools/ssContracts/SideStaking.d.ts +102 -0
  33. package/dist/src/provider/Provider.d.ts +113 -1
  34. package/dist/src/tokens/Datatoken.d.ts +291 -2
  35. package/dist/src/tokens/NFT.d.ts +294 -1
  36. package/dist/src/utils/ContractUtils.d.ts +2 -1
  37. package/dist/src/utils/DatatokenName.d.ts +4 -0
  38. package/dist/src/utils/General.d.ts +4 -0
  39. package/dist/src/utils/TokenUtils.d.ts +32 -0
  40. package/dist/src/utils/index.d.ts +1 -0
  41. package/package.json +19 -19
  42. package/dist/src/interfaces/RouterInterface.d.ts +0 -12
  43. package/dist/src/interfaces/index.d.ts +0 -5
@@ -3,6 +3,7 @@ import { Contract } from 'web3-eth-contract';
3
3
  import { AbiItem } from 'web3-utils/types';
4
4
  import Web3 from 'web3';
5
5
  import { Config } from '../../models/index.js';
6
+ import { PriceAndFees } from '../..';
6
7
  export interface FixedPriceExchange {
7
8
  active: boolean;
8
9
  exchangeOwner: string;
@@ -39,6 +40,7 @@ export declare enum FixedRateCreateProgressStep {
39
40
  }
40
41
  export declare class FixedRateExchange {
41
42
  GASLIMIT_DEFAULT: number;
43
+ /** Ocean related functions */
42
44
  oceanAddress: string;
43
45
  fixedRateAddress: string;
44
46
  fixedRateExchangeAbi: AbiItem | AbiItem[];
@@ -47,50 +49,328 @@ export declare class FixedRateExchange {
47
49
  contract: Contract;
48
50
  config: Config;
49
51
  ssAbi: AbiItem | AbiItem[];
52
+ /**
53
+ * Instantiate FixedRateExchange
54
+ * @param {any} web3
55
+ * @param {any} fixedRateExchangeAbi
56
+ */
50
57
  constructor(web3: Web3, fixedRateAddress: string, fixedRateExchangeAbi?: AbiItem | AbiItem[], oceanAddress?: string, config?: Config);
51
58
  amountToUnits(token: string, amount: string): Promise<string>;
52
59
  unitsToAmount(token: string, amount: string): Promise<string>;
60
+ /**
61
+ * Creates unique exchange identifier.
62
+ * @param {String} datatoken Datatoken contract address
63
+ * @param {String} owner Owner of the exchange
64
+ * @return {Promise<string>} exchangeId
65
+ */
53
66
  generateExchangeId(baseToken: string, datatoken: string, owner: string): Promise<string>;
67
+ /**
68
+ * Estimate gas cost for buyDT
69
+ * @param {String} account
70
+ * @param {String} dtAmount datatoken amount we want to buy
71
+ * @param {String} datatokenAddress datatokenAddress
72
+ * @param {Contract} contractInstance optional contract instance
73
+ * @return {Promise<number>}
74
+ */
54
75
  estBuyDT(account: string, datatokenAddress: string, dtAmount: string, maxBaseTokenAmount: string, contractInstance?: Contract): Promise<number>;
76
+ /**
77
+ * Atomic swap
78
+ * @param {String} exchangeId ExchangeId
79
+ * @param {String} datatokenAmount Amount of datatokens
80
+ * @param {String} maxBaseTokenAmount max amount of baseToken we want to pay for datatokenAmount
81
+ * @param {String} address User address
82
+ * @return {Promise<TransactionReceipt>} transaction receipt
83
+ */
55
84
  buyDT(address: string, exchangeId: string, datatokenAmount: string, maxBaseTokenAmount: string): Promise<TransactionReceipt>;
85
+ /**
86
+ * Estimate gas cost for sellDT
87
+ * @param {String} account
88
+ * @param {String} dtAmount datatoken amount we want to sell
89
+ * @param {String} datatokenAddress datatokenAddress
90
+ * @param {Contract} contractInstance optional contract instance
91
+ * @return {Promise<number>}
92
+ */
56
93
  estSellDT(account: string, datatokenAddress: string, dtAmount: string, maxBaseTokenAmount: string, contractInstance?: Contract): Promise<number>;
94
+ /**
95
+ * Atomic swap
96
+ * @param {String} exchangeId ExchangeId
97
+ * @param {String} datatokenAmount Amount of datatokens
98
+ * @param {String} minBaseTokenAmount min amount of baseToken we want to receive back
99
+ * @param {String} address User address
100
+ * @return {Promise<TransactionReceipt>} transaction receipt
101
+ */
57
102
  sellDT(address: string, exchangeId: string, datatokenAmount: string, minBaseTokenAmount: string): Promise<TransactionReceipt>;
103
+ /**
104
+ * Gets total number of exchanges
105
+ * @param {String} exchangeId ExchangeId
106
+ * @param {Number} datatokenAmount Amount of datatokens
107
+ * @return {Promise<Number>} no of available exchanges
108
+ */
58
109
  getNumberOfExchanges(): Promise<number>;
110
+ /**
111
+ * Estimate gas cost for setRate
112
+ * @param {String} account
113
+ * @param {String} exchangeId ExchangeId
114
+ * @param {Number} newRate New rate
115
+ * @param {Contract} contractInstance optional contract instance
116
+ * @return {Promise<number>}
117
+ */
59
118
  estSetRate(account: string, exchangeId: string, newRate: string, contractInstance?: Contract): Promise<number>;
119
+ /**
120
+ * Set new rate
121
+ * @param {String} exchangeId ExchangeId
122
+ * @param {Number} newRate New rate
123
+ * @param {String} address User account
124
+ * @return {Promise<TransactionReceipt>} transaction receipt
125
+ */
60
126
  setRate(address: string, exchangeId: string, newRate: string): Promise<TransactionReceipt>;
127
+ /**
128
+ * Estimate gas cost for setRate
129
+ * @param {String} account
130
+ * @param {String} exchangeId ExchangeId
131
+ * @param {String} newAllowedSwapper new allowed swapper address
132
+ * @param {Contract} contractInstance optional contract instance
133
+ * @return {Promise<number>}
134
+ */
61
135
  estSetAllowedSwapper(account: string, exchangeId: string, newAllowedSwapper: string, contractInstance?: Contract): Promise<number>;
136
+ /**
137
+ * Set new rate
138
+ * @param {String} exchangeId ExchangeId
139
+ * @param {String} newAllowedSwapper newAllowedSwapper (set address zero if we want to remove allowed swapper)
140
+ * @param {String} address User account
141
+ * @return {Promise<TransactionReceipt>} transaction receipt
142
+ */
62
143
  setAllowedSwapper(address: string, exchangeId: string, newAllowedSwapper: string): Promise<TransactionReceipt>;
144
+ /**
145
+ * Estimate gas cost for activate
146
+ * @param {String} account
147
+ * @param {String} exchangeId ExchangeId
148
+ * @param {Contract} contractInstance optional contract instance
149
+ * @return {Promise<number>}
150
+ */
63
151
  estActivate(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
152
+ /**
153
+ * Activate an exchange
154
+ * @param {String} exchangeId ExchangeId
155
+ * @param {String} address User address
156
+ * @return {Promise<TransactionReceipt>} transaction receipt
157
+ */
64
158
  activate(address: string, exchangeId: string): Promise<TransactionReceipt>;
159
+ /**
160
+ * Estimate gas cost for deactivate
161
+ * @param {String} account
162
+ * @param {String} exchangeId ExchangeId
163
+ * @param {Contract} contractInstance optional contract instance
164
+ * @return {Promise<number>}
165
+ */
65
166
  estDeactivate(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
167
+ /**
168
+ * Deactivate an exchange
169
+ * @param {String} exchangeId ExchangeId
170
+ * @param {String} address User address
171
+ * @return {Promise<TransactionReceipt>} transaction receipt
172
+ */
66
173
  deactivate(address: string, exchangeId: string): Promise<TransactionReceipt>;
174
+ /**
175
+ * Get Rate
176
+ * @param {String} exchangeId ExchangeId
177
+ * @return {Promise<string>} Rate (converted from wei)
178
+ */
67
179
  getRate(exchangeId: string): Promise<string>;
180
+ /**
181
+ * Get Datatoken Supply in the exchange
182
+ * @param {String} exchangeId ExchangeId
183
+ * @return {Promise<string>} dt supply formatted
184
+ */
68
185
  getDTSupply(exchangeId: string): Promise<string>;
186
+ /**
187
+ * Get BaseToken Supply in the exchange
188
+ * @param {String} exchangeId ExchangeId
189
+ * @return {Promise<string>} dt supply formatted
190
+ */
69
191
  getBTSupply(exchangeId: string): Promise<string>;
192
+ /**
193
+ * Get Allower Swapper (if set this is the only account which can use this exchange, else is set at address(0))
194
+ * @param {String} exchangeId ExchangeId
195
+ * @return {Promise<string>} address of allowedSwapper
196
+ */
70
197
  getAllowedSwapper(exchangeId: string): Promise<string>;
71
- getAmountBTIn(exchangeId: string, datatokenAmount: string): Promise<string>;
198
+ /**
199
+ * calcBaseInGivenOutDT - Calculates how many base tokens are needed to get specified amount of datatokens
200
+ * @param {String} exchangeId ExchangeId
201
+ * @param {string} datatokenAmount Amount of datatokens user wants to buy
202
+ * @return {Promise<PriceAndFees>} how many base tokens are needed and fees
203
+ */
204
+ calcBaseInGivenOutDT(exchangeId: string, datatokenAmount: string): Promise<PriceAndFees>;
205
+ /**
206
+ * getBTOut - returns amount in baseToken that user will receive for datatokenAmount sold
207
+ * @param {String} exchangeId ExchangeId
208
+ * @param {Number} datatokenAmount Amount of datatokens
209
+ * @return {Promise<string>} Amount of baseTokens user will receive
210
+ */
72
211
  getAmountBTOut(exchangeId: string, datatokenAmount: string): Promise<string>;
212
+ /**
213
+ * Get exchange details
214
+ * @param {String} exchangeId ExchangeId
215
+ * @return {Promise<FixedPricedExchange>} Exchange details
216
+ */
73
217
  getExchange(exchangeId: string): Promise<FixedPriceExchange>;
218
+ /**
219
+ * Get fee details for an exchange
220
+ * @param {String} exchangeId ExchangeId
221
+ * @return {Promise<FixedPricedExchange>} Exchange details
222
+ */
74
223
  getFeesInfo(exchangeId: string): Promise<FeesInfo>;
224
+ /**
225
+ * Get all exchanges
226
+ * @param {String} exchangeId ExchangeId
227
+ * @return {Promise<String[]>} Exchanges list
228
+ */
75
229
  getExchanges(): Promise<string[]>;
230
+ /**
231
+ * Check if an exchange is active
232
+ * @param {String} exchangeId ExchangeId
233
+ * @return {Promise<Boolean>} Result
234
+ */
76
235
  isActive(exchangeId: string): Promise<boolean>;
236
+ /**
237
+ * Estimate gas cost for activate
238
+ * @param {String} account
239
+ * @param {String} exchangeId ExchangeId
240
+ * @param {Contract} contractInstance optional contract instance
241
+ * @return {Promise<number>}
242
+ */
77
243
  estActivateMint(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
244
+ /**
245
+ * Activate minting option for fixed rate contract
246
+ * @param {String} exchangeId ExchangeId
247
+ * @param {String} address User address
248
+ * @return {Promise<TransactionReceipt>} transaction receipt
249
+ */
78
250
  activateMint(address: string, exchangeId: string): Promise<TransactionReceipt>;
251
+ /**
252
+ * Estimate gas cost for deactivate
253
+ * @param {String} account
254
+ * @param {String} exchangeId ExchangeId
255
+ * @param {Contract} contractInstance optional contract instance
256
+ * @return {Promise<number>}
257
+ */
79
258
  estDeactivateMint(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
259
+ /**
260
+ * Deactivate minting for fixed rate
261
+ * @param {String} exchangeId ExchangeId
262
+ * @param {String} address User address
263
+ * @return {Promise<TransactionReceipt>} transaction receipt
264
+ */
80
265
  deactivateMint(address: string, exchangeId: string): Promise<TransactionReceipt>;
266
+ /**
267
+ * Estimate gas cost for collectBT
268
+ * @param {String} account
269
+ * @param {String} exchangeId ExchangeId
270
+ * @param {Contract} contractInstance optional contract instance
271
+ * @return {Promise<number>}
272
+ */
81
273
  estCollectBT(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
274
+ /**
275
+ * Collect BaseTokens in the contract (only exchange owner)
276
+ * @param {String} exchangeId ExchangeId
277
+ * @param {String} address User address
278
+ * @return {Promise<TransactionReceipt>} transaction receipt
279
+ */
82
280
  collectBT(address: string, exchangeId: string): Promise<TransactionReceipt>;
281
+ /**
282
+ * Estimate gas cost for collecDT
283
+ * @param {String} account
284
+ * @param {String} exchangeId ExchangeId
285
+ * @param {Contract} contractInstance optional contract instance
286
+ * @return {Promise<number>}
287
+ */
83
288
  estCollectDT(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
289
+ /**
290
+ * Collect datatokens in the contract (only exchange owner)
291
+ * @param {String} exchangeId ExchangeId
292
+ * @param {String} address User address
293
+ * @return {Promise<TransactionReceipt>} transaction receipt
294
+ */
84
295
  collectDT(address: string, exchangeId: string): Promise<TransactionReceipt>;
296
+ /**
297
+ * Estimate gas cost for collecMarketFee
298
+ * @param {String} account
299
+ * @param {String} exchangeId ExchangeId
300
+ * @param {Contract} contractInstance optional contract instance
301
+ * @return {Promise<number>}
302
+ */
85
303
  estCollectMarketFee(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
304
+ /**
305
+ * Collect market fee and send it to marketFeeCollector (anyone can call it)
306
+ * @param {String} exchangeId ExchangeId
307
+ * @param {String} address User address
308
+ * @return {Promise<TransactionReceipt>} transaction receipt
309
+ */
86
310
  collectMarketFee(address: string, exchangeId: string): Promise<TransactionReceipt>;
311
+ /**
312
+ * Estimate gas cost for collectOceanFee
313
+ * @param {String} account
314
+ * @param {String} exchangeId ExchangeId
315
+ * @param {Contract} contractInstance optional contract instance
316
+ * @return {Promise<number>}
317
+ */
87
318
  estCollectOceanFee(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
319
+ /**
320
+ * Collect ocean fee and send it to OPF collector (anyone can call it)
321
+ * @param {String} exchangeId ExchangeId
322
+ * @param {String} address User address
323
+ * @return {Promise<TransactionReceipt>} transaction receipt
324
+ */
88
325
  collectOceanFee(address: string, exchangeId: string): Promise<TransactionReceipt>;
326
+ /**
327
+ * Get OPF Collector of fixed rate contract
328
+ * @return {String}
329
+ */
89
330
  getOPCCollector(): Promise<string>;
331
+ /**
332
+ * Get Router address set in fixed rate contract
333
+ * @return {String}
334
+ */
90
335
  getRouter(): Promise<string>;
336
+ /**
337
+ * Get Exchange Owner given an exchangeId
338
+ * @param {String} exchangeId ExchangeId
339
+ * @return {String} return exchange owner
340
+ */
91
341
  getExchangeOwner(exchangeId: string): Promise<string>;
342
+ /**
343
+ * Estimate gas cost for updateMarketFee
344
+ * @param {String} account
345
+ * @param {String} exchangeId ExchangeId
346
+ * @param {String} newMarketFee New market fee
347
+ * @param {Contract} contractInstance optional contract instance
348
+ * @return {Promise<number>}
349
+ */
92
350
  estUpdateMarketFee(account: string, exchangeId: string, newMarketFee: string, contractInstance?: Contract): Promise<number>;
351
+ /**
352
+ * Set new market fee, only market fee collector can update it
353
+ * @param {String} address user address
354
+ * @param {String} exchangeId ExchangeId
355
+ * @param {String} newMarketFee New market fee
356
+ * @return {Promise<TransactionReceipt>} transaction receipt
357
+ */
93
358
  updateMarketFee(address: string, exchangeId: string, newMarketFee: string): Promise<TransactionReceipt>;
359
+ /**
360
+ * Estimate gas cost for updateMarketFeeCollector
361
+ * @param {String} account
362
+ * @param {String} exchangeId ExchangeId
363
+ * @param {String} newMarketFee New market fee collector
364
+ * @param {Contract} contractInstance optional contract instance
365
+ * @return {Promise<number>}
366
+ */
94
367
  estUpdateMarketFeeCollector(account: string, exchangeId: string, newMarketFeeCollector: string, contractInstance?: Contract): Promise<number>;
368
+ /**
369
+ * Set new market fee collector, only market fee collector can update it
370
+ * @param {String} address user address
371
+ * @param {String} exchangeId ExchangeId
372
+ * @param {String} newMarketFeeCollector New market fee collector
373
+ * @return {Promise<TransactionReceipt>} transaction receipt
374
+ */
95
375
  updateMarketFeeCollector(address: string, exchangeId: string, newMarketFeeCollector: string): Promise<TransactionReceipt>;
96
376
  }
@@ -11,20 +11,122 @@ export declare class SideStaking {
11
11
  constructor(web3: Web3, ssAbi?: AbiItem | AbiItem[], config?: Config);
12
12
  amountToUnits(token: string, amount: string): Promise<string>;
13
13
  unitsToAmount(token: string, amount: string): Promise<string>;
14
+ /**
15
+ * Get (total vesting amount + token released from the contract when adding liquidity)
16
+ * @param {String} ssAddress side staking contract address
17
+ * @param {String} datatokenAddress datatoken address
18
+ * @return {String}
19
+ */
14
20
  getDatatokenCirculatingSupply(ssAddress: string, datatokenAddress: string): Promise<string>;
21
+ /**
22
+ * Get actual dts in circulation (vested token withdrawn from the contract +
23
+ token released from the contract when adding liquidity)
24
+ * @param {String} ssAddress side staking contract address
25
+ * @param {String} datatokenAddress datatoken address
26
+ * @return {String}
27
+ */
15
28
  getDatatokenCurrentCirculatingSupply(ssAddress: string, datatokenAddress: string): Promise<string>;
29
+ /**
30
+ * Get Publisher address
31
+ * @param {String} ssAddress side staking contract address
32
+ * @param {String} datatokenAddress datatoken address
33
+ * @return {String}
34
+ */
16
35
  getPublisherAddress(ssAddress: string, datatokenAddress: string): Promise<string>;
36
+ /**
37
+ * Get
38
+ * @param {String} ssAddress side staking contract address
39
+ * @param {String} datatokenAddress datatokenAddress
40
+ * @return {String}
41
+ */
17
42
  getBaseToken(ssAddress: string, datatokenAddress: string): Promise<string>;
43
+ /**
44
+ * Get Pool Address
45
+ * @param {String} ssAddress side staking contract address
46
+ * @param {String} datatokenAddress datatokenAddress
47
+ * @return {String}
48
+ */
18
49
  getPoolAddress(ssAddress: string, datatokenAddress: string): Promise<string>;
50
+ /**
51
+ * Get baseToken balance in the contract
52
+ * @param {String} ssAddress side staking contract address
53
+ * @param {String} datatokenAddress datatokenAddress
54
+ * @return {String}
55
+ */
19
56
  getBaseTokenBalance(ssAddress: string, datatokenAddress: string): Promise<string>;
57
+ /**
58
+ * Get dt balance in the staking contract available for being added as liquidity
59
+ * @param {String} ssAddress side staking contract address
60
+ * @param {String} datatokenAddress datatokenAddress
61
+ * @return {String}
62
+ */
20
63
  getDatatokenBalance(ssAddress: string, datatokenAddress: string): Promise<string>;
64
+ /**
65
+ * Get block when vesting ends
66
+ * @param {String} ssAddress side staking contract address
67
+ * @param {String} datatokenAddress datatokenAddress
68
+ * @return {String} end block for vesting amount
69
+ */
21
70
  getvestingEndBlock(ssAddress: string, datatokenAddress: string): Promise<string>;
71
+ /**
72
+ * Get total amount vesting
73
+ * @param {String} ssAddress side staking contract address
74
+ * @param {String} datatokenAddress datatokenAddress
75
+ * @return {String}
76
+ */
22
77
  getvestingAmount(ssAddress: string, datatokenAddress: string): Promise<string>;
78
+ /**
79
+ * Get last block publisher got some vested tokens
80
+ * @param {String} ssAddress side staking contract address
81
+ * @param {String} datatokenAddress datatokenAddress
82
+ * @return {String}
83
+ */
23
84
  getvestingLastBlock(ssAddress: string, datatokenAddress: string): Promise<string>;
85
+ /**
86
+ * Get how much has been taken from the vesting amount
87
+ * @param {String} ssAddress side staking contract address
88
+ * @param {String} datatokenAddress datatokenAddress
89
+ * @return {String}
90
+ */
24
91
  getvestingAmountSoFar(ssAddress: string, datatokenAddress: string): Promise<string>;
92
+ /**
93
+ * Estimate gas cost for getVesting
94
+ * @param {String} account
95
+ * @param {String} ssAddress side staking contract address
96
+ * @param {String} datatokenAddress datatokenAddress
97
+ * @param {Contract} contractInstance optional contract instance
98
+ * @return {Promise<number>}
99
+ */
25
100
  estGetVesting(account: string, ssAddress: string, datatokenAddress: string, contractInstance?: Contract): Promise<number>;
101
+ /** Send vested tokens available to the publisher address, can be called by anyone
102
+ *
103
+ * @param {String} account
104
+ * @param {String} ssAddress side staking contract address
105
+ * @param {String} datatokenAddress datatokenAddress
106
+ * @return {TransactionReceipt}
107
+ */
26
108
  getVesting(account: string, ssAddress: string, datatokenAddress: string): Promise<TransactionReceipt>;
109
+ /**
110
+ * Estimate gas cost for getVesting
111
+ * @param {String} account
112
+ * @param {String} ssAddress side staking contract address
113
+ * @param {String} datatokenAddress datatokenAddress
114
+ * @param {Contract} contractInstance optional contract instance
115
+ * @return {Promise<number>}
116
+ */
27
117
  estSetPoolSwapFee(account: string, ssAddress: string, datatokenAddress: string, poolAddress: string, swapFee: number, contractInstance?: Contract): Promise<number>;
118
+ /** Send vested tokens available to the publisher address, can be called by anyone
119
+ *
120
+ * @param {String} account
121
+ * @param {String} ssAddress side staking contract address
122
+ * @param {String} datatokenAddress datatokenAddress
123
+ * @return {TransactionReceipt}
124
+ */
28
125
  setPoolSwapFee(account: string, ssAddress: string, datatokenAddress: string, poolAddress: string, swapFee: number): Promise<TransactionReceipt>;
126
+ /**
127
+ * Get Router address set in side staking contract
128
+ * @param {String} ssAddress side staking contract address
129
+ * @return {String}
130
+ */
29
131
  getRouter(ssAddress: string): Promise<string>;
30
132
  }
@@ -1,5 +1,5 @@
1
1
  import Web3 from 'web3';
2
- import { FileMetadata, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ProviderInitialize } from '../@types/';
2
+ import { FileMetadata, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ProviderInitialize } from '../@types/';
3
3
  import { DownloadResponse } from '../@types/DownloadResponse';
4
4
  export interface HttpCallback {
5
5
  (httpMethod: string, url: string, body: string, header: any): Promise<any>;
@@ -13,22 +13,134 @@ export interface UserCustomParameters {
13
13
  [key: string]: any;
14
14
  }
15
15
  export declare class Provider {
16
+ /**
17
+ * Returns the provider endpoints
18
+ * @return {Promise<ServiceEndpoint[]>}
19
+ */
16
20
  getEndpoints(providerUri: string): Promise<any>;
17
21
  getEndpointURL(servicesEndpoints: ServiceEndpoint[], serviceName: string): ServiceEndpoint;
22
+ /**
23
+ * Returns the service endpoints that exist in provider.
24
+ * @param {any} endpoints
25
+ * @return {Promise<ServiceEndpoint[]>}
26
+ */
18
27
  getServiceEndpoints(providerEndpoint: string, endpoints: any): Promise<ServiceEndpoint[]>;
28
+ /** Encrypt DDO using the Provider's own symmetric key
29
+ * @param {string} providerUri provider uri address
30
+ * @param {string} consumerAddress Publisher address
31
+ * @param {AbortSignal} signal abort signal
32
+ * @param {string} providerEndpoints Identifier of the asset to be registered in ocean
33
+ * @param {string} serviceEndpoints document description object (DDO)=
34
+ * @return {Promise<string>} urlDetails
35
+ */
19
36
  getNonce(providerUri: string, consumerAddress: string, signal?: AbortSignal, providerEndpoints?: any, serviceEndpoints?: ServiceEndpoint[]): Promise<string>;
20
37
  createSignature(web3: Web3, accountId: string, agreementId: string): Promise<string>;
21
38
  createHashSignature(web3: Web3, accountId: string, message: string): Promise<string>;
39
+ /** Encrypt data using the Provider's own symmetric key
40
+ * @param {string} data data in json format that needs to be sent , it can either be a DDO or a File array
41
+ * @param {string} providerUri provider uri address
42
+ * @param {AbortSignal} signal abort signal
43
+ * @return {Promise<string>} urlDetails
44
+ */
22
45
  encrypt(data: any, providerUri: string, signal?: AbortSignal): Promise<string>;
46
+ /** Get DDO File details (if possible)
47
+ * @param {string} did did
48
+ * @param {number} serviceId the id of the service for which to check the files
49
+ * @param {string} providerUri uri of the provider that will be used to check the file
50
+ * @param {AbortSignal} signal abort signal
51
+ * @return {Promise<FileMetadata[]>} urlDetails
52
+ */
23
53
  checkDidFiles(did: string, serviceId: number, providerUri: string, signal?: AbortSignal): Promise<FileMetadata[]>;
54
+ /** Get URL details (if possible)
55
+ * @param {string} url or did
56
+ * @param {string} providerUri uri of the provider that will be used to check the file
57
+ * @param {AbortSignal} signal abort signal
58
+ * @return {Promise<FileMetadata[]>} urlDetails
59
+ */
24
60
  checkFileUrl(url: string, providerUri: string, signal?: AbortSignal): Promise<FileMetadata[]>;
61
+ /** Get Compute Environments
62
+ * @return {Promise<ComputeEnvironment[]>} urlDetails
63
+ */
64
+ getComputeEnvironments(providerUri: string, signal?: AbortSignal): Promise<ComputeEnvironment[]>;
65
+ /** Initialize a service request.
66
+ * @param {DDO | string} asset
67
+ * @param {number} serviceIndex
68
+ * @param {string} serviceType
69
+ * @param {string} consumerAddress
70
+ * @param {UserCustomParameters} userCustomParameters
71
+ * @param {string} providerUri Identifier of the asset to be registered in ocean
72
+ * @param {AbortSignal} signal abort signal
73
+ * @return {Promise<ProviderInitialize>} ProviderInitialize data
74
+ */
25
75
  initialize(did: string, serviceId: string, fileIndex: number, consumerAddress: string, providerUri: string, signal?: AbortSignal, userCustomParameters?: UserCustomParameters, computeEnv?: string, validUntil?: number): Promise<ProviderInitialize>;
76
+ /** Gets fully signed URL for download
77
+ * @param {string} did
78
+ * @param {string} accountId
79
+ * @param {string} serviceId
80
+ * @param {number} fileIndex
81
+ * @param {string} providerUri
82
+ * @param {Web3} web3
83
+ * @param {UserCustomParameters} userCustomParameters
84
+ * @return {Promise<string>}
85
+ */
26
86
  getDownloadUrl(did: string, accountId: string, serviceId: string, fileIndex: number, transferTxId: string, providerUri: string, web3: Web3, userCustomParameters?: UserCustomParameters): Promise<any>;
87
+ /** Instruct the provider to start a compute job
88
+ * @param {string} did
89
+ * @param {string} consumerAddress
90
+ * @param {string} computeEnv
91
+ * @param {ComputeAlgorithm} algorithm
92
+ * @param {string} providerUri
93
+ * @param {Web3} web3
94
+ * @param {AbortSignal} signal abort signal
95
+ * @param {ComputeOutput} output
96
+ * @return {Promise<ComputeJob | ComputeJob[]>}
97
+ */
27
98
  computeStart(providerUri: string, web3: Web3, consumerAddress: string, computeEnv: string, dataset: ComputeAsset, algorithm: ComputeAlgorithm, signal?: AbortSignal, additionalDatasets?: ComputeAsset[], output?: ComputeOutput): Promise<ComputeJob | ComputeJob[]>;
99
+ /** Instruct the provider to Stop the execution of a to stop a compute job.
100
+ * @param {string} did
101
+ * @param {string} consumerAddress
102
+ * @param {string} jobId
103
+ * @param {string} providerUri
104
+ * @param {Web3} web3
105
+ * @param {AbortSignal} signal abort signal
106
+ * @return {Promise<ComputeJob | ComputeJob[]>}
107
+ */
28
108
  computeStop(did: string, consumerAddress: string, jobId: string, providerUri: string, web3: Web3, signal?: AbortSignal): Promise<ComputeJob | ComputeJob[]>;
109
+ /** Get status for a specific jobId/documentId/owner.
110
+ * @param {string} did
111
+ * @param {string} consumerAddress
112
+ * @param {string} providerUri
113
+ * @param {Web3} web3
114
+ * @param {AbortSignal} signal abort signal
115
+ * @param {string} jobId
116
+ * @return {Promise<ComputeJob | ComputeJob[]>}
117
+ */
29
118
  computeStatus(providerUri: string, signal?: AbortSignal, jobId?: string, did?: string, consumerAddress?: string): Promise<ComputeJob | ComputeJob[]>;
119
+ /** Get status for a specific jobId/documentId/owner.
120
+ * @param {string} jobId
121
+ * @param {number} index
122
+ * @param {string} providerUri
123
+ * @param {string} destination
124
+ * @param {Web3} web3
125
+ * @param {AbortSignal} signal abort signal
126
+ * @return {Promise<ComputeJob | ComputeJob[]>}
127
+ */
30
128
  computeResult(jobId: string, index: number, accountId: string, providerUri: string, web3: Web3, signal?: AbortSignal): Promise<DownloadResponse | void>;
129
+ /** Deletes a compute job.
130
+ * @param {string} did
131
+ * @param {string} consumerAddress
132
+ * @param {string} jobId
133
+ * @param {string} providerUri
134
+ * @param {Web3} web3
135
+ * @param {AbortSignal} signal abort signal
136
+ * @return {Promise<ComputeJob | ComputeJob[]>}
137
+ */
31
138
  computeDelete(did: string, consumerAddress: string, jobId: string, providerUri: string, web3: Web3, signal?: AbortSignal): Promise<ComputeJob | ComputeJob[]>;
139
+ /** Check for a valid provider at URL
140
+ * @param {String} url provider uri address
141
+ * @param {AbortSignal} signal abort signal
142
+ * @return {Promise<boolean>} string
143
+ */
32
144
  isValidProvider(url: string, signal?: AbortSignal): Promise<boolean>;
33
145
  }
34
146
  export declare const ProviderInstance: Provider;