@dhedge/v2-sdk 1.4.0 → 1.4.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.
- package/dist/entities/pool.d.ts +33 -7
- package/dist/entities/utils.d.ts +1 -1
- package/dist/test/constants.d.ts +2 -0
- package/dist/v2-sdk.cjs.development.js +687 -293
- 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 +685 -291
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/IBalancerRewardsGauge.json +239 -0
- package/src/entities/pool.ts +88 -9
- package/src/entities/utils.ts +13 -9
- package/src/test/balancer.test.ts +115 -10
- package/src/test/constants.ts +2 -0
package/dist/entities/pool.d.ts
CHANGED
|
@@ -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}
|
|
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,
|
|
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}
|
|
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,
|
|
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
|
|
@@ -245,8 +271,8 @@ export declare class Pool {
|
|
|
245
271
|
/**
|
|
246
272
|
* Claim fees of an UniswapV3 liquidity or Arrakis pool
|
|
247
273
|
* @param {Dapp} dapp Platform either UniswapV3 or Arrakis
|
|
248
|
-
* @param {string} tokenId Token Id of UniswapV3 or
|
|
249
|
-
* @param {any} options Transaction
|
|
274
|
+
* @param {string} tokenId Token Id of UniswapV3 or Gauge address
|
|
275
|
+
* @param {any} options Transaction option
|
|
250
276
|
* @returns {Promise<any>} Transaction
|
|
251
277
|
*/
|
|
252
278
|
claimFees(dapp: Dapp, tokenId: string, options?: any): Promise<any>;
|
package/dist/entities/utils.d.ts
CHANGED
|
@@ -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
|
}
|
package/dist/test/constants.d.ts
CHANGED
|
@@ -10,4 +10,6 @@ export declare const BAL = "0x9a71012B13CA4d3D0Cdc72A177DF3ef03b0E76A3";
|
|
|
10
10
|
export declare const AMUSDC = "0x1a13f4ca1d028320a707d99520abfefca3998b7f";
|
|
11
11
|
export declare const VDEBTWETH = "0xede17e9d79fc6f9ff9250d9eefbdb88cc18038b5";
|
|
12
12
|
export declare const ARRAKIS_USDC_WETH_GAUGE = "0x33d1ad9Cd88A509397CD924C2d7613C285602C20";
|
|
13
|
+
export declare const STMATIC = "0x3A58a54C066FdC0f2D55FC9C89F0415C92eBf3C4";
|
|
14
|
+
export declare const WMATIC_STMATIC_LP = "0xaF5E0B5425dE1F5a630A8cB5AA9D97B8141C908D";
|
|
13
15
|
export declare const TEST_POOL = "TEST_POOL_ADDRESS";
|