@lifi/perps-sdk-provider-lighter 7.0.0 → 8.0.1
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.
- package/dist/cjs/LighterProvider.d.ts.map +1 -1
- package/dist/cjs/LighterProvider.js +60 -27
- package/dist/cjs/LighterProvider.js.map +1 -1
- package/dist/cjs/accountSummary.d.ts.map +1 -1
- package/dist/cjs/accountSummary.js +33 -2
- package/dist/cjs/accountSummary.js.map +1 -1
- package/dist/cjs/constants.d.ts.map +1 -1
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/signers/LighterKeyStore.d.ts.map +1 -1
- package/dist/cjs/signers/LighterKeyStore.js.map +1 -1
- package/dist/cjs/signers/LighterReadOnlyTokenManager.d.ts.map +1 -1
- package/dist/cjs/signers/LighterReadOnlyTokenManager.js.map +1 -1
- package/dist/cjs/signers/LighterSigner.d.ts.map +1 -1
- package/dist/cjs/signers/LighterSigner.js.map +1 -1
- package/dist/cjs/signers/createAuthToken.d.ts.map +1 -1
- package/dist/cjs/signers/createAuthToken.js.map +1 -1
- package/dist/cjs/signers/wasmLoader.d.ts.map +1 -1
- package/dist/cjs/signers/wasmLoader.js.map +1 -1
- package/dist/cjs/types/account.d.ts +1 -0
- package/dist/cjs/types/account.d.ts.map +1 -1
- package/dist/cjs/types/action.d.ts.map +1 -1
- package/dist/cjs/types/action.js.map +1 -1
- package/dist/cjs/types/activity.d.ts.map +1 -1
- package/dist/cjs/types/asset.d.ts.map +1 -1
- package/dist/cjs/types/fill.d.ts.map +1 -1
- package/dist/cjs/types/order.d.ts.map +1 -1
- package/dist/cjs/types/submit.d.ts.map +1 -1
- package/dist/cjs/types/ws.d.ts +5 -0
- package/dist/cjs/types/ws.d.ts.map +1 -1
- package/dist/cjs/utils/decimal.d.ts +5 -0
- package/dist/cjs/utils/decimal.d.ts.map +1 -0
- package/dist/cjs/utils/decimal.js +38 -0
- package/dist/cjs/utils/decimal.js.map +1 -0
- package/dist/cjs/utils/index.d.ts +3 -1
- package/dist/cjs/utils/index.d.ts.map +1 -1
- package/dist/cjs/utils/index.js +7 -1
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/lighterAsset.d.ts.map +1 -1
- package/dist/cjs/utils/lighterAsset.js.map +1 -1
- package/dist/cjs/utils/mapOpenPositions.d.ts +2 -2
- package/dist/cjs/utils/mapOpenPositions.d.ts.map +1 -1
- package/dist/cjs/utils/mapOpenPositions.js.map +1 -1
- package/dist/cjs/utils/mapPosition.d.ts +3 -2
- package/dist/cjs/utils/mapPosition.d.ts.map +1 -1
- package/dist/cjs/utils/mapPosition.js +30 -9
- package/dist/cjs/utils/mapPosition.js.map +1 -1
- package/dist/cjs/utils/ohlcvInterval.d.ts.map +1 -1
- package/dist/cjs/utils/ohlcvInterval.js.map +1 -1
- package/dist/cjs/utils/transferMargin.d.ts +3 -0
- package/dist/cjs/utils/transferMargin.d.ts.map +1 -0
- package/dist/cjs/utils/transferMargin.js +16 -0
- package/dist/cjs/utils/transferMargin.js.map +1 -0
- package/dist/cjs/utils/wireEncoding.d.ts.map +1 -1
- package/dist/cjs/utils/wireEncoding.js.map +1 -1
- package/dist/cjs/websocket/LighterWsProvider.d.ts.map +1 -1
- package/dist/cjs/websocket/LighterWsProvider.js +20 -9
- package/dist/cjs/websocket/LighterWsProvider.js.map +1 -1
- package/dist/esm/LighterProvider.d.ts.map +1 -1
- package/dist/esm/LighterProvider.js +49 -11
- package/dist/esm/LighterProvider.js.map +1 -1
- package/dist/esm/accountSummary.d.ts +5 -4
- package/dist/esm/accountSummary.d.ts.map +1 -1
- package/dist/esm/accountSummary.js +35 -6
- package/dist/esm/accountSummary.js.map +1 -1
- package/dist/esm/constants.d.ts +15 -2
- package/dist/esm/constants.d.ts.map +1 -1
- package/dist/esm/constants.js +15 -2
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/signers/LighterKeyStore.d.ts +31 -2
- package/dist/esm/signers/LighterKeyStore.d.ts.map +1 -1
- package/dist/esm/signers/LighterKeyStore.js +24 -1
- package/dist/esm/signers/LighterKeyStore.js.map +1 -1
- package/dist/esm/signers/LighterReadOnlyTokenManager.d.ts +23 -3
- package/dist/esm/signers/LighterReadOnlyTokenManager.d.ts.map +1 -1
- package/dist/esm/signers/LighterReadOnlyTokenManager.js +4 -0
- package/dist/esm/signers/LighterReadOnlyTokenManager.js.map +1 -1
- package/dist/esm/signers/LighterSigner.d.ts +49 -7
- package/dist/esm/signers/LighterSigner.d.ts.map +1 -1
- package/dist/esm/signers/LighterSigner.js +11 -1
- package/dist/esm/signers/LighterSigner.js.map +1 -1
- package/dist/esm/signers/createAuthToken.d.ts +8 -2
- package/dist/esm/signers/createAuthToken.d.ts.map +1 -1
- package/dist/esm/signers/createAuthToken.js.map +1 -1
- package/dist/esm/signers/wasmLoader.d.ts +14 -2
- package/dist/esm/signers/wasmLoader.d.ts.map +1 -1
- package/dist/esm/signers/wasmLoader.js.map +1 -1
- package/dist/esm/types/account.d.ts +61 -8
- package/dist/esm/types/account.d.ts.map +1 -1
- package/dist/esm/types/action.d.ts +72 -18
- package/dist/esm/types/action.d.ts.map +1 -1
- package/dist/esm/types/action.js +72 -18
- package/dist/esm/types/action.js.map +1 -1
- package/dist/esm/types/activity.d.ts +64 -10
- package/dist/esm/types/activity.d.ts.map +1 -1
- package/dist/esm/types/asset.d.ts +72 -12
- package/dist/esm/types/asset.d.ts.map +1 -1
- package/dist/esm/types/fill.d.ts +14 -2
- package/dist/esm/types/fill.d.ts.map +1 -1
- package/dist/esm/types/order.d.ts +27 -4
- package/dist/esm/types/order.d.ts.map +1 -1
- package/dist/esm/types/submit.d.ts +26 -4
- package/dist/esm/types/submit.d.ts.map +1 -1
- package/dist/esm/types/ws.d.ts +65 -9
- package/dist/esm/types/ws.d.ts.map +1 -1
- package/dist/esm/utils/decimal.d.ts +15 -0
- package/dist/esm/utils/decimal.d.ts.map +1 -0
- package/dist/esm/utils/decimal.js +39 -0
- package/dist/esm/utils/decimal.js.map +1 -0
- package/dist/esm/utils/index.d.ts +3 -1
- package/dist/esm/utils/index.d.ts.map +1 -1
- package/dist/esm/utils/index.js +3 -1
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/lighterAsset.d.ts +7 -1
- package/dist/esm/utils/lighterAsset.d.ts.map +1 -1
- package/dist/esm/utils/lighterAsset.js +7 -1
- package/dist/esm/utils/lighterAsset.js.map +1 -1
- package/dist/esm/utils/mapOpenPositions.d.ts +2 -2
- package/dist/esm/utils/mapOpenPositions.d.ts.map +1 -1
- package/dist/esm/utils/mapOpenPositions.js.map +1 -1
- package/dist/esm/utils/mapPosition.d.ts +10 -2
- package/dist/esm/utils/mapPosition.d.ts.map +1 -1
- package/dist/esm/utils/mapPosition.js +32 -11
- package/dist/esm/utils/mapPosition.js.map +1 -1
- package/dist/esm/utils/ohlcvInterval.d.ts +6 -1
- package/dist/esm/utils/ohlcvInterval.d.ts.map +1 -1
- package/dist/esm/utils/ohlcvInterval.js +6 -1
- package/dist/esm/utils/ohlcvInterval.js.map +1 -1
- package/dist/esm/utils/transferMargin.d.ts +11 -0
- package/dist/esm/utils/transferMargin.d.ts.map +1 -0
- package/dist/esm/utils/transferMargin.js +21 -0
- package/dist/esm/utils/transferMargin.js.map +1 -0
- package/dist/esm/utils/wireEncoding.d.ts +58 -23
- package/dist/esm/utils/wireEncoding.d.ts.map +1 -1
- package/dist/esm/utils/wireEncoding.js +58 -23
- package/dist/esm/utils/wireEncoding.js.map +1 -1
- package/dist/esm/websocket/LighterWsProvider.d.ts +6 -0
- package/dist/esm/websocket/LighterWsProvider.d.ts.map +1 -1
- package/dist/esm/websocket/LighterWsProvider.js +30 -13
- package/dist/esm/websocket/LighterWsProvider.js.map +1 -1
- package/dist/types/LighterProvider.d.ts.map +1 -1
- package/dist/types/accountSummary.d.ts +5 -4
- package/dist/types/accountSummary.d.ts.map +1 -1
- package/dist/types/constants.d.ts +15 -2
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/signers/LighterKeyStore.d.ts +31 -2
- package/dist/types/signers/LighterKeyStore.d.ts.map +1 -1
- package/dist/types/signers/LighterReadOnlyTokenManager.d.ts +23 -3
- package/dist/types/signers/LighterReadOnlyTokenManager.d.ts.map +1 -1
- package/dist/types/signers/LighterSigner.d.ts +49 -7
- package/dist/types/signers/LighterSigner.d.ts.map +1 -1
- package/dist/types/signers/createAuthToken.d.ts +8 -2
- package/dist/types/signers/createAuthToken.d.ts.map +1 -1
- package/dist/types/signers/wasmLoader.d.ts +14 -2
- package/dist/types/signers/wasmLoader.d.ts.map +1 -1
- package/dist/types/types/account.d.ts +61 -8
- package/dist/types/types/account.d.ts.map +1 -1
- package/dist/types/types/action.d.ts +72 -18
- package/dist/types/types/action.d.ts.map +1 -1
- package/dist/types/types/activity.d.ts +64 -10
- package/dist/types/types/activity.d.ts.map +1 -1
- package/dist/types/types/asset.d.ts +72 -12
- package/dist/types/types/asset.d.ts.map +1 -1
- package/dist/types/types/fill.d.ts +14 -2
- package/dist/types/types/fill.d.ts.map +1 -1
- package/dist/types/types/order.d.ts +27 -4
- package/dist/types/types/order.d.ts.map +1 -1
- package/dist/types/types/submit.d.ts +26 -4
- package/dist/types/types/submit.d.ts.map +1 -1
- package/dist/types/types/ws.d.ts +65 -9
- package/dist/types/types/ws.d.ts.map +1 -1
- package/dist/types/utils/decimal.d.ts +15 -0
- package/dist/types/utils/decimal.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +3 -1
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/lighterAsset.d.ts +7 -1
- package/dist/types/utils/lighterAsset.d.ts.map +1 -1
- package/dist/types/utils/mapOpenPositions.d.ts +2 -2
- package/dist/types/utils/mapOpenPositions.d.ts.map +1 -1
- package/dist/types/utils/mapPosition.d.ts +10 -2
- package/dist/types/utils/mapPosition.d.ts.map +1 -1
- package/dist/types/utils/ohlcvInterval.d.ts +6 -1
- package/dist/types/utils/ohlcvInterval.d.ts.map +1 -1
- package/dist/types/utils/transferMargin.d.ts +11 -0
- package/dist/types/utils/transferMargin.d.ts.map +1 -0
- package/dist/types/utils/wireEncoding.d.ts +58 -23
- package/dist/types/utils/wireEncoding.d.ts.map +1 -1
- package/dist/types/websocket/LighterWsProvider.d.ts +6 -0
- package/dist/types/websocket/LighterWsProvider.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/LighterProvider.ts +75 -9
- package/src/accountSummary.ts +38 -6
- package/src/constants.ts +15 -2
- package/src/signers/LighterKeyStore.ts +31 -2
- package/src/signers/LighterReadOnlyTokenManager.ts +23 -3
- package/src/signers/LighterSigner.ts +49 -7
- package/src/signers/createAuthToken.ts +8 -2
- package/src/signers/wasmLoader.ts +14 -2
- package/src/types/account.ts +61 -8
- package/src/types/action.ts +72 -18
- package/src/types/activity.ts +64 -10
- package/src/types/asset.ts +72 -12
- package/src/types/fill.ts +14 -2
- package/src/types/order.ts +27 -4
- package/src/types/submit.ts +26 -4
- package/src/types/ws.ts +65 -9
- package/src/utils/decimal.ts +52 -0
- package/src/utils/index.ts +3 -1
- package/src/utils/lighterAsset.ts +7 -1
- package/src/utils/mapOpenPositions.ts +2 -2
- package/src/utils/mapPosition.ts +40 -14
- package/src/utils/ohlcvInterval.ts +6 -1
- package/src/utils/transferMargin.ts +31 -0
- package/src/utils/wireEncoding.ts +58 -23
- package/src/websocket/LighterWsProvider.ts +47 -11
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Venue configuration nested in a Lighter perpetual-market descriptor.
|
|
3
|
+
* Numeric fields are Lighter wire mode values; booleans indicate whether the
|
|
4
|
+
* market is currently restricted or hidden.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
2
8
|
export interface LtMarketConfig {
|
|
3
9
|
market_margin_mode: number;
|
|
4
10
|
insurance_fund_account_index: number;
|
|
@@ -8,7 +14,14 @@ export interface LtMarketConfig {
|
|
|
8
14
|
funding_fee_discounts_enabled: boolean;
|
|
9
15
|
hidden: boolean;
|
|
10
16
|
}
|
|
11
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Perpetual-market metadata returned by Lighter's order-book-details endpoint.
|
|
19
|
+
* Decimal strings use the market's native asset/quote precision. Decimal-count
|
|
20
|
+
* fields describe supported and canonical order precision; fee and margin
|
|
21
|
+
* fractions use Lighter's wire representation.
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
12
25
|
export interface LtPerpsOrderBookDetail {
|
|
13
26
|
symbol: string;
|
|
14
27
|
market_id: number;
|
|
@@ -44,7 +57,13 @@ export interface LtPerpsOrderBookDetail {
|
|
|
44
57
|
market_config: LtMarketConfig;
|
|
45
58
|
strategy_index: number;
|
|
46
59
|
}
|
|
47
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* Spot-market metadata returned by Lighter's order-book-details endpoint.
|
|
62
|
+
* Decimal strings use the market's native asset/quote precision; decimal-count
|
|
63
|
+
* fields describe supported order precision.
|
|
64
|
+
*
|
|
65
|
+
* @public
|
|
66
|
+
*/
|
|
48
67
|
export interface LtSpotOrderBookDetail {
|
|
49
68
|
symbol: string;
|
|
50
69
|
market_id: number;
|
|
@@ -72,13 +91,22 @@ export interface LtSpotOrderBookDetail {
|
|
|
72
91
|
daily_price_change: number;
|
|
73
92
|
daily_chart: Record<string, unknown>;
|
|
74
93
|
}
|
|
75
|
-
/**
|
|
94
|
+
/**
|
|
95
|
+
* Response envelope containing both perpetual and spot market descriptors.
|
|
96
|
+
*
|
|
97
|
+
* @public
|
|
98
|
+
*/
|
|
76
99
|
export interface LtOrderBookDetailsResponse {
|
|
77
100
|
code: number;
|
|
78
101
|
order_book_details: LtPerpsOrderBookDetail[];
|
|
79
102
|
spot_order_book_details: LtSpotOrderBookDetail[];
|
|
80
103
|
}
|
|
81
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Token metadata returned by Lighter's token-list endpoint. `market` identifies
|
|
106
|
+
* whether the token is associated with a perpetual or spot market.
|
|
107
|
+
*
|
|
108
|
+
* @public
|
|
109
|
+
*/
|
|
82
110
|
export interface LtToken {
|
|
83
111
|
symbol: string;
|
|
84
112
|
name: string;
|
|
@@ -86,12 +114,21 @@ export interface LtToken {
|
|
|
86
114
|
logo_extension: string;
|
|
87
115
|
market: 'PERPS' | 'SPOT';
|
|
88
116
|
}
|
|
89
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* Response envelope for Lighter's token-list endpoint.
|
|
119
|
+
*
|
|
120
|
+
* @public
|
|
121
|
+
*/
|
|
90
122
|
export interface LtTokenListResponse {
|
|
91
123
|
code: number;
|
|
92
124
|
tokens: LtToken[];
|
|
93
125
|
}
|
|
94
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* Asset metadata returned by Lighter. `l1_decimals` is the token precision on
|
|
128
|
+
* L1; `decimals` is the Lighter ledger precision.
|
|
129
|
+
*
|
|
130
|
+
* @public
|
|
131
|
+
*/
|
|
95
132
|
export interface LtAssetDetail {
|
|
96
133
|
asset_id: number;
|
|
97
134
|
symbol: string;
|
|
@@ -99,12 +136,21 @@ export interface LtAssetDetail {
|
|
|
99
136
|
decimals: number;
|
|
100
137
|
l1_address: string;
|
|
101
138
|
}
|
|
102
|
-
/**
|
|
139
|
+
/**
|
|
140
|
+
* Response envelope for Lighter's asset-details endpoint.
|
|
141
|
+
*
|
|
142
|
+
* @public
|
|
143
|
+
*/
|
|
103
144
|
export interface LtAssetDetailsResponse {
|
|
104
145
|
code: number;
|
|
105
146
|
asset_details: LtAssetDetail[];
|
|
106
147
|
}
|
|
107
|
-
/**
|
|
148
|
+
/**
|
|
149
|
+
* OHLCV candle returned by Lighter. `t` is the candle timestamp in Unix
|
|
150
|
+
* milliseconds; `o`, `h`, `l`, and `c` are prices and `v` is volume.
|
|
151
|
+
*
|
|
152
|
+
* @public
|
|
153
|
+
*/
|
|
108
154
|
export interface LtCandle {
|
|
109
155
|
t: number;
|
|
110
156
|
o: number;
|
|
@@ -113,20 +159,34 @@ export interface LtCandle {
|
|
|
113
159
|
c: number;
|
|
114
160
|
v: number;
|
|
115
161
|
}
|
|
116
|
-
/**
|
|
162
|
+
/**
|
|
163
|
+
* Response envelope for a Lighter candle query. `r` is the endpoint's result
|
|
164
|
+
* value and `c` contains the returned candles.
|
|
165
|
+
*
|
|
166
|
+
* @public
|
|
167
|
+
*/
|
|
117
168
|
export interface LtCandlesResponse {
|
|
118
169
|
code: number;
|
|
119
170
|
r: string;
|
|
120
171
|
c: LtCandle[];
|
|
121
172
|
}
|
|
122
|
-
/**
|
|
173
|
+
/**
|
|
174
|
+
* Funding-rate snapshot for one Lighter perpetual market. `rate` is the
|
|
175
|
+
* venue-provided funding-rate value for the named exchange and market.
|
|
176
|
+
*
|
|
177
|
+
* @public
|
|
178
|
+
*/
|
|
123
179
|
export interface LtFundingRate {
|
|
124
180
|
market_id: number;
|
|
125
181
|
exchange: string;
|
|
126
182
|
symbol: string;
|
|
127
183
|
rate: number;
|
|
128
184
|
}
|
|
129
|
-
/**
|
|
185
|
+
/**
|
|
186
|
+
* Response envelope containing current funding rates by market.
|
|
187
|
+
*
|
|
188
|
+
* @public
|
|
189
|
+
*/
|
|
130
190
|
export interface LtFundingRatesResponse {
|
|
131
191
|
code: number;
|
|
132
192
|
funding_rates: LtFundingRate[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../../src/types/asset.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../../src/types/asset.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,4BAA4B,EAAE,MAAM,CAAA;IACpC,gBAAgB,EAAE,MAAM,CAAA;IACxB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,aAAa,EAAE,MAAM,CAAA;IACrB,6BAA6B,EAAE,OAAO,CAAA;IAC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,EAAE,CAAA;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,aAAa,EAAE,CAAA;CAC/B;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,QAAQ,EAAE,CAAA;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,aAAa,EAAE,CAAA;CAC/B"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Public trade/fill row returned by Lighter's `/api/v1/trades` endpoint.
|
|
3
|
+
* Size, price, and notional fields are decimal strings in market precision;
|
|
4
|
+
* `timestamp` and `transaction_time` are Unix millisecond timestamps. The
|
|
5
|
+
* optional fee fields are integer fee ticks and may be absent on older rows.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
2
9
|
export type LtTrade = {
|
|
3
10
|
trade_id: number;
|
|
4
11
|
tx_hash: string;
|
|
@@ -22,7 +29,12 @@ export type LtTrade = {
|
|
|
22
29
|
taker_entry_quote_before?: string;
|
|
23
30
|
maker_entry_quote_before?: string;
|
|
24
31
|
};
|
|
25
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Paginated trade-history response from Lighter. `next_cursor` is an opaque
|
|
34
|
+
* continuation value for the next page.
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
26
38
|
export interface LtTradesResponse {
|
|
27
39
|
code: number;
|
|
28
40
|
next_cursor: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fill.d.ts","sourceRoot":"","sources":["../../../src/types/fill.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"fill.d.ts","sourceRoot":"","sources":["../../../src/types/fill.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,OAAO,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IAIjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;IAGxB,0BAA0B,EAAE,MAAM,CAAA;IAClC,0BAA0B,EAAE,MAAM,CAAA;IAKlC,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,wBAAwB,CAAC,EAAE,MAAM,CAAA;CAClC,CAAA;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,OAAO,EAAE,CAAA;CAClB"}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Order payload returned by Lighter's REST API. Amounts and prices are decimal
|
|
3
|
+
* strings in market precision. `order_expiry` is an absolute Unix-millisecond
|
|
4
|
+
* expiry; `created_at`, `updated_at`, and `transaction_time` are Unix seconds.
|
|
5
|
+
* Enum-like side, type, time-in-force, status, and trigger fields retain
|
|
6
|
+
* Lighter's wire strings.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
2
10
|
export type LtOrder = {
|
|
3
11
|
order_index: number;
|
|
4
12
|
client_order_index: number;
|
|
@@ -33,13 +41,24 @@ export type LtOrder = {
|
|
|
33
41
|
updated_at: number;
|
|
34
42
|
transaction_time: number;
|
|
35
43
|
};
|
|
36
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Paginated order-history response from Lighter. `next_cursor` is an opaque
|
|
46
|
+
* continuation value for the next page.
|
|
47
|
+
*
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
37
50
|
export interface LtOrdersResponse {
|
|
38
51
|
code: number;
|
|
39
52
|
next_cursor: string;
|
|
40
53
|
orders: LtOrder[];
|
|
41
54
|
}
|
|
42
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Single order-book level returned by Lighter. Amounts and prices are decimal
|
|
57
|
+
* strings in the market's native precision; expiry and transaction time are
|
|
58
|
+
* Unix milliseconds.
|
|
59
|
+
*
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
43
62
|
export interface LtOrderBookOrder {
|
|
44
63
|
order_index: number;
|
|
45
64
|
order_id: string;
|
|
@@ -50,7 +69,11 @@ export interface LtOrderBookOrder {
|
|
|
50
69
|
order_expiry: number;
|
|
51
70
|
transaction_time: number;
|
|
52
71
|
}
|
|
53
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* Order-book response containing separate ask and bid levels plus their counts.
|
|
74
|
+
*
|
|
75
|
+
* @public
|
|
76
|
+
*/
|
|
54
77
|
export interface LtOrderBookOrdersResponse {
|
|
55
78
|
code: number;
|
|
56
79
|
total_asks: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order.d.ts","sourceRoot":"","sources":["../../../src/types/order.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"order.d.ts","sourceRoot":"","sources":["../../../src/types/order.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,mBAAmB,EAAE,MAAM,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,qBAAqB,EAAE,MAAM,CAAA;IAC7B,MAAM,EAAE,OAAO,CAAA;IACf,kBAAkB,EAAE,MAAM,CAAA;IAC1B,mBAAmB,EAAE,MAAM,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,OAAO,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,eAAe,EAAE,MAAM,CAAA;IACvB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,qBAAqB,EAAE,MAAM,CAAA;IAC7B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;CACzB,CAAA;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,OAAO,EAAE,CAAA;CAClB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,mBAAmB,EAAE,MAAM,CAAA;IAC3B,qBAAqB,EAAE,MAAM,CAAA;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,gBAAgB,EAAE,MAAM,CAAA;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,gBAAgB,EAAE,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,gBAAgB,EAAE,CAAA;CACzB"}
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Request body for Lighter's `/api/v1/sendTx` endpoint. `tx_type` and
|
|
3
|
+
* `tx_info` are the signed WASM transaction envelope; `price_protection` is an
|
|
4
|
+
* optional venue-side execution guard.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
2
8
|
export interface LtSendTxRequest {
|
|
3
9
|
tx_type: number;
|
|
4
10
|
tx_info: string;
|
|
5
11
|
price_protection?: boolean;
|
|
6
12
|
}
|
|
7
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Response from Lighter's `/api/v1/sendTx` endpoint. `tx_hash` identifies the
|
|
15
|
+
* submitted transaction; timing and quota fields are optional venue estimates.
|
|
16
|
+
*
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
8
19
|
export interface LtSendTxResponse {
|
|
9
20
|
code: number;
|
|
10
21
|
message: string;
|
|
@@ -12,12 +23,23 @@ export interface LtSendTxResponse {
|
|
|
12
23
|
predicted_execution_time_ms?: number;
|
|
13
24
|
volume_quota_remaining?: number;
|
|
14
25
|
}
|
|
15
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Batch request body for Lighter's transaction submission endpoint.
|
|
28
|
+
* `tx_types` is a JSON-encoded number array and `tx_infos` a JSON-encoded
|
|
29
|
+
* string array; corresponding entries are submitted in array order.
|
|
30
|
+
*
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
16
33
|
export interface LtSendTxBatchRequest {
|
|
17
34
|
tx_types: string;
|
|
18
35
|
tx_infos: string;
|
|
19
36
|
}
|
|
20
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Batch submission response from Lighter. Each `tx_hash` corresponds to the
|
|
39
|
+
* transaction at the same index in the submitted batch.
|
|
40
|
+
*
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
21
43
|
export interface LtSendTxBatchResponse {
|
|
22
44
|
code: number;
|
|
23
45
|
message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submit.d.ts","sourceRoot":"","sources":["../../../src/types/submit.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"submit.d.ts","sourceRoot":"","sources":["../../../src/types/submit.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,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
*
|
|
4
|
+
* `channel` identifies the subscribed stream when present; `type` is the
|
|
5
|
+
* subscription, update, or control-frame discriminator.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
2
9
|
export type LtWsMessage = {
|
|
3
10
|
channel?: string;
|
|
4
11
|
type: string;
|
|
5
12
|
};
|
|
6
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Lighter WebSocket keepalive frame.
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
7
18
|
export type LtWsPingMessage = LtWsMessage & {
|
|
8
19
|
type: 'ping';
|
|
9
20
|
};
|
|
10
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Perpetual-market statistics pushed by Lighter's `market_stats` channels.
|
|
23
|
+
* Price, interest, volume, and funding values are decimal strings; the funding
|
|
24
|
+
* timestamp is a Unix timestamp in milliseconds.
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
11
28
|
export type LtWsMarketStats = {
|
|
12
29
|
market_id: number;
|
|
13
30
|
index_price: string;
|
|
@@ -59,18 +76,32 @@ export type LtWsSpotMarketStatsAllMessage = LtWsMessage & {
|
|
|
59
76
|
type: 'subscribed/spot_market_stats' | 'update/spot_market_stats';
|
|
60
77
|
spot_market_stats?: LtWsSpotMarketStats | Record<string, LtWsSpotMarketStats>;
|
|
61
78
|
};
|
|
62
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* One bid or ask level in a Lighter order-book snapshot or delta. Price and
|
|
81
|
+
* size are decimal strings in the market's native precision.
|
|
82
|
+
*
|
|
83
|
+
* @public
|
|
84
|
+
*/
|
|
63
85
|
export type LtWsOrderBookLevel = {
|
|
64
86
|
price: string;
|
|
65
87
|
size: string;
|
|
66
88
|
};
|
|
67
|
-
/**
|
|
89
|
+
/**
|
|
90
|
+
* Lighter order-book state containing ask and bid levels. `offset`, when
|
|
91
|
+
* present, identifies the sequence offset used for stateful delta updates.
|
|
92
|
+
*
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
68
95
|
export type LtWsOrderBook = {
|
|
69
96
|
asks: LtWsOrderBookLevel[];
|
|
70
97
|
bids: LtWsOrderBookLevel[];
|
|
71
98
|
offset?: number;
|
|
72
99
|
};
|
|
73
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* Subscription or update frame carrying a Lighter order-book snapshot/delta.
|
|
102
|
+
*
|
|
103
|
+
* @public
|
|
104
|
+
*/
|
|
74
105
|
export type LtWsOrderBookMessage = LtWsMessage & {
|
|
75
106
|
type: 'subscribed/order_book' | 'update/order_book';
|
|
76
107
|
order_book: LtWsOrderBook;
|
|
@@ -89,7 +120,11 @@ export type LtWsTrade = {
|
|
|
89
120
|
is_maker_ask: boolean;
|
|
90
121
|
timestamp: number;
|
|
91
122
|
};
|
|
92
|
-
/**
|
|
123
|
+
/**
|
|
124
|
+
* Subscription or update frame carrying public trades from a Lighter market.
|
|
125
|
+
*
|
|
126
|
+
* @public
|
|
127
|
+
*/
|
|
93
128
|
export type LtWsTradeMessage = LtWsMessage & {
|
|
94
129
|
type: 'subscribed/trade' | 'update/trade';
|
|
95
130
|
trades?: LtWsTrade[];
|
|
@@ -118,7 +153,13 @@ export type LtWsAccountAllOrdersMessage = LtWsMessage & {
|
|
|
118
153
|
orders?: Record<string, unknown[]> | unknown[];
|
|
119
154
|
};
|
|
120
155
|
};
|
|
121
|
-
/**
|
|
156
|
+
/**
|
|
157
|
+
* Authenticated account trade-history frame. Trade arrays may be flat or
|
|
158
|
+
* market-indexed depending on whether the frame is an initial snapshot or
|
|
159
|
+
* update.
|
|
160
|
+
*
|
|
161
|
+
* @public
|
|
162
|
+
*/
|
|
122
163
|
export type LtWsAccountAllTradesMessage = LtWsMessage & {
|
|
123
164
|
type: 'subscribed/account_all_trades' | 'update/account_all_trades';
|
|
124
165
|
trades?: Record<string, unknown[]> | unknown[];
|
|
@@ -131,7 +172,10 @@ export type LtWsAccountAllTradesMessage = LtWsMessage & {
|
|
|
131
172
|
};
|
|
132
173
|
};
|
|
133
174
|
/**
|
|
134
|
-
* `user_stats/{account_index}` frame; decimal strings in USD.
|
|
175
|
+
* `user_stats/{account_index}` frame; decimal strings in USD. The top-level
|
|
176
|
+
* figures span the whole account (`available_balance` = total withdrawable,
|
|
177
|
+
* including isolated positions' excess margin); `cross_stats` scopes them to
|
|
178
|
+
* the cross pool, whose `available_balance` is the free tradable collateral.
|
|
135
179
|
* @public
|
|
136
180
|
*/
|
|
137
181
|
export type LtWsUserStatsMessage = LtWsMessage & {
|
|
@@ -139,8 +183,20 @@ export type LtWsUserStatsMessage = LtWsMessage & {
|
|
|
139
183
|
collateral?: string;
|
|
140
184
|
portfolio_value?: string;
|
|
141
185
|
available_balance?: string;
|
|
186
|
+
cross_stats?: {
|
|
187
|
+
collateral: string;
|
|
188
|
+
portfolio_value: string;
|
|
189
|
+
available_balance: string;
|
|
190
|
+
};
|
|
142
191
|
};
|
|
143
192
|
};
|
|
193
|
+
/**
|
|
194
|
+
* Authenticated account-position frame. Position and funding maps are keyed
|
|
195
|
+
* by Lighter market index; the provider normalizes the payload before emitting
|
|
196
|
+
* account updates.
|
|
197
|
+
*
|
|
198
|
+
* @public
|
|
199
|
+
*/
|
|
144
200
|
export type LtWsAccountAllPositionsMessage = LtWsMessage & {
|
|
145
201
|
type: 'subscribed/account_all_positions' | 'update/account_all_positions';
|
|
146
202
|
positions?: Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws.d.ts","sourceRoot":"","sources":["../../../src/types/ws.ts"],"names":[],"mappings":"AAYA
|
|
1
|
+
{"version":3,"file":"ws.d.ts","sourceRoot":"","sources":["../../../src/types/ws.ts"],"names":[],"mappings":"AAYA;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,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AM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9C,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAA;CAC/C,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Big from 'big.js';
|
|
2
|
+
/**
|
|
3
|
+
* Exact-decimal parse of a venue decimal string; null when absent or
|
|
4
|
+
* unparsable, so callers can gate on presence before deriving.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export declare const toBigOrNull: (value: string | undefined) => Big | null;
|
|
8
|
+
/**
|
|
9
|
+
* Parse a required venue decimal and identify the bad field on failure.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export declare const toRequiredBig: (value: string | undefined, field: string) => Big;
|
|
13
|
+
/** Parse a required venue decimal that must be greater than zero. */
|
|
14
|
+
export declare const toPositiveRequiredBig: (value: string | undefined, field: string) => Big;
|
|
15
|
+
//# sourceMappingURL=decimal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decimal.d.ts","sourceRoot":"","sources":["../../../src/utils/decimal.ts"],"names":[],"mappings":"AAEA,OAAO,GAAG,MAAM,QAAQ,CAAA;AAExB;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,GAAG,SAAS,KAAG,GAAG,GAAG,IAS7D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,MAAM,GAAG,SAAS,EACzB,OAAO,MAAM,KACZ,GASF,CAAA;AAED,qEAAqE;AACrE,eAAO,MAAM,qBAAqB,GAChC,OAAO,MAAM,GAAG,SAAS,EACzB,OAAO,MAAM,KACZ,GASF,CAAA"}
|
|
@@ -2,6 +2,7 @@ export type { LighterActivityCursor } from './activityCursor.js';
|
|
|
2
2
|
export { decodeActivityCursor, encodeActivityCursor, } from './activityCursor.js';
|
|
3
3
|
export { LighterApiClient } from './apiClient.js';
|
|
4
4
|
export { assetMarginModeInt, isAssetMarginEnabled } from './assetCollateral.js';
|
|
5
|
+
export { toBigOrNull, toRequiredBig } from './decimal.js';
|
|
5
6
|
export { fetchDetailedAccount } from './fetchDetailedAccount.js';
|
|
6
7
|
export { lighterAsset } from './lighterAsset.js';
|
|
7
8
|
export { estimateLiquidationPrice } from './liquidation.js';
|
|
@@ -9,9 +10,10 @@ export { mapFill } from './mapFill.js';
|
|
|
9
10
|
export { mapMarketContext } from './mapMarketContext.js';
|
|
10
11
|
export { mapOpenPositions } from './mapOpenPositions.js';
|
|
11
12
|
export { classifyAndMapOrders, isTriggerOrder, isTriggerType, mapOrder, mapOrderDetail, mapStatusReason, mapTriggerOrder, } from './mapOrder.js';
|
|
12
|
-
export { mapPosition } from './mapPosition.js';
|
|
13
|
+
export { leverageFromImf, mapPosition } from './mapPosition.js';
|
|
13
14
|
export { mapInterval } from './ohlcvInterval.js';
|
|
14
15
|
export { formatOrderPrice, formatOrderSize } from './orderFormatting.js';
|
|
15
16
|
export { toIsoFromMs, toIsoFromSeconds } from './time.js';
|
|
17
|
+
export { positionMarginConstraints } from './transferMargin.js';
|
|
16
18
|
export { leverageToFraction, mapOrderTypeToInt, mapTimeInForceToInt, marginFractionToMaxLeverage, orderExpiryForTif, resolveTimeInForce, } from './wireEncoding.js';
|
|
17
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC/E,OAAO,EAAE,oB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,EACf,eAAe,GAChB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,mBAAmB,CAAA"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { Asset } from '@lifi/perps-types';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Create the SDK asset descriptor for a Lighter asset identifier and display
|
|
4
|
+
* symbol. Lighter assets do not provide a package-level logo URI, so this
|
|
5
|
+
* helper leaves that field empty.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
3
9
|
export declare const lighterAsset: (id: string, displaySymbol: string) => Asset;
|
|
4
10
|
//# sourceMappingURL=lighterAsset.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lighterAsset.d.ts","sourceRoot":"","sources":["../../../src/utils/lighterAsset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAG9C
|
|
1
|
+
{"version":3,"file":"lighterAsset.d.ts","sourceRoot":"","sources":["../../../src/utils/lighterAsset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAG9C;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,IAAI,MAAM,EAAE,eAAe,MAAM,KAAG,KAK/D,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PerpsMarketDisplay, Position } from '@lifi/perps-types';
|
|
2
2
|
import type { LtAccountPosition } from '../types/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Map raw Lighter account positions to open {@link Position}s, dropping
|
|
@@ -7,5 +7,5 @@ import type { LtAccountPosition } from '../types/index.js';
|
|
|
7
7
|
*
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
10
|
-
export declare const mapOpenPositions: (positions: LtAccountPosition[], resolveMarket: (marketId: number) =>
|
|
10
|
+
export declare const mapOpenPositions: (positions: LtAccountPosition[], resolveMarket: (marketId: number) => PerpsMarketDisplay) => Position[];
|
|
11
11
|
//# sourceMappingURL=mapOpenPositions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapOpenPositions.d.ts","sourceRoot":"","sources":["../../../src/utils/mapOpenPositions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"mapOpenPositions.d.ts","sourceRoot":"","sources":["../../../src/utils/mapOpenPositions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAG1D;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAC3B,WAAW,iBAAiB,EAAE,EAC9B,eAAe,CAAC,QAAQ,EAAE,MAAM,KAAK,kBAAkB,KACtD,QAAQ,EAGgD,CAAA"}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PerpsMarketDisplay, Position } from '@lifi/perps-types';
|
|
2
2
|
import type { LtAccountPosition } from '../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Display leverage from an IMF percent string: `100 / IMF` in exact decimal
|
|
5
|
+
* arithmetic before conversion to `number`. This value is for displaying the
|
|
6
|
+
* venue setting; provider risk calculations consume the original decimal IMF
|
|
7
|
+
* instead. `undefined` for a non-positive or unparsable IMF.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export declare const leverageFromImf: (imf: string) => number | undefined;
|
|
3
11
|
/**
|
|
4
12
|
* Map a raw Lighter account position to the generic Position type.
|
|
5
13
|
* @param market - Backend-resolved market identity for `pos.market_id`.
|
|
6
14
|
* @public
|
|
7
15
|
*/
|
|
8
|
-
export declare const mapPosition: (pos: LtAccountPosition, market:
|
|
16
|
+
export declare const mapPosition: (pos: LtAccountPosition, market: PerpsMarketDisplay) => Position;
|
|
9
17
|
//# sourceMappingURL=mapPosition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapPosition.d.ts","sourceRoot":"","sources":["../../../src/utils/mapPosition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"mapPosition.d.ts","sourceRoot":"","sources":["../../../src/utils/mapPosition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAGrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAI1D;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,KAAG,MAAM,GAAG,SAWtD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,GACtB,KAAK,iBAAiB,EACtB,QAAQ,kBAAkB,KACzB,QAgCF,CAAA"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Validate and map an SDK OHLCV interval to Lighter's resolution string.
|
|
3
|
+
* Unsupported intervals raise a validation error instead of being rounded.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
2
7
|
export declare const mapInterval: (interval: string) => string;
|
|
3
8
|
//# sourceMappingURL=ohlcvInterval.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ohlcvInterval.d.ts","sourceRoot":"","sources":["../../../src/utils/ohlcvInterval.ts"],"names":[],"mappings":"AAsBA
|
|
1
|
+
{"version":3,"file":"ohlcvInterval.d.ts","sourceRoot":"","sources":["../../../src/utils/ohlcvInterval.ts"],"names":[],"mappings":"AAsBA;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,KAAG,MAU9C,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Position, type PositionMarginConstraints } from '@lifi/perps-types';
|
|
2
|
+
/**
|
|
3
|
+
* Lighter's exact isolated-margin requirement. Lighter publishes no separate
|
|
4
|
+
* notional floor, so the provider-normalized initial-margin requirement is
|
|
5
|
+
* the retained amount.
|
|
6
|
+
*
|
|
7
|
+
* @see https://docs.lighter.xyz/trading/liquidations-and-llp-insurance-fund
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export declare function positionMarginConstraints(position: Position): PositionMarginConstraints | undefined;
|
|
11
|
+
//# sourceMappingURL=transferMargin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transferMargin.d.ts","sourceRoot":"","sources":["../../../src/utils/transferMargin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,yBAAyB,EAE/B,MAAM,mBAAmB,CAAA;AAK1B;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,GACjB,yBAAyB,GAAG,SAAS,CAWvC"}
|