@rabby-wallet/hyperliquid-sdk 1.1.2-beta.1 → 1.1.2-beta.2

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 { L2Book, Candle, WsOrder, WebData2, WsActiveAssetCtx, WsUserFills, WsClearinghouseState, Notification, WsTwapStates, WsOpenOrders, WsUserTwapSliceFills, WsUserTwapHistory, wsUserNonFundingLedgerUpdates, WsAllMids, WsTrade } from '../types';
1
+ import type { L2Book, Candle, WsOrder, WebData2, WsActiveAssetCtx, WsUserFills, WsClearinghouseState, Notification, WsTwapStates, WsOpenOrders, WsUserTwapSliceFills, WsUserTwapHistory, wsUserNonFundingLedgerUpdates, WsAllMids, WsTrade, WsActiveAssetData } from '../types';
2
2
  export interface WebSocketClientConfig {
3
3
  masterAddress?: string;
4
4
  isTestnet?: boolean;
@@ -79,6 +79,12 @@ export declare class WebSocketClient {
79
79
  * Subscribe to active asset ctx
80
80
  */
81
81
  subscribeToActiveAssetCtx(coin: string, callback: SubscriptionCallback<WsActiveAssetCtx>): Subscription;
82
+ /**
83
+ * Subscribe to active asset data
84
+ * user: string;
85
+ * coin: string;
86
+ */
87
+ subscribeToActiveAssetData(coin: string, user: string, callback: SubscriptionCallback<WsActiveAssetData>): Subscription;
82
88
  /**
83
89
  * Subscribe to trades for a specific coin
84
90
  */
@@ -327,6 +327,16 @@ class WebSocketClient {
327
327
  subscription: { type: constants_1.WsSubscriptionType.ACTIVE_ASSET_CTX, coin },
328
328
  }, callback);
329
329
  }
330
+ /**
331
+ * Subscribe to active asset data
332
+ * user: string;
333
+ * coin: string;
334
+ */
335
+ subscribeToActiveAssetData(coin, user, callback) {
336
+ return this.subscribe({
337
+ subscription: { type: constants_1.WsSubscriptionType.ACTIVE_ASSET_DATA, coin, user },
338
+ }, callback);
339
+ }
330
340
  /**
331
341
  * Subscribe to trades for a specific coin
332
342
  */
@@ -79,6 +79,7 @@ export declare enum WsSubscriptionType {
79
79
  TRADES = "trades",
80
80
  CANDLE = "candle",
81
81
  ACTIVE_ASSET_CTX = "activeAssetCtx",
82
+ ACTIVE_ASSET_DATA = "activeAssetData",
82
83
  USER_FILLS = "userFills",
83
84
  ORDER_UPDATES = "orderUpdates",
84
85
  USER_FUNDINGS = "userFundings",
@@ -94,6 +94,7 @@ var WsSubscriptionType;
94
94
  WsSubscriptionType["TRADES"] = "trades";
95
95
  WsSubscriptionType["CANDLE"] = "candle";
96
96
  WsSubscriptionType["ACTIVE_ASSET_CTX"] = "activeAssetCtx";
97
+ WsSubscriptionType["ACTIVE_ASSET_DATA"] = "activeAssetData";
97
98
  WsSubscriptionType["USER_FILLS"] = "userFills";
98
99
  WsSubscriptionType["ORDER_UPDATES"] = "orderUpdates";
99
100
  WsSubscriptionType["USER_FUNDINGS"] = "userFundings";
@@ -306,6 +306,14 @@ export interface WsActiveAssetCtx {
306
306
  oraclePx: string;
307
307
  };
308
308
  }
309
+ export interface WsActiveAssetData {
310
+ availableToTrade: [string, string];
311
+ coin: string;
312
+ leverage: Leverage;
313
+ markPx: string;
314
+ maxTradeSzs: [string, string];
315
+ user: string;
316
+ }
309
317
  export interface WsTrade {
310
318
  coin: string;
311
319
  hash: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/hyperliquid-sdk",
3
- "version": "1.1.2-beta.1",
3
+ "version": "1.1.2-beta.2",
4
4
  "description": "Simplified Hyperliquid Perpetuals Trading SDK for Frontend Applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",