@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.
- package/CHANGELOG.md +47 -16
- package/CodeExamples.md +28 -315
- package/README.md +4 -7
- 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 +4 -4
- package/dist/src/@types/Compute.d.ts +1 -1
- package/dist/src/@types/DDO/DDO.d.ts +2 -5
- package/dist/src/@types/{Erc20.d.ts → Datatoken.d.ts} +18 -1
- package/dist/src/@types/Dispenser.d.ts +9 -0
- package/dist/src/@types/FixedPrice.d.ts +24 -0
- package/dist/src/@types/{Erc721.d.ts → NFT.d.ts} +6 -0
- package/dist/src/@types/NFTFactory.d.ts +20 -0
- package/dist/src/@types/Provider.d.ts +8 -0
- package/dist/src/@types/ReturnTypes.d.ts +2 -0
- package/dist/src/@types/Router.d.ts +1 -1
- package/dist/src/@types/index.d.ts +11 -8
- package/dist/src/{models → config}/Config.d.ts +2 -23
- package/dist/src/{utils → config}/ConfigHelper.d.ts +1 -1
- package/dist/src/config/index.d.ts +2 -0
- package/dist/src/contracts/Datatoken.d.ts +232 -0
- package/dist/src/contracts/Dispenser.d.ts +73 -0
- package/dist/src/contracts/FixedRateExchange.d.ts +212 -0
- package/dist/src/contracts/NFT.d.ts +197 -0
- package/dist/src/contracts/NFTFactory.d.ts +144 -0
- package/dist/src/contracts/Router.d.ts +92 -0
- package/dist/src/contracts/SmartContract.d.ts +22 -0
- package/dist/src/contracts/SmartContractWithAddress.d.ts +18 -0
- package/dist/src/contracts/index.d.ts +11 -0
- package/dist/src/contracts/ve/VeAllocate.d.ts +41 -0
- package/dist/src/contracts/ve/VeFeeDistributor.d.ts +30 -0
- package/dist/src/contracts/ve/VeOcean.d.ts +69 -0
- package/dist/src/index.d.ts +4 -7
- package/dist/src/{aquarius → services}/Aquarius.d.ts +4 -14
- package/dist/src/{provider → services}/Provider.d.ts +5 -13
- package/dist/src/services/index.d.ts +2 -0
- package/dist/src/utils/Constants.d.ts +2 -0
- package/dist/src/utils/ContractUtils.d.ts +14 -8
- package/dist/src/utils/DdoHelpers.d.ts +1 -1
- package/dist/src/utils/FetchHelper.d.ts +1 -4
- package/dist/src/utils/Logger.d.ts +0 -1
- package/dist/src/utils/TokenUtils.d.ts +17 -39
- package/dist/src/utils/index.d.ts +6 -7
- package/dist/test/TestContractHandler.d.ts +4 -4
- package/dist/test/config.d.ts +1 -1
- package/dist/test/unit/{tokens/Datatoken.test.d.ts → Datatoken.test.d.ts} +0 -0
- package/dist/test/unit/{pools/dispenser/Dispenser.test.d.ts → Dispenser.test.d.ts} +0 -0
- package/dist/test/unit/{pools/fixedRate/FixedRateExchange.test.d.ts → FixedRateExchange.test.d.ts} +0 -0
- package/dist/test/unit/{tokens/Nft.test.d.ts → Nft.test.d.ts} +0 -0
- package/dist/test/unit/{factories/NftFactory.test.d.ts → NftFactory.test.d.ts} +0 -0
- package/dist/test/unit/{pools/Router.test.d.ts → Router.test.d.ts} +0 -0
- package/dist/test/unit/{pools/balancer/Pool.test.d.ts → veOcean.test.d.ts} +0 -0
- package/package.json +6 -19
- package/dist/src/@types/Pool.d.ts +0 -45
- package/dist/src/aquarius/index.d.ts +0 -1
- package/dist/src/factories/NFTFactory.d.ts +0 -275
- package/dist/src/factories/index.d.ts +0 -1
- package/dist/src/models/index.d.ts +0 -1
- package/dist/src/pools/Router.d.ts +0 -228
- package/dist/src/pools/balancer/Pool.d.ts +0 -395
- package/dist/src/pools/balancer/index.d.ts +0 -1
- package/dist/src/pools/dispenser/Dispenser.d.ts +0 -145
- package/dist/src/pools/dispenser/index.d.ts +0 -1
- package/dist/src/pools/fixedRate/FixedRateExchange.d.ts +0 -388
- package/dist/src/pools/fixedRate/index.d.ts +0 -1
- package/dist/src/pools/index.d.ts +0 -5
- package/dist/src/pools/ssContracts/SideStaking.d.ts +0 -133
- package/dist/src/pools/ssContracts/index.d.ts +0 -1
- package/dist/src/provider/index.d.ts +0 -1
- package/dist/src/tokens/Datatoken.d.ts +0 -413
- package/dist/src/tokens/NFT.d.ts +0 -364
- package/dist/src/tokens/index.d.ts +0 -2
- package/dist/src/utils/ConversionTypeHelper.d.ts +0 -3
- package/dist/src/utils/PoolHelpers.d.ts +0 -8
- package/dist/test/unit/pools/ssContracts/SideStaking.test.d.ts +0 -1
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
import { Contract } from 'web3-eth-contract';
|
|
2
|
-
import Web3 from 'web3';
|
|
3
|
-
import { TransactionReceipt } from 'web3-core';
|
|
4
|
-
import { AbiItem } from 'web3-utils';
|
|
5
|
-
import { Config } from '../models/index.js';
|
|
6
|
-
import { ProviderFees, FreCreationParams, Erc20CreateParams, PoolCreationParams, DispenserCreationParams, ConsumeMarketFee } from '../@types/index.js';
|
|
7
|
-
interface Template {
|
|
8
|
-
templateAddress: string;
|
|
9
|
-
isActive: boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface TokenOrder {
|
|
12
|
-
tokenAddress: string;
|
|
13
|
-
consumer: string;
|
|
14
|
-
serviceIndex: number;
|
|
15
|
-
_providerFee: ProviderFees;
|
|
16
|
-
_consumeMarketFee: ConsumeMarketFee;
|
|
17
|
-
}
|
|
18
|
-
export interface NftCreateData {
|
|
19
|
-
name: string;
|
|
20
|
-
symbol: string;
|
|
21
|
-
templateIndex: number;
|
|
22
|
-
tokenURI: string;
|
|
23
|
-
transferable: boolean;
|
|
24
|
-
owner: string;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Provides an interface for NFT Factory contract
|
|
28
|
-
*/
|
|
29
|
-
export declare class NftFactory {
|
|
30
|
-
factory721Address: string;
|
|
31
|
-
factory721Abi: AbiItem | AbiItem[];
|
|
32
|
-
web3: Web3;
|
|
33
|
-
config: Config;
|
|
34
|
-
factory721: Contract;
|
|
35
|
-
/**
|
|
36
|
-
* Instantiate Datatokens.
|
|
37
|
-
* @param {String} factory721Address
|
|
38
|
-
* @param {AbiItem | AbiItem[]} factory721ABI
|
|
39
|
-
* @param {Web3} web3
|
|
40
|
-
*/
|
|
41
|
-
constructor(factory721Address: string, web3: Web3, network?: string | number, factory721Abi?: AbiItem | AbiItem[], config?: Config);
|
|
42
|
-
/**
|
|
43
|
-
* Get estimated gas cost for deployERC721Contract value
|
|
44
|
-
* @param {String} address
|
|
45
|
-
* @param {String} nftData
|
|
46
|
-
* @return {Promise<string>} NFT datatoken address
|
|
47
|
-
*/
|
|
48
|
-
estGasCreateNFT(address: string, nftData: NftCreateData): Promise<string>;
|
|
49
|
-
/**
|
|
50
|
-
* Create new NFT
|
|
51
|
-
* @param {String} address
|
|
52
|
-
* @param {NFTCreateData} nftData
|
|
53
|
-
* @return {Promise<string>} NFT datatoken address
|
|
54
|
-
*/
|
|
55
|
-
createNFT(address: string, nftData: NftCreateData): Promise<string>;
|
|
56
|
-
/** Get Current NFT Count (NFT created)
|
|
57
|
-
* @return {Promise<number>} Number of NFT created from this factory
|
|
58
|
-
*/
|
|
59
|
-
getCurrentNFTCount(): Promise<number>;
|
|
60
|
-
/** Get Current Datatoken Count
|
|
61
|
-
* @return {Promise<number>} Number of DTs created from this factory
|
|
62
|
-
*/
|
|
63
|
-
getCurrentTokenCount(): Promise<number>;
|
|
64
|
-
/** Get Factory Owner
|
|
65
|
-
* @return {Promise<string>} Factory Owner address
|
|
66
|
-
*/
|
|
67
|
-
getOwner(): Promise<string>;
|
|
68
|
-
/** Get Current NFT Template Count
|
|
69
|
-
* @return {Promise<number>} Number of NFT Template added to this factory
|
|
70
|
-
*/
|
|
71
|
-
getCurrentNFTTemplateCount(): Promise<number>;
|
|
72
|
-
/** Get Current Template Datatoken (ERC20) Count
|
|
73
|
-
* @return {Promise<number>} Number of ERC20 Template added to this factory
|
|
74
|
-
*/
|
|
75
|
-
getCurrentTokenTemplateCount(): Promise<number>;
|
|
76
|
-
/** Get NFT Template
|
|
77
|
-
* @param {Number} index Template index
|
|
78
|
-
* @return {Promise<Template>} Number of Template added to this factory
|
|
79
|
-
*/
|
|
80
|
-
getNFTTemplate(index: number): Promise<Template>;
|
|
81
|
-
/** Get Datatoken(erc20) Template
|
|
82
|
-
* @param {Number} index Template index
|
|
83
|
-
* @return {Promise<Template>} DT Template info
|
|
84
|
-
*/
|
|
85
|
-
getTokenTemplate(index: number): Promise<Template>;
|
|
86
|
-
/** Check if ERC20 is deployed from the factory
|
|
87
|
-
* @param {String} datatoken Datatoken address we want to check
|
|
88
|
-
* @return {Promise<Boolean>} return true if deployed from this factory
|
|
89
|
-
*/
|
|
90
|
-
checkDatatoken(datatoken: string): Promise<Boolean>;
|
|
91
|
-
/** Check if NFT is deployed from the factory
|
|
92
|
-
* @param {String} nftAddress nftAddress address we want to check
|
|
93
|
-
* @return {Promise<String>} return address(0) if it's not, or the nftAddress if true
|
|
94
|
-
*/
|
|
95
|
-
checkNFT(nftAddress: string): Promise<String>;
|
|
96
|
-
/**
|
|
97
|
-
* Estimate gas cost for add721TokenTemplate method
|
|
98
|
-
* @param {String} address
|
|
99
|
-
* @param {String} templateAddress template address to add
|
|
100
|
-
* @return {Promise<TransactionReceipt>}
|
|
101
|
-
*/
|
|
102
|
-
estGasAddNFTTemplate(address: string, templateAddress: string): Promise<any>;
|
|
103
|
-
/**
|
|
104
|
-
* Add a new erc721 token template - only factory Owner
|
|
105
|
-
* @param {String} address
|
|
106
|
-
* @param {String} templateAddress template address to add
|
|
107
|
-
* @return {Promise<TransactionReceipt>}
|
|
108
|
-
*/
|
|
109
|
-
addNFTTemplate(address: string, templateAddress: string): Promise<TransactionReceipt>;
|
|
110
|
-
/**
|
|
111
|
-
* Estimate gas cost for disable721TokenTemplate method
|
|
112
|
-
* @param {String} address
|
|
113
|
-
* @param {Number} templateIndex index of the template we want to disable
|
|
114
|
-
* @return {Promise<TransactionReceipt>} current token template count
|
|
115
|
-
*/
|
|
116
|
-
estGasDisableNFTTemplate(address: string, templateIndex: number): Promise<any>;
|
|
117
|
-
/**
|
|
118
|
-
* Disable token template - only factory Owner
|
|
119
|
-
* @param {String} address
|
|
120
|
-
* @param {Number} templateIndex index of the template we want to disable
|
|
121
|
-
* @return {Promise<TransactionReceipt>} current token template count
|
|
122
|
-
*/
|
|
123
|
-
disableNFTTemplate(address: string, templateIndex: number): Promise<TransactionReceipt>;
|
|
124
|
-
/**
|
|
125
|
-
* Reactivate a previously disabled token template - only factory Owner
|
|
126
|
-
* @param {String} address
|
|
127
|
-
* @param {Number} templateIndex index of the template we want to reactivate
|
|
128
|
-
* @return {Promise<TransactionReceipt>} current token template count
|
|
129
|
-
*/
|
|
130
|
-
estGasReactivateNFTTemplate(address: string, templateIndex: number): Promise<any>;
|
|
131
|
-
/**
|
|
132
|
-
* Reactivate a previously disabled token template - only factory Owner
|
|
133
|
-
* @param {String} address
|
|
134
|
-
* @param {Number} templateIndex index of the template we want to reactivate
|
|
135
|
-
* @return {Promise<TransactionReceipt>} current token template count
|
|
136
|
-
*/
|
|
137
|
-
reactivateNFTTemplate(address: string, templateIndex: number): Promise<TransactionReceipt>;
|
|
138
|
-
/**
|
|
139
|
-
* Estimate gas cost for addTokenTemplate method
|
|
140
|
-
* @param {String} address
|
|
141
|
-
* @param {String} templateAddress template address to add
|
|
142
|
-
* @return {Promise<TransactionReceipt>}
|
|
143
|
-
*/
|
|
144
|
-
estGasAddTokenTemplate(address: string, templateAddress: string): Promise<any>;
|
|
145
|
-
/**
|
|
146
|
-
* Add a new erc721 token template - only factory Owner
|
|
147
|
-
* @param {String} address
|
|
148
|
-
* @param {String} templateAddress template address to add
|
|
149
|
-
* @return {Promise<TransactionReceipt>}
|
|
150
|
-
*/
|
|
151
|
-
addTokenTemplate(address: string, templateAddress: string): Promise<TransactionReceipt>;
|
|
152
|
-
/**
|
|
153
|
-
* Estimate gas cost for disableTokenTemplate method
|
|
154
|
-
* @param {String} address
|
|
155
|
-
* @param {Number} templateIndex index of the template we want to disable
|
|
156
|
-
* @return {Promise<TransactionReceipt>} current token template count
|
|
157
|
-
*/
|
|
158
|
-
estGasDisableTokenTemplate(address: string, templateIndex: number): Promise<any>;
|
|
159
|
-
/**
|
|
160
|
-
* Disable token template - only factory Owner
|
|
161
|
-
* @param {String} address
|
|
162
|
-
* @param {Number} templateIndex index of the template we want to disable
|
|
163
|
-
* @return {Promise<TransactionReceipt>} current token template count
|
|
164
|
-
*/
|
|
165
|
-
disableTokenTemplate(address: string, templateIndex: number): Promise<TransactionReceipt>;
|
|
166
|
-
/**
|
|
167
|
-
* Estimate gas cost for reactivateTokenTemplate method
|
|
168
|
-
* @param {String} address
|
|
169
|
-
* @param {Number} templateIndex index of the template we want to reactivate
|
|
170
|
-
* @return {Promise<TransactionReceipt>} current token template count
|
|
171
|
-
*/
|
|
172
|
-
estGasReactivateTokenTemplate(address: string, templateIndex: number): Promise<any>;
|
|
173
|
-
/**
|
|
174
|
-
* Reactivate a previously disabled token template - only factory Owner
|
|
175
|
-
* @param {String} address
|
|
176
|
-
* @param {Number} templateIndex index of the template we want to reactivate
|
|
177
|
-
* @return {Promise<TransactionReceipt>} current token template count
|
|
178
|
-
*/
|
|
179
|
-
reactivateTokenTemplate(address: string, templateIndex: number): Promise<TransactionReceipt>;
|
|
180
|
-
/** Estimate gas cost for startMultipleTokenOrder method
|
|
181
|
-
* @param address Caller address
|
|
182
|
-
* @param orders an array of struct tokenOrder
|
|
183
|
-
* @return {Promise<TransactionReceipt>} transaction receipt
|
|
184
|
-
*/
|
|
185
|
-
estGasStartMultipleTokenOrder(address: string, orders: TokenOrder[]): Promise<any>;
|
|
186
|
-
/**
|
|
187
|
-
* @dev startMultipleTokenOrder
|
|
188
|
-
* Used as a proxy to order multiple services
|
|
189
|
-
* Users can have inifinite approvals for fees for factory instead of having one approval/ erc20 contract
|
|
190
|
-
* Requires previous approval of all :
|
|
191
|
-
* - consumeFeeTokens
|
|
192
|
-
* - publishMarketFeeTokens
|
|
193
|
-
* - erc20 datatokens
|
|
194
|
-
* @param address Caller address
|
|
195
|
-
* @param orders an array of struct tokenOrder
|
|
196
|
-
* @return {Promise<TransactionReceipt>} transaction receipt
|
|
197
|
-
*/
|
|
198
|
-
startMultipleTokenOrder(address: string, orders: TokenOrder[]): Promise<TransactionReceipt>;
|
|
199
|
-
/**
|
|
200
|
-
* Estimate gas cost for createNftWithErc20 method
|
|
201
|
-
* @param address Caller address
|
|
202
|
-
* @param _NftCreateData input data for nft creation
|
|
203
|
-
* @param _ErcCreateData input data for erc20 creation
|
|
204
|
-
* @return {Promise<TransactionReceipt>} transaction receipt
|
|
205
|
-
*/
|
|
206
|
-
estGasCreateNftWithErc20(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams): Promise<any>;
|
|
207
|
-
/**
|
|
208
|
-
* @dev createNftWithErc20
|
|
209
|
-
* Creates a new NFT, then a ERC20,all in one call
|
|
210
|
-
* @param address Caller address
|
|
211
|
-
* @param _NftCreateData input data for nft creation
|
|
212
|
-
* @param _ErcCreateData input data for erc20 creation
|
|
213
|
-
* @return {Promise<TransactionReceipt>} transaction receipt
|
|
214
|
-
*/
|
|
215
|
-
createNftWithErc20(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams): Promise<TransactionReceipt>;
|
|
216
|
-
/**
|
|
217
|
-
* Estimate gas cost for createNftErc20WithPool method
|
|
218
|
-
* @param address Caller address
|
|
219
|
-
* @param nftCreateData input data for NFT Creation
|
|
220
|
-
* @param ercParams input data for ERC20 Creation
|
|
221
|
-
* @param poolParams input data for Pool Creation
|
|
222
|
-
* @return {Promise<TransactionReceipt>} transaction receipt
|
|
223
|
-
*/
|
|
224
|
-
estGasCreateNftErc20WithPool(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams, poolParams: PoolCreationParams): Promise<any>;
|
|
225
|
-
/**
|
|
226
|
-
* @dev createNftErc20WithPool
|
|
227
|
-
* Creates a new NFT, then a ERC20, then a Pool, all in one call
|
|
228
|
-
* Use this carefully, because if Pool creation fails, you are still going to pay a lot of gas
|
|
229
|
-
* @param address Caller address
|
|
230
|
-
* @param nftCreateData input data for NFT Creation
|
|
231
|
-
* @param ercParams input data for ERC20 Creation
|
|
232
|
-
* @param poolParams input data for Pool Creation
|
|
233
|
-
* @return {Promise<TransactionReceipt>} transaction receipt
|
|
234
|
-
*/
|
|
235
|
-
createNftErc20WithPool(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams, poolParams: PoolCreationParams): Promise<TransactionReceipt>;
|
|
236
|
-
/** Estimate gas cost for createNftErc20WithFixedRate method
|
|
237
|
-
* @param address Caller address
|
|
238
|
-
* @param nftCreateData input data for NFT Creation
|
|
239
|
-
* @param ercParams input data for ERC20 Creation
|
|
240
|
-
* @param freParams input data for FixedRate Creation
|
|
241
|
-
* @return {Promise<TransactionReceipt>} transaction receipt
|
|
242
|
-
*/
|
|
243
|
-
estGasCreateNftErc20WithFixedRate(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams, freParams: FreCreationParams): Promise<any>;
|
|
244
|
-
/**
|
|
245
|
-
* @dev createNftErc20WithFixedRate
|
|
246
|
-
* Creates a new NFT, then a ERC20, then a FixedRateExchange, all in one call
|
|
247
|
-
* Use this carefully, because if Fixed Rate creation fails, you are still going to pay a lot of gas
|
|
248
|
-
* @param address Caller address
|
|
249
|
-
* @param nftCreateData input data for NFT Creation
|
|
250
|
-
* @param ercParams input data for ERC20 Creation
|
|
251
|
-
* @param freParams input data for FixedRate Creation
|
|
252
|
-
* @return {Promise<TransactionReceipt>} transaction receipt
|
|
253
|
-
*/
|
|
254
|
-
createNftErc20WithFixedRate(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams, freParams: FreCreationParams): Promise<TransactionReceipt>;
|
|
255
|
-
/** Estimate gas cost for createNftErc20WithFixedRate method
|
|
256
|
-
* @param address Caller address
|
|
257
|
-
* @param nftCreateData input data for NFT Creation
|
|
258
|
-
* @param ercParams input data for ERC20 Creation
|
|
259
|
-
* @param dispenserParams input data for Dispenser Creation
|
|
260
|
-
* @return {Promise<TransactionReceipt>} transaction receipt
|
|
261
|
-
*/
|
|
262
|
-
estGasCreateNftErc20WithDispenser(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams, dispenserParams: DispenserCreationParams): Promise<any>;
|
|
263
|
-
/**
|
|
264
|
-
* @dev createNftErc20WithDispenser
|
|
265
|
-
* Creates a new NFT, then a ERC20, then a Dispenser, all in one call
|
|
266
|
-
* Use this carefully, because if Dispenser creation fails, you are still going to pay a lot of gas
|
|
267
|
-
* @param address Caller address
|
|
268
|
-
* @param nftCreateData input data for NFT Creation
|
|
269
|
-
* @param ercParams input data for ERC20 Creation
|
|
270
|
-
* @param dispenserParams input data for Dispenser Creation
|
|
271
|
-
* @return {Promise<TransactionReceipt>} transaction receipt
|
|
272
|
-
*/
|
|
273
|
-
createNftErc20WithDispenser(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams, dispenserParams: DispenserCreationParams): Promise<TransactionReceipt>;
|
|
274
|
-
}
|
|
275
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './NFTFactory';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Config';
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import { Contract } from 'web3-eth-contract';
|
|
2
|
-
import Web3 from 'web3';
|
|
3
|
-
import { TransactionReceipt } from 'web3-core';
|
|
4
|
-
import { AbiItem } from 'web3-utils';
|
|
5
|
-
import { Operation } from '../@types/Router';
|
|
6
|
-
import { Config } from '../models/index.js';
|
|
7
|
-
/**
|
|
8
|
-
* Provides an interface for FactoryRouter contract
|
|
9
|
-
*/
|
|
10
|
-
export declare class Router {
|
|
11
|
-
routerAddress: string;
|
|
12
|
-
RouterAbi: AbiItem | AbiItem[];
|
|
13
|
-
web3: Web3;
|
|
14
|
-
config: Config;
|
|
15
|
-
router: Contract;
|
|
16
|
-
/**
|
|
17
|
-
* Instantiate Router.
|
|
18
|
-
* @param {String} routerAddress
|
|
19
|
-
* @param {AbiItem | AbiItem[]} Router
|
|
20
|
-
* @param {Web3} web3
|
|
21
|
-
*/
|
|
22
|
-
constructor(routerAddress: string, web3: Web3, network?: string | number, RouterAbi?: AbiItem | AbiItem[], config?: Config);
|
|
23
|
-
/**
|
|
24
|
-
* Estimate gas cost for buyDTBatch method
|
|
25
|
-
* @param {String} address
|
|
26
|
-
* @param {Operation} operations Operations objects array
|
|
27
|
-
* @return {Promise<TransactionReceipt>} Transaction receipt
|
|
28
|
-
*/
|
|
29
|
-
estGasBuyDTBatch(address: string, operations: Operation[]): Promise<any>;
|
|
30
|
-
/**
|
|
31
|
-
* BuyDTBatch
|
|
32
|
-
* @param {String} address
|
|
33
|
-
* @param {Operation} operations Operations objects array
|
|
34
|
-
* @return {Promise<TransactionReceipt>} Transaction receipt
|
|
35
|
-
*/
|
|
36
|
-
buyDTBatch(address: string, operations: Operation[]): Promise<TransactionReceipt>;
|
|
37
|
-
/** Check if a token is on approved tokens list, if true opfFee is lower in pools with that token/DT
|
|
38
|
-
* @return {Promise<boolean>} true if is on the list.
|
|
39
|
-
*/
|
|
40
|
-
isApprovedToken(address: string): Promise<boolean>;
|
|
41
|
-
/** Check if an address is a side staking contract.
|
|
42
|
-
* @return {Promise<boolean>} true if is a SS contract
|
|
43
|
-
*/
|
|
44
|
-
isSideStaking(address: string): Promise<boolean>;
|
|
45
|
-
/** Check if an address is a Fixed Rate contract.
|
|
46
|
-
* @return {Promise<boolean>} true if is a Fixed Rate contract
|
|
47
|
-
*/
|
|
48
|
-
isFixedPrice(address: string): Promise<boolean>;
|
|
49
|
-
/** Get Router Owner
|
|
50
|
-
* @return {Promise<string>} Router Owner address
|
|
51
|
-
*/
|
|
52
|
-
getOwner(): Promise<string>;
|
|
53
|
-
/** Get NFT Factory address
|
|
54
|
-
* @return {Promise<string>} NFT Factory address
|
|
55
|
-
*/
|
|
56
|
-
getNFTFactory(): Promise<string>;
|
|
57
|
-
/** Check if an address is a pool template contract.
|
|
58
|
-
* @return {Promise<boolean>} true if is a Template
|
|
59
|
-
*/
|
|
60
|
-
isPoolTemplate(address: string): Promise<boolean>;
|
|
61
|
-
/**
|
|
62
|
-
* Estimate gas cost for addApprovedToken
|
|
63
|
-
* @param {String} address
|
|
64
|
-
* @param {String} tokenAddress token address we want to add
|
|
65
|
-
* @param {Contract} routerContract optional contract instance
|
|
66
|
-
* @return {Promise<any>}
|
|
67
|
-
*/
|
|
68
|
-
estGasAddApprovedToken(address: string, tokenAddress: string, contractInstance?: Contract): Promise<any>;
|
|
69
|
-
/**
|
|
70
|
-
* Add a new token to oceanTokens list, pools with baseToken in this list have NO opf Fee
|
|
71
|
-
* @param {String} address caller address
|
|
72
|
-
* @param {String} tokenAddress token address to add
|
|
73
|
-
* @return {Promise<TransactionReceipt>}
|
|
74
|
-
*/
|
|
75
|
-
addApprovedToken(address: string, tokenAddress: string): Promise<TransactionReceipt>;
|
|
76
|
-
/**
|
|
77
|
-
* Estimate gas cost for removeApprovedToken
|
|
78
|
-
* @param {String} address caller address
|
|
79
|
-
* @param {String} tokenAddress token address we want to add
|
|
80
|
-
* @param {Contract} routerContract optional contract instance
|
|
81
|
-
* @return {Promise<any>}
|
|
82
|
-
*/
|
|
83
|
-
estGasRemoveApprovedToken(address: string, tokenAddress: string, contractInstance?: Contract): Promise<any>;
|
|
84
|
-
/**
|
|
85
|
-
* Remove a token from oceanTokens list, pools without baseToken in this list have a opf Fee
|
|
86
|
-
* @param {String} address
|
|
87
|
-
* @param {String} tokenAddress address to remove
|
|
88
|
-
* @return {Promise<TransactionReceipt>}
|
|
89
|
-
*/
|
|
90
|
-
removeApprovedToken(address: string, tokenAddress: string): Promise<TransactionReceipt>;
|
|
91
|
-
/**
|
|
92
|
-
* Estimate gas cost for addSSContract method
|
|
93
|
-
* @param {String} address
|
|
94
|
-
* @param {String} tokenAddress contract address to add
|
|
95
|
-
* @return {Promise<TransactionReceipt>}
|
|
96
|
-
*/
|
|
97
|
-
estGasAddSSContract(address: string, tokenAddress: string): Promise<any>;
|
|
98
|
-
/**
|
|
99
|
-
* Add a new contract to ssContract list, after is added, can be used when deploying a new pool
|
|
100
|
-
* @param {String} address
|
|
101
|
-
* @param {String} tokenAddress contract address to add
|
|
102
|
-
* @return {Promise<TransactionReceipt>}
|
|
103
|
-
*/
|
|
104
|
-
addSSContract(address: string, tokenAddress: string): Promise<TransactionReceipt>;
|
|
105
|
-
/**
|
|
106
|
-
* Estimate gas cost for removeSSContract method
|
|
107
|
-
* @param {String} address caller address
|
|
108
|
-
* @param {String} tokenAddress contract address to add
|
|
109
|
-
* @return {Promise<TransactionReceipt>}
|
|
110
|
-
*/
|
|
111
|
-
estGasRemoveSSContract(address: string, tokenAddress: string): Promise<any>;
|
|
112
|
-
/**
|
|
113
|
-
* Removes a new contract from ssContract list
|
|
114
|
-
* @param {String} address caller address
|
|
115
|
-
* @param {String} tokenAddress contract address to removed
|
|
116
|
-
* @return {Promise<TransactionReceipt>}
|
|
117
|
-
*/
|
|
118
|
-
removeSSContract(address: string, tokenAddress: string): Promise<TransactionReceipt>;
|
|
119
|
-
/**
|
|
120
|
-
* Estimate gas cost for addFixedRateContract method
|
|
121
|
-
* @param {String} address
|
|
122
|
-
* @param {String} tokenAddress contract address to add
|
|
123
|
-
* @return {Promise<TransactionReceipt>}
|
|
124
|
-
*/
|
|
125
|
-
estGasAddFixedRateContract(address: string, tokenAddress: string): Promise<any>;
|
|
126
|
-
/**
|
|
127
|
-
* Add a new contract to fixedRate list, after is added, can be used when deploying a new pool
|
|
128
|
-
* @param {String} address
|
|
129
|
-
* @param {String} tokenAddress contract address to add
|
|
130
|
-
* @return {Promise<TransactionReceipt>}
|
|
131
|
-
*/
|
|
132
|
-
addFixedRateContract(address: string, tokenAddress: string): Promise<TransactionReceipt>;
|
|
133
|
-
/**
|
|
134
|
-
* Estimate gas cost for addFixedRateContract method
|
|
135
|
-
* @param {String} address
|
|
136
|
-
* @param {String} tokenAddress contract address to add
|
|
137
|
-
* @return {Promise<TransactionReceipt>}
|
|
138
|
-
*/
|
|
139
|
-
estGasRemoveFixedRateContract(address: string, tokenAddress: string): Promise<any>;
|
|
140
|
-
/**
|
|
141
|
-
* Removes a contract from fixedRate list
|
|
142
|
-
* @param {String} address
|
|
143
|
-
* @param {String} tokenAddress contract address to add
|
|
144
|
-
* @return {Promise<TransactionReceipt>}
|
|
145
|
-
*/
|
|
146
|
-
removeFixedRateContract(address: string, tokenAddress: string): Promise<TransactionReceipt>;
|
|
147
|
-
/**
|
|
148
|
-
* Estimate gas cost for addDispenserContract method
|
|
149
|
-
* @param {String} address
|
|
150
|
-
* @param {String} tokenAddress contract address to add
|
|
151
|
-
* @return {Promise<TransactionReceipt>}
|
|
152
|
-
*/
|
|
153
|
-
estGasAddDispenserContract(address: string, tokenAddress: string): Promise<any>;
|
|
154
|
-
/**
|
|
155
|
-
* Add a new contract to dispenser list, after is added, can be used when deploying a new pool
|
|
156
|
-
* @param {String} address
|
|
157
|
-
* @param {String} tokenAddress contract address to add
|
|
158
|
-
* @return {Promise<TransactionReceipt>}
|
|
159
|
-
*/
|
|
160
|
-
addDispenserContract(address: string, tokenAddress: string): Promise<TransactionReceipt>;
|
|
161
|
-
/**
|
|
162
|
-
* Estimate gas cost for addDispenserContract method
|
|
163
|
-
* @param {String} address
|
|
164
|
-
* @param {String} tokenAddress contract address to add
|
|
165
|
-
* @return {Promise<TransactionReceipt>}
|
|
166
|
-
*/
|
|
167
|
-
estGasRemoveDispenserContract(address: string, tokenAddress: string): Promise<any>;
|
|
168
|
-
/**
|
|
169
|
-
* Add a new contract to dispenser list, after is added, can be used when deploying a new pool
|
|
170
|
-
* @param {String} address
|
|
171
|
-
* @param {String} tokenAddress contract address to add
|
|
172
|
-
* @return {Promise<TransactionReceipt>}
|
|
173
|
-
*/
|
|
174
|
-
removeDispenserContract(address: string, tokenAddress: string): Promise<TransactionReceipt>;
|
|
175
|
-
/** Get OPF Fee per token
|
|
176
|
-
* @return {Promise<number>} OPC fee for a specific baseToken
|
|
177
|
-
*/
|
|
178
|
-
getOPCFee(baseToken: string): Promise<number>;
|
|
179
|
-
/** Get Current OPF Fee
|
|
180
|
-
* @return {Promise<number>} OPF fee
|
|
181
|
-
*/
|
|
182
|
-
getCurrentOPCFee(): Promise<number>;
|
|
183
|
-
/**
|
|
184
|
-
* Estimate gas cost for updateOPFFee method
|
|
185
|
-
* @param {String} address
|
|
186
|
-
* @param {String} newFee new OPF Fee
|
|
187
|
-
* @return {Promise<TransactionReceipt>}
|
|
188
|
-
*/
|
|
189
|
-
estGasUpdateOPCFee(address: string, newSwapOceanFee: number, newSwapNonOceanFee: number, newConsumeFee: number, newProviderFee: number): Promise<any>;
|
|
190
|
-
/**
|
|
191
|
-
* Add a new contract to fixedRate list, after is added, can be used when deploying a new pool
|
|
192
|
-
* @param {String} address
|
|
193
|
-
* @param {number} newSwapOceanFee Amount charged for swapping with ocean approved tokens
|
|
194
|
-
* @param {number} newSwapNonOceanFee Amount charged for swapping with non ocean approved tokens
|
|
195
|
-
* @param {number} newConsumeFee Amount charged from consumeFees
|
|
196
|
-
* @param {number} newProviderFee Amount charged for providerFees
|
|
197
|
-
* @return {Promise<TransactionReceipt>}
|
|
198
|
-
*/
|
|
199
|
-
updateOPCFee(address: string, newSwapOceanFee: number, newSwapNonOceanFee: number, newConsumeFee: number, newProviderFee: number): Promise<TransactionReceipt>;
|
|
200
|
-
/**
|
|
201
|
-
* Estimate gas cost for addPoolTemplate method
|
|
202
|
-
* @param {String} address
|
|
203
|
-
* @param {String} templateAddress template address to add
|
|
204
|
-
* @return {Promise<TransactionReceipt>}
|
|
205
|
-
*/
|
|
206
|
-
estGasAddPoolTemplate(address: string, templateAddress: string): Promise<any>;
|
|
207
|
-
/**
|
|
208
|
-
* Add a new template to poolTemplates mapping, after template is added,it can be used
|
|
209
|
-
* @param {String} address
|
|
210
|
-
* @param {String} templateAddress template address to add
|
|
211
|
-
* @return {Promise<TransactionReceipt>}
|
|
212
|
-
*/
|
|
213
|
-
addPoolTemplate(address: string, templateAddress: string): Promise<TransactionReceipt>;
|
|
214
|
-
/**
|
|
215
|
-
* Estimate gas cost for removePoolTemplate method
|
|
216
|
-
* @param {String} address
|
|
217
|
-
* @param {String} templateAddress template address to remove
|
|
218
|
-
* @return {Promise<TransactionReceipt>}
|
|
219
|
-
*/
|
|
220
|
-
estGasRemovePoolTemplate(address: string, templateAddress: string): Promise<any>;
|
|
221
|
-
/**
|
|
222
|
-
* Remove template from poolTemplates mapping, after template is removed,it can be used anymore
|
|
223
|
-
* @param {String} address
|
|
224
|
-
* @param {String} templateAddress template address to remove
|
|
225
|
-
* @return {Promise<TransactionReceipt>}
|
|
226
|
-
*/
|
|
227
|
-
removePoolTemplate(address: string, templateAddress: string): Promise<TransactionReceipt>;
|
|
228
|
-
}
|