@oceanprotocol/lib 3.0.4 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/lib.js +1 -1
- package/dist/lib.js.map +1 -1
- package/dist/lib.modern.js +1 -1
- package/dist/lib.modern.js.map +1 -1
- package/dist/lib.module.js +1 -1
- package/dist/lib.module.js.map +1 -1
- package/dist/lib.umd.js +1 -1
- package/dist/lib.umd.js.map +1 -1
- package/dist/src/@types/Asset.d.ts +148 -148
- package/dist/src/@types/Compute.d.ts +71 -71
- package/dist/src/@types/Contracts.d.ts +26 -26
- package/dist/src/@types/DDO/ConsumerParameter.d.ts +37 -37
- package/dist/src/@types/DDO/Credentials.d.ts +8 -8
- package/dist/src/@types/DDO/DDO.d.ts +55 -55
- package/dist/src/@types/DDO/Event.d.ts +27 -27
- package/dist/src/@types/DDO/Metadata.d.ts +141 -141
- package/dist/src/@types/DDO/Service.d.ts +100 -100
- package/dist/src/@types/Datatoken.d.ts +38 -38
- package/dist/src/@types/Dispenser.d.ts +16 -16
- package/dist/src/@types/DownloadResponse.d.ts +4 -4
- package/dist/src/@types/File.d.ts +89 -89
- package/dist/src/@types/FileInfo.d.ts +43 -43
- package/dist/src/@types/FixedPrice.d.ts +51 -51
- package/dist/src/@types/NFT.d.ts +18 -18
- package/dist/src/@types/NFTFactory.d.ts +20 -20
- package/dist/src/@types/Provider.d.ts +33 -33
- package/dist/src/@types/ReturnTypes.d.ts +3 -3
- package/dist/src/@types/Router.d.ts +59 -59
- package/dist/src/@types/index.d.ts +20 -20
- package/dist/src/config/Config.d.ts +153 -153
- package/dist/src/config/ConfigHelper.d.ts +12 -12
- package/dist/src/config/index.d.ts +2 -2
- package/dist/src/contracts/Datatoken.d.ts +278 -260
- package/dist/src/contracts/Dispenser.d.ts +73 -73
- package/dist/src/contracts/FixedRateExchange.d.ts +209 -209
- package/dist/src/contracts/NFT.d.ts +220 -220
- package/dist/src/contracts/NFTFactory.d.ts +165 -165
- package/dist/src/contracts/Router.d.ts +107 -107
- package/dist/src/contracts/SmartContract.d.ts +45 -45
- package/dist/src/contracts/SmartContractWithAddress.d.ts +17 -17
- package/dist/src/contracts/df/DfRewards.d.ts +31 -31
- package/dist/src/contracts/df/DfStrategyV1.d.ts +21 -21
- package/dist/src/contracts/index.d.ts +14 -14
- package/dist/src/contracts/ve/VeAllocate.d.ts +38 -38
- package/dist/src/contracts/ve/VeFeeDistributor.d.ts +29 -29
- package/dist/src/contracts/ve/VeFeeEstimate.d.ts +14 -14
- package/dist/src/contracts/ve/VeOcean.d.ts +68 -68
- package/dist/src/index.d.ts +5 -5
- package/dist/src/services/Aquarius.d.ts +53 -53
- package/dist/src/services/Provider.d.ts +197 -197
- package/dist/src/services/index.d.ts +2 -2
- package/dist/src/utils/Constants.d.ts +4 -4
- package/dist/src/utils/ContractUtils.d.ts +46 -46
- package/dist/src/utils/DatatokenName.d.ts +14 -14
- package/dist/src/utils/DdoHelpers.d.ts +13 -13
- package/dist/src/utils/FetchHelper.d.ts +14 -14
- package/dist/src/utils/General.d.ts +5 -5
- package/dist/src/utils/Logger.d.ts +19 -19
- package/dist/src/utils/OrderUtils.d.ts +17 -0
- package/dist/src/utils/ProviderErrors.d.ts +1 -1
- package/dist/src/utils/SignatureUtils.d.ts +12 -12
- package/dist/src/utils/TokenUtils.d.ts +70 -70
- package/dist/src/utils/index.d.ts +12 -11
- package/dist/src/utils/minAbi.d.ts +38 -38
- package/dist/test/config.d.ts +19 -19
- package/dist/test/integration/CodeExamples.test.d.ts +1 -1
- package/dist/test/integration/ComputeExamples.test.d.ts +1 -1
- package/dist/test/integration/ComputeFlow.test.d.ts +1 -1
- package/dist/test/integration/Provider.test.d.ts +1 -1
- package/dist/test/integration/PublishEditConsume.test.d.ts +1 -1
- package/dist/test/integration/PublishFlows.test.d.ts +1 -1
- package/dist/test/integration/helpers.d.ts +7 -7
- package/dist/test/unit/DFRewards.test.d.ts +1 -1
- package/dist/test/unit/Datatoken.test.d.ts +1 -1
- package/dist/test/unit/Dispenser.test.d.ts +1 -1
- package/dist/test/unit/FixedRateExchange.test.d.ts +1 -1
- package/dist/test/unit/Nft.test.d.ts +1 -1
- package/dist/test/unit/NftFactory.test.d.ts +1 -1
- package/dist/test/unit/Router.test.d.ts +1 -1
- package/dist/test/unit/veOcean.test.d.ts +1 -1
- package/package.json +5 -5
|
@@ -1,260 +1,278 @@
|
|
|
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
|
|
212
|
-
* @param {String} dtAddress Datatoken adress
|
|
213
|
-
* @return {Promise<number>}
|
|
214
|
-
*/
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
*
|
|
218
|
-
* @param {String} dtAddress Datatoken adress
|
|
219
|
-
* @return {Promise<number>}
|
|
220
|
-
*/
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
*
|
|
224
|
-
* @param {String} dtAddress Datatoken adress
|
|
225
|
-
* @return {Promise<number>}
|
|
226
|
-
*/
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
*
|
|
230
|
-
* @param {String} dtAddress Datatoken adress
|
|
231
|
-
* @
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
*
|
|
237
|
-
* @
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
*
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
*
|
|
248
|
-
* @param {
|
|
249
|
-
* @param {String}
|
|
250
|
-
* @
|
|
251
|
-
*/
|
|
252
|
-
|
|
253
|
-
/**
|
|
254
|
-
*
|
|
255
|
-
* @param {String}
|
|
256
|
-
* @
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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
|
+
}
|