@syldel/hl-shared-types 0.0.11 → 0.0.12
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.
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./candle.interfaces"), exports);
|
|
18
18
|
__exportStar(require("./portfolio.interfaces"), exports);
|
|
19
|
+
__exportStar(require("./l2Book.interfaces"), exports);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { DecimalString, Timestamp } from '../common';
|
|
2
|
+
/**
|
|
3
|
+
* Valid configuration options for significant figures aggregation.
|
|
4
|
+
* null means full precision.
|
|
5
|
+
*/
|
|
6
|
+
export type HLNSigFigsOptions = 2 | 3 | 4 | 5 | null;
|
|
7
|
+
/**
|
|
8
|
+
* Valid mantissa values for aggregation.
|
|
9
|
+
* This field is only allowed if nSigFigs is set to 5.
|
|
10
|
+
*/
|
|
11
|
+
export type HLMantissaOptions = 1 | 2 | 5;
|
|
12
|
+
/**
|
|
13
|
+
* Represents the request payload for the L2 Book Snapshot endpoint.
|
|
14
|
+
*/
|
|
15
|
+
export interface HLL2BookRequest {
|
|
16
|
+
/** The type of info request. */
|
|
17
|
+
type: 'l2Book';
|
|
18
|
+
/** The trading coin symbol (e.g., "BTC", "ETH"). */
|
|
19
|
+
coin: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional field to aggregate levels to N significant figures.
|
|
22
|
+
* Valid values are 2, 3, 4, 5, and null (full precision).
|
|
23
|
+
*/
|
|
24
|
+
nSigFigs?: HLNSigFigsOptions;
|
|
25
|
+
/**
|
|
26
|
+
* Optional field to aggregate levels.
|
|
27
|
+
* This field is only allowed if nSigFigs is 5.
|
|
28
|
+
*/
|
|
29
|
+
mantissa?: HLMantissaOptions;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Represents a single price level in the L2 order book.
|
|
33
|
+
*/
|
|
34
|
+
export interface HLL2BookLevel {
|
|
35
|
+
/** The price of the level. String format prevents floating-point precision loss. */
|
|
36
|
+
px: DecimalString;
|
|
37
|
+
/** The total size/volume available at this price level. */
|
|
38
|
+
sz: DecimalString;
|
|
39
|
+
/** The total number of individual orders making up this level. */
|
|
40
|
+
n: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Represents the response data for an L2 Book Snapshot request.
|
|
44
|
+
*/
|
|
45
|
+
export interface HLL2BookResponse {
|
|
46
|
+
/** The trading coin symbol. */
|
|
47
|
+
coin: string;
|
|
48
|
+
/** The server timestamp when the snapshot was generated. */
|
|
49
|
+
time: Timestamp;
|
|
50
|
+
/**
|
|
51
|
+
* An array containing exactly two elements representing the order book depth.
|
|
52
|
+
* Index 0: Bids (Buy orders), sorted from highest price to lowest.
|
|
53
|
+
* Index 1: Asks (Sell orders), sorted from lowest price to highest.
|
|
54
|
+
* Returns at most 20 levels per side.
|
|
55
|
+
*/
|
|
56
|
+
levels: [HLL2BookLevel[], HLL2BookLevel[]];
|
|
57
|
+
}
|