@pear-protocol/hyperliquid-sdk 0.0.45 → 0.0.47-alpha
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/dist/clients/portfolio.d.ts +39 -0
- package/dist/clients/positions.d.ts +3 -0
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/usePortfolio.d.ts +13 -0
- package/dist/hooks/useWebData.d.ts +0 -1
- package/dist/hyperliquid-websocket.d.ts +0 -2
- package/dist/index.d.ts +57 -22
- package/dist/index.js +285 -2575
- package/dist/provider.d.ts +0 -3
- package/dist/types.d.ts +6 -0
- package/dist/websocket.d.ts +0 -2
- package/package.json +3 -5
- package/dist/hooks/useAuth.d.ts +0 -12
package/dist/provider.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { ReadyState } from 'react-use-websocket';
|
|
3
2
|
import type { UserProfile } from './types';
|
|
4
3
|
import { AuthStatus } from './types';
|
|
5
4
|
import type { AgentWalletState } from './types';
|
|
@@ -8,10 +7,8 @@ export interface PearHyperliquidContextType {
|
|
|
8
7
|
wsUrl: string;
|
|
9
8
|
address: string | null;
|
|
10
9
|
setAddress: (address: string | null) => void;
|
|
11
|
-
connectionStatus: ReadyState;
|
|
12
10
|
isConnected: boolean;
|
|
13
11
|
lastError: string | null;
|
|
14
|
-
nativeConnectionStatus: ReadyState;
|
|
15
12
|
nativeIsConnected: boolean;
|
|
16
13
|
nativeLastError: string | null;
|
|
17
14
|
authStatus: AuthStatus;
|
package/dist/types.d.ts
CHANGED
|
@@ -48,6 +48,12 @@ export interface SyncFillsResponseDto {
|
|
|
48
48
|
* WebSocket connection states
|
|
49
49
|
*/
|
|
50
50
|
export type WebSocketConnectionState = 'connecting' | 'connected' | 'disconnected' | 'error';
|
|
51
|
+
export declare enum ReadyState {
|
|
52
|
+
CONNECTING = 0,
|
|
53
|
+
OPEN = 1,
|
|
54
|
+
CLOSING = 2,
|
|
55
|
+
CLOSED = 3
|
|
56
|
+
}
|
|
51
57
|
/**
|
|
52
58
|
* WebSocket channels
|
|
53
59
|
*/
|
package/dist/websocket.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { ReadyState } from 'react-use-websocket';
|
|
2
1
|
export interface UseHyperliquidWebSocketProps {
|
|
3
2
|
wsUrl: string;
|
|
4
3
|
address: string | null;
|
|
5
4
|
}
|
|
6
5
|
export declare const useHyperliquidWebSocket: ({ wsUrl, address }: UseHyperliquidWebSocketProps) => {
|
|
7
|
-
connectionStatus: ReadyState;
|
|
8
6
|
isConnected: boolean;
|
|
9
7
|
lastError: string | null;
|
|
10
8
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pear-protocol/hyperliquid-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.47-alpha",
|
|
4
4
|
"description": "React SDK for Pear Protocol Hyperliquid API integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -24,8 +24,7 @@
|
|
|
24
24
|
"clean": "rimraf dist"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"axios": "^1.6.0"
|
|
28
|
-
"react-use-websocket": "^4.8.1"
|
|
27
|
+
"axios": "^1.6.0"
|
|
29
28
|
},
|
|
30
29
|
"peerDependencies": {
|
|
31
30
|
"react": "^18.0.0",
|
|
@@ -39,8 +38,7 @@
|
|
|
39
38
|
"@types/react": "^18.0.0",
|
|
40
39
|
"concurrently": "^9.2.1",
|
|
41
40
|
"esbuild": "^0.25.9",
|
|
42
|
-
|
|
43
|
-
"react-dom": "^18.3.1",
|
|
41
|
+
|
|
44
42
|
"rimraf": "^5.0.0",
|
|
45
43
|
"rollup": "^3.0.0",
|
|
46
44
|
"rollup-plugin-dts": "^6.0.0",
|
package/dist/hooks/useAuth.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare function useAuth(): {
|
|
2
|
-
readonly status: import("..").AuthStatus;
|
|
3
|
-
readonly isAuthenticated: boolean;
|
|
4
|
-
readonly accessToken: string | null;
|
|
5
|
-
readonly user: import("..").UserProfile | null;
|
|
6
|
-
readonly error: string | null;
|
|
7
|
-
readonly getEip712: (address: string) => Promise<any>;
|
|
8
|
-
readonly loginWithSignedMessage: (address: string, signature: string, timestamp: number) => Promise<void>;
|
|
9
|
-
readonly loginWithPrivyToken: (address: string, appId: string, accessToken: string) => Promise<void>;
|
|
10
|
-
readonly refreshTokens: () => Promise<any>;
|
|
11
|
-
readonly logout: () => Promise<void>;
|
|
12
|
-
};
|