@dhedge/v2-sdk 1.4.2 → 1.5.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.
Files changed (39) hide show
  1. package/dist/config.d.ts +1 -0
  2. package/dist/entities/dhedge.d.ts +6 -0
  3. package/dist/entities/pool.d.ts +8 -0
  4. package/dist/services/aave/assets.d.ts +2 -0
  5. package/dist/services/aave/incentives.d.ts +2 -0
  6. package/dist/services/chainLink/price.d.ts +2 -0
  7. package/dist/services/oneInch/protocols.d.ts +1 -0
  8. package/dist/services/toros/easySwapper.d.ts +7 -0
  9. package/dist/services/toros/pool.d.ts +3 -0
  10. package/dist/test/constants.d.ts +15 -1
  11. package/dist/types.d.ts +2 -1
  12. package/dist/v2-sdk.cjs.development.js +4558 -115
  13. package/dist/v2-sdk.cjs.development.js.map +1 -1
  14. package/dist/v2-sdk.cjs.production.min.js +1 -1
  15. package/dist/v2-sdk.cjs.production.min.js.map +1 -1
  16. package/dist/v2-sdk.esm.js +4556 -113
  17. package/dist/v2-sdk.esm.js.map +1 -1
  18. package/package.json +1 -1
  19. package/src/abi/IAaveV3Incentives.json +614 -0
  20. package/src/abi/IAaveV3LendingPool.json +1241 -0
  21. package/src/abi/IAaveV3PoolAddressProvider.json +468 -0
  22. package/src/abi/IDhedgeEasySwapper.json +443 -0
  23. package/src/abi/IPriceOracle.json +244 -0
  24. package/src/config.ts +18 -4
  25. package/src/entities/dhedge.ts +9 -0
  26. package/src/entities/pool.ts +94 -51
  27. package/src/services/aave/assets.ts +26 -0
  28. package/src/services/aave/incentives.ts +23 -0
  29. package/src/services/chainLink/price.ts +26 -0
  30. package/src/services/oneInch/protocols.ts +18 -0
  31. package/src/services/toros/easySwapper.ts +110 -0
  32. package/src/services/toros/pool.ts +14 -0
  33. package/src/test/1inch.test.ts +3 -3
  34. package/src/test/aave.test.ts +40 -13
  35. package/src/test/arrakis.test.ts +2 -2
  36. package/src/test/constants.ts +17 -10
  37. package/src/test/toros.test.ts +117 -0
  38. package/src/test/wallet.ts +5 -5
  39. 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
  }
@@ -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,2 @@
1
+ import { Dapp, Pool } from "../..";
2
+ export declare function getAaveAssetsForUnderlying(pool: Pool, dapp: Dapp, assets: string[]): Promise<string[]>;
@@ -0,0 +1,2 @@
1
+ import { Pool } from "../..";
2
+ export declare function getAaveV3ClaimTxData(pool: Pool, assets: string[], rewardAsset: string): Promise<any>;
@@ -0,0 +1,2 @@
1
+ import { ethers, Pool } from "../..";
2
+ export declare function getChainlinkPriceInUsd(pool: Pool, asset: string): Promise<ethers.BigNumber>;
@@ -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): 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>;
@@ -0,0 +1,3 @@
1
+ import { Pool } from "../..";
2
+ export declare function loadPool(pool: Pool, poolAddress: string): Promise<Pool>;
3
+ export declare function isPool(pool: Pool, poolAddress: string): Promise<boolean>;
@@ -1,4 +1,18 @@
1
+ export declare const SUSHI = "0x0b3f868e0be5597d5db7feb59e1cadbb0fdda50a";
2
+ export declare const WMATIC = "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270";
3
+ export declare const BAL = "0x9a71012B13CA4d3D0Cdc72A177DF3ef03b0E76A3";
4
+ export declare const AMUSDC = "0x1a13f4ca1d028320a707d99520abfefca3998b7f";
5
+ export declare const VDEBTWETH = "0xede17e9d79fc6f9ff9250d9eefbdb88cc18038b5";
6
+ export declare const ARRAKIS_USDC_WETH_GAUGE = "0x33d1ad9Cd88A509397CD924C2d7613C285602C20";
7
+ export declare const STMATIC = "0x3A58a54C066FdC0f2D55FC9C89F0415C92eBf3C4";
8
+ export declare const WMATIC_STMATIC_LP = "0xaF5E0B5425dE1F5a630A8cB5AA9D97B8141C908D";
9
+ export declare const AARAKIS_WNATIC_STMATIC_GAUGE = "0x9928340f9E1aaAd7dF1D95E27bd9A5c715202a56";
10
+ export declare const ETHBULL3X = "0x460b60565cb73845d56564384ab84bf84c13e47d";
11
+ export declare const BTCBEAR2X = "0x3dbce2c8303609c17aa23b69ebe83c2f5c510ada";
1
12
  export declare const WETH = "0x4200000000000000000000000000000000000006";
2
13
  export declare const USDC = "0x7F5c764cBc14f9669B88837ca1490cCa17c31607";
3
14
  export declare const DAI = "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1";
4
- export declare const TEST_POOL = "TEST_POOL_ADDRESS";
15
+ export declare const USDy = "0x1ec50880101022c11530a069690f5446d1464592";
16
+ export declare const WBTC = "0x68f180fcCe6836688e9084f035309E29Bf0A2095";
17
+ export declare const OP = "4200000000000000000000000000000000000042";
18
+ export declare const TEST_POOL = "TEST_POOL";
package/dist/types.d.ts CHANGED
@@ -12,7 +12,8 @@ export declare enum Dapp {
12
12
  UNISWAPV3 = "uniswapV3",
13
13
  SYNTHETIX = "synthetix",
14
14
  AAVEV3 = "aavev3",
15
- ARRAKIS = "arrakis"
15
+ ARRAKIS = "arrakis",
16
+ TOROS = "toros"
16
17
  }
17
18
  export declare enum Transaction {
18
19
  SWAP = "swapExactTokensForTokens",