@pear-protocol/hyperliquid-sdk 0.0.4 → 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.
@@ -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.4",
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
+ }