@dhedge/v2-sdk 1.2.0 → 1.4.0

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 (41) hide show
  1. package/dist/config.d.ts +5 -0
  2. package/dist/entities/pool.d.ts +72 -5
  3. package/dist/entities/utils.d.ts +6 -0
  4. package/dist/services/claim-balancer/claim.service.d.ts +1 -5
  5. package/dist/services/uniswap/V3Liquidity.d.ts +9 -0
  6. package/dist/services/uniswap/V3Trade.d.ts +4 -0
  7. package/dist/services/uniswap/types.d.ts +3 -0
  8. package/dist/test/constants.d.ts +3 -2
  9. package/dist/test/txOptions.d.ts +1 -0
  10. package/dist/types.d.ts +19 -10
  11. package/dist/v2-sdk.cjs.development.js +4172 -1593
  12. package/dist/v2-sdk.cjs.development.js.map +1 -1
  13. package/dist/v2-sdk.cjs.production.min.js +1 -1
  14. package/dist/v2-sdk.cjs.production.min.js.map +1 -1
  15. package/dist/v2-sdk.esm.js +4175 -1596
  16. package/dist/v2-sdk.esm.js.map +1 -1
  17. package/package.json +4 -1
  18. package/src/abi/IArrakisV1RouterStaking.json +107 -0
  19. package/src/abi/IERC20.json +15 -1
  20. package/src/abi/ILiquidityGaugeV4.json +153 -0
  21. package/src/abi/INonfungiblePositionManager.json +1221 -0
  22. package/src/abi/ISynthetix.json +139 -0
  23. package/src/abi/IUniswapV3Quoter.json +195 -0
  24. package/src/abi/IUniswapV3Router.json +221 -0
  25. package/src/config.ts +40 -9
  26. package/src/entities/dhedge.ts +4 -2
  27. package/src/entities/pool.ts +316 -30
  28. package/src/entities/utils.ts +12 -0
  29. package/src/services/claim-balancer/claim.service.ts +14 -76
  30. package/src/services/uniswap/V3Liquidity.ts +134 -0
  31. package/src/services/uniswap/V3Trade.ts +47 -0
  32. package/src/services/uniswap/types.ts +16 -0
  33. package/src/test/aave.test.ts +53 -25
  34. package/src/test/arrakis.test.ts +89 -0
  35. package/src/test/constants.ts +10 -2
  36. package/src/test/oneInch.test.ts +13 -20
  37. package/src/test/synthetix.test.ts +34 -0
  38. package/src/test/txOptions.ts +15 -0
  39. package/src/test/uniswap.test.ts +125 -0
  40. package/src/test/wallet.ts +4 -0
  41. package/src/types.ts +19 -10
package/src/types.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { ChainId } from "@sushiswap/sdk";
2
1
  import { BigNumber } from "ethers";
3
2
 
4
3
  export enum Network {
5
- POLYGON = "polygon"
4
+ POLYGON = "polygon",
5
+ OPTIMISM = "optimism"
6
6
  }
7
7
 
8
8
  export enum Dapp {
@@ -10,7 +10,11 @@ export enum Dapp {
10
10
  AAVE = "aave",
11
11
  ONEINCH = "1inch",
12
12
  QUICKSWAP = "quickswap",
13
- BALANCER = "balancer"
13
+ BALANCER = "balancer",
14
+ UNISWAPV3 = "uniswapV3",
15
+ SYNTHETIX = "synthetix",
16
+ AAVEV3 = "aavev3",
17
+ ARRAKIS = "arrakis"
14
18
  }
15
19
 
16
20
  export enum Transaction {
@@ -21,19 +25,24 @@ export enum Transaction {
21
25
  CLAIM_DISTRIBIUTIONS = "claimDistributions",
22
26
  CLAIM_REWARDS = "claimRewards",
23
27
  REMOVE_LIQUIDITY = "removeLiquidity",
28
+ DECREASE_LIQUIDITY = "decreaseLiquidity",
29
+ INCREASE_LIQUIDITY = "increaseLiquidity",
30
+ COLLECT = "collect",
31
+ MULTI_CALL = "multicall",
24
32
  BORROW = "borrow",
25
33
  REPAY = "repay",
26
- WITHDRAW = "withdraw"
34
+ WITHDRAW = "withdraw",
35
+ MINT = "mint",
36
+ BURN = "burn",
37
+ SWAP_SYNTHS = "exchangeWithTracking",
38
+ ADD_LIQUIDITY_STAKE = "addLiquidityAndStake",
39
+ REMOVE_LIQUIDITY_UNSTAKE = "removeLiquidityAndUnstake"
27
40
  }
28
41
 
29
42
  export type AddressNetworkMap = Readonly<Record<Network, string>>;
30
43
 
31
44
  export type AddressDappMap = {
32
- [Dapp.SUSHISWAP]?: string;
33
- [Dapp.AAVE]?: string;
34
- [Dapp.ONEINCH]?: string;
35
- [Dapp.QUICKSWAP]?: string;
36
- [Dapp.BALANCER]?: string;
45
+ [key in Dapp]?: string;
37
46
  };
38
47
 
39
48
  export type AddressDappNetworkMap = Readonly<Record<Network, AddressDappMap>>;
@@ -57,4 +66,4 @@ export type Reserves = {
57
66
  assetB: BigNumber;
58
67
  };
59
68
 
60
- export type NetworkChainIdMap = Readonly<Record<Network, ChainId>>;
69
+ export type NetworkChainIdMap = Readonly<Record<Network, number>>;