@oceanprotocol/lib 1.1.7 → 2.0.0-next.2

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