@dhedge/v2-sdk 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { Contract, ethers, Wallet, BigNumber } from "ethers";
2
- import { Dapp, FundComposition, AssetEnabled, Network, LyraOptionMarket, LyraOptionType, LyraTradeType, LyraPosition } from "../types";
2
+ import { Dapp, FundComposition, AssetEnabled, Network, LyraOptionMarket, LyraOptionType, LyraTradeType, LyraPosition, SDKOptions } from "../types";
3
3
  import { Utils } from "./utils";
4
4
  export declare class Pool {
5
5
  readonly poolLogic: Contract;
@@ -48,50 +48,50 @@ export declare class Pool {
48
48
  * @param {string} asset Address of asset
49
49
  * @param {BigNumber | string} Amount to be approved
50
50
  * @param {any} options Transaction options
51
- * @param {boolean} estimateGas Simulate/estimate gas
51
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
52
52
  * @returns {Promise<any>} Transaction
53
53
  */
54
- approve(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
54
+ approve(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
55
55
  /**
56
56
  * Approve the liquidity pool token for staking
57
57
  * @param {Dapp} dapp Platform like Sushiswap or Uniswap
58
58
  * @param {string} asset Address of liquidity pool token
59
59
  * @param {BigNumber | string} amount Aamount to be approved
60
60
  * @param {any} options Transaction options
61
- * @param {boolean} estimateGas Simulate/estimate gas
61
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
62
62
  * @returns {Promise<any>} Transaction
63
63
  */
64
- approveStaking(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
64
+ approveStaking(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
65
65
  /**
66
66
  * Approve the liquidity pool token for staking
67
67
  * @param {Dapp} dapp Platform like Sushiswap or Uniswap
68
68
  * @param {string} asset Address of liquidity pool token
69
69
  * @param {BigNumber | string} amount Aamount to be approved
70
70
  * @param {any} options Transaction options
71
- * @param {boolean} estimateGas Simulate/estimate gas
71
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
72
72
  * @returns {Promise<any>} Transaction
73
73
  */
74
- approveUniswapV3Liquidity(asset: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
74
+ approveUniswapV3Liquidity(asset: string, amount: BigNumber | string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
75
75
  /**
76
76
  * Approve the asset for provided spender address
77
77
  * @param {string} spender Spender address
78
78
  * @param {string} asset Address of asset
79
79
  * @param {BigNumber | string} amount to be approved
80
80
  * @param {any} options Transaction options
81
- * @param {boolean} estimateGas Simulate/estimate gas
81
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
82
82
  * @returns {Promise<any>} Transaction
83
83
  */
84
- approveSpender(spender: string, asset: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
84
+ approveSpender(spender: string, asset: string, amount: BigNumber | string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
85
85
  /**
86
86
  * Approve NFT for provided spender address
87
87
  * @param {string} spender Spender address
88
88
  * @param {string} asset Address of asset
89
89
  * @param {string} tokenId NFT id
90
90
  * @param {any} options Transaction options
91
- * @param {boolean} estimateGas Simulate/estimate gas
91
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
92
92
  * @returns {Promise<any>} Transaction
93
93
  */
94
- approveSpenderNFT(spender: string, asset: string, tokenId: string, options?: any, estimateGas?: boolean): Promise<any>;
94
+ approveSpenderNFT(spender: string, asset: string, tokenId: string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
95
95
  /**
96
96
  * Trade an asset into another asset
97
97
  * @param {Dapp} dapp Platform like Sushiswap or Uniswap
@@ -100,10 +100,10 @@ export declare class Pool {
100
100
  * @param {BigNumber | string} amountIn Amount
101
101
  * @param {number} slippage Slippage tolerance in %
102
102
  * @param {any} options Transaction options
103
- * @param {boolean} estimateGas Simulate/estimate gas
103
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
104
104
  * @returns {Promise<any>} Transaction
105
105
  */
106
- trade(dapp: Dapp, assetFrom: string, assetTo: string, amountIn: BigNumber | string, slippage?: number, options?: any, estimateGas?: boolean): Promise<any>;
106
+ trade(dapp: Dapp, assetFrom: string, assetTo: string, amountIn: BigNumber | string, slippage?: number, options?: any, sdkOptions?: SDKOptions): Promise<any>;
107
107
  /**
108
108
  * Add liquidity to a liquidity pool
109
109
  * @param {Dapp} dapp Platform like Sushiswap or Uniswap
@@ -112,10 +112,10 @@ export declare class Pool {
112
112
  * @param {BigNumber | string} amountA Amount first asset
113
113
  * @param {BigNumber | string} amountB Amount second asset
114
114
  * @param {any} options Transaction options
115
- * @param {boolean} estimateGas Simulate/estimate gas
115
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
116
116
  * @returns {Promise<any>} Transaction
117
117
  */
118
- addLiquidity(dapp: Dapp, assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
118
+ addLiquidity(dapp: Dapp, assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
119
119
  /**
120
120
  * Remove liquidity from a liquidity pool
121
121
  * @param {Dapp} dapp Platform like Sushiswap or Uniswap
@@ -123,49 +123,49 @@ export declare class Pool {
123
123
  * @param {string} assetB Second asset
124
124
  * @param {BigNumber | string} amount Amount of liquidity pool tokens
125
125
  * @param {any} options Transaction options
126
- * @param {boolean} estimateGas Simulate/estimate gas
126
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
127
127
  * @returns {Promise<any>} Transaction
128
128
  */
129
- removeLiquidity(dapp: Dapp, assetA: string, assetB: string, amount: string | BigNumber, options?: any, estimateGas?: boolean): Promise<any>;
129
+ removeLiquidity(dapp: Dapp, assetA: string, assetB: string, amount: string | BigNumber, options?: any, sdkOptions?: SDKOptions): Promise<any>;
130
130
  /**
131
131
  * Stake liquidity pool tokens in a yield farm
132
132
  * @param {Dapp} dapp Platform like Sushiswap or Uniswap
133
133
  * @param {string} asset Liquidity pool token
134
134
  * @param {BigNumber | string} amount Amount of liquidity pool tokens
135
135
  * @param {any} options Transaction options
136
- * @param {boolean} estimateGas Simulate/estimate gas
136
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
137
137
  * @returns {Promise<any>} Transaction
138
138
  */
139
- stake(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
139
+ stake(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
140
140
  /**
141
141
  * Stake liquidity pool tokens in gauge contract
142
142
  * @param {Dapp} dapp Platform like Balancer or Velodrome
143
143
  * @param {string} gauge Gauge contract address
144
144
  * @param {BigNumber | string} amount Amount of liquidity pool tokens or token ID for Velodrome CL
145
145
  * @param {any} options Transaction options
146
- * @param {boolean} estimateGas Simulate/estimate gas
146
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
147
147
  * @returns {Promise<any>} Transaction
148
148
  */
149
- stakeInGauge(dapp: Dapp, gauge: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
149
+ stakeInGauge(dapp: Dapp, gauge: string, amount: BigNumber | string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
150
150
  /**
151
151
  * Unstake liquidity pool tokens from a yield farm
152
152
  * @param {Dapp} dapp Platform like Sushiswap or Uniswap
153
153
  * @param {string} asset Liquidity pool token
154
154
  * @param {BigNumber | string} amount Amount of liquidity pool tokens
155
155
  * @param {any} options Transaction options
156
- * @param {boolean} estimateGas Simulate/estimate gas
156
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
157
157
  * @returns {Promise<any>} Transaction
158
158
  */
159
- unStake(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
159
+ unStake(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
160
160
  /**
161
161
  * Unstake liquidity pool tokens from Velodrome or Balancer gauge
162
162
  * @param {string} gauge Gauge contract address
163
163
  * @param {BigNumber | string} amount Amount of liquidity pool tokens or CL token ID
164
164
  * @param {any} options Transaction options
165
- * @param {boolean} estimateGas Simulate/estimate gas
165
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
166
166
  * @returns {Promise<any>} Transaction
167
167
  */
168
- unstakeFromGauge(gauge: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
168
+ unstakeFromGauge(gauge: string, amount: BigNumber | string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
169
169
  /**
170
170
  * Lend asset to a lending pool
171
171
  * @param {Dapp} dapp Platform like Aave
@@ -173,40 +173,40 @@ export declare class Pool {
173
173
  * @param {BigNumber | string} amount Amount of asset to lend
174
174
  * @param {number} referralCode Code from Aave referral program
175
175
  * @param {any} options Transaction options
176
- * @param {boolean} estimateGas Simulate/estimate gas
176
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
177
177
  * @returns {Promise<any>} Transaction
178
178
  */
179
- lend(dapp: Dapp, asset: string, amount: BigNumber | string, referralCode?: number, options?: any, estimateGas?: boolean): Promise<any>;
179
+ lend(dapp: Dapp, asset: string, amount: BigNumber | string, referralCode?: number, options?: any, sdkOptions?: SDKOptions): Promise<any>;
180
180
  /**
181
181
  * Lend asset to a Compound V3 or Fluid lending pool
182
182
  * @param {string} market Address of cToken or fToken
183
183
  * @param {string} asset Asset
184
184
  * @param {BigNumber | string} amount Amount of asset to lend
185
185
  * @param {any} options Transaction options
186
- * @param {boolean} estimateGas Simulate/estimate gas
186
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
187
187
  * @returns {Promise<any>} Transaction
188
188
  */
189
- lendCompoundV3(market: string, asset: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
189
+ lendCompoundV3(market: string, asset: string, amount: BigNumber | string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
190
190
  /**
191
191
  * Witdraw asset from a lending pool
192
192
  * @param {Dapp} dapp Platform like Aave
193
193
  * @param {string} asset Asset
194
194
  * @param {BigNumber | string} amount Amount of asset to lend
195
195
  * @param {any} options Transaction options
196
- * @param {boolean} estimateGas Simulate/estimate gas
196
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
197
197
  * @returns {Promise<any>} Transaction
198
198
  */
199
- withdrawDeposit(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
199
+ withdrawDeposit(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
200
200
  /**
201
201
  * Witdraw asset from a Compound V3 or Fluid lending pool
202
202
  * @param {string} market Address of cToken or fToken
203
203
  * @param {string} asset Asset
204
204
  * @param {BigNumber | string} amount Amount of asset to withdraw
205
205
  * @param {any} options Transaction options
206
- * @param {boolean} estimateGas Simulate/estimate gas
206
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
207
207
  * @returns {Promise<any>} Transaction
208
208
  */
209
- withdrawCompoundV3(market: string, asset: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
209
+ withdrawCompoundV3(market: string, asset: string, amount: BigNumber | string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
210
210
  /**
211
211
  * Borrow asset from a lending pool
212
212
  * @param {Dapp} dapp Platform like Aave
@@ -214,29 +214,29 @@ export declare class Pool {
214
214
  * @param {BigNumber | string} amount Amount of asset to lend
215
215
  * @param {number} referralCode Code from Aave referral program
216
216
  * @param {any} options Transaction options
217
- * @param {boolean} estimateGas Simulate/estimate gas
217
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
218
218
  * @returns {Promise<any>} Transaction
219
219
  */
220
- borrow(dapp: Dapp, asset: string, amount: BigNumber | string, referralCode?: number, options?: any, estimateGas?: boolean): Promise<any>;
220
+ borrow(dapp: Dapp, asset: string, amount: BigNumber | string, referralCode?: number, options?: any, sdkOptions?: SDKOptions): Promise<any>;
221
221
  /**
222
222
  * Repays borrowed asset to a lending pool
223
223
  * @param {Dapp} dapp Platform like Aave
224
224
  * @param {string} asset Asset
225
225
  * @param {BigNumber | string} amount Amount of asset to lend
226
226
  * @param {any} options Transaction options
227
- * @param {boolean} estimateGas Simulate/estimate gas
227
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
228
228
  * @returns {Promise<any>} Transaction
229
229
  */
230
- repay(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
230
+ repay(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
231
231
  /**
232
232
  * Claim rewards of staked liquidity pool tokens
233
233
  * @param {Dapp} dapp Platform like Sushiswap or Uniswap
234
234
  * @param {string} asset Liquidity pool token
235
235
  * @param {any} options Transaction option
236
- * @param {boolean} estimateGas Simulate/estimate gas
236
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
237
237
  * @returns {Promise<any>} Transaction
238
238
  */
239
- harvestRewards(dapp: Dapp, asset: string, options?: any, estimateGas?: boolean): Promise<any>;
239
+ harvestRewards(dapp: Dapp, asset: string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
240
240
  /**
241
241
  * Change enabled pool assets
242
242
  * @param {AssetEnabled[]} assets New pool assets
@@ -259,10 +259,10 @@ export declare class Pool {
259
259
  * @param {string[] | } assetsIn Array of balancer pool assets
260
260
  * @param {BigNumber[] | string[]} amountsIn Array of maximum amounts to provide to pool
261
261
  * @param {any} options Transaction options
262
- * @param {boolean} estimateGas Simulate/estimate gas
262
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
263
263
  * @returns {Promise<any>} Transaction
264
264
  */
265
- joinBalancerPool(poolId: string, assets: string[], amountsIn: string[] | BigNumber[], options?: any, estimateGas?: boolean): Promise<any>;
265
+ joinBalancerPool(poolId: string, assets: string[], amountsIn: string[] | BigNumber[], options?: any, sdkOptions?: SDKOptions): Promise<any>;
266
266
  /**
267
267
  * Invest into a Balancer pool
268
268
  * @param {string} poolId Balancer pool id
@@ -270,35 +270,35 @@ export declare class Pool {
270
270
  * @param {BigNumber | string } amount Amount of pool tokens to withdraw
271
271
  * @param { null | number } singleExitAssetIndex Index of asset to withdraw to
272
272
  * @param {any} options Transaction options
273
- * @param {boolean} estimateGas Simulate/estimate gas
273
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
274
274
  * @returns {Promise<any>} Transaction
275
275
  */
276
- exitBalancerPool(poolId: string, assets: string[], amount: string | BigNumber, singleExitAssetIndex?: number | null, options?: any, estimateGas?: boolean): Promise<any>;
276
+ exitBalancerPool(poolId: string, assets: string[], amount: string | BigNumber, singleExitAssetIndex?: number | null, options?: any, sdkOptions?: SDKOptions): Promise<any>;
277
277
  /**
278
278
  * Claim rewards from Aave platform
279
279
  * @param {string[]} assets Aave tokens (deposit/debt) hold by pool
280
280
  * @param {any} options Transaction options
281
- * @param {boolean} estimateGas Simulate/estimate gas
281
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
282
282
  * @returns {Promise<any>} Transaction
283
283
  */
284
- harvestAaveRewards(assets: string[], options?: any, estimateGas?: boolean): Promise<any>;
284
+ harvestAaveRewards(assets: string[], options?: any, sdkOptions?: SDKOptions): Promise<any>;
285
285
  /**
286
286
  * Claim rewards from Aave platform
287
287
  * @param {string[]} assets Assets invested in Aave
288
288
  * @param {string} rewardAssets Reward token address
289
289
  * @param {any} options Transaction options
290
- * @param {boolean} estimateGas Simulate/estimate gas
290
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
291
291
  * @returns {Promise<any>} Transaction
292
292
  */
293
- harvestAaveV3Rewards(assets: string[], rewardAsset: string, options?: any, estimateGas?: boolean): Promise<any>;
293
+ harvestAaveV3Rewards(assets: string[], rewardAsset: string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
294
294
  /**
295
295
  * Claim rewards from CompoundV3
296
296
  * @param {string} asset Compound lending asset
297
297
  * @param {any} options Transaction options
298
- * @param {boolean} estimateGas Simulate/estimate gas
298
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
299
299
  * @returns {Promise<any>} Transaction
300
300
  */
301
- harvestCompoundV3Rewards(asset: string, options?: any, estimateGas?: boolean): Promise<any>;
301
+ harvestCompoundV3Rewards(asset: string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
302
302
  /**
303
303
  * Create UniswapV3 liquidity pool
304
304
  * @param {dapp} Platform UniswapV3, VelodromeCL, AerodromeCL or RamesesCL
@@ -312,20 +312,20 @@ export declare class Pool {
312
312
  * @param { number } maxTick Upper tick range
313
313
  * @param { number } feeAmountOrTickSpacing Fee tier UniswapV3 or tick spacing VelodromeCL
314
314
  * @param {any} options Transaction options
315
- * @param {boolean} estimateGas Simulate/estimate gas
315
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
316
316
  * @returns {Promise<any>} Transaction
317
317
  */
318
- addLiquidityUniswapV3(dapp: Dapp.UNISWAPV3 | Dapp.VELODROMECL | Dapp.AERODROMECL | Dapp.RAMSESCL | Dapp.PANCAKECL, assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, minPrice: number | null, maxPrice: number | null, minTick: number | null, maxTick: number | null, feeAmountOrTickSpacing: number, options?: any, estimateGas?: boolean): Promise<any>;
318
+ addLiquidityUniswapV3(dapp: Dapp.UNISWAPV3 | Dapp.VELODROMECL | Dapp.AERODROMECL | Dapp.RAMSESCL | Dapp.PANCAKECL, assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, minPrice: number | null, maxPrice: number | null, minTick: number | null, maxTick: number | null, feeAmountOrTickSpacing: number, options?: any, sdkOptions?: SDKOptions): Promise<any>;
319
319
  /**
320
320
  * Remove liquidity from an UniswapV3 or Arrakis liquidity pool
321
321
  * @param {Dapp} dapp Platform either UniswapV3 or Arrakis
322
322
  * @param {string} tokenId Token Id of UniswapV3 position
323
323
  * @param {number} amount Amount in percent of assets to be removed
324
324
  * @param {any} options Transaction options
325
- * @param {boolean} estimateGas Simulate/estimate gas
325
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
326
326
  * @returns {Promise<any>} Transaction
327
327
  */
328
- decreaseLiquidity(dapp: Dapp, tokenId: string, amount?: number, options?: any, estimateGas?: boolean): Promise<any>;
328
+ decreaseLiquidity(dapp: Dapp, tokenId: string, amount?: number, options?: any, sdkOptions?: SDKOptions): Promise<any>;
329
329
  /**
330
330
  * Increase liquidity of an UniswapV, VelodromeCL or Arrakis liquidity pool
331
331
  * @param {Dapp} dapp Platform either UniswapV3 or Arrakis
@@ -333,29 +333,29 @@ export declare class Pool {
333
333
  * @param {BigNumber | string} amountA Amount first asset
334
334
  * @param {BigNumber | string} amountB Amount second asset
335
335
  * @param {any} options Transaction options
336
- * @param {boolean} estimateGas Simulate/estimate gas
336
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
337
337
  * @returns {Promise<any>} Transaction
338
338
  */
339
- increaseLiquidity(dapp: Dapp, tokenId: string, amountA: BigNumber | string, amountB: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
339
+ increaseLiquidity(dapp: Dapp, tokenId: string, amountA: BigNumber | string, amountB: BigNumber | string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
340
340
  /**
341
341
  * Claim fees of an UniswapV3 liquidity or Arrakis pool
342
342
  * @param {Dapp} dapp Platform either UniswapV3 or Arrakis
343
343
  * @param {string} tokenId Token Id of UniswapV3 or Gauge address
344
344
  * @param {any} options Transaction option
345
- * @param {boolean} estimateGas Simulate/estimate gas
345
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
346
346
  * @returns {Promise<any>} Transaction
347
347
  */
348
- claimFees(dapp: Dapp, tokenId: string, options?: any, estimateGas?: boolean): Promise<any>;
348
+ claimFees(dapp: Dapp, tokenId: string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
349
349
  /**
350
350
  * Get rewards of an NFT position
351
351
  * @param {Dapp} dapp Platform e.g. Ramses CL
352
352
  * @param {string} tokenId Token Id
353
353
  * @param {string[]} rewards Reward tokens
354
354
  * @param {any} options Transaction option
355
- * @param {boolean} estimateGas Simulate/estimate gas
355
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
356
356
  * @returns {Promise<any>} Transaction
357
357
  */
358
- getRewards(dapp: Dapp, tokenId: string, rewards: string[], options?: any, estimateGas?: boolean): Promise<any>;
358
+ getRewards(dapp: Dapp, tokenId: string, rewards: string[], options?: any, sdkOptions?: SDKOptions): Promise<any>;
359
359
  /**
360
360
  * Trade an asset into another asset
361
361
  * @param {Dapp} dapp Platform like Sushiswap or Uniswap
@@ -365,10 +365,10 @@ export declare class Pool {
365
365
  * @param { FeeAmount } feeAmount Fee tier (Low 0.05%, Medium 0.3%, High 1%)
366
366
  * @param {number} slippage Slippage tolerance in %
367
367
  * @param {any} options Transaction options
368
- * @param {boolean} estimateGas Simulate/estimate gas
368
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
369
369
  * @returns {Promise<any>} Transaction
370
370
  */
371
- tradeUniswapV3(assetFrom: string, assetTo: string, amountIn: BigNumber | string, feeAmount: number, slippage?: number, options?: any, estimateGas?: boolean): Promise<any>;
371
+ tradeUniswapV3(assetFrom: string, assetTo: string, amountIn: BigNumber | string, feeAmount: number, slippage?: number, options?: any, sdkOptions?: SDKOptions): Promise<any>;
372
372
  /**
373
373
  * Add liquidity to Velodrome pool
374
374
  * @param {string} assetA First asset
@@ -377,10 +377,10 @@ export declare class Pool {
377
377
  * @param {BigNumber | string} amountB Amount second asset
378
378
  * @param { boolean } isStable Is stable pool
379
379
  * @param {any} options Transaction options
380
- * @param {boolean} estimateGas Simulate/estimate gas
380
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
381
381
  * @returns {Promise<any>} Transaction
382
382
  */
383
- addLiquidityVelodrome(assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, isStable: boolean, options?: any, estimateGas?: boolean): Promise<any>;
383
+ addLiquidityVelodrome(assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, isStable: boolean, options?: any, sdkOptions?: SDKOptions): Promise<any>;
384
384
  /**
385
385
  * Remove liquidity from Velodrome pool
386
386
  * @param {string} assetA First asset
@@ -388,10 +388,10 @@ export declare class Pool {
388
388
  * @param {BigNumber | string} amount Amount of LP tokens
389
389
  * @param { boolean } isStable Is stable pool
390
390
  * @param {any} options Transaction options
391
- * @param {boolean} estimateGas Simulate/estimate gas
391
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
392
392
  * @returns {Promise<any>} Transaction
393
393
  */
394
- removeLiquidityVelodrome(assetA: string, assetB: string, amount: BigNumber | string, isStable: boolean, options?: any, estimateGas?: boolean): Promise<any>;
394
+ removeLiquidityVelodrome(assetA: string, assetB: string, amount: BigNumber | string, isStable: boolean, options?: any, sdkOptions?: SDKOptions): Promise<any>;
395
395
  /**
396
396
  * Add liquidity to Velodrome V2 pool
397
397
  * @param {string} assetA First asset
@@ -400,10 +400,10 @@ export declare class Pool {
400
400
  * @param {BigNumber | string} amountB Amount second asset
401
401
  * @param { boolean } isStable Is stable pool
402
402
  * @param {any} options Transaction options
403
- * @param {boolean} estimateGas Simulate/estimate gas
403
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
404
404
  * @returns {Promise<any>} Transaction
405
405
  */
406
- addLiquidityVelodromeV2(assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, isStable: boolean, options?: any, estimateGas?: boolean): Promise<any>;
406
+ addLiquidityVelodromeV2(assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, isStable: boolean, options?: any, sdkOptions?: SDKOptions): Promise<any>;
407
407
  /**
408
408
  * Remove liquidity from Velodrome V2 pool
409
409
  * @param {string} assetA First asset
@@ -411,10 +411,10 @@ export declare class Pool {
411
411
  * @param {BigNumber | string} amount Amount of LP tokens
412
412
  * @param { boolean } isStable Is stable pool
413
413
  * @param {any} options Transaction options
414
- * @param {boolean} estimateGas Simulate/estimate gas
414
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
415
415
  * @returns {Promise<any>} Transaction
416
416
  */
417
- removeLiquidityVelodromeV2(assetA: string, assetB: string, amount: BigNumber | string, isStable: boolean, options?: any, estimateGas?: boolean): Promise<any>;
417
+ removeLiquidityVelodromeV2(assetA: string, assetB: string, amount: BigNumber | string, isStable: boolean, options?: any, sdkOptions?: SDKOptions): Promise<any>;
418
418
  /**
419
419
  * Add liquidity to Velodrome V2 or Ramses pool
420
420
  * @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
@@ -424,10 +424,10 @@ export declare class Pool {
424
424
  * @param {BigNumber | string} amountB Amount second asset
425
425
  * @param { boolean } isStable Is stable pool
426
426
  * @param {any} options Transaction options
427
- * @param {boolean} estimateGas Simulate/estimate gas
427
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
428
428
  * @returns {Promise<any>} Transaction
429
429
  */
430
- addLiquidityV2(dapp: Dapp.VELODROMEV2 | Dapp.RAMSES | Dapp.AERODROME, assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, isStable: boolean, options?: any, estimateGas?: boolean): Promise<any>;
430
+ addLiquidityV2(dapp: Dapp.VELODROMEV2 | Dapp.RAMSES | Dapp.AERODROME, assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, isStable: boolean, options?: any, sdkOptions?: SDKOptions): Promise<any>;
431
431
  /**
432
432
  * Remove liquidity from Velodrome V2 or Ramses pool
433
433
  * @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
@@ -436,10 +436,10 @@ export declare class Pool {
436
436
  * @param {BigNumber | string} amount Amount of LP tokens
437
437
  * @param { boolean } isStable Is stable pool
438
438
  * @param {any} options Transaction options
439
- * @param {boolean} estimateGas Simulate/estimate gas
439
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
440
440
  * @returns {Promise<any>} Transaction
441
441
  */
442
- removeLiquidityV2(dapp: Dapp.VELODROMEV2 | Dapp.RAMSES | Dapp.AERODROME, assetA: string, assetB: string, amount: BigNumber | string, isStable: boolean, options?: any, estimateGas?: boolean): Promise<any>;
442
+ removeLiquidityV2(dapp: Dapp.VELODROMEV2 | Dapp.RAMSES | Dapp.AERODROME, assetA: string, assetB: string, amount: BigNumber | string, isStable: boolean, options?: any, sdkOptions?: SDKOptions): Promise<any>;
443
443
  /**
444
444
  * Trade options on lyra
445
445
  * @param {LyraOptionMarket} market Underlying market e.g. eth
@@ -452,10 +452,10 @@ export declare class Pool {
452
452
  * @param {BigNumber | string } collateralChangeAmount Collateral amount to add when shorting options and to remove when covering shorts
453
453
  * @param {boolean} isCoveredCall Selling covered call options
454
454
  * @param {any} options Transaction options
455
- * @param {boolean} estimateGas Simulate/estimate gas
455
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
456
456
  * @returns {Promise<any>} Transaction
457
457
  */
458
- 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>;
458
+ tradeLyraOption(market: LyraOptionMarket, expiry: number, strike: number, optionType: LyraOptionType, tradeType: LyraTradeType, optionAmount: BigNumber | string, assetIn: string, collateralChangeAmount?: BigNumber | string, isCoveredCall?: boolean, options?: any, sdkOptions?: SDKOptions): Promise<any>;
459
459
  /**
460
460
  * Gets Lyra option positions
461
461
  * @returns {Promise<Position>} Transaction
@@ -466,27 +466,27 @@ export declare class Pool {
466
466
  * @param {string} market Address of futures market
467
467
  * @param {BigNumber | string } changeAmount Amount to increase/decrease margin
468
468
  * @param {any} options Transaction options
469
- * @param {boolean} estimateGas Simulate/estimate gas
469
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
470
470
  * @returns {Promise<any>} Transaction
471
471
  */
472
- changeFuturesMargin(market: string, changeAmount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
472
+ changeFuturesMargin(market: string, changeAmount: BigNumber | string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
473
473
  /** Change position in Synthetix futures market (long/short)
474
474
  *
475
475
  * @param {string} market Address of futures market
476
476
  * @param {BigNumber | string } changeAmount Negative for short, positive for long
477
477
  * @param {any} options Transaction options
478
- * @param {boolean} estimateGas Simulate/estimate gas
478
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
479
479
  * @returns {Promise<any>} Transaction
480
480
  */
481
- changeFuturesPosition(market: string, changeAmount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
481
+ changeFuturesPosition(market: string, changeAmount: BigNumber | string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
482
482
  /** Cancels an open oder on Synthetix futures market
483
483
  *
484
484
  * @param {string} market Address of futures market
485
485
  * @param {any} options Transaction options
486
- * @param {boolean} estimateGas Simulate/estimate gas
486
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
487
487
  * @returns {Promise<any>} Transaction
488
488
  */
489
- cancelFuturesOrder(market: string, options?: any, estimateGas?: boolean): Promise<any>;
489
+ cancelFuturesOrder(market: string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
490
490
  /**
491
491
  * mintManagerFee
492
492
  * @param {any} options Transaction options
@@ -504,47 +504,47 @@ export declare class Pool {
504
504
  * @param {string} tokenAddress Address of the token to vest
505
505
  * @param {BigNumber | string } changeAmount Negative for short, positive for long
506
506
  * @param {any} options Transaction options
507
- * @param {boolean} estimateGas Simulate/estimate gas
507
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
508
508
  * @returns {Promise<any>} Transaction
509
509
  */
510
- vestTokens(tokenAddress: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
510
+ vestTokens(tokenAddress: string, amount: BigNumber | string, options?: any, sdkOptions?: SDKOptions): Promise<any>;
511
511
  /** Exit position of vested tokens (e.g. Ramses xoRAM)
512
512
  *
513
513
  * @param {string} tokenAddress Address of the token to vest
514
514
  * @param {number } id position Id of the vested tokens
515
515
  * @param {any} options Transaction options
516
- * @param {boolean} estimateGas Simulate/estimate gas
516
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
517
517
  * @returns {Promise<any>} Transaction
518
518
  */
519
- exitVestedToken(tokenAddress: string, id: number, options?: any, estimateGas?: boolean): Promise<any>;
519
+ exitVestedToken(tokenAddress: string, id: number, options?: any, sdkOptions?: SDKOptions): Promise<any>;
520
520
  /** deposit rETH to mint UNIT via the Flat Money protocol
521
521
  *
522
522
  * @param { BigNumber | string } depositAmount Amount of rETH to deposit
523
523
  * @param { number } slippage slippage, 0.5 represents 0.5%
524
524
  * @param { number | null } maxKeeperFeeInUsd 5 represents $5; null will skip the maxKeeperFee check
525
525
  * @param {any} options Transaction options
526
- * @param {boolean} estimateGas Simulate/estimate gas
526
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
527
527
  * @returns {Promise<any>} Transaction
528
528
  */
529
- mintUnitViaFlatMoney(depositAmount: ethers.BigNumber | string, slippage: number | undefined, maxKeeperFeeInUsd: number | null, options?: any, estimateGas?: boolean): Promise<any>;
529
+ mintUnitViaFlatMoney(depositAmount: ethers.BigNumber | string, slippage: number | undefined, maxKeeperFeeInUsd: number | null, options?: any, sdkOptions?: SDKOptions): Promise<any>;
530
530
  /** redeem UNIT via the Flat Money protocol
531
531
  *
532
532
  * @param { BigNumber | string } depositAmount Amount of UNIT to withdraw
533
533
  * @param { number } slippage slippage, 0.5 represents 0.5%
534
534
  * @param { number | null } maxKeeperFeeInUsd 5 represents $5; null will skip the maxKeeperFee check
535
535
  * @param {any} options Transaction options
536
- * @param {boolean} estimateGas Simulate/estimate gas
536
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
537
537
  * @returns {Promise<any>} Transaction
538
538
  */
539
- redeemUnitViaFlatMoney(withdrawAmount: ethers.BigNumber | string, slippage: number | undefined, maxKeeperFeeInUsd: number | null, options?: any, estimateGas?: boolean): Promise<any>;
539
+ redeemUnitViaFlatMoney(withdrawAmount: ethers.BigNumber | string, slippage: number | undefined, maxKeeperFeeInUsd: number | null, options?: any, sdkOptions?: SDKOptions): Promise<any>;
540
540
  cancelOrderViaFlatMoney(options?: any, estimateGas?: boolean): Promise<any>;
541
541
  /**
542
542
  * Complete a Toros withdrawal to a single asset
543
543
  * @param {string} destinationToken Address of destination asset
544
544
  * @param {number} slippage Slippage tolerance in %
545
545
  * @param {any} options Transaction options
546
- * @param {boolean} estimateGas Simulate/estimate gas
546
+ * @param {SDKOptions} sdkOptions SDK options including estimateGas
547
547
  * @returns {Promise<any>} Transaction
548
548
  */
549
- completeTorosWithdrawal(destinationToken: string, slippage?: number, options?: any, estimateGas?: boolean): Promise<any>;
549
+ completeTorosWithdrawal(destinationToken: string, slippage?: number, options?: any, sdkOptions?: SDKOptions): Promise<any>;
550
550
  }
@@ -1,10 +1,10 @@
1
- import { Pool, ethers } from "../..";
1
+ import { Pool, SDKOptions, ethers } from "../..";
2
2
  export declare function getAnnounceStableDepositTxData(depositAmount: ethers.BigNumber | string, minAmountOut: ethers.BigNumber | string, keeperFee: ethers.BigNumber | string): string;
3
3
  export declare function getAnnounceStableWithdrawTxData(withdrawAmount: ethers.BigNumber | string, minAmountOut: ethers.BigNumber | string, keeperFee: ethers.BigNumber | string): string;
4
4
  export declare function getCancelExistingOrderTxData(account: string): string;
5
5
  export declare function getCancelExistingOrderTxDataForV2(account: string): string;
6
6
  export declare function mintUnitViaFlatMoney(pool: Pool, depositAmount: ethers.BigNumber | string, slippage: number, // 0.5 means 0.5%
7
- maxKeeperFeeInUsd: number | null, options?: any, estimateGas?: boolean): Promise<any>;
7
+ maxKeeperFeeInUsd: number | null, options?: any, sdkOptions?: SDKOptions): Promise<any>;
8
8
  export declare function redeemUnitViaFlatMoney(pool: Pool, withdrawAmount: ethers.BigNumber | string, slippage: number, // 0.5 means 0.5%
9
- maxKeeperFeeInUsd: number | null, options?: any, estimateGas?: boolean): Promise<any>;
10
- export declare function cancelOrderViaFlatMoney(pool: Pool, options?: any, estimateGas?: boolean): Promise<any>;
9
+ maxKeeperFeeInUsd: number | null, options?: any, sdkOptions?: SDKOptions): Promise<any>;
10
+ export declare function cancelOrderViaFlatMoney(pool: Pool, options?: any, sdkOptions?: SDKOptions): Promise<any>;
@@ -1,5 +1,6 @@
1
1
  import { ethers } from "../..";
2
2
  import { Pool } from "../../entities";
3
+ export declare const odosBaseUrl = "https://api.odos.xyz/sor";
3
4
  export declare function getOdosSwapTxData(pool: Pool, assetFrom: string, assetTo: string, amountIn: ethers.BigNumber | string, slippage: number): Promise<{
4
5
  swapTxData: string;
5
6
  minAmountOut: string;
@@ -0,0 +1,7 @@
1
+ import { ethers, Pool } from "../..";
2
+ export interface TrackedAsset {
3
+ token: string;
4
+ balance: ethers.BigNumber;
5
+ }
6
+ export declare const createCompleteWithdrawalTxArguments: (pool: Pool, receiveToken: string, slippage: number) => Promise<any>;
7
+ export declare const getCompleteWithdrawalTxData: (pool: Pool, receiveToken: string, slippage: number, useOnChainSwap: boolean) => Promise<string>;
@@ -1,8 +1,8 @@
1
1
  import { ethers } from "ethers";
2
2
  import { Pool } from "../..";
3
+ export declare const LOW_USD_VALUE_FOR_WITHDRAWAL = 1;
4
+ export declare const SLIPPAGE_FOR_LOW_VALUE_SWAP = 500;
3
5
  export declare function getPoolDepositAsset(pool: Pool, poolAddress: string, investAsset: string): Promise<string | undefined>;
4
6
  export declare function getTorosPoolTokenPrice(pool: Pool, poolAddress: string): Promise<ethers.BigNumber>;
5
7
  export declare function getEasySwapperDepositQuote(pool: Pool, torosAsset: string, investAsset: string, amountIn: ethers.BigNumber): Promise<ethers.BigNumber>;
6
- export declare function getEasySwapperWithdrawalQuote(pool: Pool, torosAsset: string, investAsset: string, amountIn: ethers.BigNumber): Promise<ethers.BigNumber>;
7
8
  export declare function getEasySwapperTxData(pool: Pool, assetFrom: string, assetTo: string, amountIn: ethers.BigNumber, slippage: number): Promise<any>;
8
- export declare function getCompleteWithdrawalTxData(pool: Pool, destToken: string, slippage: number): Promise<string>;
@@ -0,0 +1,3 @@
1
+ import { Pool } from "../..";
2
+ export declare const createWithdrawTxArguments: (pool: Pool, torosAsset: string, amountIn: string, slippage: number, useOnChainSwap: boolean) => Promise<any>;
3
+ export declare const getInitWithdrawalTxData: (pool: Pool, torosAsset: string, amountIn: string, slippage: number, useOnChainSwap: boolean) => Promise<string>;
@@ -0,0 +1,5 @@
1
+ export declare function retry<T>({ fn, maxRetries, delayMs }: {
2
+ fn: () => Promise<T>;
3
+ maxRetries?: number;
4
+ delayMs?: number;
5
+ }): Promise<T>;
@@ -0,0 +1,11 @@
1
+ export declare const SWAPPER_ADDERSS = "0x4F754e0F0924afD74980886b0B479Fa1D7C58D0D";
2
+ export interface SwapParams {
3
+ srcAsset: string;
4
+ srcAmount: string;
5
+ dstAsset: string;
6
+ chainId: number;
7
+ from: string;
8
+ receiver: string;
9
+ slippage: number;
10
+ }
11
+ export declare const getSwapDataViaOdos: ({ srcAsset, srcAmount, dstAsset, chainId, from, slippage }: SwapParams) => Promise<string>;