@rabby-wallet/hyperliquid-sdk 1.0.0-beta.3 → 1.0.0-beta.4
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,4 +1,4 @@
|
|
|
1
|
-
import type { AllMids, L2Book, Candle, WsFill, WsOrder, WebData2 } from '../types';
|
|
1
|
+
import type { AllMids, L2Book, Candle, WsFill, WsOrder, WebData2, WsActiveAssetCtx } from '../types';
|
|
2
2
|
export interface WebSocketClientConfig {
|
|
3
3
|
masterAddress: string;
|
|
4
4
|
isTestnet?: boolean;
|
|
@@ -43,6 +43,10 @@ export declare class WebSocketClient {
|
|
|
43
43
|
* Subscribe to L2 order book for a specific coin
|
|
44
44
|
*/
|
|
45
45
|
subscribeToL2Book(coin: string, callback: SubscriptionCallback<L2Book>): Subscription;
|
|
46
|
+
/**
|
|
47
|
+
* Subscribe to active asset ctx
|
|
48
|
+
*/
|
|
49
|
+
subscribeToActiveAssetCtx(coin: string, callback: SubscriptionCallback<WsActiveAssetCtx>): Subscription;
|
|
46
50
|
/**
|
|
47
51
|
* Subscribe to trades for a specific coin
|
|
48
52
|
*/
|
|
@@ -159,6 +159,14 @@ class WebSocketClient {
|
|
|
159
159
|
subscription: { type: 'l2Book', coin },
|
|
160
160
|
}, callback);
|
|
161
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Subscribe to active asset ctx
|
|
164
|
+
*/
|
|
165
|
+
subscribeToActiveAssetCtx(coin, callback) {
|
|
166
|
+
return this.subscribe({
|
|
167
|
+
subscription: { type: 'activeAssetCtx', coin },
|
|
168
|
+
}, callback);
|
|
169
|
+
}
|
|
162
170
|
/**
|
|
163
171
|
* Subscribe to trades for a specific coin
|
|
164
172
|
*/
|
package/dist/types/index.d.ts
CHANGED
|
@@ -237,6 +237,18 @@ export interface L2Book {
|
|
|
237
237
|
levels: [WsLevel[], WsLevel[]];
|
|
238
238
|
time: number;
|
|
239
239
|
}
|
|
240
|
+
export interface WsActiveAssetCtx {
|
|
241
|
+
coin: string;
|
|
242
|
+
ctx: {
|
|
243
|
+
dayNtlVlm: number;
|
|
244
|
+
prevDayPx: number;
|
|
245
|
+
markPx: number;
|
|
246
|
+
midPx?: number;
|
|
247
|
+
funding: number;
|
|
248
|
+
openInterest: number;
|
|
249
|
+
oraclePx: number;
|
|
250
|
+
};
|
|
251
|
+
}
|
|
240
252
|
export interface Candle {
|
|
241
253
|
t: number;
|
|
242
254
|
T: number;
|
package/package.json
CHANGED