@dhedge/v2-sdk 1.9.5 → 1.9.6
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/dist/entities/pool.d.ts +76 -39
- package/dist/test/utils/testingHelper.d.ts +1 -0
- package/dist/utils/contract.d.ts +2 -1
- package/dist/v2-sdk.cjs.development.js +965 -437
- package/dist/v2-sdk.cjs.development.js.map +1 -1
- package/dist/v2-sdk.cjs.production.min.js +1 -1
- package/dist/v2-sdk.cjs.production.min.js.map +1 -1
- package/dist/v2-sdk.esm.js +965 -437
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/PoolLogic.json +349 -63
- package/src/entities/pool.ts +334 -222
- package/src/test/oneInch.test.ts +34 -2
- package/src/test/utils/testingHelper.ts +4 -0
- package/src/utils/contract.ts +17 -1
package/dist/entities/pool.d.ts
CHANGED
|
@@ -43,38 +43,42 @@ export declare class Pool {
|
|
|
43
43
|
* Approve the asset for trading and providing liquidity
|
|
44
44
|
* @param {Dapp} dapp Platform like Sushiswap or Uniswap
|
|
45
45
|
* @param {string} asset Address of asset
|
|
46
|
-
* @param
|
|
46
|
+
* @param {BigNumber | string} Amount to be approved
|
|
47
47
|
* @param {any} options Transaction options
|
|
48
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
48
49
|
* @returns {Promise<any>} Transaction
|
|
49
50
|
*/
|
|
50
|
-
approve(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any): Promise<any>;
|
|
51
|
+
approve(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
51
52
|
/**
|
|
52
53
|
* Approve the liquidity pool token for staking
|
|
53
54
|
* @param {Dapp} dapp Platform like Sushiswap or Uniswap
|
|
54
55
|
* @param {string} asset Address of liquidity pool token
|
|
55
56
|
* @param {BigNumber | string} amount Aamount to be approved
|
|
56
57
|
* @param {any} options Transaction options
|
|
58
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
57
59
|
* @returns {Promise<any>} Transaction
|
|
58
60
|
*/
|
|
59
|
-
approveStaking(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any): Promise<any>;
|
|
61
|
+
approveStaking(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
60
62
|
/**
|
|
61
63
|
* Approve the liquidity pool token for staking
|
|
62
64
|
* @param {Dapp} dapp Platform like Sushiswap or Uniswap
|
|
63
65
|
* @param {string} asset Address of liquidity pool token
|
|
64
66
|
* @param {BigNumber | string} amount Aamount to be approved
|
|
65
67
|
* @param {any} options Transaction options
|
|
68
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
66
69
|
* @returns {Promise<any>} Transaction
|
|
67
70
|
*/
|
|
68
|
-
approveUniswapV3Liquidity(asset: string, amount: BigNumber | string, options?: any): Promise<any>;
|
|
71
|
+
approveUniswapV3Liquidity(asset: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
69
72
|
/**
|
|
70
73
|
* Approve the asset for provided spender address
|
|
71
74
|
* @param {string} spender Spender address
|
|
72
75
|
* @param {string} asset Address of asset
|
|
73
76
|
* @param {BigNumber | string} amount to be approved
|
|
74
77
|
* @param {any} options Transaction options
|
|
78
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
75
79
|
* @returns {Promise<any>} Transaction
|
|
76
80
|
*/
|
|
77
|
-
approveSpender(spender: string, asset: string, amount: BigNumber | string, options?: any): Promise<any>;
|
|
81
|
+
approveSpender(spender: string, asset: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
78
82
|
/**
|
|
79
83
|
* Trade an asset into another asset
|
|
80
84
|
* @param {Dapp} dapp Platform like Sushiswap or Uniswap
|
|
@@ -83,9 +87,10 @@ export declare class Pool {
|
|
|
83
87
|
* @param {BigNumber | string} amountIn Amount
|
|
84
88
|
* @param {number} slippage Slippage tolerance in %
|
|
85
89
|
* @param {any} options Transaction options
|
|
90
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
86
91
|
* @returns {Promise<any>} Transaction
|
|
87
92
|
*/
|
|
88
|
-
trade(dapp: Dapp, assetFrom: string, assetTo: string, amountIn: BigNumber | string, slippage?: number, options?: any): Promise<any>;
|
|
93
|
+
trade(dapp: Dapp, assetFrom: string, assetTo: string, amountIn: BigNumber | string, slippage?: number, options?: any, estimateGas?: boolean): Promise<any>;
|
|
89
94
|
/**
|
|
90
95
|
* Add liquidity to a liquidity pool
|
|
91
96
|
* @param {Dapp} dapp Platform like Sushiswap or Uniswap
|
|
@@ -94,9 +99,10 @@ export declare class Pool {
|
|
|
94
99
|
* @param {BigNumber | string} amountA Amount first asset
|
|
95
100
|
* @param {BigNumber | string} amountB Amount second asset
|
|
96
101
|
* @param {any} options Transaction options
|
|
102
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
97
103
|
* @returns {Promise<any>} Transaction
|
|
98
104
|
*/
|
|
99
|
-
addLiquidity(dapp: Dapp, assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, options?: any): Promise<any>;
|
|
105
|
+
addLiquidity(dapp: Dapp, assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
100
106
|
/**
|
|
101
107
|
* Remove liquidity from a liquidity pool
|
|
102
108
|
* @param {Dapp} dapp Platform like Sushiswap or Uniswap
|
|
@@ -104,44 +110,49 @@ export declare class Pool {
|
|
|
104
110
|
* @param {string} assetB Second asset
|
|
105
111
|
* @param {BigNumber | string} amount Amount of liquidity pool tokens
|
|
106
112
|
* @param {any} options Transaction options
|
|
113
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
107
114
|
* @returns {Promise<any>} Transaction
|
|
108
115
|
*/
|
|
109
|
-
removeLiquidity(dapp: Dapp, assetA: string, assetB: string, amount: string | BigNumber, options?: any): Promise<any>;
|
|
116
|
+
removeLiquidity(dapp: Dapp, assetA: string, assetB: string, amount: string | BigNumber, options?: any, estimateGas?: boolean): Promise<any>;
|
|
110
117
|
/**
|
|
111
118
|
* Stake liquidity pool tokens in a yield farm
|
|
112
119
|
* @param {Dapp} dapp Platform like Sushiswap or Uniswap
|
|
113
120
|
* @param {string} asset Liquidity pool token
|
|
114
121
|
* @param {BigNumber | string} amount Amount of liquidity pool tokens
|
|
115
122
|
* @param {any} options Transaction options
|
|
123
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
116
124
|
* @returns {Promise<any>} Transaction
|
|
117
125
|
*/
|
|
118
|
-
stake(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any): Promise<any>;
|
|
126
|
+
stake(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
119
127
|
/**
|
|
120
128
|
* Stake liquidity pool tokens in gauge contract
|
|
121
129
|
* @param {Dapp} dapp Platform like Balancer or Velodrome
|
|
122
130
|
* @param {string} gauge Gauge contract address
|
|
123
131
|
* @param {BigNumber | string} amount Amount of liquidity pool tokens
|
|
124
132
|
* @param {any} options Transaction options
|
|
133
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
125
134
|
* @returns {Promise<any>} Transaction
|
|
126
135
|
*/
|
|
127
|
-
stakeInGauge(dapp: Dapp, gauge: string, amount: BigNumber | string, options?: any): Promise<any>;
|
|
136
|
+
stakeInGauge(dapp: Dapp, gauge: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
128
137
|
/**
|
|
129
138
|
* Unstake liquidity pool tokens from a yield farm
|
|
130
139
|
* @param {Dapp} dapp Platform like Sushiswap or Uniswap
|
|
131
140
|
* @param {string} asset Liquidity pool token
|
|
132
141
|
* @param {BigNumber | string} amount Amount of liquidity pool tokens
|
|
133
142
|
* @param {any} options Transaction options
|
|
143
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
134
144
|
* @returns {Promise<any>} Transaction
|
|
135
145
|
*/
|
|
136
|
-
unStake(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any): Promise<any>;
|
|
146
|
+
unStake(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
137
147
|
/**
|
|
138
148
|
* Unstake liquidity pool tokens from Velodrome or Balancer gauge
|
|
139
149
|
* @param {string} gauge Gauge contract address
|
|
140
150
|
* @param {BigNumber | string} amount Amount of liquidity pool tokens
|
|
141
151
|
* @param {any} options Transaction options
|
|
152
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
142
153
|
* @returns {Promise<any>} Transaction
|
|
143
154
|
*/
|
|
144
|
-
unstakeFromGauge(gauge: string, amount: BigNumber | string, options?: any): Promise<any>;
|
|
155
|
+
unstakeFromGauge(gauge: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
145
156
|
/**
|
|
146
157
|
* Lend asset to a lending pool
|
|
147
158
|
* @param {Dapp} dapp Platform like Aave
|
|
@@ -149,18 +160,20 @@ export declare class Pool {
|
|
|
149
160
|
* @param {BigNumber | string} amount Amount of asset to lend
|
|
150
161
|
* @param {number} referralCode Code from Aave referral program
|
|
151
162
|
* @param {any} options Transaction options
|
|
163
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
152
164
|
* @returns {Promise<any>} Transaction
|
|
153
165
|
*/
|
|
154
|
-
lend(dapp: Dapp, asset: string, amount: BigNumber | string, referralCode?: number, options?: any): Promise<any>;
|
|
166
|
+
lend(dapp: Dapp, asset: string, amount: BigNumber | string, referralCode?: number, options?: any, estimateGas?: boolean): Promise<any>;
|
|
155
167
|
/**
|
|
156
168
|
* Witdraw asset from a lending pool
|
|
157
169
|
* @param {Dapp} dapp Platform like Aave
|
|
158
170
|
* @param {string} asset Asset
|
|
159
171
|
* @param {BigNumber | string} amount Amount of asset to lend
|
|
160
172
|
* @param {any} options Transaction options
|
|
173
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
161
174
|
* @returns {Promise<any>} Transaction
|
|
162
175
|
*/
|
|
163
|
-
withdrawDeposit(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any): Promise<any>;
|
|
176
|
+
withdrawDeposit(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
164
177
|
/**
|
|
165
178
|
* Borrow asset from a lending pool
|
|
166
179
|
* @param {Dapp} dapp Platform like Aave
|
|
@@ -168,26 +181,29 @@ export declare class Pool {
|
|
|
168
181
|
* @param {BigNumber | string} amount Amount of asset to lend
|
|
169
182
|
* @param {number} referralCode Code from Aave referral program
|
|
170
183
|
* @param {any} options Transaction options
|
|
184
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
171
185
|
* @returns {Promise<any>} Transaction
|
|
172
186
|
*/
|
|
173
|
-
borrow(dapp: Dapp, asset: string, amount: BigNumber | string, referralCode?: number, options?: any): Promise<any>;
|
|
187
|
+
borrow(dapp: Dapp, asset: string, amount: BigNumber | string, referralCode?: number, options?: any, estimateGas?: boolean): Promise<any>;
|
|
174
188
|
/**
|
|
175
189
|
* Repays borrowed asset to a lending pool
|
|
176
190
|
* @param {Dapp} dapp Platform like Aave
|
|
177
191
|
* @param {string} asset Asset
|
|
178
192
|
* @param {BigNumber | string} amount Amount of asset to lend
|
|
179
193
|
* @param {any} options Transaction options
|
|
194
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
180
195
|
* @returns {Promise<any>} Transaction
|
|
181
196
|
*/
|
|
182
|
-
repay(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any): Promise<any>;
|
|
197
|
+
repay(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
183
198
|
/**
|
|
184
199
|
* Claim rewards of staked liquidity pool tokens
|
|
185
200
|
* @param {Dapp} dapp Platform like Sushiswap or Uniswap
|
|
186
201
|
* @param {string} asset Liquidity pool token
|
|
187
|
-
* @param {any} options Transaction
|
|
202
|
+
* @param {any} options Transaction option
|
|
203
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
188
204
|
* @returns {Promise<any>} Transaction
|
|
189
205
|
*/
|
|
190
|
-
harvestRewards(dapp: Dapp, asset: string, options?: any): Promise<any>;
|
|
206
|
+
harvestRewards(dapp: Dapp, asset: string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
191
207
|
/**
|
|
192
208
|
* Change enabled pool assets
|
|
193
209
|
* @param {AssetEnabled[]} assets New pool assets
|
|
@@ -208,9 +224,10 @@ export declare class Pool {
|
|
|
208
224
|
* @param {string[] | } assetsIn Array of balancer pool assets
|
|
209
225
|
* @param {BigNumber[] | string[]} amountsIn Array of maximum amounts to provide to pool
|
|
210
226
|
* @param {any} options Transaction options
|
|
227
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
211
228
|
* @returns {Promise<any>} Transaction
|
|
212
229
|
*/
|
|
213
|
-
joinBalancerPool(poolId: string, assets: string[], amountsIn: string[] | BigNumber[], options?: any): Promise<any>;
|
|
230
|
+
joinBalancerPool(poolId: string, assets: string[], amountsIn: string[] | BigNumber[], options?: any, estimateGas?: boolean): Promise<any>;
|
|
214
231
|
/**
|
|
215
232
|
* Invest into a Balancer pool
|
|
216
233
|
* @param {string} poolId Balancer pool id
|
|
@@ -218,24 +235,27 @@ export declare class Pool {
|
|
|
218
235
|
* @param {BigNumber | string } amount Amount of pool tokens to withdraw
|
|
219
236
|
* @param { null | number } singleExitAssetIndex Index of asset to withdraw to
|
|
220
237
|
* @param {any} options Transaction options
|
|
238
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
221
239
|
* @returns {Promise<any>} Transaction
|
|
222
240
|
*/
|
|
223
|
-
exitBalancerPool(poolId: string, assets: string[], amount: string | BigNumber, singleExitAssetIndex?: number | null, options?: any): Promise<any>;
|
|
241
|
+
exitBalancerPool(poolId: string, assets: string[], amount: string | BigNumber, singleExitAssetIndex?: number | null, options?: any, estimateGas?: boolean): Promise<any>;
|
|
224
242
|
/**
|
|
225
243
|
* Claim rewards from Aave platform
|
|
226
244
|
* @param {string[]} assets Aave tokens (deposit/debt) hold by pool
|
|
227
245
|
* @param {any} options Transaction options
|
|
246
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
228
247
|
* @returns {Promise<any>} Transaction
|
|
229
248
|
*/
|
|
230
|
-
harvestAaveRewards(assets: string[], options?: any): Promise<any>;
|
|
249
|
+
harvestAaveRewards(assets: string[], options?: any, estimateGas?: boolean): Promise<any>;
|
|
231
250
|
/**
|
|
232
251
|
* Claim rewards from Aave platform
|
|
233
252
|
* @param {string[]} assets Assets invested in Aave
|
|
234
253
|
* @param {string} rewardAssets Reward token address
|
|
235
254
|
* @param {any} options Transaction options
|
|
255
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
236
256
|
* @returns {Promise<any>} Transaction
|
|
237
257
|
*/
|
|
238
|
-
harvestAaveV3Rewards(assets: string[], rewardAsset: string, options?: any): Promise<any>;
|
|
258
|
+
harvestAaveV3Rewards(assets: string[], rewardAsset: string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
239
259
|
/**
|
|
240
260
|
* Create UniswapV3 liquidity pool
|
|
241
261
|
* @param {string} assetA First asset
|
|
@@ -248,18 +268,20 @@ export declare class Pool {
|
|
|
248
268
|
* @param { number } maxTick Upper tick range
|
|
249
269
|
* @param { FeeAmount } feeAmount Fee tier (Low 0.05%, Medium 0.3%, High 1%)
|
|
250
270
|
* @param {any} options Transaction options
|
|
271
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
251
272
|
* @returns {Promise<any>} Transaction
|
|
252
273
|
*/
|
|
253
|
-
addLiquidityUniswapV3(assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, minPrice: number | null, maxPrice: number | null, minTick: number | null, maxTick: number | null, feeAmount: FeeAmount, options?: any): Promise<any>;
|
|
274
|
+
addLiquidityUniswapV3(assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, minPrice: number | null, maxPrice: number | null, minTick: number | null, maxTick: number | null, feeAmount: FeeAmount, options?: any, estimateGas?: boolean): Promise<any>;
|
|
254
275
|
/**
|
|
255
276
|
* Remove liquidity from an UniswapV3 or Arrakis liquidity pool
|
|
256
277
|
* @param {Dapp} dapp Platform either UniswapV3 or Arrakis
|
|
257
278
|
* @param {string} tokenId Token Id of UniswapV3 position
|
|
258
279
|
* @param {number} amount Amount in percent of assets to be removed
|
|
259
280
|
* @param {any} options Transaction options
|
|
281
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
260
282
|
* @returns {Promise<any>} Transaction
|
|
261
283
|
*/
|
|
262
|
-
decreaseLiquidity(dapp: Dapp, tokenId: string, amount?: number, options?: any): Promise<any>;
|
|
284
|
+
decreaseLiquidity(dapp: Dapp, tokenId: string, amount?: number, options?: any, estimateGas?: boolean): Promise<any>;
|
|
263
285
|
/**
|
|
264
286
|
* Increase liquidity of an UniswapV3 or Arrakis liquidity pool
|
|
265
287
|
* @param {Dapp} dapp Platform either UniswapV3 or Arrakis
|
|
@@ -267,17 +289,19 @@ export declare class Pool {
|
|
|
267
289
|
* @param {BigNumber | string} amountA Amount first asset
|
|
268
290
|
* @param {BigNumber | string} amountB Amount second asset
|
|
269
291
|
* @param {any} options Transaction options
|
|
292
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
270
293
|
* @returns {Promise<any>} Transaction
|
|
271
294
|
*/
|
|
272
|
-
increaseLiquidity(dapp: Dapp, tokenId: string, amountA: BigNumber | string, amountB: BigNumber | string, options?: any): Promise<any>;
|
|
295
|
+
increaseLiquidity(dapp: Dapp, tokenId: string, amountA: BigNumber | string, amountB: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
273
296
|
/**
|
|
274
297
|
* Claim fees of an UniswapV3 liquidity or Arrakis pool
|
|
275
298
|
* @param {Dapp} dapp Platform either UniswapV3 or Arrakis
|
|
276
299
|
* @param {string} tokenId Token Id of UniswapV3 or Gauge address
|
|
277
300
|
* @param {any} options Transaction option
|
|
301
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
278
302
|
* @returns {Promise<any>} Transaction
|
|
279
303
|
*/
|
|
280
|
-
claimFees(dapp: Dapp, tokenId: string, options?: any): Promise<any>;
|
|
304
|
+
claimFees(dapp: Dapp, tokenId: string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
281
305
|
/**
|
|
282
306
|
* Trade an asset into another asset
|
|
283
307
|
* @param {Dapp} dapp Platform like Sushiswap or Uniswap
|
|
@@ -287,9 +311,10 @@ export declare class Pool {
|
|
|
287
311
|
* @param { FeeAmount } feeAmount Fee tier (Low 0.05%, Medium 0.3%, High 1%)
|
|
288
312
|
* @param {number} slippage Slippage tolerance in %
|
|
289
313
|
* @param {any} options Transaction options
|
|
314
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
290
315
|
* @returns {Promise<any>} Transaction
|
|
291
316
|
*/
|
|
292
|
-
tradeUniswapV3(assetFrom: string, assetTo: string, amountIn: BigNumber | string, feeAmount: FeeAmount, slippage?: number, options?: any): Promise<any>;
|
|
317
|
+
tradeUniswapV3(assetFrom: string, assetTo: string, amountIn: BigNumber | string, feeAmount: FeeAmount, slippage?: number, options?: any, estimateGas?: boolean): Promise<any>;
|
|
293
318
|
/**
|
|
294
319
|
* Add liquidity to Velodrome pool
|
|
295
320
|
* @param {string} assetA First asset
|
|
@@ -298,9 +323,10 @@ export declare class Pool {
|
|
|
298
323
|
* @param {BigNumber | string} amountB Amount second asset
|
|
299
324
|
* @param { boolean } isStable Is stable pool
|
|
300
325
|
* @param {any} options Transaction options
|
|
326
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
301
327
|
* @returns {Promise<any>} Transaction
|
|
302
328
|
*/
|
|
303
|
-
addLiquidityVelodrome(assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, isStable: boolean, options?: any): Promise<any>;
|
|
329
|
+
addLiquidityVelodrome(assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, isStable: boolean, options?: any, estimateGas?: boolean): Promise<any>;
|
|
304
330
|
/**
|
|
305
331
|
* Remove liquidity from Velodrome pool
|
|
306
332
|
* @param {string} assetA First asset
|
|
@@ -308,9 +334,10 @@ export declare class Pool {
|
|
|
308
334
|
* @param {BigNumber | string} amount Amount of LP tokens
|
|
309
335
|
* @param { boolean } isStable Is stable pool
|
|
310
336
|
* @param {any} options Transaction options
|
|
337
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
311
338
|
* @returns {Promise<any>} Transaction
|
|
312
339
|
*/
|
|
313
|
-
removeLiquidityVelodrome(assetA: string, assetB: string, amount: BigNumber | string, isStable: boolean, options?: any): Promise<any>;
|
|
340
|
+
removeLiquidityVelodrome(assetA: string, assetB: string, amount: BigNumber | string, isStable: boolean, options?: any, estimateGas?: boolean): Promise<any>;
|
|
314
341
|
/**
|
|
315
342
|
* Add liquidity to Velodrome V2 pool
|
|
316
343
|
* @param {string} assetA First asset
|
|
@@ -319,9 +346,10 @@ export declare class Pool {
|
|
|
319
346
|
* @param {BigNumber | string} amountB Amount second asset
|
|
320
347
|
* @param { boolean } isStable Is stable pool
|
|
321
348
|
* @param {any} options Transaction options
|
|
349
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
322
350
|
* @returns {Promise<any>} Transaction
|
|
323
351
|
*/
|
|
324
|
-
addLiquidityVelodromeV2(assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, isStable: boolean, options?: any): Promise<any>;
|
|
352
|
+
addLiquidityVelodromeV2(assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, isStable: boolean, options?: any, estimateGas?: boolean): Promise<any>;
|
|
325
353
|
/**
|
|
326
354
|
* Remove liquidity from Velodrome V2 pool
|
|
327
355
|
* @param {string} assetA First asset
|
|
@@ -329,9 +357,10 @@ export declare class Pool {
|
|
|
329
357
|
* @param {BigNumber | string} amount Amount of LP tokens
|
|
330
358
|
* @param { boolean } isStable Is stable pool
|
|
331
359
|
* @param {any} options Transaction options
|
|
360
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
332
361
|
* @returns {Promise<any>} Transaction
|
|
333
362
|
*/
|
|
334
|
-
removeLiquidityVelodromeV2(assetA: string, assetB: string, amount: BigNumber | string, isStable: boolean, options?: any): Promise<any>;
|
|
363
|
+
removeLiquidityVelodromeV2(assetA: string, assetB: string, amount: BigNumber | string, isStable: boolean, options?: any, estimateGas?: boolean): Promise<any>;
|
|
335
364
|
/**
|
|
336
365
|
* Add liquidity to Velodrome V2 or Ramses pool
|
|
337
366
|
* @param {Dapp} dapp VelodromeV2 or Ramses
|
|
@@ -341,9 +370,10 @@ export declare class Pool {
|
|
|
341
370
|
* @param {BigNumber | string} amountB Amount second asset
|
|
342
371
|
* @param { boolean } isStable Is stable pool
|
|
343
372
|
* @param {any} options Transaction options
|
|
373
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
344
374
|
* @returns {Promise<any>} Transaction
|
|
345
375
|
*/
|
|
346
|
-
addLiquidityV2(dapp: Dapp.VELODROMEV2 | Dapp.RAMSES, assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, isStable: boolean, options?: any): Promise<any>;
|
|
376
|
+
addLiquidityV2(dapp: Dapp.VELODROMEV2 | Dapp.RAMSES, assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, isStable: boolean, options?: any, estimateGas?: boolean): Promise<any>;
|
|
347
377
|
/**
|
|
348
378
|
* Remove liquidity from Velodrome V2 or Ramses pool
|
|
349
379
|
* @param {Dapp} dapp VelodromeV2 or Ramses
|
|
@@ -352,9 +382,10 @@ export declare class Pool {
|
|
|
352
382
|
* @param {BigNumber | string} amount Amount of LP tokens
|
|
353
383
|
* @param { boolean } isStable Is stable pool
|
|
354
384
|
* @param {any} options Transaction options
|
|
385
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
355
386
|
* @returns {Promise<any>} Transaction
|
|
356
387
|
*/
|
|
357
|
-
removeLiquidityV2(dapp: Dapp.VELODROMEV2 | Dapp.RAMSES, assetA: string, assetB: string, amount: BigNumber | string, isStable: boolean, options?: any): Promise<any>;
|
|
388
|
+
removeLiquidityV2(dapp: Dapp.VELODROMEV2 | Dapp.RAMSES, assetA: string, assetB: string, amount: BigNumber | string, isStable: boolean, options?: any, estimateGas?: boolean): Promise<any>;
|
|
358
389
|
/**
|
|
359
390
|
* Trade options on lyra
|
|
360
391
|
* @param {LyraOptionMarket} market Underlying market e.g. eth
|
|
@@ -367,9 +398,10 @@ export declare class Pool {
|
|
|
367
398
|
* @param {BigNumber | string } collateralChangeAmount Collateral amount to add when shorting options and to remove when covering shorts
|
|
368
399
|
* @param {boolean} isCoveredCall Selling covered call options
|
|
369
400
|
* @param {any} options Transaction options
|
|
401
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
370
402
|
* @returns {Promise<any>} Transaction
|
|
371
403
|
*/
|
|
372
|
-
tradeLyraOption(market: LyraOptionMarket, expiry: number, strike: number, optionType: LyraOptionType, tradeType: LyraTradeType, optionAmount: BigNumber | string, assetIn: string, collateralChangeAmount?: BigNumber | string, isCoveredCall?: boolean, options?: any): Promise<any>;
|
|
404
|
+
tradeLyraOption(market: LyraOptionMarket, expiry: number, strike: number, optionType: LyraOptionType, tradeType: LyraTradeType, optionAmount: BigNumber | string, assetIn: string, collateralChangeAmount?: BigNumber | string, isCoveredCall?: boolean, options?: any, estimateGas?: boolean): Promise<any>;
|
|
373
405
|
/**
|
|
374
406
|
* Gets Lyra option positions
|
|
375
407
|
* @returns {Promise<Position>} Transaction
|
|
@@ -380,24 +412,27 @@ export declare class Pool {
|
|
|
380
412
|
* @param {string} market Address of futures market
|
|
381
413
|
* @param {BigNumber | string } changeAmount Amount to increase/decrease margin
|
|
382
414
|
* @param {any} options Transaction options
|
|
415
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
383
416
|
* @returns {Promise<any>} Transaction
|
|
384
417
|
*/
|
|
385
|
-
changeFuturesMargin(market: string, changeAmount: BigNumber | string, options?: any): Promise<any>;
|
|
418
|
+
changeFuturesMargin(market: string, changeAmount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
386
419
|
/** Change position in Synthetix futures market (long/short)
|
|
387
420
|
*
|
|
388
421
|
* @param {string} market Address of futures market
|
|
389
422
|
* @param {BigNumber | string } changeAmount Negative for short, positive for long
|
|
390
423
|
* @param {any} options Transaction options
|
|
424
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
391
425
|
* @returns {Promise<any>} Transaction
|
|
392
426
|
*/
|
|
393
|
-
changeFuturesPosition(market: string, changeAmount: BigNumber | string, options?: any): Promise<any>;
|
|
427
|
+
changeFuturesPosition(market: string, changeAmount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
394
428
|
/** Cancels an open oder on Synthetix futures market
|
|
395
429
|
*
|
|
396
430
|
* @param {string} market Address of futures market
|
|
397
431
|
* @param {any} options Transaction options
|
|
432
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
398
433
|
* @returns {Promise<any>} Transaction
|
|
399
434
|
*/
|
|
400
|
-
cancelFuturesOrder(market: string, options?: any): Promise<any>;
|
|
435
|
+
cancelFuturesOrder(market: string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
401
436
|
/**
|
|
402
437
|
* mintManagerFee
|
|
403
438
|
* @param {any} options Transaction options
|
|
@@ -414,15 +449,17 @@ export declare class Pool {
|
|
|
414
449
|
* @param {string} tokenAddress Address of the token to vest
|
|
415
450
|
* @param {BigNumber | string } changeAmount Negative for short, positive for long
|
|
416
451
|
* @param {any} options Transaction options
|
|
452
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
417
453
|
* @returns {Promise<any>} Transaction
|
|
418
454
|
*/
|
|
419
|
-
vestTokens(tokenAddress: string, amount: BigNumber | string, options?: any): Promise<any>;
|
|
455
|
+
vestTokens(tokenAddress: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
420
456
|
/** Exit position of vested tokens (e.g. Ramses xoRAM)
|
|
421
457
|
*
|
|
422
458
|
* @param {string} tokenAddress Address of the token to vest
|
|
423
459
|
* @param {number } id position Id of the vested tokens
|
|
424
460
|
* @param {any} options Transaction options
|
|
461
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
425
462
|
* @returns {Promise<any>} Transaction
|
|
426
463
|
*/
|
|
427
|
-
exitVestedToken(tokenAddress: string, id: number, options?: any): Promise<any>;
|
|
464
|
+
exitVestedToken(tokenAddress: string, id: number, options?: any, estimateGas?: boolean): Promise<any>;
|
|
428
465
|
}
|
package/dist/utils/contract.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ethers, Network } from "..";
|
|
1
|
+
import { ethers, Network, Pool } from "..";
|
|
2
2
|
export declare function call(provider: ethers.Signer, abi: any[], call: any[], options?: any): Promise<any>;
|
|
3
3
|
export declare function multicall<T>(network: Network, provider: ethers.Signer, abi: any[], calls: any[], options?: any, requireSuccess?: boolean): Promise<(T | null)[]>;
|
|
4
4
|
export declare class Multicaller {
|
|
@@ -12,3 +12,4 @@ export declare class Multicaller {
|
|
|
12
12
|
call(path: any, address: any, fn: any, params?: any): Multicaller;
|
|
13
13
|
execute(from?: any): Promise<any>;
|
|
14
14
|
}
|
|
15
|
+
export declare const getPoolTxOrGasEstimate: (pool: Pool, args: any[], estimateGas: boolean) => Promise<any>;
|