@dhedge/v2-sdk 1.3.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,10 +26,4 @@ export declare class Dhedge {
26
26
  * @returns {Pool} Loaded Pool
27
27
  */
28
28
  loadPool(address: string): Promise<Pool>;
29
- /**
30
- * Check if pool address is valid
31
- * @param {string} address Pool address
32
- * @returns {boolean} Is valid pool address
33
- */
34
- private validatePool;
35
29
  }
@@ -66,6 +66,15 @@ export declare class Pool {
66
66
  * @returns {Promise<any>} Transaction
67
67
  */
68
68
  approveUniswapV3Liquidity(asset: string, amount: BigNumber | string, options?: any): Promise<any>;
69
+ /**
70
+ * Approve the asset for provided spender address
71
+ * @param {string} spender Spender address
72
+ * @param {string} asset Address of asset
73
+ * @param {BigNumber | string} amount to be approved
74
+ * @param {any} options Transaction options
75
+ * @returns {Promise<any>} Transaction
76
+ */
77
+ approveSpender(spender: string, asset: string, amount: BigNumber | string, options?: any): Promise<any>;
69
78
  /**
70
79
  * Trade an asset into another asset
71
80
  * @param {Dapp} dapp Platform like Sushiswap or Uniswap
@@ -107,6 +116,14 @@ export declare class Pool {
107
116
  * @returns {Promise<any>} Transaction
108
117
  */
109
118
  stake(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any): Promise<any>;
119
+ /**
120
+ * Stake liquidity pool tokens in gauge contract
121
+ * @param {string} gauge Gauge contract address
122
+ * @param {BigNumber | string} amount Amount of liquidity pool tokens
123
+ * @param {any} options Transaction options
124
+ * @returns {Promise<any>} Transaction
125
+ */
126
+ stakeInGauge(gauge: string, amount: BigNumber | string, options?: any): Promise<any>;
110
127
  /**
111
128
  * Unstake liquidity pool tokens from a yield farm
112
129
  * @param {Dapp} dapp Platform like Sushiswap or Uniswap
@@ -116,16 +133,24 @@ export declare class Pool {
116
133
  * @returns {Promise<any>} Transaction
117
134
  */
118
135
  unStake(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any): Promise<any>;
136
+ /**
137
+ * Unstake liquidity pool tokens from gauge contract
138
+ * @param {string} gauge Gauge contract address
139
+ * @param {BigNumber | string} amount Amount of liquidity pool tokens
140
+ * @param {any} options Transaction options
141
+ * @returns {Promise<any>} Transaction
142
+ */
143
+ unstakeFromGauge(gauge: string, amount: BigNumber | string, options?: any): Promise<any>;
119
144
  /**
120
145
  * Lend asset to a lending pool
121
146
  * @param {Dapp} dapp Platform like Aave
122
147
  * @param {string} asset Asset
123
148
  * @param {BigNumber | string} amount Amount of asset to lend
124
- * @param {number} referrralCode Code from Aave referral program
149
+ * @param {number} referralCode Code from Aave referral program
125
150
  * @param {any} options Transaction options
126
151
  * @returns {Promise<any>} Transaction
127
152
  */
128
- lend(dapp: Dapp, asset: string, amount: BigNumber | string, referrralCode?: number, options?: any): Promise<any>;
153
+ lend(dapp: Dapp, asset: string, amount: BigNumber | string, referralCode?: number, options?: any): Promise<any>;
129
154
  /**
130
155
  * Witdraw asset from a lending pool
131
156
  * @param {Dapp} dapp Platform like Aave
@@ -140,11 +165,11 @@ export declare class Pool {
140
165
  * @param {Dapp} dapp Platform like Aave
141
166
  * @param {string} asset Asset
142
167
  * @param {BigNumber | string} amount Amount of asset to lend
143
- * @param {number} referrralCode Code from Aave referral program
168
+ * @param {number} referralCode Code from Aave referral program
144
169
  * @param {any} options Transaction options
145
170
  * @returns {Promise<any>} Transaction
146
171
  */
147
- borrow(dapp: Dapp, asset: string, amount: BigNumber | string, referrralCode?: number, options?: any): Promise<any>;
172
+ borrow(dapp: Dapp, asset: string, amount: BigNumber | string, referralCode?: number, options?: any): Promise<any>;
148
173
  /**
149
174
  * Repays borrowed asset to a lending pool
150
175
  * @param {Dapp} dapp Platform like Aave
@@ -190,10 +215,11 @@ export declare class Pool {
190
215
  * @param {string} poolId Balancer pool id
191
216
  * @param {string[] | } assets Array of balancer pool assets
192
217
  * @param {BigNumber | string } amount Amount of pool tokens to withdraw
218
+ * @param { null | number } singleExitAssetIndex Index of asset to withdraw to
193
219
  * @param {any} options Transaction options
194
220
  * @returns {Promise<any>} Transaction
195
221
  */
196
- exitBalancerPool(poolId: string, assets: string[], amount: string | BigNumber, options?: any): Promise<any>;
222
+ exitBalancerPool(poolId: string, assets: string[], amount: string | BigNumber, singleExitAssetIndex?: number | null, options?: any): Promise<any>;
197
223
  /**
198
224
  * Claim rewards from Balancer pools
199
225
  * @param {string[]} assets Array of tokens being claimed
@@ -224,29 +250,32 @@ export declare class Pool {
224
250
  */
225
251
  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>;
226
252
  /**
227
- * Remove liquidity from an UniswapV3 liquidity pool
253
+ * Remove liquidity from an UniswapV3 or Arrakis liquidity pool
254
+ * @param {Dapp} dapp Platform either UniswapV3 or Arrakis
228
255
  * @param {string} tokenId Token Id of UniswapV3 position
229
256
  * @param {number} amount Amount in percent of assets to be removed
230
257
  * @param {any} options Transaction options
231
258
  * @returns {Promise<any>} Transaction
232
259
  */
233
- removeLiquidityUniswapV3(tokenId: string, amount?: number, options?: any): Promise<any>;
260
+ decreaseLiquidity(dapp: Dapp, tokenId: string, amount?: number, options?: any): Promise<any>;
234
261
  /**
235
- * Increase liquidity of an UniswapV3 liquidity pool
262
+ * Increase liquidity of an UniswapV3 or Arrakis liquidity pool
263
+ * @param {Dapp} dapp Platform either UniswapV3 or Arrakis
236
264
  * @param {string} tokenId Token Id of UniswapV3 position
237
265
  * @param {BigNumber | string} amountA Amount first asset
238
266
  * @param {BigNumber | string} amountB Amount second asset
239
267
  * @param {any} options Transaction options
240
268
  * @returns {Promise<any>} Transaction
241
269
  */
242
- increaseLiquidityUniswapV3(tokenId: string, amountA: BigNumber | string, amountB: BigNumber | string, options?: any): Promise<any>;
270
+ increaseLiquidity(dapp: Dapp, tokenId: string, amountA: BigNumber | string, amountB: BigNumber | string, options?: any): Promise<any>;
243
271
  /**
244
- * Claim fees of an UniswapV3 liquidity pool
245
- * @param {string} tokenId Token Id of UniswapV3 position
246
- * @param {any} options Transaction options
272
+ * Claim fees of an UniswapV3 liquidity or Arrakis pool
273
+ * @param {Dapp} dapp Platform either UniswapV3 or Arrakis
274
+ * @param {string} tokenId Token Id of UniswapV3 or Gauge address
275
+ * @param {any} options Transaction option
247
276
  * @returns {Promise<any>} Transaction
248
277
  */
249
- claimFeesUniswapV3(tokenId: string, options?: any): Promise<any>;
278
+ claimFees(dapp: Dapp, tokenId: string, options?: any): Promise<any>;
250
279
  /**
251
280
  * Trade an asset into another asset
252
281
  * @param {Dapp} dapp Platform like Sushiswap or Uniswap
@@ -49,5 +49,5 @@ export declare class Utils {
49
49
  getMinAmountOut(dapp: Dapp, assetFrom: string, assetTo: string, amountIn: string | ethers.BigNumber, slippage: number): Promise<ethers.BigNumber>;
50
50
  getBalancerSwapTx(pool: Pool, assetFrom: string, assetTo: string, amountIn: ethers.BigNumber | string, slippage: number): Promise<any>;
51
51
  getBalancerJoinPoolTx(pool: Pool, balancerPoolId: string, assets: string[], amountsIn: string[] | ethers.BigNumber[]): Promise<any>;
52
- getBalancerExitPoolTx(pool: Pool, balancerPoolId: string, assets: string[], amount: string | ethers.BigNumber): Promise<any>;
52
+ getBalancerExitPoolTx(pool: Pool, balancerPoolId: string, assets: string[], singleExitAssetIndex: null | number, amount: string | ethers.BigNumber): Promise<any>;
53
53
  }
@@ -1,12 +1,4 @@
1
- export declare const USDC = "0x7F5c764cBc14f9669B88837ca1490cCa17c31607";
2
- export declare const USDT = "0xc2132D05D31c914a87C6611C10748AEb04B58e8F";
3
- export declare const DAI = "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063";
4
- export declare const TUSD = "0x2e1ad108ff1d8c782fcbbb89aad783ac49586756";
5
1
  export declare const WETH = "0x4200000000000000000000000000000000000006";
6
- export declare const WBTC = "0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6";
7
- export declare const SUSHI = "0x0b3f868e0be5597d5db7feb59e1cadbb0fdda50a";
8
- export declare const WMATIC = "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270";
9
- export declare const BAL = "0x9a71012B13CA4d3D0Cdc72A177DF3ef03b0E76A3";
10
- export declare const AMUSDC = "0x1a13f4ca1d028320a707d99520abfefca3998b7f";
11
- export declare const VDEBTWETH = "0xede17e9d79fc6f9ff9250d9eefbdb88cc18038b5";
12
- export declare const TEST_POOL = "0xf36f550907872faaa02477f791df3ce33fe38854";
2
+ export declare const USDC = "0x7F5c764cBc14f9669B88837ca1490cCa17c31607";
3
+ export declare const DAI = "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1";
4
+ export declare const TEST_POOL = "TEST_POOL_ADDRESS";
@@ -1 +1,2 @@
1
- export declare const getTxOptions: () => Promise<any>;
1
+ import { Network } from "../types";
2
+ export declare const getTxOptions: (network: Network) => Promise<any>;
package/dist/types.d.ts CHANGED
@@ -10,7 +10,9 @@ export declare enum Dapp {
10
10
  QUICKSWAP = "quickswap",
11
11
  BALANCER = "balancer",
12
12
  UNISWAPV3 = "uniswapV3",
13
- SYNTHETIX = "synthetix"
13
+ SYNTHETIX = "synthetix",
14
+ AAVEV3 = "aavev3",
15
+ ARRAKIS = "arrakis"
14
16
  }
15
17
  export declare enum Transaction {
16
18
  SWAP = "swapExactTokensForTokens",
@@ -29,17 +31,13 @@ export declare enum Transaction {
29
31
  WITHDRAW = "withdraw",
30
32
  MINT = "mint",
31
33
  BURN = "burn",
32
- SWAP_SYNTHS = "exchangeWithTracking"
34
+ SWAP_SYNTHS = "exchangeWithTracking",
35
+ ADD_LIQUIDITY_STAKE = "addLiquidityAndStake",
36
+ REMOVE_LIQUIDITY_UNSTAKE = "removeLiquidityAndUnstake"
33
37
  }
34
38
  export declare type AddressNetworkMap = Readonly<Record<Network, string>>;
35
39
  export declare type AddressDappMap = {
36
- [Dapp.SUSHISWAP]?: string;
37
- [Dapp.AAVE]?: string;
38
- [Dapp.ONEINCH]?: string;
39
- [Dapp.QUICKSWAP]?: string;
40
- [Dapp.BALANCER]?: string;
41
- [Dapp.UNISWAPV3]?: string;
42
- [Dapp.SYNTHETIX]?: string;
40
+ [key in Dapp]?: string;
43
41
  };
44
42
  export declare type AddressDappNetworkMap = Readonly<Record<Network, AddressDappMap>>;
45
43
  export declare type SupportedAsset = [string, boolean];