@dhedge/v2-sdk 1.4.3 → 1.5.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.
- package/dist/config.d.ts +1 -0
- package/dist/entities/dhedge.d.ts +6 -0
- package/dist/entities/pool.d.ts +8 -0
- package/dist/services/aave/assets.d.ts +2 -0
- package/dist/services/aave/incentives.d.ts +2 -0
- package/dist/services/chainLink/price.d.ts +2 -0
- package/dist/services/oneInch/protocols.d.ts +1 -0
- package/dist/services/toros/easySwapper.d.ts +7 -0
- package/dist/services/toros/pool.d.ts +3 -0
- package/dist/test/constants.d.ts +8 -6
- package/dist/types.d.ts +2 -1
- package/dist/v2-sdk.cjs.development.js +4569 -115
- 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 +4567 -113
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/IAaveV3Incentives.json +614 -0
- package/src/abi/IAaveV3LendingPool.json +1241 -0
- package/src/abi/IAaveV3PoolAddressProvider.json +468 -0
- package/src/abi/IDhedgeEasySwapper.json +443 -0
- package/src/abi/IPriceOracle.json +244 -0
- package/src/config.ts +18 -4
- package/src/entities/dhedge.ts +9 -0
- package/src/entities/pool.ts +90 -47
- package/src/services/aave/assets.ts +26 -0
- package/src/services/aave/incentives.ts +23 -0
- package/src/services/chainLink/price.ts +26 -0
- package/src/services/oneInch/protocols.ts +18 -0
- package/src/services/toros/easySwapper.ts +120 -0
- package/src/services/toros/pool.ts +14 -0
- package/src/test/1inch.test.ts +3 -3
- package/src/test/aave.test.ts +40 -13
- package/src/test/constants.ts +14 -9
- package/src/test/toros.test.ts +117 -0
- package/src/test/wallet.ts +5 -5
- package/src/types.ts +2 -1
package/dist/config.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const factoryAddress: AddressNetworkMap;
|
|
|
4
4
|
export declare const routerAddress: AddressDappNetworkMap;
|
|
5
5
|
export declare const dappFactoryAddress: AddressDappNetworkMap;
|
|
6
6
|
export declare const stakingAddress: AddressDappNetworkMap;
|
|
7
|
+
export declare const aaveAddressProvider: AddressDappNetworkMap;
|
|
7
8
|
export declare const nonfungiblePositionManagerAddress: AddressNetworkMap;
|
|
8
9
|
export declare const networkChainIdMap: NetworkChainIdMap;
|
|
9
10
|
export declare const balancerSubgraph: AddressNetworkMap;
|
|
@@ -26,4 +26,10 @@ 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
|
+
validatePool(address: string): Promise<boolean>;
|
|
29
35
|
}
|
package/dist/entities/pool.d.ts
CHANGED
|
@@ -234,6 +234,14 @@ export declare class Pool {
|
|
|
234
234
|
* @returns {Promise<any>} Transaction
|
|
235
235
|
*/
|
|
236
236
|
harvestAaveRewards(assets: string[], options?: any): Promise<any>;
|
|
237
|
+
/**
|
|
238
|
+
* Claim rewards from Aave platform
|
|
239
|
+
* @param {string[]} assets Assets invested in Aave
|
|
240
|
+
* @param {string} rewardAssets Reward token address
|
|
241
|
+
* @param {any} options Transaction options
|
|
242
|
+
* @returns {Promise<any>} Transaction
|
|
243
|
+
*/
|
|
244
|
+
harvestAaveV3Rewards(assets: string[], rewardAsset: string, options?: any): Promise<any>;
|
|
237
245
|
/**
|
|
238
246
|
* Create UniswapV3 liquidity pool
|
|
239
247
|
* @param {string} assetA First asset
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getOneInchProtocols(chainId: number): Promise<string>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ethers } from "ethers";
|
|
2
|
+
import { Pool } from "../..";
|
|
3
|
+
export declare function getPoolDepositAsset(pool: Pool, poolAddress: string, investAsset: string): Promise<string | undefined>;
|
|
4
|
+
export declare function getTorosPoolTokenPrice(pool: Pool, poolAddress: string): Promise<ethers.BigNumber>;
|
|
5
|
+
export declare function getEasySwapperDepositQuote(pool: Pool, torosAsset: string, investAsset: string, depositAsset: 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
|
+
export declare function getEasySwapperTxData(pool: Pool, assetFrom: string, assetTo: string, amountIn: ethers.BigNumber, slippage: number): Promise<any>;
|
package/dist/test/constants.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
export declare const USDC = "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174";
|
|
2
|
-
export declare const WETH = "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619";
|
|
3
|
-
export declare const USDT = "0xc2132D05D31c914a87C6611C10748AEb04B58e8F";
|
|
4
|
-
export declare const DAI = "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063";
|
|
5
|
-
export declare const TUSD = "0x2e1ad108ff1d8c782fcbbb89aad783ac49586756";
|
|
6
|
-
export declare const WBTC = "0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6";
|
|
7
1
|
export declare const SUSHI = "0x0b3f868e0be5597d5db7feb59e1cadbb0fdda50a";
|
|
8
2
|
export declare const WMATIC = "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270";
|
|
9
3
|
export declare const BAL = "0x9a71012B13CA4d3D0Cdc72A177DF3ef03b0E76A3";
|
|
@@ -13,4 +7,12 @@ export declare const ARRAKIS_USDC_WETH_GAUGE = "0x33d1ad9Cd88A509397CD924C2d7613
|
|
|
13
7
|
export declare const STMATIC = "0x3A58a54C066FdC0f2D55FC9C89F0415C92eBf3C4";
|
|
14
8
|
export declare const WMATIC_STMATIC_LP = "0xaF5E0B5425dE1F5a630A8cB5AA9D97B8141C908D";
|
|
15
9
|
export declare const AARAKIS_WNATIC_STMATIC_GAUGE = "0x9928340f9E1aaAd7dF1D95E27bd9A5c715202a56";
|
|
10
|
+
export declare const ETHBULL3X = "0x460b60565cb73845d56564384ab84bf84c13e47d";
|
|
11
|
+
export declare const BTCBEAR2X = "0x3dbce2c8303609c17aa23b69ebe83c2f5c510ada";
|
|
12
|
+
export declare const WETH = "0x4200000000000000000000000000000000000006";
|
|
13
|
+
export declare const USDC = "0x7F5c764cBc14f9669B88837ca1490cCa17c31607";
|
|
14
|
+
export declare const DAI = "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1";
|
|
15
|
+
export declare const USDy = "0x1ec50880101022c11530a069690f5446d1464592";
|
|
16
|
+
export declare const WBTC = "0x68f180fcCe6836688e9084f035309E29Bf0A2095";
|
|
17
|
+
export declare const OP = "4200000000000000000000000000000000000042";
|
|
16
18
|
export declare const TEST_POOL = "TEST_POOL";
|
package/dist/types.d.ts
CHANGED