@syldel/hl-shared-types 0.0.14 → 0.0.16

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.
@@ -0,0 +1 @@
1
+ export type AccountAbstractionMode = 'unifiedAccount' | 'portfolioMargin' | 'disabled' | 'default' | 'dexAbstraction';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,8 +1,20 @@
1
1
  import { DecimalString, Timestamp } from '../common';
2
2
  /**
3
- * Supported Hyperliquid candle intervals.
3
+ * Supported Hyperliquid candle intervals (source of truth array).
4
4
  */
5
- export type CandleInterval = '1m' | '3m' | '5m' | '15m' | '30m' | '1h' | '2h' | '4h' | '8h' | '12h' | '1d' | '3d' | '1w' | '1M';
5
+ export declare const CANDLE_INTERVALS: readonly ["1m", "3m", "5m", "15m", "30m", "1h", "2h", "4h", "8h", "12h", "1d", "3d", "1w", "1M"];
6
+ /**
7
+ * Supported Hyperliquid candle intervals type.
8
+ */
9
+ export type CandleInterval = (typeof CANDLE_INTERVALS)[number];
10
+ /**
11
+ * Duration in minutes for each native Hyperliquid interval.
12
+ */
13
+ export declare const CANDLE_INTERVAL_MINUTES: Record<CandleInterval, number>;
14
+ /**
15
+ * Type guard to check if a string is a valid native Hyperliquid CandleInterval.
16
+ */
17
+ export declare function isCandleInterval(value: string): value is CandleInterval;
6
18
  /**
7
19
  * Raw candle data returned by the Hyperliquid `candleSnapshot` endpoint.
8
20
  */
@@ -1,2 +1,48 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CANDLE_INTERVAL_MINUTES = exports.CANDLE_INTERVALS = void 0;
4
+ exports.isCandleInterval = isCandleInterval;
5
+ /**
6
+ * Supported Hyperliquid candle intervals (source of truth array).
7
+ */
8
+ exports.CANDLE_INTERVALS = [
9
+ '1m',
10
+ '3m',
11
+ '5m',
12
+ '15m',
13
+ '30m',
14
+ '1h',
15
+ '2h',
16
+ '4h',
17
+ '8h',
18
+ '12h',
19
+ '1d',
20
+ '3d',
21
+ '1w',
22
+ '1M',
23
+ ];
24
+ /**
25
+ * Duration in minutes for each native Hyperliquid interval.
26
+ */
27
+ exports.CANDLE_INTERVAL_MINUTES = {
28
+ '1m': 1,
29
+ '3m': 3,
30
+ '5m': 5,
31
+ '15m': 15,
32
+ '30m': 30,
33
+ '1h': 60,
34
+ '2h': 120,
35
+ '4h': 240,
36
+ '8h': 480,
37
+ '12h': 720,
38
+ '1d': 1440,
39
+ '3d': 4320,
40
+ '1w': 10080,
41
+ '1M': 43200,
42
+ };
43
+ /**
44
+ * Type guard to check if a string is a valid native Hyperliquid CandleInterval.
45
+ */
46
+ function isCandleInterval(value) {
47
+ return exports.CANDLE_INTERVALS.includes(value);
48
+ }
@@ -2,3 +2,4 @@ export * from './candle.interfaces';
2
2
  export * from './portfolio.interfaces';
3
3
  export * from './l2Book.interfaces';
4
4
  export * from './active-asset.interfaces';
5
+ export * from './account-abstraction.type';
@@ -18,3 +18,4 @@ __exportStar(require("./candle.interfaces"), exports);
18
18
  __exportStar(require("./portfolio.interfaces"), exports);
19
19
  __exportStar(require("./l2Book.interfaces"), exports);
20
20
  __exportStar(require("./active-asset.interfaces"), exports);
21
+ __exportStar(require("./account-abstraction.type"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syldel/hl-shared-types",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "Shared TypeScript interfaces and types for Hyperliquid integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",