@syldel/hl-shared-types 0.0.8 → 0.0.9

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.
@@ -1,11 +1,23 @@
1
1
  import { DecimalString } from '../common';
2
+ /**
3
+ * User's balance for a spot asset.
4
+ */
2
5
  export interface HLSpotBalance {
6
+ /** Asset symbol, e.g. "USDC" or "ETH". */
3
7
  coin: string;
8
+ /** Token index in Hyperliquid's system. */
4
9
  token: number;
10
+ /** Amount currently on hold / reserved. */
5
11
  hold: DecimalString;
12
+ /** Total amount owned (available + hold). */
6
13
  total: DecimalString;
14
+ /** Entry notional for the position. */
7
15
  entryNtl: DecimalString;
8
16
  }
17
+ /**
18
+ * Spot clearinghouse state containing all balances.
19
+ */
9
20
  export interface HLSpotClearinghouseState {
21
+ /** Array of spot balances for this user. */
10
22
  balances: HLSpotBalance[];
11
23
  }
@@ -1,23 +1,50 @@
1
+ /**
2
+ * Metadata for a spot token.
3
+ */
1
4
  export interface HLSpotTokenMeta {
5
+ /** Token symbol, e.g. "USDC". */
2
6
  name: string;
7
+ /** Number of decimals for display purposes. */
3
8
  szDecimals: number;
9
+ /** Number of decimals used on-chain (wei). */
4
10
  weiDecimals: number;
11
+ /** Token index in Hyperliquid system. */
5
12
  index: number;
13
+ /** Unique token identifier. */
6
14
  tokenId: string;
15
+ /** Whether this is the canonical token in the system. */
7
16
  isCanonical: boolean;
17
+ /** EVM contract address (if applicable). */
8
18
  evmContract: string | null;
19
+ /** Full token name, optional. */
9
20
  fullName: string | null;
10
21
  }
22
+ /**
23
+ * Metadata for a spot market.
24
+ */
11
25
  export interface HLSpotMarketMeta {
26
+ /** Market symbol, e.g. "ETH/USDC". */
12
27
  name: string;
28
+ /** Indexes of the base and quote tokens. */
13
29
  tokens: [number, number];
30
+ /** Market index in Hyperliquid system. */
14
31
  index: number;
32
+ /** Whether the market uses canonical tokens. */
15
33
  isCanonical: boolean;
16
34
  }
35
+ /**
36
+ * Complete spot metadata including tokens and markets.
37
+ */
17
38
  export interface HLSpotMeta {
39
+ /** All spot tokens. */
18
40
  tokens: HLSpotTokenMeta[];
41
+ /** All spot markets (universe). */
19
42
  universe: HLSpotMarketMeta[];
20
43
  }
44
+ /**
45
+ * Summary of a spot asset, extending market metadata.
46
+ */
21
47
  export interface HLSpotAssetSummary extends HLSpotMarketMeta {
48
+ /** Optional: number of decimals for size/amount display. */
22
49
  szDecimals?: number;
23
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syldel/hl-shared-types",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Shared TypeScript interfaces and types for Hyperliquid integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",