@pear-protocol/hyperliquid-sdk 0.0.3 → 0.0.5

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.
@@ -5,7 +5,9 @@ import { SyncTradeHistoryDto, SyncTradeHistoryResponseDto, SyncOpenPositionDto,
5
5
  */
6
6
  export declare class PearMigrationSDK {
7
7
  private client;
8
- private isSyncRunning;
8
+ private isTradeHistorySyncRunning;
9
+ private isOpenPositionsSyncRunning;
10
+ private isOpenOrdersSyncRunning;
9
11
  constructor(client: PearHyperliquidClient);
10
12
  /**
11
13
  * Sync trade history data - can only run one at a time
@@ -23,9 +25,21 @@ export declare class PearMigrationSDK {
23
25
  */
24
26
  syncOpenOrders(payload: SyncOpenOrderDto): Promise<ApiResponse<SyncOpenOrderResponseDto> | null>;
25
27
  /**
26
- * Check if sync is currently running
28
+ * Check if any sync is currently running
27
29
  */
28
30
  isSyncInProgress(): boolean;
31
+ /**
32
+ * Check if trade history sync is currently running
33
+ */
34
+ isTradeHistorySyncInProgress(): boolean;
35
+ /**
36
+ * Check if open positions sync is currently running
37
+ */
38
+ isOpenPositionsSyncInProgress(): boolean;
39
+ /**
40
+ * Check if open orders sync is currently running
41
+ */
42
+ isOpenOrdersSyncInProgress(): boolean;
29
43
  /**
30
44
  * Get the underlying client instance
31
45
  */
@@ -3,6 +3,7 @@ import { ReadyState } from 'react-use-websocket';
3
3
  import { PearHyperliquidClient } from './client';
4
4
  import { PearHyperliquidConfig } from './types';
5
5
  import { PearMigrationSDK } from './migration-sdk';
6
+ import { HyperliquidService } from './hyperliquid-service';
6
7
  import type { PaginatedTradeHistoryResponseDto, OpenPositionDto, OpenLimitOrderDto, AccountSummaryResponseDto } from './types';
7
8
  interface WebSocketData {
8
9
  tradeHistories: PaginatedTradeHistoryResponseDto | null;
@@ -13,6 +14,7 @@ interface WebSocketData {
13
14
  export interface PearHyperliquidContextType {
14
15
  client: PearHyperliquidClient;
15
16
  migrationSDK: PearMigrationSDK;
17
+ hyperliquidService: HyperliquidService;
16
18
  address: string | null;
17
19
  setAddress: (address: string | null) => void;
18
20
  connectionStatus: ReadyState;
@@ -28,6 +30,11 @@ interface PearHyperliquidProviderProps {
28
30
  * @default 'wss://hl-v2.pearprotocol.io/ws'
29
31
  */
30
32
  wsUrl?: string;
33
+ /**
34
+ * Hyperliquid WebSocket URL
35
+ * @default 'wss://api.hyperliquid.xyz/ws'
36
+ */
37
+ hyperliquidWsUrl?: string;
31
38
  children: ReactNode;
32
39
  }
33
40
  /**
@@ -42,4 +49,8 @@ export declare const usePearHyperliquidClient: () => PearHyperliquidClient;
42
49
  * Hook to use migration SDK from context
43
50
  */
44
51
  export declare const useMigrationSDK: () => PearMigrationSDK;
52
+ /**
53
+ * Hook to use Hyperliquid service from context
54
+ */
55
+ export declare const useHyperliquidService: () => HyperliquidService;
45
56
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/hyperliquid-sdk",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "React SDK for Pear Protocol Hyperliquid API integration",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -15,6 +15,7 @@
15
15
  "clean": "rimraf dist"
16
16
  },
17
17
  "dependencies": {
18
+ "@nktkas/hyperliquid": "^0.22.1",
18
19
  "axios": "^1.6.0",
19
20
  "react-use-websocket": "^4.8.1"
20
21
  },
@@ -33,7 +34,14 @@
33
34
  "tslib": "^2.6.0",
34
35
  "typescript": "^5.0.0"
35
36
  },
36
- "keywords": ["pear", "hyperliquid", "sdk", "react", "trading", "api"],
37
+ "keywords": [
38
+ "pear",
39
+ "hyperliquid",
40
+ "sdk",
41
+ "react",
42
+ "trading",
43
+ "api"
44
+ ],
37
45
  "author": "Pear Protocol",
38
46
  "license": "MIT",
39
47
  "repository": {
@@ -46,4 +54,4 @@
46
54
  "access": "public"
47
55
  },
48
56
  "private": false
49
- }
57
+ }