@nktkas/hyperliquid 0.24.2 → 0.24.3
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/README.md +105 -102
- package/esm/src/clients/info.d.ts +63 -57
- package/esm/src/clients/info.d.ts.map +1 -1
- package/esm/src/clients/info.js +60 -92
- package/esm/src/clients/subscription.d.ts +104 -31
- package/esm/src/clients/subscription.d.ts.map +1 -1
- package/esm/src/clients/subscription.js +92 -12
- package/esm/src/types/info/requests.d.ts +6 -0
- package/esm/src/types/info/requests.d.ts.map +1 -1
- package/esm/src/types/subscriptions/requests.d.ts +11 -0
- package/esm/src/types/subscriptions/requests.d.ts.map +1 -1
- package/esm/src/types/subscriptions/responses.d.ts +25 -0
- package/esm/src/types/subscriptions/responses.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/src/clients/info.d.ts +63 -57
- package/script/src/clients/info.d.ts.map +1 -1
- package/script/src/clients/info.js +60 -92
- package/script/src/clients/subscription.d.ts +104 -31
- package/script/src/clients/subscription.d.ts.map +1 -1
- package/script/src/clients/subscription.js +92 -12
- package/script/src/types/info/requests.d.ts +6 -0
- package/script/src/types/info/requests.d.ts.map +1 -1
- package/script/src/types/subscriptions/requests.d.ts +11 -0
- package/script/src/types/subscriptions/requests.d.ts.map +1 -1
- package/script/src/types/subscriptions/responses.d.ts +25 -0
- package/script/src/types/subscriptions/responses.d.ts.map +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ISubscriptionTransport, Subscription } from "../transports/base.js";
|
|
2
|
-
import type { ActiveAssetData, ActiveAssetDataRequest, AllMidsRequest, Book, Candle, L2BookRequest, Order, OrderStatus, TxDetails, UserFillsRequest, UserTwapSliceFillsRequest, WsActiveAssetCtx, WsActiveAssetCtxRequest, WsActiveSpotAssetCtx, WsAllMids, WsBbo, WsBboRequest, WsBlockDetails, WsCandleRequest, WsNotification, WsNotificationRequest, WsOrderUpdatesRequest, WsTrade, WsTradesRequest, WsUserEvent, WsUserEventsRequest, WsUserFills, WsUserFundings, WsUserFundingsRequest, WsUserNonFundingLedgerUpdates, WsUserNonFundingLedgerUpdatesRequest, WsUserTwapHistory, WsUserTwapHistoryRequest, WsUserTwapSliceFills, WsWebData2, WsWebData2Request } from "../types/mod.js";
|
|
2
|
+
import type { ActiveAssetData, ActiveAssetDataRequest, AllMidsRequest, Book, Candle, ClearinghouseStateRequest, L2BookRequest, OpenOrdersRequest, Order, OrderStatus, TxDetails, UserFillsRequest, UserTwapSliceFillsRequest, WsActiveAssetCtx, WsActiveAssetCtxRequest, WsActiveSpotAssetCtx, WsAllMids, WsAssetCtxs, WsAssetCtxsRequest, WsBbo, WsBboRequest, WsBlockDetails, WsCandleRequest, WsClearinghouseState, WsNotification, WsNotificationRequest, WsOpenOrders, WsOrderUpdatesRequest, WsTrade, WsTradesRequest, WsUserEvent, WsUserEventsRequest, WsUserFills, WsUserFundings, WsUserFundingsRequest, WsUserNonFundingLedgerUpdates, WsUserNonFundingLedgerUpdatesRequest, WsUserTwapHistory, WsUserTwapHistoryRequest, WsUserTwapSliceFills, WsWebData2, WsWebData2Request } from "../types/mod.js";
|
|
3
3
|
/** @see https://github.com/microsoft/TypeScript/issues/13923#issuecomment-2191862501 */
|
|
4
4
|
type DeepImmutable<T> = {
|
|
5
5
|
readonly [K in keyof T]: DeepImmutable<T[K]>;
|
|
@@ -10,37 +10,43 @@ export interface SubscriptionClientParameters<T extends ISubscriptionTransport =
|
|
|
10
10
|
transport: T;
|
|
11
11
|
}
|
|
12
12
|
/** Subscription parameters for the {@linkcode SubscriptionClient.activeAssetCtx} method. */
|
|
13
|
-
export type
|
|
13
|
+
export type WsActiveAssetCtxParameters = Omit<WsActiveAssetCtxRequest, "type">;
|
|
14
14
|
/** Subscription parameters for the {@linkcode SubscriptionClient.activeAssetData} method. */
|
|
15
|
-
export type
|
|
15
|
+
export type WsActiveAssetDataParameters = Omit<ActiveAssetDataRequest, "type">;
|
|
16
16
|
/** Subscription parameters for the {@linkcode SubscriptionClient.allMids} method. */
|
|
17
17
|
export type WsAllMidsParameters = Omit<AllMidsRequest, "type">;
|
|
18
|
+
/** Subscription parameters for the {@linkcode SubscriptionClient.assetCtxs} method. */
|
|
19
|
+
export type WsAssetCtxsParameters = Omit<WsAssetCtxsRequest, "type">;
|
|
18
20
|
/** Subscription parameters for the {@linkcode SubscriptionClient.bbo} method. */
|
|
19
|
-
export type
|
|
21
|
+
export type WsBboParameters = Omit<WsBboRequest, "type">;
|
|
20
22
|
/** Subscription parameters for the {@linkcode SubscriptionClient.candle} method. */
|
|
21
|
-
export type
|
|
23
|
+
export type WsCandleParameters = Omit<WsCandleRequest, "type">;
|
|
24
|
+
/** Subscription parameters for the {@linkcode SubscriptionClient.clearinghouseState} method. */
|
|
25
|
+
export type WsClearinghouseStateParameters = Omit<ClearinghouseStateRequest, "type">;
|
|
22
26
|
/** Subscription parameters for the {@linkcode SubscriptionClient.l2Book} method. */
|
|
23
|
-
export type
|
|
27
|
+
export type WsL2BookParameters = Omit<L2BookRequest, "type">;
|
|
24
28
|
/** Subscription parameters for the {@linkcode SubscriptionClient.notification} method. */
|
|
25
|
-
export type
|
|
29
|
+
export type WsNotificationParameters = Omit<WsNotificationRequest, "type">;
|
|
30
|
+
/** Subscription parameters for the {@linkcode SubscriptionClient.openOrders} method. */
|
|
31
|
+
export type WsOpenOrdersParameters = Omit<OpenOrdersRequest, "type">;
|
|
26
32
|
/** Subscription parameters for the {@linkcode SubscriptionClient.orderUpdates} method. */
|
|
27
|
-
export type
|
|
33
|
+
export type WsOrderUpdatesParameters = Omit<WsOrderUpdatesRequest, "type">;
|
|
28
34
|
/** Subscription parameters for the {@linkcode SubscriptionClient.trades} method. */
|
|
29
|
-
export type
|
|
35
|
+
export type WsTradesParameters = Omit<WsTradesRequest, "type">;
|
|
30
36
|
/** Subscription parameters for the {@linkcode SubscriptionClient.userEvents} method. */
|
|
31
|
-
export type
|
|
37
|
+
export type WsUserEventsParameters = Omit<WsUserEventsRequest, "type">;
|
|
32
38
|
/** Subscription parameters for the {@linkcode SubscriptionClient.userFills} method. */
|
|
33
|
-
export type
|
|
39
|
+
export type WsUserFillsParameters = Omit<UserFillsRequest, "type">;
|
|
34
40
|
/** Subscription parameters for the {@linkcode SubscriptionClient.userFundings} method. */
|
|
35
|
-
export type
|
|
41
|
+
export type WsUserFundingsParameters = Omit<WsUserFundingsRequest, "type">;
|
|
36
42
|
/** Subscription parameters for the {@linkcode SubscriptionClient.userNonFundingLedgerUpdates} method. */
|
|
37
|
-
export type
|
|
43
|
+
export type WsUserNonFundingLedgerUpdatesParameters = Omit<WsUserNonFundingLedgerUpdatesRequest, "type">;
|
|
38
44
|
/** Subscription parameters for the {@linkcode SubscriptionClient.userTwapHistory} method. */
|
|
39
|
-
export type
|
|
45
|
+
export type WsUserTwapHistoryParameters = Omit<WsUserTwapHistoryRequest, "type">;
|
|
40
46
|
/** Subscription parameters for the {@linkcode SubscriptionClient.userTwapSliceFills} method. */
|
|
41
|
-
export type
|
|
47
|
+
export type WsUserTwapSliceFillsParameters = Omit<UserTwapSliceFillsRequest, "type">;
|
|
42
48
|
/** Subscription parameters for the {@linkcode SubscriptionClient.webData2} method. */
|
|
43
|
-
export type
|
|
49
|
+
export type WsWebData2Parameters = Omit<WsWebData2Request, "type">;
|
|
44
50
|
/**
|
|
45
51
|
* Subscription client for subscribing to various Hyperliquid events.
|
|
46
52
|
* @typeParam T The type of transport used to connect to the Hyperliquid Websocket API.
|
|
@@ -81,7 +87,7 @@ export declare class SubscriptionClient<T extends ISubscriptionTransport = ISubs
|
|
|
81
87
|
* });
|
|
82
88
|
* ```
|
|
83
89
|
*/
|
|
84
|
-
activeAssetCtx(params: DeepImmutable<
|
|
90
|
+
activeAssetCtx(params: DeepImmutable<WsActiveAssetCtxParameters>, listener: (data: WsActiveAssetCtx | WsActiveSpotAssetCtx) => void): Promise<Subscription>;
|
|
85
91
|
/**
|
|
86
92
|
* Subscribe to trading data updates for a specific asset and user.
|
|
87
93
|
* @param params - Subscription-specific parameters.
|
|
@@ -103,7 +109,7 @@ export declare class SubscriptionClient<T extends ISubscriptionTransport = ISubs
|
|
|
103
109
|
* });
|
|
104
110
|
* ```
|
|
105
111
|
*/
|
|
106
|
-
activeAssetData(params: DeepImmutable<
|
|
112
|
+
activeAssetData(params: DeepImmutable<WsActiveAssetDataParameters>, listener: (data: ActiveAssetData) => void): Promise<Subscription>;
|
|
107
113
|
/**
|
|
108
114
|
* Subscribe to mid prices for all actively traded assets.
|
|
109
115
|
* @param params - An optional subscription-specific parameters.
|
|
@@ -127,6 +133,29 @@ export declare class SubscriptionClient<T extends ISubscriptionTransport = ISubs
|
|
|
127
133
|
*/
|
|
128
134
|
allMids(listener: (data: WsAllMids) => void): Promise<Subscription>;
|
|
129
135
|
allMids(params: DeepImmutable<WsAllMidsParameters>, listener: (data: WsAllMids) => void): Promise<Subscription>;
|
|
136
|
+
/**
|
|
137
|
+
* Subscribe to asset contexts for all perpetual assets.
|
|
138
|
+
* @param params - An optional subscription-specific parameters.
|
|
139
|
+
* @param listener - A callback function to be called when the event is received.
|
|
140
|
+
* @returns A request-promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
141
|
+
*
|
|
142
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
143
|
+
*
|
|
144
|
+
* @see null
|
|
145
|
+
* @example
|
|
146
|
+
* ```ts
|
|
147
|
+
* import * as hl from "@nktkas/hyperliquid";
|
|
148
|
+
*
|
|
149
|
+
* const transport = new hl.WebSocketTransport();
|
|
150
|
+
* const subsClient = new hl.SubscriptionClient({ transport });
|
|
151
|
+
*
|
|
152
|
+
* const sub = await subsClient.assetCtxs((data) => {
|
|
153
|
+
* console.log(data);
|
|
154
|
+
* });
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
assetCtxs(listener: (data: WsAssetCtxs) => void): Promise<Subscription>;
|
|
158
|
+
assetCtxs(params: DeepImmutable<WsAssetCtxsParameters>, listener: (data: WsAssetCtxs) => void): Promise<Subscription>;
|
|
130
159
|
/**
|
|
131
160
|
* Subscribe to best bid and offer updates for a specific asset.
|
|
132
161
|
* @param params - Subscription-specific parameters.
|
|
@@ -148,7 +177,7 @@ export declare class SubscriptionClient<T extends ISubscriptionTransport = ISubs
|
|
|
148
177
|
* });
|
|
149
178
|
* ```
|
|
150
179
|
*/
|
|
151
|
-
bbo(params: DeepImmutable<
|
|
180
|
+
bbo(params: DeepImmutable<WsBboParameters>, listener: (data: WsBbo) => void): Promise<Subscription>;
|
|
152
181
|
/**
|
|
153
182
|
* Subscribe to candlestick data updates for a specific asset.
|
|
154
183
|
* @param params - Subscription-specific parameters.
|
|
@@ -170,7 +199,29 @@ export declare class SubscriptionClient<T extends ISubscriptionTransport = ISubs
|
|
|
170
199
|
* });
|
|
171
200
|
* ```
|
|
172
201
|
*/
|
|
173
|
-
candle(params: DeepImmutable<
|
|
202
|
+
candle(params: DeepImmutable<WsCandleParameters>, listener: (data: Candle) => void): Promise<Subscription>;
|
|
203
|
+
/**
|
|
204
|
+
* Subscribe to clearinghouse state updates for a specific user.
|
|
205
|
+
* @param params - Subscription-specific parameters.
|
|
206
|
+
* @param listener - A callback function to be called when the event is received.
|
|
207
|
+
* @returns A request-promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
208
|
+
*
|
|
209
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
210
|
+
*
|
|
211
|
+
* @see null
|
|
212
|
+
* @example
|
|
213
|
+
* ```ts
|
|
214
|
+
* import * as hl from "@nktkas/hyperliquid";
|
|
215
|
+
*
|
|
216
|
+
* const transport = new hl.WebSocketTransport();
|
|
217
|
+
* const subsClient = new hl.SubscriptionClient({ transport });
|
|
218
|
+
*
|
|
219
|
+
* const sub = await subsClient.clearinghouseState({ user: "0x..." }, (data) => {
|
|
220
|
+
* console.log(data);
|
|
221
|
+
* });
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
224
|
+
clearinghouseState(params: DeepImmutable<WsClearinghouseStateParameters>, listener: (data: WsClearinghouseState) => void): Promise<Subscription>;
|
|
174
225
|
/**
|
|
175
226
|
* Subscribe to explorer block updates.
|
|
176
227
|
* @param listener - A callback function to be called when the event is received.
|
|
@@ -236,7 +287,7 @@ export declare class SubscriptionClient<T extends ISubscriptionTransport = ISubs
|
|
|
236
287
|
* });
|
|
237
288
|
* ```
|
|
238
289
|
*/
|
|
239
|
-
l2Book(params: DeepImmutable<
|
|
290
|
+
l2Book(params: DeepImmutable<WsL2BookParameters>, listener: (data: Book) => void): Promise<Subscription>;
|
|
240
291
|
/**
|
|
241
292
|
* Subscribe to notification updates for a specific user.
|
|
242
293
|
* @param params - Subscription-specific parameters.
|
|
@@ -258,7 +309,29 @@ export declare class SubscriptionClient<T extends ISubscriptionTransport = ISubs
|
|
|
258
309
|
* });
|
|
259
310
|
* ```
|
|
260
311
|
*/
|
|
261
|
-
notification(params: DeepImmutable<
|
|
312
|
+
notification(params: DeepImmutable<WsNotificationParameters>, listener: (data: WsNotification) => void): Promise<Subscription>;
|
|
313
|
+
/**
|
|
314
|
+
* Subscribe to open orders updates for a specific user.
|
|
315
|
+
* @param params - Subscription-specific parameters.
|
|
316
|
+
* @param listener - A callback function to be called when the event is received.
|
|
317
|
+
* @returns A request-promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
318
|
+
*
|
|
319
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
320
|
+
*
|
|
321
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
322
|
+
* @example
|
|
323
|
+
* ```ts
|
|
324
|
+
* import * as hl from "@nktkas/hyperliquid";
|
|
325
|
+
*
|
|
326
|
+
* const transport = new hl.WebSocketTransport();
|
|
327
|
+
* const subsClient = new hl.SubscriptionClient({ transport });
|
|
328
|
+
*
|
|
329
|
+
* const sub = await subsClient.openOrders({ user: "0x..." }, (data) => {
|
|
330
|
+
* console.log(data);
|
|
331
|
+
* });
|
|
332
|
+
* ```
|
|
333
|
+
*/
|
|
334
|
+
openOrders(params: DeepImmutable<WsOpenOrdersParameters>, listener: (data: WsOpenOrders) => void): Promise<Subscription>;
|
|
262
335
|
/**
|
|
263
336
|
* Subscribe to order status updates for a specific user.
|
|
264
337
|
* @param params - Subscription-specific parameters.
|
|
@@ -280,7 +353,7 @@ export declare class SubscriptionClient<T extends ISubscriptionTransport = ISubs
|
|
|
280
353
|
* });
|
|
281
354
|
* ```
|
|
282
355
|
*/
|
|
283
|
-
orderUpdates(params: DeepImmutable<
|
|
356
|
+
orderUpdates(params: DeepImmutable<WsOrderUpdatesParameters>, listener: (data: OrderStatus<Order>[]) => void): Promise<Subscription>;
|
|
284
357
|
/**
|
|
285
358
|
* Subscribe to real-time trade updates for a specific asset.
|
|
286
359
|
* @param params - Subscription-specific parameters.
|
|
@@ -302,7 +375,7 @@ export declare class SubscriptionClient<T extends ISubscriptionTransport = ISubs
|
|
|
302
375
|
* });
|
|
303
376
|
* ```
|
|
304
377
|
*/
|
|
305
|
-
trades(params: DeepImmutable<
|
|
378
|
+
trades(params: DeepImmutable<WsTradesParameters>, listener: (data: WsTrade[]) => void): Promise<Subscription>;
|
|
306
379
|
/**
|
|
307
380
|
* Subscribe to non-order events for a specific user.
|
|
308
381
|
* @param params - Subscription-specific parameters.
|
|
@@ -325,7 +398,7 @@ export declare class SubscriptionClient<T extends ISubscriptionTransport = ISubs
|
|
|
325
398
|
* });
|
|
326
399
|
* ```
|
|
327
400
|
*/
|
|
328
|
-
userEvents(params: DeepImmutable<
|
|
401
|
+
userEvents(params: DeepImmutable<WsUserEventsParameters>, listener: (data: WsUserEvent) => void): Promise<Subscription>;
|
|
329
402
|
/**
|
|
330
403
|
* Subscribe to trade fill updates for a specific user.
|
|
331
404
|
* @param params - Subscription-specific parameters.
|
|
@@ -347,7 +420,7 @@ export declare class SubscriptionClient<T extends ISubscriptionTransport = ISubs
|
|
|
347
420
|
* });
|
|
348
421
|
* ```
|
|
349
422
|
*/
|
|
350
|
-
userFills(params: DeepImmutable<
|
|
423
|
+
userFills(params: DeepImmutable<WsUserFillsParameters>, listener: (data: WsUserFills) => void): Promise<Subscription>;
|
|
351
424
|
/**
|
|
352
425
|
* Subscribe to funding payment updates for a specific user.
|
|
353
426
|
* @param params - Subscription-specific parameters.
|
|
@@ -369,7 +442,7 @@ export declare class SubscriptionClient<T extends ISubscriptionTransport = ISubs
|
|
|
369
442
|
* });
|
|
370
443
|
* ```
|
|
371
444
|
*/
|
|
372
|
-
userFundings(params: DeepImmutable<
|
|
445
|
+
userFundings(params: DeepImmutable<WsUserFundingsParameters>, listener: (data: WsUserFundings) => void): Promise<Subscription>;
|
|
373
446
|
/**
|
|
374
447
|
* Subscribe to non-funding ledger updates for a specific user.
|
|
375
448
|
* @param params - Subscription-specific parameters.
|
|
@@ -391,7 +464,7 @@ export declare class SubscriptionClient<T extends ISubscriptionTransport = ISubs
|
|
|
391
464
|
* });
|
|
392
465
|
* ```
|
|
393
466
|
*/
|
|
394
|
-
userNonFundingLedgerUpdates(params: DeepImmutable<
|
|
467
|
+
userNonFundingLedgerUpdates(params: DeepImmutable<WsUserNonFundingLedgerUpdatesParameters>, listener: (data: WsUserNonFundingLedgerUpdates) => void): Promise<Subscription>;
|
|
395
468
|
/**
|
|
396
469
|
* Subscribe to TWAP order history updates for a specific user.
|
|
397
470
|
* @param params - Subscription-specific parameters.
|
|
@@ -413,7 +486,7 @@ export declare class SubscriptionClient<T extends ISubscriptionTransport = ISubs
|
|
|
413
486
|
* });
|
|
414
487
|
* ```
|
|
415
488
|
*/
|
|
416
|
-
userTwapHistory(params: DeepImmutable<
|
|
489
|
+
userTwapHistory(params: DeepImmutable<WsUserTwapHistoryParameters>, listener: (data: WsUserTwapHistory) => void): Promise<Subscription>;
|
|
417
490
|
/**
|
|
418
491
|
* Subscribe to TWAP execution updates for a specific user.
|
|
419
492
|
* @param params - Subscription-specific parameters.
|
|
@@ -435,7 +508,7 @@ export declare class SubscriptionClient<T extends ISubscriptionTransport = ISubs
|
|
|
435
508
|
* });
|
|
436
509
|
* ```
|
|
437
510
|
*/
|
|
438
|
-
userTwapSliceFills(params: DeepImmutable<
|
|
511
|
+
userTwapSliceFills(params: DeepImmutable<WsUserTwapSliceFillsParameters>, listener: (data: WsUserTwapSliceFills) => void): Promise<Subscription>;
|
|
439
512
|
/**
|
|
440
513
|
* Subscribe to comprehensive user and market data updates.
|
|
441
514
|
* @param params - Subscription-specific parameters.
|
|
@@ -457,7 +530,7 @@ export declare class SubscriptionClient<T extends ISubscriptionTransport = ISubs
|
|
|
457
530
|
* });
|
|
458
531
|
* ```
|
|
459
532
|
*/
|
|
460
|
-
webData2(params: DeepImmutable<
|
|
533
|
+
webData2(params: DeepImmutable<WsWebData2Parameters>, listener: (data: WsWebData2) => void): Promise<Subscription>;
|
|
461
534
|
[Symbol.asyncDispose](): Promise<void>;
|
|
462
535
|
}
|
|
463
536
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../src/src/clients/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAClF,OAAO,KAAK,EACR,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,IAAI,EACJ,MAAM,EACN,aAAa,EACb,KAAK,EACL,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,yBAAyB,EACzB,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,SAAS,EACT,KAAK,EACL,YAAY,EACZ,cAAc,EACd,eAAe,
|
|
1
|
+
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../src/src/clients/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAClF,OAAO,KAAK,EACR,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,IAAI,EACJ,MAAM,EACN,y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IACH,eAAe,CACX,MAAM,EAAE,aAAa,CAAC,2BAA2B,CAAC,EAClD,QAAQ,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,GAC5C,OAAO,CAAC,YAAY,CAAC;IASxB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,kBAAkB,CACd,MAAM,EAAE,aAAa,CAAC,8BAA8B,CAAC,EACrD,QAAQ,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,GAC/C,OAAO,CAAC,YAAY,CAAC;IASxB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,QAAQ,CACJ,MAAM,EAAE,aAAa,CAAC,oBAAoB,CAAC,EAC3C,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,GACrC,OAAO,CAAC,YAAY,CAAC;IASlB,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;CAG/C"}
|
|
@@ -47,7 +47,7 @@ class SubscriptionClient {
|
|
|
47
47
|
const channel = params.coin.startsWith("@") ? "activeSpotAssetCtx" : "activeAssetCtx";
|
|
48
48
|
const payload = { type: "activeAssetCtx", ...params };
|
|
49
49
|
return this.transport.subscribe(channel, payload, (e) => {
|
|
50
|
-
if (e.detail.coin ===
|
|
50
|
+
if (e.detail.coin === payload.coin) {
|
|
51
51
|
listener(e.detail);
|
|
52
52
|
}
|
|
53
53
|
});
|
|
@@ -76,7 +76,7 @@ class SubscriptionClient {
|
|
|
76
76
|
activeAssetData(params, listener) {
|
|
77
77
|
const payload = { type: "activeAssetData", ...params };
|
|
78
78
|
return this.transport.subscribe(payload.type, payload, (e) => {
|
|
79
|
-
if (e.detail.coin ===
|
|
79
|
+
if (e.detail.coin === payload.coin && e.detail.user === payload.user.toLowerCase()) {
|
|
80
80
|
listener(e.detail);
|
|
81
81
|
}
|
|
82
82
|
});
|
|
@@ -89,6 +89,20 @@ class SubscriptionClient {
|
|
|
89
89
|
listener(e.detail);
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
+
assetCtxs(params_or_listener, maybeListener) {
|
|
93
|
+
const params = typeof params_or_listener === "function" ? {} : params_or_listener;
|
|
94
|
+
const listener = typeof params_or_listener === "function" ? params_or_listener : maybeListener;
|
|
95
|
+
const payload = {
|
|
96
|
+
type: "assetCtxs",
|
|
97
|
+
...params,
|
|
98
|
+
dex: params.dex ?? "",
|
|
99
|
+
};
|
|
100
|
+
return this.transport.subscribe(payload.type, payload, (e) => {
|
|
101
|
+
if (e.detail.dex === payload.dex) {
|
|
102
|
+
listener(e.detail);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
92
106
|
/**
|
|
93
107
|
* Subscribe to best bid and offer updates for a specific asset.
|
|
94
108
|
* @param params - Subscription-specific parameters.
|
|
@@ -113,7 +127,7 @@ class SubscriptionClient {
|
|
|
113
127
|
bbo(params, listener) {
|
|
114
128
|
const payload = { type: "bbo", ...params };
|
|
115
129
|
return this.transport.subscribe(payload.type, payload, (e) => {
|
|
116
|
-
if (e.detail.coin ===
|
|
130
|
+
if (e.detail.coin === payload.coin) {
|
|
117
131
|
listener(e.detail);
|
|
118
132
|
}
|
|
119
133
|
});
|
|
@@ -142,7 +156,40 @@ class SubscriptionClient {
|
|
|
142
156
|
candle(params, listener) {
|
|
143
157
|
const payload = { type: "candle", ...params };
|
|
144
158
|
return this.transport.subscribe(payload.type, payload, (e) => {
|
|
145
|
-
if (e.detail.s ===
|
|
159
|
+
if (e.detail.s === payload.coin && e.detail.i === payload.interval) {
|
|
160
|
+
listener(e.detail);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Subscribe to clearinghouse state updates for a specific user.
|
|
166
|
+
* @param params - Subscription-specific parameters.
|
|
167
|
+
* @param listener - A callback function to be called when the event is received.
|
|
168
|
+
* @returns A request-promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
169
|
+
*
|
|
170
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
171
|
+
*
|
|
172
|
+
* @see null
|
|
173
|
+
* @example
|
|
174
|
+
* ```ts
|
|
175
|
+
* import * as hl from "@nktkas/hyperliquid";
|
|
176
|
+
*
|
|
177
|
+
* const transport = new hl.WebSocketTransport();
|
|
178
|
+
* const subsClient = new hl.SubscriptionClient({ transport });
|
|
179
|
+
*
|
|
180
|
+
* const sub = await subsClient.clearinghouseState({ user: "0x..." }, (data) => {
|
|
181
|
+
* console.log(data);
|
|
182
|
+
* });
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
185
|
+
clearinghouseState(params, listener) {
|
|
186
|
+
const payload = {
|
|
187
|
+
type: "clearinghouseState",
|
|
188
|
+
...params,
|
|
189
|
+
dex: params.dex ?? "",
|
|
190
|
+
};
|
|
191
|
+
return this.transport.subscribe(payload.type, payload, (e) => {
|
|
192
|
+
if (e.detail.user === payload.user.toLowerCase() && e.detail.dex === payload.dex) {
|
|
146
193
|
listener(e.detail);
|
|
147
194
|
}
|
|
148
195
|
});
|
|
@@ -230,7 +277,7 @@ class SubscriptionClient {
|
|
|
230
277
|
mantissa: params.mantissa ?? null,
|
|
231
278
|
};
|
|
232
279
|
return this.transport.subscribe(payload.type, payload, (e) => {
|
|
233
|
-
if (e.detail.coin ===
|
|
280
|
+
if (e.detail.coin === payload.coin) {
|
|
234
281
|
listener(e.detail);
|
|
235
282
|
}
|
|
236
283
|
});
|
|
@@ -262,6 +309,39 @@ class SubscriptionClient {
|
|
|
262
309
|
listener(e.detail);
|
|
263
310
|
});
|
|
264
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* Subscribe to open orders updates for a specific user.
|
|
314
|
+
* @param params - Subscription-specific parameters.
|
|
315
|
+
* @param listener - A callback function to be called when the event is received.
|
|
316
|
+
* @returns A request-promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
317
|
+
*
|
|
318
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
319
|
+
*
|
|
320
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
321
|
+
* @example
|
|
322
|
+
* ```ts
|
|
323
|
+
* import * as hl from "@nktkas/hyperliquid";
|
|
324
|
+
*
|
|
325
|
+
* const transport = new hl.WebSocketTransport();
|
|
326
|
+
* const subsClient = new hl.SubscriptionClient({ transport });
|
|
327
|
+
*
|
|
328
|
+
* const sub = await subsClient.openOrders({ user: "0x..." }, (data) => {
|
|
329
|
+
* console.log(data);
|
|
330
|
+
* });
|
|
331
|
+
* ```
|
|
332
|
+
*/
|
|
333
|
+
openOrders(params, listener) {
|
|
334
|
+
const payload = {
|
|
335
|
+
type: "openOrders",
|
|
336
|
+
...params,
|
|
337
|
+
dex: params.dex ?? "",
|
|
338
|
+
};
|
|
339
|
+
return this.transport.subscribe(payload.type, payload, (e) => {
|
|
340
|
+
if (e.detail.user === payload.user.toLowerCase() && e.detail.dex === payload.dex) {
|
|
341
|
+
listener(e.detail);
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
}
|
|
265
345
|
/**
|
|
266
346
|
* Subscribe to order status updates for a specific user.
|
|
267
347
|
* @param params - Subscription-specific parameters.
|
|
@@ -313,7 +393,7 @@ class SubscriptionClient {
|
|
|
313
393
|
trades(params, listener) {
|
|
314
394
|
const payload = { type: "trades", ...params };
|
|
315
395
|
return this.transport.subscribe(payload.type, payload, (e) => {
|
|
316
|
-
if (e.detail[0]?.coin ===
|
|
396
|
+
if (e.detail[0]?.coin === payload.coin) {
|
|
317
397
|
listener(e.detail);
|
|
318
398
|
}
|
|
319
399
|
});
|
|
@@ -374,7 +454,7 @@ class SubscriptionClient {
|
|
|
374
454
|
aggregateByTime: params.aggregateByTime ?? false,
|
|
375
455
|
};
|
|
376
456
|
return this.transport.subscribe(payload.type, payload, (e) => {
|
|
377
|
-
if (e.detail.user ===
|
|
457
|
+
if (e.detail.user === payload.user.toLowerCase()) {
|
|
378
458
|
listener(e.detail);
|
|
379
459
|
}
|
|
380
460
|
});
|
|
@@ -403,7 +483,7 @@ class SubscriptionClient {
|
|
|
403
483
|
userFundings(params, listener) {
|
|
404
484
|
const payload = { type: "userFundings", ...params };
|
|
405
485
|
return this.transport.subscribe(payload.type, payload, (e) => {
|
|
406
|
-
if (e.detail.user ===
|
|
486
|
+
if (e.detail.user === payload.user.toLowerCase()) {
|
|
407
487
|
listener(e.detail);
|
|
408
488
|
}
|
|
409
489
|
});
|
|
@@ -435,7 +515,7 @@ class SubscriptionClient {
|
|
|
435
515
|
...params,
|
|
436
516
|
};
|
|
437
517
|
return this.transport.subscribe(payload.type, payload, (e) => {
|
|
438
|
-
if (e.detail.user ===
|
|
518
|
+
if (e.detail.user === payload.user.toLowerCase()) {
|
|
439
519
|
listener(e.detail);
|
|
440
520
|
}
|
|
441
521
|
});
|
|
@@ -464,7 +544,7 @@ class SubscriptionClient {
|
|
|
464
544
|
userTwapHistory(params, listener) {
|
|
465
545
|
const payload = { type: "userTwapHistory", ...params };
|
|
466
546
|
return this.transport.subscribe(payload.type, payload, (e) => {
|
|
467
|
-
if (e.detail.user ===
|
|
547
|
+
if (e.detail.user === payload.user.toLowerCase()) {
|
|
468
548
|
listener(e.detail);
|
|
469
549
|
}
|
|
470
550
|
});
|
|
@@ -493,7 +573,7 @@ class SubscriptionClient {
|
|
|
493
573
|
userTwapSliceFills(params, listener) {
|
|
494
574
|
const payload = { type: "userTwapSliceFills", ...params };
|
|
495
575
|
return this.transport.subscribe(payload.type, payload, (e) => {
|
|
496
|
-
if (e.detail.user ===
|
|
576
|
+
if (e.detail.user === payload.user.toLowerCase()) {
|
|
497
577
|
listener(e.detail);
|
|
498
578
|
}
|
|
499
579
|
});
|
|
@@ -522,7 +602,7 @@ class SubscriptionClient {
|
|
|
522
602
|
webData2(params, listener) {
|
|
523
603
|
const payload = { type: "webData2", ...params };
|
|
524
604
|
return this.transport.subscribe(payload.type, payload, (e) => {
|
|
525
|
-
if (e.detail.user ===
|
|
605
|
+
if (e.detail.user === payload.user.toLowerCase()) {
|
|
526
606
|
listener(e.detail);
|
|
527
607
|
}
|
|
528
608
|
});
|
|
@@ -53,6 +53,8 @@ export interface ClearinghouseStateRequest {
|
|
|
53
53
|
type: "clearinghouseState";
|
|
54
54
|
/** User address. */
|
|
55
55
|
user: Hex;
|
|
56
|
+
/** DEX name (empty string for main dex). */
|
|
57
|
+
dex?: string;
|
|
56
58
|
}
|
|
57
59
|
/**
|
|
58
60
|
* Request user staking delegations.
|
|
@@ -266,6 +268,8 @@ export interface MetaRequest {
|
|
|
266
268
|
export interface MetaAndAssetCtxsRequest {
|
|
267
269
|
/** Type of request. */
|
|
268
270
|
type: "metaAndAssetCtxs";
|
|
271
|
+
/** DEX name (empty string for main dex). */
|
|
272
|
+
dex?: string;
|
|
269
273
|
}
|
|
270
274
|
/**
|
|
271
275
|
* Request open orders.
|
|
@@ -319,6 +323,8 @@ export interface PerpDexsRequest {
|
|
|
319
323
|
export interface PerpsAtOpenInterestCapRequest {
|
|
320
324
|
/** Type of request. */
|
|
321
325
|
type: "perpsAtOpenInterestCap";
|
|
326
|
+
/** DEX name (empty string for main dex). */
|
|
327
|
+
dex?: string;
|
|
322
328
|
}
|
|
323
329
|
/**
|
|
324
330
|
* Request user portfolio.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../src/src/types/info/requests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAErC;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACnC,uBAAuB;IACvB,IAAI,EAAE,iBAAiB,CAAC;IACxB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC3B,uBAAuB;IACvB,IAAI,EAAE,SAAS,CAAC;IAChB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IAClC,uBAAuB;IACvB,IAAI,EAAE,gBAAgB,CAAC;IACvB,0BAA0B;IAC1B,GAAG,EAAE;QACD,gCAAgC;QAChC,IAAI,EAAE,MAAM,CAAC;QACb,qBAAqB;QACrB,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;QAC7G,sCAAsC;QACtC,SAAS,EAAE,MAAM,CAAC;QAClB,oCAAoC;QACpC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC3B,CAAC;CACL;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACtC,uBAAuB;IACvB,IAAI,EAAE,oBAAoB,CAAC;IAC3B,oBAAoB;IACpB,IAAI,EAAE,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../src/src/types/info/requests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAErC;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACnC,uBAAuB;IACvB,IAAI,EAAE,iBAAiB,CAAC;IACxB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC3B,uBAAuB;IACvB,IAAI,EAAE,SAAS,CAAC;IAChB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IAClC,uBAAuB;IACvB,IAAI,EAAE,gBAAgB,CAAC;IACvB,0BAA0B;IAC1B,GAAG,EAAE;QACD,gCAA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E,GAAG,CAAC;IACV,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,iGAAiG;IACjG,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACrC,uBAAuB;IACvB,IAAI,EAAE,mBAAmB,CAAC;IAC1B,oBAAoB;IACpB,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACpC,uBAAuB;IACvB,IAAI,EAAE,kBAAkB,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACtC,uBAAuB;IACvB,IAAI,EAAE,oBAAoB,CAAC;CAC9B;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAChC,uBAAuB;IACvB,IAAI,EAAE,cAAc,CAAC;IACrB,qBAAqB;IACrB,YAAY,EAAE,GAAG,CAAC;IAClB,oBAAoB;IACpB,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IAClC,uBAAuB;IACvB,IAAI,EAAE,gBAAgB,CAAC;CAC1B"}
|
|
@@ -10,6 +10,17 @@ export interface WsActiveAssetCtxRequest {
|
|
|
10
10
|
/** Asset symbol (e.g., BTC). */
|
|
11
11
|
coin: string;
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Context events for all perpetual assets on a specified DEX.
|
|
15
|
+
* @returns {WsAssetCtx[]}
|
|
16
|
+
* @see null
|
|
17
|
+
*/
|
|
18
|
+
export interface WsAssetCtxsRequest {
|
|
19
|
+
/** Type of subscription. */
|
|
20
|
+
type: "assetCtxs";
|
|
21
|
+
/** DEX name (empty string for main dex). */
|
|
22
|
+
dex?: string;
|
|
23
|
+
}
|
|
13
24
|
/**
|
|
14
25
|
* Best bid and offer events for a specific asset.
|
|
15
26
|
* @returns {WsBbo}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../src/src/types/subscriptions/requests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAErC;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACpC,4BAA4B;IAC5B,IAAI,EAAE,gBAAgB,CAAC;IACvB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IACzB,4BAA4B;IAC5B,IAAI,EAAE,KAAK,CAAC;IACZ,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC5B,4BAA4B;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAChH;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACnC,4BAA4B;IAC5B,IAAI,EAAE,eAAe,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACjC,4BAA4B;IAC5B,IAAI,EAAE,aAAa,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IAClC,4BAA4B;IAC5B,IAAI,EAAE,cAAc,CAAC;IACrB,oBAAoB;IACpB,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IAClC,4BAA4B;IAC5B,IAAI,EAAE,cAAc,CAAC;IACrB,oBAAoB;IACpB,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC5B,4BAA4B;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAChC,4BAA4B;IAC5B,IAAI,EAAE,YAAY,CAAC;IACnB,oBAAoB;IACpB,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IAClC,4BAA4B;IAC5B,IAAI,EAAE,cAAc,CAAC;IACrB,oBAAoB;IACpB,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,oCAAoC;IACjD,4BAA4B;IAC5B,IAAI,EAAE,6BAA6B,CAAC;IACpC,oBAAoB;IACpB,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACrC,4BAA4B;IAC5B,IAAI,EAAE,iBAAiB,CAAC;IACxB,oBAAoB;IACpB,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAC9B,4BAA4B;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,oBAAoB;IACpB,IAAI,EAAE,GAAG,CAAC;CACb"}
|
|
1
|
+
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../src/src/types/subscriptions/requests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAErC;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACpC,4BAA4B;IAC5B,IAAI,EAAE,gBAAgB,CAAC;IACvB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAC/B,4BAA4B;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,4CAA4C;IAC5C,G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;;GAIG;AACH,MAAM,WAAW,qBAAqB;IAClC,4BAA4B;IAC5B,IAAI,EAAE,cAAc,CAAC;IACrB,oBAAoB;IACpB,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,oCAAoC;IACjD,4BAA4B;IAC5B,IAAI,EAAE,6BAA6B,CAAC;IACpC,oBAAoB;IACpB,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACrC,4BAA4B;IAC5B,IAAI,EAAE,iBAAiB,CAAC;IACxB,oBAAoB;IACpB,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAC9B,4BAA4B;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,oBAAoB;IACpB,IAAI,EAAE,GAAG,CAAC;CACb"}
|
|
@@ -22,6 +22,13 @@ export interface WsAllMids {
|
|
|
22
22
|
/** Mapping of coin symbols to mid prices. */
|
|
23
23
|
mids: AllMids;
|
|
24
24
|
}
|
|
25
|
+
/** Asset contexts for all perpetual assets on a specified DEX. */
|
|
26
|
+
export interface WsAssetCtxs {
|
|
27
|
+
/** DEX name (empty string for main dex). */
|
|
28
|
+
dex: string;
|
|
29
|
+
/** Array of context information for each perpetual asset. */
|
|
30
|
+
ctxs: PerpsAssetCtx[];
|
|
31
|
+
}
|
|
25
32
|
/** Best Bid and Offer. */
|
|
26
33
|
export interface WsBbo {
|
|
27
34
|
/** Asset symbol (e.g., BTC). */
|
|
@@ -33,11 +40,29 @@ export interface WsBbo {
|
|
|
33
40
|
}
|
|
34
41
|
/** Block details. */
|
|
35
42
|
export type WsBlockDetails = Omit<BlockDetails, "txs">;
|
|
43
|
+
/** Clearinghouse state for a specific user. */
|
|
44
|
+
export interface WsClearinghouseState {
|
|
45
|
+
/** DEX name (empty string for main dex). */
|
|
46
|
+
dex: string;
|
|
47
|
+
/** User address. */
|
|
48
|
+
user: Hex;
|
|
49
|
+
/** Perpetual clearinghouse state. */
|
|
50
|
+
clearinghouseState: PerpsClearinghouseState;
|
|
51
|
+
}
|
|
36
52
|
/** User notifications. */
|
|
37
53
|
export interface WsNotification {
|
|
38
54
|
/** Notification content. */
|
|
39
55
|
notification: string;
|
|
40
56
|
}
|
|
57
|
+
/** Open orders for a specific user. */
|
|
58
|
+
export interface WsOpenOrders {
|
|
59
|
+
/** DEX name (empty string for main dex). */
|
|
60
|
+
dex: string;
|
|
61
|
+
/** User address. */
|
|
62
|
+
user: Hex;
|
|
63
|
+
/** Array of open orders. */
|
|
64
|
+
orders: FrontendOrder[];
|
|
65
|
+
}
|
|
41
66
|
/** Trade information. */
|
|
42
67
|
export interface WsTrade {
|
|
43
68
|
/** Asset symbol (e.g., BTC). */
|