@oceanprotocol/lib 1.0.0-next.2 → 1.0.0-next.20

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 (55) hide show
  1. package/CHANGELOG.md +163 -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/@types/DownloadResponse.d.ts +4 -0
  18. package/dist/src/{interfaces/Erc20Interface.d.ts → @types/Erc20.d.ts} +5 -0
  19. package/dist/src/@types/Erc721.d.ts +12 -0
  20. package/dist/src/@types/FileMetadata.d.ts +30 -0
  21. package/dist/src/{interfaces/FixedRateInterface.d.ts → @types/FixedPrice.d.ts} +8 -2
  22. package/dist/src/{interfaces/PoolInterface.d.ts → @types/Pool.d.ts} +13 -6
  23. package/dist/src/@types/Provider.d.ts +3 -2
  24. package/dist/src/@types/Router.d.ts +59 -0
  25. package/dist/src/@types/index.d.ts +6 -0
  26. package/dist/src/aquarius/Aquarius.d.ts +26 -4
  27. package/dist/src/factories/NFTFactory.d.ts +222 -18
  28. package/dist/src/index.d.ts +1 -1
  29. package/dist/src/models/Config.d.ts +132 -0
  30. package/dist/src/pools/Router.d.ts +190 -7
  31. package/dist/src/pools/balancer/Pool.d.ts +381 -26
  32. package/dist/src/pools/dispenser/Dispenser.d.ts +112 -3
  33. package/dist/src/pools/fixedRate/FixedRateExchange.d.ts +304 -13
  34. package/dist/src/pools/ssContracts/SideStaking.d.ts +109 -5
  35. package/dist/src/provider/Provider.d.ts +128 -12
  36. package/dist/src/tokens/Datatoken.d.ts +301 -13
  37. package/dist/src/tokens/NFT.d.ts +301 -3
  38. package/dist/src/utils/ConfigHelper.d.ts +1 -1
  39. package/dist/src/utils/Constants.d.ts +1 -0
  40. package/dist/src/utils/ContractUtils.d.ts +12 -0
  41. package/dist/src/utils/DatatokenName.d.ts +4 -0
  42. package/dist/src/utils/FetchHelper.d.ts +3 -2
  43. package/dist/src/utils/General.d.ts +4 -0
  44. package/dist/src/utils/TokenUtils.d.ts +39 -0
  45. package/dist/src/utils/index.d.ts +3 -2
  46. package/dist/src/utils/minAbi.d.ts +2 -0
  47. package/docs/beginners_guide.md +4 -4
  48. package/docs/overview.md +100 -9
  49. package/docs/quickstart_marketplace.md +34 -33
  50. package/docs/quickstart_simple.md +18 -16
  51. package/package.json +24 -23
  52. package/dist/src/interfaces/RouterInterface.d.ts +0 -12
  53. package/dist/src/interfaces/index.d.ts +0 -5
  54. package/dist/src/utils/ContractParams.d.ts +0 -4
  55. package/dist/src/utils/GasUtils.d.ts +0 -2
@@ -2,10 +2,12 @@ import { TransactionReceipt } from 'web3-core';
2
2
  import { Contract } from 'web3-eth-contract';
3
3
  import { AbiItem } from 'web3-utils/types';
4
4
  import Web3 from 'web3';
5
+ import { Config } from '../../models/index.js';
6
+ import { PriceAndFees } from '../..';
5
7
  export interface FixedPriceExchange {
6
8
  active: boolean;
7
9
  exchangeOwner: string;
8
- dataToken: string;
10
+ datatoken: string;
9
11
  baseToken: string;
10
12
  fixedRate: string;
11
13
  dtDecimals: string;
@@ -19,7 +21,7 @@ export interface FixedPriceExchange {
19
21
  exchangeId?: string;
20
22
  }
21
23
  export interface FeesInfo {
22
- opfFee: string;
24
+ opcFee: string;
23
25
  marketFee: string;
24
26
  marketFeeCollector: string;
25
27
  marketFeeAvailable: string;
@@ -30,7 +32,7 @@ export interface FixedPriceSwap {
30
32
  exchangeId: string;
31
33
  caller: string;
32
34
  baseTokenAmount: string;
33
- dataTokenAmount: string;
35
+ datatokenAmount: string;
34
36
  }
35
37
  export declare enum FixedRateCreateProgressStep {
36
38
  CreatingExchange = 0,
@@ -38,58 +40,347 @@ export declare enum FixedRateCreateProgressStep {
38
40
  }
39
41
  export declare class FixedRateExchange {
40
42
  GASLIMIT_DEFAULT: number;
43
+ /** Ocean related functions */
41
44
  oceanAddress: string;
42
45
  fixedRateAddress: string;
43
46
  fixedRateExchangeAbi: AbiItem | AbiItem[];
44
47
  fixedRateContract: Contract;
45
48
  web3: Web3;
46
49
  contract: Contract;
47
- startBlock: number;
50
+ config: Config;
48
51
  ssAbi: AbiItem | AbiItem[];
49
- constructor(web3: Web3, fixedRateAddress: string, fixedRateExchangeAbi?: AbiItem | AbiItem[], oceanAddress?: string, startBlock?: number);
52
+ /**
53
+ * Instantiate FixedRateExchange
54
+ * @param {any} web3
55
+ * @param {any} fixedRateExchangeAbi
56
+ */
57
+ constructor(web3: Web3, fixedRateAddress: string, fixedRateExchangeAbi?: AbiItem | AbiItem[], oceanAddress?: string, config?: Config);
50
58
  amountToUnits(token: string, amount: string): Promise<string>;
51
59
  unitsToAmount(token: string, amount: string): Promise<string>;
52
- generateExchangeId(basetoken: string, dataToken: string, owner: string): Promise<string>;
53
- estBuyDT(account: string, datatokenAddress: string, dtAmount: string, maxBasetokenAmount: string, contractInstance?: Contract): Promise<number>;
54
- buyDT(address: string, exchangeId: string, datatokenAmount: string, maxBasetokenAmount: string): Promise<TransactionReceipt>;
55
- estSellDT(account: string, datatokenAddress: string, dtAmount: string, maxBasetokenAmount: string, contractInstance?: Contract): Promise<number>;
56
- sellDT(address: string, exchangeId: string, datatokenAmount: string, minBasetokenAmount: string): Promise<TransactionReceipt>;
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
+ */
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 {String} consumeMarketAddress consumeMarketAddress
73
+ * @param {String} consumeMarketFee fee recieved by the consume market when a dt is bought from a fixed rate exchange, percent
74
+ * @param {Contract} contractInstance optional contract instance
75
+ * @return {Promise<number>}
76
+ */
77
+ estBuyDT(account: string, datatokenAddress: string, dtAmount: string, maxBaseTokenAmount: string, consumeMarketAddress: string, consumeMarketFee: string, contractInstance?: Contract): Promise<number>;
78
+ /**
79
+ * Atomic swap
80
+ * @param {String} exchangeId ExchangeId
81
+ * @param {String} datatokenAmount Amount of datatokens
82
+ * @param {String} maxBaseTokenAmount max amount of baseToken we want to pay for datatokenAmount
83
+ * @param {String} address User address
84
+ * @param {String} consumeMarketAddress consumeMarketAddress
85
+ * @param {String} consumeMarketFee consumeMarketFee
86
+ * @return {Promise<TransactionReceipt>} transaction receipt
87
+ */
88
+ buyDT(address: string, exchangeId: string, datatokenAmount: string, maxBaseTokenAmount: string, consumeMarketAddress?: string, consumeMarketFee?: string): Promise<TransactionReceipt>;
89
+ /**
90
+ * Estimate gas cost for sellDT
91
+ * @param {String} account
92
+ * @param {String} dtAmount datatoken amount we want to sell
93
+ * @param {String} datatokenAddress datatokenAddress
94
+ * @param {String} consumeMarketAddress consumeMarketAddress
95
+ * @param {String} consumeMarketFee consumeMarketFee
96
+ * @param {Contract} contractInstance optional contract instance
97
+ * @return {Promise<number>}
98
+ */
99
+ estSellDT(account: string, datatokenAddress: string, dtAmount: string, maxBaseTokenAmount: string, consumeMarketAddress: string, consumeMarketFee: string, contractInstance?: Contract): Promise<number>;
100
+ /**
101
+ * Atomic swap
102
+ * @param {String} exchangeId ExchangeId
103
+ * @param {String} datatokenAmount Amount of datatokens
104
+ * @param {String} minBaseTokenAmount min amount of baseToken we want to receive back
105
+ * @param {String} address User address
106
+ * @param {String} consumeMarketAddress consumeMarketAddress
107
+ * @param {String} consumeMarketFee consumeMarketFee
108
+ * @return {Promise<TransactionReceipt>} transaction receipt
109
+ */
110
+ sellDT(address: string, exchangeId: string, datatokenAmount: string, minBaseTokenAmount: string, consumeMarketAddress?: string, consumeMarketFee?: string): Promise<TransactionReceipt>;
111
+ /**
112
+ * Gets total number of exchanges
113
+ * @param {String} exchangeId ExchangeId
114
+ * @param {Number} datatokenAmount Amount of datatokens
115
+ * @return {Promise<Number>} no of available exchanges
116
+ */
57
117
  getNumberOfExchanges(): Promise<number>;
118
+ /**
119
+ * Estimate gas cost for setRate
120
+ * @param {String} account
121
+ * @param {String} exchangeId ExchangeId
122
+ * @param {Number} newRate New rate
123
+ * @param {Contract} contractInstance optional contract instance
124
+ * @return {Promise<number>}
125
+ */
58
126
  estSetRate(account: string, exchangeId: string, newRate: string, contractInstance?: Contract): Promise<number>;
127
+ /**
128
+ * Set new rate
129
+ * @param {String} exchangeId ExchangeId
130
+ * @param {Number} newRate New rate
131
+ * @param {String} address User account
132
+ * @return {Promise<TransactionReceipt>} transaction receipt
133
+ */
59
134
  setRate(address: string, exchangeId: string, newRate: string): Promise<TransactionReceipt>;
135
+ /**
136
+ * Estimate gas cost for setRate
137
+ * @param {String} account
138
+ * @param {String} exchangeId ExchangeId
139
+ * @param {String} newAllowedSwapper new allowed swapper address
140
+ * @param {Contract} contractInstance optional contract instance
141
+ * @return {Promise<number>}
142
+ */
60
143
  estSetAllowedSwapper(account: string, exchangeId: string, newAllowedSwapper: string, contractInstance?: Contract): Promise<number>;
144
+ /**
145
+ * Set new rate
146
+ * @param {String} exchangeId ExchangeId
147
+ * @param {String} newAllowedSwapper newAllowedSwapper (set address zero if we want to remove allowed swapper)
148
+ * @param {String} address User account
149
+ * @return {Promise<TransactionReceipt>} transaction receipt
150
+ */
61
151
  setAllowedSwapper(address: string, exchangeId: string, newAllowedSwapper: string): Promise<TransactionReceipt>;
152
+ /**
153
+ * Estimate gas cost for activate
154
+ * @param {String} account
155
+ * @param {String} exchangeId ExchangeId
156
+ * @param {Contract} contractInstance optional contract instance
157
+ * @return {Promise<number>}
158
+ */
62
159
  estActivate(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
160
+ /**
161
+ * Activate an exchange
162
+ * @param {String} exchangeId ExchangeId
163
+ * @param {String} address User address
164
+ * @return {Promise<TransactionReceipt>} transaction receipt
165
+ */
63
166
  activate(address: string, exchangeId: string): Promise<TransactionReceipt>;
167
+ /**
168
+ * Estimate gas cost for deactivate
169
+ * @param {String} account
170
+ * @param {String} exchangeId ExchangeId
171
+ * @param {Contract} contractInstance optional contract instance
172
+ * @return {Promise<number>}
173
+ */
64
174
  estDeactivate(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
175
+ /**
176
+ * Deactivate an exchange
177
+ * @param {String} exchangeId ExchangeId
178
+ * @param {String} address User address
179
+ * @return {Promise<TransactionReceipt>} transaction receipt
180
+ */
65
181
  deactivate(address: string, exchangeId: string): Promise<TransactionReceipt>;
182
+ /**
183
+ * Get Rate
184
+ * @param {String} exchangeId ExchangeId
185
+ * @return {Promise<string>} Rate (converted from wei)
186
+ */
66
187
  getRate(exchangeId: string): Promise<string>;
188
+ /**
189
+ * Get Datatoken Supply in the exchange
190
+ * @param {String} exchangeId ExchangeId
191
+ * @return {Promise<string>} dt supply formatted
192
+ */
67
193
  getDTSupply(exchangeId: string): Promise<string>;
194
+ /**
195
+ * Get BaseToken Supply in the exchange
196
+ * @param {String} exchangeId ExchangeId
197
+ * @return {Promise<string>} dt supply formatted
198
+ */
68
199
  getBTSupply(exchangeId: string): Promise<string>;
200
+ /**
201
+ * Get Allower Swapper (if set this is the only account which can use this exchange, else is set at address(0))
202
+ * @param {String} exchangeId ExchangeId
203
+ * @return {Promise<string>} address of allowedSwapper
204
+ */
69
205
  getAllowedSwapper(exchangeId: string): Promise<string>;
70
- getAmountBTIn(exchangeId: string, dataTokenAmount: string): Promise<string>;
71
- getAmountBTOut(exchangeId: string, dataTokenAmount: string): Promise<string>;
206
+ /**
207
+ * calcBaseInGivenOutDT - Calculates how many base tokens are needed to get specified amount of datatokens
208
+ * @param {String} exchangeId ExchangeId
209
+ * @param {string} datatokenAmount Amount of datatokens user wants to buy
210
+ * @param {String} consumeMarketFee consumeMarketFee
211
+ * @return {Promise<PriceAndFees>} how many base tokens are needed and fees
212
+ */
213
+ calcBaseInGivenOutDT(exchangeId: string, datatokenAmount: string, consumeMarketFee?: string): Promise<PriceAndFees>;
214
+ /**
215
+ * getBTOut - returns amount in baseToken that user will receive for datatokenAmount sold
216
+ * @param {String} exchangeId ExchangeId
217
+ * @param {Number} datatokenAmount Amount of datatokens
218
+ * @param {String} consumeMarketFee consumeMarketFee
219
+ * @return {Promise<string>} Amount of baseTokens user will receive
220
+ */
221
+ getAmountBTOut(exchangeId: string, datatokenAmount: string, consumeMarketFee?: string): Promise<string>;
222
+ /**
223
+ * Get exchange details
224
+ * @param {String} exchangeId ExchangeId
225
+ * @return {Promise<FixedPricedExchange>} Exchange details
226
+ */
72
227
  getExchange(exchangeId: string): Promise<FixedPriceExchange>;
228
+ /**
229
+ * Get fee details for an exchange
230
+ * @param {String} exchangeId ExchangeId
231
+ * @return {Promise<FixedPricedExchange>} Exchange details
232
+ */
73
233
  getFeesInfo(exchangeId: string): Promise<FeesInfo>;
234
+ /**
235
+ * Get all exchanges
236
+ * @param {String} exchangeId ExchangeId
237
+ * @return {Promise<String[]>} Exchanges list
238
+ */
74
239
  getExchanges(): Promise<string[]>;
240
+ /**
241
+ * Check if an exchange is active
242
+ * @param {String} exchangeId ExchangeId
243
+ * @return {Promise<Boolean>} Result
244
+ */
75
245
  isActive(exchangeId: string): Promise<boolean>;
246
+ /**
247
+ * Estimate gas cost for activate
248
+ * @param {String} account
249
+ * @param {String} exchangeId ExchangeId
250
+ * @param {Contract} contractInstance optional contract instance
251
+ * @return {Promise<number>}
252
+ */
76
253
  estActivateMint(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
254
+ /**
255
+ * Activate minting option for fixed rate contract
256
+ * @param {String} exchangeId ExchangeId
257
+ * @param {String} address User address
258
+ * @return {Promise<TransactionReceipt>} transaction receipt
259
+ */
77
260
  activateMint(address: string, exchangeId: string): Promise<TransactionReceipt>;
261
+ /**
262
+ * Estimate gas cost for deactivate
263
+ * @param {String} account
264
+ * @param {String} exchangeId ExchangeId
265
+ * @param {Contract} contractInstance optional contract instance
266
+ * @return {Promise<number>}
267
+ */
78
268
  estDeactivateMint(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
269
+ /**
270
+ * Deactivate minting for fixed rate
271
+ * @param {String} exchangeId ExchangeId
272
+ * @param {String} address User address
273
+ * @return {Promise<TransactionReceipt>} transaction receipt
274
+ */
79
275
  deactivateMint(address: string, exchangeId: string): Promise<TransactionReceipt>;
276
+ /**
277
+ * Estimate gas cost for collectBT
278
+ * @param {String} account
279
+ * @param {String} exchangeId ExchangeId
280
+ * @param {Contract} contractInstance optional contract instance
281
+ * @return {Promise<number>}
282
+ */
80
283
  estCollectBT(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
284
+ /**
285
+ * Collect BaseTokens in the contract (only exchange owner)
286
+ * @param {String} exchangeId ExchangeId
287
+ * @param {String} address User address
288
+ * @return {Promise<TransactionReceipt>} transaction receipt
289
+ */
81
290
  collectBT(address: string, exchangeId: string): Promise<TransactionReceipt>;
291
+ /**
292
+ * Estimate gas cost for collecDT
293
+ * @param {String} account
294
+ * @param {String} exchangeId ExchangeId
295
+ * @param {Contract} contractInstance optional contract instance
296
+ * @return {Promise<number>}
297
+ */
82
298
  estCollectDT(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
299
+ /**
300
+ * Collect datatokens in the contract (only exchange owner)
301
+ * @param {String} exchangeId ExchangeId
302
+ * @param {String} address User address
303
+ * @return {Promise<TransactionReceipt>} transaction receipt
304
+ */
83
305
  collectDT(address: string, exchangeId: string): Promise<TransactionReceipt>;
306
+ /**
307
+ * Estimate gas cost for collecMarketFee
308
+ * @param {String} account
309
+ * @param {String} exchangeId ExchangeId
310
+ * @param {Contract} contractInstance optional contract instance
311
+ * @return {Promise<number>}
312
+ */
84
313
  estCollectMarketFee(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
314
+ /**
315
+ * Collect market fee and send it to marketFeeCollector (anyone can call it)
316
+ * @param {String} exchangeId ExchangeId
317
+ * @param {String} address User address
318
+ * @return {Promise<TransactionReceipt>} transaction receipt
319
+ */
85
320
  collectMarketFee(address: string, exchangeId: string): Promise<TransactionReceipt>;
321
+ /**
322
+ * Estimate gas cost for collectOceanFee
323
+ * @param {String} account
324
+ * @param {String} exchangeId ExchangeId
325
+ * @param {Contract} contractInstance optional contract instance
326
+ * @return {Promise<number>}
327
+ */
86
328
  estCollectOceanFee(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
329
+ /**
330
+ * Collect ocean fee and send it to OPF collector (anyone can call it)
331
+ * @param {String} exchangeId ExchangeId
332
+ * @param {String} address User address
333
+ * @return {Promise<TransactionReceipt>} transaction receipt
334
+ */
87
335
  collectOceanFee(address: string, exchangeId: string): Promise<TransactionReceipt>;
88
- getOPFCollector(): Promise<string>;
336
+ /**
337
+ * Get OPF Collector of fixed rate contract
338
+ * @return {String}
339
+ */
340
+ getOPCCollector(): Promise<string>;
341
+ /**
342
+ * Get Router address set in fixed rate contract
343
+ * @return {String}
344
+ */
89
345
  getRouter(): Promise<string>;
346
+ /**
347
+ * Get Exchange Owner given an exchangeId
348
+ * @param {String} exchangeId ExchangeId
349
+ * @return {String} return exchange owner
350
+ */
90
351
  getExchangeOwner(exchangeId: string): Promise<string>;
352
+ /**
353
+ * Estimate gas cost for updateMarketFee
354
+ * @param {String} account
355
+ * @param {String} exchangeId ExchangeId
356
+ * @param {String} newMarketFee New market fee
357
+ * @param {Contract} contractInstance optional contract instance
358
+ * @return {Promise<number>}
359
+ */
91
360
  estUpdateMarketFee(account: string, exchangeId: string, newMarketFee: string, contractInstance?: Contract): Promise<number>;
361
+ /**
362
+ * Set new market fee, only market fee collector can update it
363
+ * @param {String} address user address
364
+ * @param {String} exchangeId ExchangeId
365
+ * @param {String} newMarketFee New market fee
366
+ * @return {Promise<TransactionReceipt>} transaction receipt
367
+ */
92
368
  updateMarketFee(address: string, exchangeId: string, newMarketFee: string): Promise<TransactionReceipt>;
369
+ /**
370
+ * Estimate gas cost for updateMarketFeeCollector
371
+ * @param {String} account
372
+ * @param {String} exchangeId ExchangeId
373
+ * @param {String} newMarketFee New market fee collector
374
+ * @param {Contract} contractInstance optional contract instance
375
+ * @return {Promise<number>}
376
+ */
93
377
  estUpdateMarketFeeCollector(account: string, exchangeId: string, newMarketFeeCollector: string, contractInstance?: Contract): Promise<number>;
378
+ /**
379
+ * Set new market fee collector, only market fee collector can update it
380
+ * @param {String} address user address
381
+ * @param {String} exchangeId ExchangeId
382
+ * @param {String} newMarketFeeCollector New market fee collector
383
+ * @return {Promise<TransactionReceipt>} transaction receipt
384
+ */
94
385
  updateMarketFeeCollector(address: string, exchangeId: string, newMarketFeeCollector: string): Promise<TransactionReceipt>;
95
386
  }
@@ -2,27 +2,131 @@ import Web3 from 'web3';
2
2
  import { AbiItem } from 'web3-utils/types';
3
3
  import { TransactionReceipt } from 'web3-core';
4
4
  import { Contract } from 'web3-eth-contract';
5
+ import { Config } from '../../models';
5
6
  export declare class SideStaking {
6
7
  ssAbi: AbiItem | AbiItem[];
7
8
  web3: Web3;
8
9
  GASLIMIT_DEFAULT: number;
9
- constructor(web3: Web3, ssAbi?: AbiItem | AbiItem[]);
10
+ config: Config;
11
+ constructor(web3: Web3, ssAbi?: AbiItem | AbiItem[], config?: Config);
10
12
  amountToUnits(token: string, amount: string): Promise<string>;
11
13
  unitsToAmount(token: string, amount: string): Promise<string>;
12
- getDataTokenCirculatingSupply(ssAddress: string, datatokenAddress: string): Promise<string>;
13
- getDataTokenCurrentCirculatingSupply(ssAddress: string, datatokenAddress: 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
+ */
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
+ */
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
+ */
14
35
  getPublisherAddress(ssAddress: string, datatokenAddress: string): Promise<string>;
15
- getBasetoken(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
+ */
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
+ */
16
49
  getPoolAddress(ssAddress: string, datatokenAddress: string): Promise<string>;
17
- getBasetokenBalance(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
+ */
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
+ */
18
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
+ */
19
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
+ */
20
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
+ */
21
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
+ */
22
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
+ */
23
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
+ */
24
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
+ */
25
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
+ */
26
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
+ */
27
131
  getRouter(ssAddress: string): Promise<string>;
28
132
  }