@oceanprotocol/lib 3.3.0 → 3.3.1

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 (83) hide show
  1. package/.nvmrc +1 -1
  2. package/CHANGELOG.md +19 -16
  3. package/dist/lib.js +1 -1
  4. package/dist/lib.js.map +1 -1
  5. package/dist/lib.modern.js +1 -1
  6. package/dist/lib.modern.js.map +1 -1
  7. package/dist/lib.module.js +1 -1
  8. package/dist/lib.module.js.map +1 -1
  9. package/dist/lib.umd.js +1 -1
  10. package/dist/lib.umd.js.map +1 -1
  11. package/package.json +1 -1
  12. package/dist/src/@types/Asset.d.ts +0 -148
  13. package/dist/src/@types/Compute.d.ts +0 -71
  14. package/dist/src/@types/Contracts.d.ts +0 -26
  15. package/dist/src/@types/DDO/ConsumerParameter.d.ts +0 -37
  16. package/dist/src/@types/DDO/Credentials.d.ts +0 -8
  17. package/dist/src/@types/DDO/DDO.d.ts +0 -55
  18. package/dist/src/@types/DDO/Event.d.ts +0 -27
  19. package/dist/src/@types/DDO/Metadata.d.ts +0 -141
  20. package/dist/src/@types/DDO/Service.d.ts +0 -100
  21. package/dist/src/@types/Datatoken.d.ts +0 -38
  22. package/dist/src/@types/Dispenser.d.ts +0 -16
  23. package/dist/src/@types/DownloadResponse.d.ts +0 -4
  24. package/dist/src/@types/File.d.ts +0 -89
  25. package/dist/src/@types/FileInfo.d.ts +0 -43
  26. package/dist/src/@types/FixedPrice.d.ts +0 -51
  27. package/dist/src/@types/NFT.d.ts +0 -18
  28. package/dist/src/@types/NFTFactory.d.ts +0 -20
  29. package/dist/src/@types/Provider.d.ts +0 -33
  30. package/dist/src/@types/ReturnTypes.d.ts +0 -3
  31. package/dist/src/@types/Router.d.ts +0 -59
  32. package/dist/src/@types/index.d.ts +0 -20
  33. package/dist/src/config/Config.d.ts +0 -153
  34. package/dist/src/config/ConfigHelper.d.ts +0 -12
  35. package/dist/src/config/index.d.ts +0 -2
  36. package/dist/src/contracts/Datatoken.d.ts +0 -278
  37. package/dist/src/contracts/Dispenser.d.ts +0 -73
  38. package/dist/src/contracts/FixedRateExchange.d.ts +0 -209
  39. package/dist/src/contracts/NFT.d.ts +0 -220
  40. package/dist/src/contracts/NFTFactory.d.ts +0 -165
  41. package/dist/src/contracts/Router.d.ts +0 -107
  42. package/dist/src/contracts/SmartContract.d.ts +0 -45
  43. package/dist/src/contracts/SmartContractWithAddress.d.ts +0 -17
  44. package/dist/src/contracts/df/DfRewards.d.ts +0 -31
  45. package/dist/src/contracts/df/DfStrategyV1.d.ts +0 -21
  46. package/dist/src/contracts/index.d.ts +0 -14
  47. package/dist/src/contracts/ve/VeAllocate.d.ts +0 -38
  48. package/dist/src/contracts/ve/VeFeeDistributor.d.ts +0 -29
  49. package/dist/src/contracts/ve/VeFeeEstimate.d.ts +0 -14
  50. package/dist/src/contracts/ve/VeOcean.d.ts +0 -68
  51. package/dist/src/index.d.ts +0 -5
  52. package/dist/src/services/Aquarius.d.ts +0 -53
  53. package/dist/src/services/Provider.d.ts +0 -197
  54. package/dist/src/services/index.d.ts +0 -2
  55. package/dist/src/utils/Constants.d.ts +0 -4
  56. package/dist/src/utils/ContractUtils.d.ts +0 -46
  57. package/dist/src/utils/DatatokenName.d.ts +0 -14
  58. package/dist/src/utils/DdoHelpers.d.ts +0 -13
  59. package/dist/src/utils/FetchHelper.d.ts +0 -14
  60. package/dist/src/utils/General.d.ts +0 -5
  61. package/dist/src/utils/Logger.d.ts +0 -19
  62. package/dist/src/utils/OrderUtils.d.ts +0 -20
  63. package/dist/src/utils/ProviderErrors.d.ts +0 -1
  64. package/dist/src/utils/SignatureUtils.d.ts +0 -12
  65. package/dist/src/utils/TokenUtils.d.ts +0 -70
  66. package/dist/src/utils/index.d.ts +0 -12
  67. package/dist/src/utils/minAbi.d.ts +0 -38
  68. package/dist/test/config.d.ts +0 -19
  69. package/dist/test/integration/CodeExamples.test.d.ts +0 -1
  70. package/dist/test/integration/ComputeExamples.test.d.ts +0 -1
  71. package/dist/test/integration/ComputeFlow.test.d.ts +0 -1
  72. package/dist/test/integration/Provider.test.d.ts +0 -1
  73. package/dist/test/integration/PublishEditConsume.test.d.ts +0 -1
  74. package/dist/test/integration/PublishFlows.test.d.ts +0 -1
  75. package/dist/test/integration/helpers.d.ts +0 -7
  76. package/dist/test/unit/DFRewards.test.d.ts +0 -1
  77. package/dist/test/unit/Datatoken.test.d.ts +0 -1
  78. package/dist/test/unit/Dispenser.test.d.ts +0 -1
  79. package/dist/test/unit/FixedRateExchange.test.d.ts +0 -1
  80. package/dist/test/unit/Nft.test.d.ts +0 -1
  81. package/dist/test/unit/NftFactory.test.d.ts +0 -1
  82. package/dist/test/unit/Router.test.d.ts +0 -1
  83. package/dist/test/unit/veOcean.test.d.ts +0 -1
@@ -1,278 +0,0 @@
1
- import { Signer } from 'ethers';
2
- import { AbiItem, ConsumeMarketFee, FreOrderParams, FreCreationParams, ProviderFees, PublishingMarketFee, DispenserParams, OrderParams, DatatokenRoles, ReceiptOrEstimate } from '../@types';
3
- import { Nft } from './NFT';
4
- import { Config } from '../config';
5
- import { SmartContract } from './SmartContract';
6
- export declare class Datatoken extends SmartContract {
7
- abiEnterprise: AbiItem[];
8
- nft: Nft;
9
- getDefaultAbi(): AbiItem[];
10
- /**
11
- * Instantiate Datatoken class
12
- * @param {Signer} signer The signer object.
13
- * @param {string | number} [network] Network id or name
14
- * @param {Config} [config] The configuration object.
15
- * @param {AbiItem[]} [abi] ABI array of the smart contract
16
- * @param {AbiItem[]} abiEnterprise Enterprise ABI array of the smart contract
17
- */
18
- constructor(signer: Signer, network?: string | number, config?: Config, abi?: AbiItem[], abiEnterprise?: AbiItem[]);
19
- /**
20
- * Approves a spender to spend a certain amount of datatokens.
21
- * @param {String} dtAddress Datatoken address
22
- * @param {String} spender Spender address
23
- * @param {string} amount Number of datatokens, as number. Will be converted to wei
24
- * @param {Boolean} estimateGas if True, return gas estimate
25
- * @return {Promise<ReceiptOrEstimate>}
26
- */
27
- approve<G extends boolean = false>(dtAddress: string, spender: string, amount: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
28
- /**
29
- * Creates a new FixedRateExchange setup.
30
- * @param {String} dtAddress Datatoken address
31
- * @param {String} address Caller address
32
- * @param {FixedRateParams} fixedRateParams The parameters required to create a fixed-rate exchange contract.
33
- * @param {Boolean} estimateGas if True, return gas estimate
34
- * @return {Promise<ReceiptOrEstimate>}
35
- */
36
- createFixedRate<G extends boolean = false>(dtAddress: string, address: string, fixedRateParams: FreCreationParams, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
37
- /**
38
- * Creates a new Dispenser
39
- * @param {String} dtAddress Datatoken address
40
- * @param {String} address Caller address
41
- * @param {String} dispenserAddress Dispenser contract address
42
- * @param {DispenserParams} dispenserParams The parameters required to create a dispenser contract.
43
- * @param {Boolean} estimateGas if True, return gas estimate
44
- * @return {Promise<ReceiptOrEstimate>} transactionId
45
- */
46
- createDispenser<G extends boolean = false>(dtAddress: string, address: string, dispenserAddress: string, dispenserParams: DispenserParams, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
47
- /**
48
- * Mints datatokens
49
- * @param {String} dtAddress Datatoken address
50
- * @param {String} address Minter address
51
- * @param {String} amount Number of datatokens, as number. Will be converted to wei
52
- * @param {String} toAddress only if toAddress is different from the minter
53
- * @param {Boolean} estimateGas if True, return gas estimate
54
- * @return {Promise<ReceiptOrEstimate>} transactionId
55
- */
56
- mint<G extends boolean = false>(dtAddress: string, address: string, amount: string, toAddress?: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
57
- /**
58
- * Add Minter for an ERC20 Datatoken
59
- * only DatatokenDeployer can succeed
60
- * @param {String} dtAddress Datatoken address
61
- * @param {String} address caller address
62
- * @param {String} minter address which is going to be a Minter
63
- * @param {Boolean} estimateGas if True, return gas estimate
64
- * @return {Promise<ReceiptOrEstimate>} transactionId
65
- */
66
- addMinter<G extends boolean = false>(dtAddress: string, address: string, minter: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
67
- /**
68
- * Revoke Minter permission for an ERC20 Datatoken
69
- * only DatatokenDeployer can succeed
70
- * @param {String} dtAddress Datatoken address
71
- * @param {String} address caller address
72
- * @param {String} minter address which will have removed the Minter permission
73
- * @param {Boolean} estimateGas if True, return gas estimate
74
- * @return {Promise<ReceiptOrEstimate>}
75
- */
76
- removeMinter<G extends boolean = false>(dtAddress: string, address: string, minter: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
77
- /**
78
- * Adds a payment manager on a datatoken to a desired address.(can set who's going to collect fee when consuming orders)
79
- * only DatatokenDeployer can succeed
80
- * @param {String} dtAddress Datatoken address
81
- * @param {String} address Caller address
82
- * @param {String} paymentManager The address of the payment manager
83
- * @param {Boolean} estimateGas if True, return gas estimate
84
- * @return {Promise<ReceiptOrEstimate>} transactionId
85
- */
86
- addPaymentManager<G extends boolean = false>(dtAddress: string, address: string, paymentManager: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
87
- /**
88
- * Revoke paymentManager permission for an ERC20 Datatoken
89
- * only DatatokenDeployer can succeed
90
- * @param {String} dtAddress Datatoken address
91
- * @param {String} address User address
92
- * @param {String} paymentManager User which will be removed from paymentManager permission
93
- * @param {Boolean} estimateGas if True, return gas estimate
94
- * @return {Promise<ReceiptOrEstimate>} trxReceipt
95
- */
96
- removePaymentManager<G extends boolean = false>(dtAddress: string, address: string, paymentManager: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
97
- /**
98
- * This function allows to set a new PaymentCollector (receives DT when consuming)
99
- * If not set the paymentCollector is the NFT Owner
100
- * only NFT owner can call
101
- * @param dtAddress Datatoken address
102
- * @param address Caller address
103
- * @param paymentCollector User to be set as new payment collector
104
- * @param {Boolean} estimateGas if True, return gas estimate
105
- * @return {Promise<ReceiptOrEstimate>} trxReceipt
106
- */
107
- setPaymentCollector<G extends boolean = false>(dtAddress: string, address: string, paymentCollector: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
108
- /**
109
- * getPaymentCollector - It returns the current paymentCollector
110
- * @param dtAddress datatoken address
111
- * @return {Promise<string>}
112
- */
113
- getPaymentCollector(dtAddress: string): Promise<string>;
114
- /**
115
- * Transfer tokens(as number) from address to toAddress
116
- * @param {String} dtAddress Datatoken address
117
- * @param {String} toAddress Receiver address
118
- * @param {String} amount Number of datatokens, as number. Will be converted to wei.
119
- * @param {Boolean} estimateGas if True, return gas estimate
120
- * @return {Promise<ReceiptOrEstimate>} transactionId
121
- */
122
- transfer<G extends boolean = false>(dtAddress: string, toAddress: string, amount: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
123
- /**
124
- * Transfer in wei from address to toAddress
125
- * @param {String} dtAddress Datatoken address
126
- * @param {String} toAddress Receiver address
127
- * @param {String} amount Number of datatokens (number) expressed as wei
128
- * @param {Boolean} estimateGas if True, return gas estimate
129
- * @return {Promise<ReceiptOrEstimate>} transactionId
130
- */
131
- transferWei<G extends boolean = false>(dtAddress: string, toAddress: string, amount: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
132
- /**
133
- * Start Order: called by payer or consumer prior ordering a service consume on a marketplace.
134
- * @param {String} dtAddress Datatoken address
135
- * @param {String} consumer Consumer Address
136
- * @param {Number} serviceIndex Service index in the metadata
137
- * @param {providerFees} providerFees provider fees
138
- * @param {consumeMarketFee} ConsumeMarketFee consume market fees
139
- * @param {Boolean} estimateGas if True, return gas estimate
140
- * @return {Promise<ReceiptOrEstimate>} string
141
- */
142
- startOrder<G extends boolean = false>(dtAddress: string, consumer: string, serviceIndex: number, providerFees: ProviderFees, consumeMarketFee?: ConsumeMarketFee, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
143
- /**
144
- * Reuse Order: called by payer or consumer having a valid order, but with expired provider access.
145
- * Pays the provider fee again, but it will not require a new datatoken payment
146
- * Requires previous approval of provider fee.
147
- * @param {String} dtAddress Datatoken address
148
- * @param {String} orderTxId previous valid order
149
- * @param {providerFees} providerFees provider fees
150
- * @param {Boolean} estimateGas if True, return gas estimate
151
- * @return {Promise<ReceiptOrEstimate>} string
152
- */
153
- reuseOrder<G extends boolean = false>(dtAddress: string, orderTxId: string, providerFees: ProviderFees, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
154
- /**
155
- * Buys 1 DT from the FRE and then startsOrder, while burning that DT
156
- * @param {String} dtAddress Datatoken address
157
- * @param {OrderParams} orderParams The parameters required to place an order.
158
- * @param {FreParams} freParams The parameters required to buy from a fixed-rate exchange.
159
- * @param {Boolean} estimateGas if True, return gas estimate
160
- * @return {Promise<ReceiptOrEstimate>}
161
- */
162
- buyFromFreAndOrder<G extends boolean = false>(dtAddress: string, orderParams: OrderParams, freParams: FreOrderParams, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
163
- /**
164
- * Gets 1 DT from dispenser and then startsOrder, while burning that DT
165
- * @param {String} dtAddress Datatoken address
166
- * @param {OrderParams} orderParams - The parameters required to place an order.
167
- * @param {String} dispenserContract dispenser address
168
- * @param {Boolean} estimateGas if True, return gas estimate
169
- * @return {Promise<ReceiptOrEstimate>}
170
- */
171
- buyFromDispenserAndOrder<G extends boolean = false>(dtAddress: string, orderParams: OrderParams, dispenserContract: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
172
- /** setData
173
- * This function allows to store data with a preset key (keccak256(dtAddress)) into NFT 725 Store
174
- * only DatatokenDeployer can succeed
175
- * @param {String} dtAddress Datatoken address
176
- * @param {String} address User address
177
- * @param {String} value Data to be stored into 725Y standard
178
- * @param {Boolean} estimateGas if True, return gas estimate
179
- * @return {Promise<ReceiptOrEstimate>} transactionId
180
- */
181
- setData<G extends boolean = false>(dtAddress: string, address: string, value: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
182
- /**
183
- * Clean Datatoken level Permissions (minters, paymentManager and reset the paymentCollector) for an ERC20 Datatoken
184
- * Only NFT Owner (at 721 level) can call it.
185
- * @param {string} dtAddress Datatoken address where we want to clean permissions
186
- * @param {string} address User adress
187
- * @param {Boolean} estimateGas if True, return gas estimate
188
- * @return {Promise<ReceiptOrEstimate>} transactionId
189
- */
190
- cleanPermissions<G extends boolean = false>(dtAddress: string, address: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
191
- /**
192
- * Returns ERC20 Datatoken user's permissions for a datatoken
193
- * @param {String} dtAddress Datatoken adress
194
- * @param {String} address user adress
195
- * @return {Promise<DatatokenRoles>}
196
- */
197
- getPermissions(dtAddress: string, address: string): Promise<DatatokenRoles>;
198
- /**
199
- * Returns the Datatoken cap
200
- * @param {String} dtAddress Datatoken adress
201
- * @return {Promise<string>}
202
- */
203
- getCap(dtAddress: string): Promise<string>;
204
- /**
205
- * It returns the token decimals, how many supported decimal points
206
- * @param {String} dtAddress Datatoken adress
207
- * @return {Promise<number>}
208
- */
209
- getDecimals(dtAddress: string): Promise<number>;
210
- /**
211
- * It returns the token template index.
212
- * @param {String} dtAddress Datatoken adress
213
- * @return {Promise<number>}
214
- */
215
- getId(dtAddress: string): Promise<number>;
216
- /**
217
- * It returns the token symbol
218
- * @param {String} dtAddress Datatoken adress
219
- * @return {Promise<number>}
220
- */
221
- getSymbol(dtAddress: string): Promise<string>;
222
- /**
223
- * It returns the name of the token
224
- * @param {String} dtAddress Datatoken adress
225
- * @return {Promise<number>}
226
- */
227
- getName(dtAddress: string): Promise<string>;
228
- /**
229
- * It returns the token decimals, how many supported decimal points
230
- * @param {String} dtAddress Datatoken adress
231
- * @return {Promise<number>}
232
- */
233
- getNFTAddress(dtAddress: string): Promise<string>;
234
- /**
235
- * It returns the list of fixedRateExchanges created for this datatoken.
236
- * @param {String} dtAddress Datatoken adress
237
- * @return {Promise<number>}
238
- */
239
- getFixedRates(dtAddress: string): Promise<any[]>;
240
- /**
241
- * It returns the list of dispensers created for this datatoken.
242
- * @param {String} dtAddress Datatoken adress
243
- * @return {Promise<number>}
244
- */
245
- getDispensers(dtAddress: string): Promise<any[]>;
246
- /**
247
- * Returns true if address has deployERC20 role
248
- * @param {String} dtAddress Datatoken adress
249
- * @param {String} dtAddress Datatoken adress
250
- * @return {Promise<boolean>}
251
- */
252
- isDatatokenDeployer(dtAddress: string, address: string): Promise<boolean>;
253
- /**
254
- * Get Address Balance for datatoken
255
- * @param {String} dtAddress Datatoken adress
256
- * @param {String} address user adress
257
- * @return {Promise<String>} balance Number of datatokens. Will be converted from wei
258
- */
259
- balance(datatokenAddress: string, address: string): Promise<string>;
260
- /**
261
- * Allows to set the fee required by the publisherMarket
262
- * only publishMarketFeeAddress can call it
263
- * @param {string} datatokenAddress Datatoken adress
264
- * @param {string} publishMarketFeeAddress new publish Market Fee Address
265
- * @param {string} publishMarketFeeToken new publish Market Fee Token
266
- * @param {string} publishMarketFeeAmount new fee amount
267
- * @param {String} address user adress
268
- * @param {Boolean} estimateGas if True, return gas estimate
269
- */
270
- setPublishingMarketFee<G extends boolean = false>(datatokenAddress: string, publishMarketFeeAddress: string, publishMarketFeeToken: string, publishMarketFeeAmount: string, address: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
271
- /**
272
- * Returns the current fee set by the publishing market
273
- * @param {String} datatokenAddress Datatoken adress
274
- * @return {Promise<PublishingMarketFee>} Current fee set by the publishing market
275
- */
276
- getPublishingMarketFee(datatokenAddress: string): Promise<PublishingMarketFee>;
277
- private getFreOrderParams;
278
- }
@@ -1,73 +0,0 @@
1
- import { Datatoken } from './Datatoken';
2
- import { SmartContractWithAddress } from './SmartContractWithAddress';
3
- import { DispenserToken, ReceiptOrEstimate, AbiItem } from '../@types';
4
- export declare class Dispenser extends SmartContractWithAddress {
5
- getDefaultAbi(): AbiItem[];
6
- /**
7
- * Get information about a datatoken dispenser
8
- * @param {String} dtAddress
9
- * @return {Promise<DispenserToken>}
10
- */
11
- status(dtAdress: string): Promise<DispenserToken>;
12
- /**
13
- * Creates a new Dispenser
14
- * @param {String} dtAddress Datatoken address
15
- * @param {String} address Owner address
16
- * @param {String} maxTokens max tokens to dispense
17
- * @param {String} maxBalance max balance of requester
18
- * @param {String} allowedSwapper only account that can ask tokens. set address(0) if not required
19
- * @param {Boolean} estimateGas if True, return gas estimate
20
- * @return {Promise<ReceiptOrEstimate>} transactionId
21
- */
22
- create<G extends boolean = false>(dtAddress: string, address: string, maxTokens: string, maxBalance: string, allowedSwapper: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
23
- /**
24
- * Activates a dispener.
25
- * @param {String} dtAddress refers to datatoken address.
26
- * @param {Number} maxTokens max amount of tokens to dispense
27
- * @param {Number} maxBalance max balance of user. If user balance is >, then dispense will be rejected
28
- * @param {Boolean} estimateGas if True, return gas estimate
29
- * @return {Promise<ReceiptOrEstimate>} TransactionReceipt
30
- */
31
- activate<G extends boolean = false>(dtAddress: string, maxTokens: string, maxBalance: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
32
- /**
33
- * Deactivate an existing dispenser.
34
- * @param {String} dtAddress refers to datatoken address.
35
- * @param {Boolean} estimateGas if True, return gas estimate
36
- * @return {Promise<ReceiptOrEstimate>} TransactionReceipt
37
- */
38
- deactivate<G extends boolean = false>(dtAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
39
- /**
40
- * Sets a new allowed swapper.
41
- * @param {String} dtAddress Datatoken address.
42
- * @param {String} newAllowedSwapper The address of the new allowed swapper.
43
- * @param {Boolean} estimateGas if True, return gas estimate
44
- * @return {Promise<ReceiptOrEstimate>}
45
- */
46
- setAllowedSwapper<G extends boolean = false>(dtAddress: string, newAllowedSwapper: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
47
- /**
48
- * Dispense datatokens to caller.
49
- * The dispenser must be active, hold enough datatokens (or be able to mint more)
50
- * and respect maxTokens/maxBalance requirements
51
- * @param {String} dtAddress Datatoken address.
52
- * @param {String} amount Amount of datatokens required.
53
- * @param {String} destination address of tokens receiver
54
- * @param {Boolean} estimateGas if True, return gas estimate
55
- * @return {Promise<ReceiptOrEstimate>}
56
- */
57
- dispense<G extends boolean = false>(dtAddress: string, amount: string, destination: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
58
- /**
59
- * Withdraw all tokens from the dispenser
60
- * @param {String} dtAddress Datatoken address.
61
- * @param {Boolean} estimateGas if True, return gas estimate
62
- * @return {Promise<ReceiptOrEstimate>}
63
- */
64
- ownerWithdraw<G extends boolean = false>(dtAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
65
- /**
66
- * Check if tokens can be dispensed
67
- * @param {String} dtAddress Datatoken address
68
- * @param {String} address User address that will receive datatokens
69
- * @param {String} amount amount of datatokens required.
70
- * @return {Promise<Boolean>}
71
- */
72
- isDispensable(dtAddress: string, datatoken: Datatoken, address: string, amount?: string): Promise<Boolean>;
73
- }
@@ -1,209 +0,0 @@
1
- import { PriceAndFees, FeesInfo, FixedPriceExchange, ReceiptOrEstimate, AbiItem } from '../@types';
2
- import { SmartContractWithAddress } from './SmartContractWithAddress';
3
- export declare class FixedRateExchange extends SmartContractWithAddress {
4
- getDefaultAbi(): AbiItem[];
5
- /**
6
- * Creates unique exchange identifier.
7
- * @param {String} baseToken baseToken contract address
8
- * @param {String} datatoken Datatoken contract address
9
- * @return {Promise<string>} exchangeId
10
- */
11
- generateExchangeId(baseToken: string, datatoken: string): Promise<string>;
12
- /**
13
- * Atomic swap
14
- * @param {String} exchangeId ExchangeId
15
- * @param {String} datatokenAmount Amount of datatokens
16
- * @param {String} maxBaseTokenAmount max amount of baseToken we want to pay for datatokenAmount
17
- * @param {String} consumeMarketAddress consumeMarketAddress
18
- * @param {String} consumeMarketFee consumeMarketFee in fraction
19
- * @param {Boolean} estimateGas if True, return gas estimate
20
- * @return {Promise<ReceiptOrEstimate>} transaction receipt
21
- */
22
- buyDatatokens<G extends boolean = false>(exchangeId: string, datatokenAmount: string, maxBaseTokenAmount: string, consumeMarketAddress?: string, consumeMarketFee?: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
23
- /**
24
- * Sell datatokenAmount while expecting at least minBaseTokenAmount
25
- * @param {String} exchangeId ExchangeId
26
- * @param {String} datatokenAmount Amount of datatokens
27
- * @param {String} minBaseTokenAmount min amount of baseToken we want to receive back
28
- * @param {String} consumeMarketAddress consumeMarketAddress
29
- * @param {String} consumeMarketFee consumeMarketFee in fraction
30
- * @param {Boolean} estimateGas if True, return gas estimate
31
- * @return {Promise<ReceiptOrEstimate>} transaction receipt
32
- */
33
- sellDatatokens<G extends boolean = false>(exchangeId: string, datatokenAmount: string, minBaseTokenAmount: string, consumeMarketAddress?: string, consumeMarketFee?: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
34
- /**
35
- * Gets total number of exchanges
36
- * @return {Promise<Number>} no of available exchanges
37
- */
38
- getNumberOfExchanges(): Promise<number>;
39
- /**
40
- * Set new rate
41
- * @param {String} exchangeId Exchange ID
42
- * @param {String} newRate New rate
43
- * @param {Boolean} estimateGas if True, return gas estimate
44
- * @return {Promise<ReceiptOrEstimate>} transaction receipt
45
- */
46
- setRate<G extends boolean = false>(exchangeId: string, newRate: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
47
- /**
48
- * Sets a new allowedSwapper
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
52
- * @return {Promise<ReceiptOrEstimate>} transaction receipt
53
- */
54
- setAllowedSwapper<G extends boolean = false>(exchangeId: string, newAllowedSwapper: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
55
- /**
56
- * Activate an exchange
57
- * @param {String} exchangeId ExchangeId
58
- * @param {Boolean} estimateGas if True, return gas estimate
59
- * @return {Promise<ReceiptOrEstimate>} transaction receipt
60
- */
61
- activate<G extends boolean = false>(exchangeId: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
62
- /**
63
- * Deactivate an exchange
64
- * @param {String} exchangeId ExchangeId
65
- * @param {Boolean} estimateGas if True, return gas estimate
66
- * @return {Promise<ReceiptOrEstimate>} transaction receipt
67
- */
68
- deactivate<G extends boolean = false>(exchangeId: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
69
- /**
70
- * Get Exchange Rate
71
- * @param {String} exchangeId Exchange ID
72
- * @return {Promise<string>} Rate (converted from wei)
73
- */
74
- getRate(exchangeId: string): Promise<string>;
75
- /**
76
- * Get Datatoken Supply in the exchange
77
- * @param {String} exchangeId Exchange Id
78
- * @return {Promise<string>} dt supply formatted
79
- */
80
- getDatatokenSupply(exchangeId: string): Promise<string>;
81
- /**
82
- * Returns basetoken supply in the exchange
83
- * @param {String} exchangeId Exchange Id
84
- * @return {Promise<string>} dt supply formatted
85
- */
86
- getBasetokenSupply(exchangeId: string): Promise<string>;
87
- /**
88
- * Get Allower Swapper (if set this is the only account which can use this exchange, else is set at address(0))
89
- * @param {String} exchangeId Exchange Id
90
- * @return {Promise<string>} address of allowed swapper
91
- */
92
- getAllowedSwapper(exchangeId: string): Promise<string>;
93
- /**
94
- * calcBaseInGivenDatatokensOut - Calculates how many base tokens are needed to get specified amount of datatokens
95
- * @param {String} exchangeId Exchange Id
96
- * @param {string} datatokenAmount Amount of datatokens user wants to buy
97
- * @param {String} consumeMarketFee consumeMarketFee in fraction
98
- * @return {Promise<PriceAndFees>} how many base tokens are needed and fees
99
- */
100
- calcBaseInGivenDatatokensOut(exchangeId: string, datatokenAmount: string, consumeMarketFee?: string): Promise<PriceAndFees>;
101
- /**
102
- * Returns amount in baseToken that user will receive for datatokenAmount sold
103
- * @param {String} exchangeId Exchange Id
104
- * @param {Number} datatokenAmount Amount of datatokens
105
- * @param {String} consumeMarketFee consumeMarketFee in fraction
106
- * @return {Promise<string>} Amount of baseTokens user will receive
107
- */
108
- getAmountBasetokensOut(exchangeId: string, datatokenAmount: string, consumeMarketFee?: string): Promise<string>;
109
- /**
110
- * Get exchange details
111
- * @param {String} exchangeId Exchange Id
112
- * @return {Promise<FixedPricedExchange>} Exchange details
113
- */
114
- getExchange(exchangeId: string): Promise<FixedPriceExchange>;
115
- /**
116
- * Get fee details for an exchange
117
- * @param {String} exchangeId Exchange Id
118
- * @return {Promise<FeesInfo>} Exchange details
119
- */
120
- getFeesInfo(exchangeId: string): Promise<FeesInfo>;
121
- /**
122
- * Returns all exchanges
123
- * @param {String} exchangeId Exchang eId
124
- * @return {Promise<String[]>} Exchanges list
125
- */
126
- getExchanges(): Promise<string[]>;
127
- /**
128
- * Check if an exchange is active
129
- * @param {String} exchangeId ExchangeId
130
- * @return {Promise<Boolean>}
131
- */
132
- isActive(exchangeId: string): Promise<boolean>;
133
- /**
134
- * Activate minting option for fixed rate contract
135
- * @param {String} exchangeId Exchang eId
136
- * @param {Boolean} estimateGas if True, return gas estimate
137
- * @return {Promise<ReceiptOrEstimate>} transaction receipt
138
- */
139
- activateMint<G extends boolean = false>(exchangeId: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
140
- /**
141
- * Deactivate minting for fixed rate
142
- * @param {String} exchangeId ExchangeId
143
- * @param {Boolean} estimateGas if True, return gas estimate
144
- * @return {Promise<ReceiptOrEstimate>} transaction receipt
145
- */
146
- deactivateMint<G extends boolean = false>(exchangeId: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
147
- /**
148
- * Collect BaseTokens in the contract (anyone can call this, funds are sent to Datatoken.paymentCollector)
149
- * @param {String} exchangeId Exchange Id
150
- * @param {String} amount amount to be collected
151
- * @param {Boolean} estimateGas if True, return gas estimate
152
- * @return {Promise<ReceiptOrEstimate>} transaction receipt
153
- */
154
- collectBasetokens<G extends boolean = false>(exchangeId: string, amount: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
155
- /**
156
- * Collect datatokens in the contract (anyone can call this, funds are sent to Datatoken.paymentCollector)
157
- * @param {String} exchangeId Exchange Id
158
- * @param {String} amount amount to be collected
159
- * @param {Boolean} estimateGas if True, return gas estimate
160
- * @return {Promise<ReceiptOrEstimate>} transaction receipt
161
- */
162
- collectDatatokens<G extends boolean = false>(exchangeId: string, amount: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
163
- /**
164
- * Collect market fee and send it to marketFeeCollector (anyone can call it)
165
- * @param {String} exchangeId Exchange Id
166
- * @param {Boolean} estimateGas if True, return gas estimate
167
- * @return {Promise<ReceiptOrEstimate>} transaction receipt
168
- */
169
- collectMarketFee<G extends boolean = false>(exchangeId: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
170
- /**
171
- * Collect ocean fee and send it to OPF collector (anyone can call it)
172
- * @param {String} exchangeId Exchange Id
173
- * @param {Boolean} estimateGas if True, return gas estimate
174
- * @return {Promise<ReceiptOrEstimate>} transaction receipt
175
- */
176
- collectOceanFee<G extends boolean = false>(exchangeId: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
177
- /**
178
- * Get OPF Collector of fixed rate contract
179
- * @return {String}
180
- */
181
- getOPCCollector(): Promise<string>;
182
- /**
183
- * Get Router address set in fixed rate contract
184
- * @return {String}
185
- */
186
- getRouter(): Promise<string>;
187
- /**
188
- * Get Exchange Owner given an exchangeId
189
- * @param {String} exchangeId Exchange Id
190
- * @return {String} return exchange owner
191
- */
192
- getExchangeOwner(exchangeId: string): Promise<string>;
193
- /**
194
- * Set new market fee, only market fee collector can update it
195
- * @param {String} exchangeId Exchange Id
196
- * @param {String} newMarketFee New market fee
197
- * @param {Boolean} estimateGas if True, return gas estimate
198
- * @return {Promise<ReceiptOrEstimate>} transaction receipt
199
- */
200
- updateMarketFee<G extends boolean = false>(exchangeId: string, newMarketFee: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
201
- /**
202
- * Set new market fee collector, only market fee collector can update it
203
- * @param {String} exchangeId Exchange Id
204
- * @param {String} newMarketFeeCollector New market fee collector
205
- * @param {Boolean} estimateGas if True, return gas estimate
206
- * @return {Promise<ReceiptOrEstimate>} transaction receipt
207
- */
208
- updateMarketFeeCollector<G extends boolean = false>(exchangeId: string, newMarketFeeCollector: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
209
- }