@dhedge/v2-sdk 2.1.5 → 2.1.6

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 (34) hide show
  1. package/README.md +180 -45
  2. package/dist/config.d.ts +2 -0
  3. package/dist/entities/pool.d.ts +110 -1
  4. package/dist/services/hyperliquid/constants.d.ts +16 -0
  5. package/dist/services/hyperliquid/index.d.ts +6 -0
  6. package/dist/services/hyperliquid/marketData.d.ts +12 -0
  7. package/dist/services/hyperliquid/positionData.d.ts +1 -0
  8. package/dist/services/toros/limitOrder.d.ts +8 -0
  9. package/dist/test/constants.d.ts +7 -1
  10. package/dist/test/wallet.d.ts +1 -0
  11. package/dist/types.d.ts +12 -2
  12. package/dist/v2-sdk.cjs.development.js +1470 -32
  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 +1449 -12
  17. package/dist/v2-sdk.esm.js.map +1 -1
  18. package/package.json +3 -2
  19. package/src/abi/hyperliquid/ICoreDepositWallet.json +130 -0
  20. package/src/abi/hyperliquid/ICoreWriter.json +1 -0
  21. package/src/abi/toros/IPoolLimitOrderManager.json +78 -0
  22. package/src/config.ts +31 -9
  23. package/src/entities/pool.ts +348 -4
  24. package/src/services/hyperliquid/constants.ts +23 -0
  25. package/src/services/hyperliquid/index.ts +176 -0
  26. package/src/services/hyperliquid/marketData.ts +157 -0
  27. package/src/services/hyperliquid/positionData.ts +33 -0
  28. package/src/services/toros/limitOrder.ts +86 -0
  29. package/src/test/constants.ts +11 -5
  30. package/src/test/hyperliquid.test.ts +107 -0
  31. package/src/test/pool.test.ts +37 -45
  32. package/src/test/torosLimitOrder.test.ts +130 -0
  33. package/src/test/wallet.ts +2 -1
  34. package/src/types.ts +13 -2
package/src/types.ts CHANGED
@@ -7,7 +7,8 @@ export enum Network {
7
7
  ARBITRUM = "arbitrum",
8
8
  BASE = "base",
9
9
  ETHEREUM = "ethereum",
10
- PLASMA = "plasma"
10
+ PLASMA = "plasma",
11
+ HYPERLIQUID = "hyperliquid"
11
12
  }
12
13
 
13
14
  export enum Dapp {
@@ -33,7 +34,8 @@ export enum Dapp {
33
34
  COMPOUNDV3 = "compoundV3",
34
35
  ODOS = "odos",
35
36
  PENDLE = "pendle",
36
- KYBERSWAP = "kyberswap"
37
+ KYBERSWAP = "kyberswap",
38
+ HYPERLIQUID = "hyperliquid"
37
39
  }
38
40
 
39
41
  export enum Transaction {
@@ -111,3 +113,12 @@ export type SDKOptions =
111
113
  useTraderAddressAsFrom?: boolean;
112
114
  }
113
115
  | boolean; // shorthand for { estimateGas: true/false }; for backward compatibility
116
+
117
+ export type LimitOrderInfo = {
118
+ amount: BigNumber;
119
+ stopLossPriceD18: BigNumber;
120
+ takeProfitPriceD18: BigNumber;
121
+ user: string;
122
+ pool: string;
123
+ pricingAsset: string;
124
+ };