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