@pear-protocol/hyperliquid-sdk 0.0.55-fix → 0.0.55-fix-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.
- package/dist/clients/agentWallet.d.ts +2 -2
- package/dist/clients/notifications.d.ts +2 -2
- package/dist/clients/orders.d.ts +3 -3
- package/dist/clients/portfolio.d.ts +2 -2
- package/dist/clients/positions.d.ts +7 -7
- package/dist/clients/sync.d.ts +2 -2
- package/dist/clients/watchlist.d.ts +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useAuth.d.ts +12 -0
- package/dist/hooks/useAutoSyncFills.d.ts +0 -2
- package/dist/index.d.ts +76 -75
- package/dist/index.js +4136 -4024
- package/dist/provider.d.ts +1 -29
- package/dist/types.d.ts +1 -7
- package/dist/utils/http.d.ts +23 -0
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ApiResponse, GetAgentWalletResponseDto, CreateAgentWalletResponseDto } from '../types';
|
|
2
|
-
export declare function getAgentWallet(baseUrl: string
|
|
3
|
-
export declare function createAgentWallet(baseUrl: string
|
|
2
|
+
export declare function getAgentWallet(baseUrl: string): Promise<ApiResponse<GetAgentWalletResponseDto>>;
|
|
3
|
+
export declare function createAgentWallet(baseUrl: string): Promise<ApiResponse<CreateAgentWalletResponseDto>>;
|
|
@@ -2,12 +2,12 @@ import type { ApiResponse } from '../types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Mark notifications as read up to a given timestamp (ms)
|
|
4
4
|
*/
|
|
5
|
-
export declare function markNotificationsRead(baseUrl: string,
|
|
5
|
+
export declare function markNotificationsRead(baseUrl: string, timestampMs: number): Promise<ApiResponse<{
|
|
6
6
|
updated: number;
|
|
7
7
|
}>>;
|
|
8
8
|
/**
|
|
9
9
|
* Mark a single notification as read by id
|
|
10
10
|
*/
|
|
11
|
-
export declare function markNotificationReadById(baseUrl: string,
|
|
11
|
+
export declare function markNotificationReadById(baseUrl: string, id: string): Promise<ApiResponse<{
|
|
12
12
|
updated: number;
|
|
13
13
|
}>>;
|
package/dist/clients/orders.d.ts
CHANGED
|
@@ -9,16 +9,16 @@ export interface AdjustOrderResponseDto {
|
|
|
9
9
|
usdValue: number;
|
|
10
10
|
updatedAt: string;
|
|
11
11
|
}
|
|
12
|
-
export declare function adjustOrder(baseUrl: string,
|
|
12
|
+
export declare function adjustOrder(baseUrl: string, orderId: string, payload: AdjustOrderRequestInput): Promise<ApiResponse<AdjustOrderResponseDto>>;
|
|
13
13
|
export interface CancelOrderResponseDto {
|
|
14
14
|
orderId: string;
|
|
15
15
|
status: string;
|
|
16
16
|
cancelledAt: string;
|
|
17
17
|
}
|
|
18
|
-
export declare function cancelOrder(baseUrl: string,
|
|
18
|
+
export declare function cancelOrder(baseUrl: string, orderId: string): Promise<ApiResponse<CancelOrderResponseDto>>;
|
|
19
19
|
export interface CancelTwapResponseDto {
|
|
20
20
|
orderId: string;
|
|
21
21
|
status: string;
|
|
22
22
|
cancelledAt: string;
|
|
23
23
|
}
|
|
24
|
-
export declare function cancelTwapOrder(baseUrl: string,
|
|
24
|
+
export declare function cancelTwapOrder(baseUrl: string, orderId: string): Promise<ApiResponse<CancelTwapResponseDto>>;
|
|
@@ -34,6 +34,6 @@ export interface PortfolioResponseDto {
|
|
|
34
34
|
/**
|
|
35
35
|
* Get portfolio summary buckets and overall metrics
|
|
36
36
|
* Returns bucketed volume, open interest snapshot, win/loss trade counts, and overall metrics filtered to PEAR fills (cloid LIKE 0x50454152%)
|
|
37
|
-
*
|
|
37
|
+
* Authorization is derived from headers (Axios defaults or browser localStorage fallback)
|
|
38
38
|
*/
|
|
39
|
-
export declare function getPortfolio(baseUrl: string
|
|
39
|
+
export declare function getPortfolio(baseUrl: string): Promise<ApiResponse<PortfolioResponseDto>>;
|
|
@@ -53,10 +53,10 @@ export interface CreatePositionResponseDto {
|
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Create a position (MARKET/LIMIT/TWAP) using Pear Hyperliquid service
|
|
56
|
-
*
|
|
56
|
+
* Authorization is derived from headers (Axios defaults or browser localStorage fallback)
|
|
57
57
|
* @throws MinimumPositionSizeError if any asset has less than $11 USD value
|
|
58
58
|
*/
|
|
59
|
-
export declare function createPosition(baseUrl: string,
|
|
59
|
+
export declare function createPosition(baseUrl: string, payload: CreatePositionRequestInput, displayToFull: Map<string, string>): Promise<ApiResponse<CreatePositionResponseDto>>;
|
|
60
60
|
export interface UpdateRiskParametersRequestInput {
|
|
61
61
|
stopLoss?: TpSlThresholdInput | null;
|
|
62
62
|
takeProfit?: TpSlThresholdInput | null;
|
|
@@ -67,7 +67,7 @@ export interface UpdateRiskParametersResponseDto {
|
|
|
67
67
|
takeProfit: TpSlThresholdInput | null;
|
|
68
68
|
updatedAt: string;
|
|
69
69
|
}
|
|
70
|
-
export declare function updateRiskParameters(baseUrl: string,
|
|
70
|
+
export declare function updateRiskParameters(baseUrl: string, positionId: string, payload: UpdateRiskParametersRequestInput): Promise<ApiResponse<UpdateRiskParametersResponseDto>>;
|
|
71
71
|
export type CloseExecutionType = "MARKET" | "TWAP";
|
|
72
72
|
export interface ClosePositionRequestInput {
|
|
73
73
|
executionType: CloseExecutionType;
|
|
@@ -81,7 +81,7 @@ export interface ClosePositionResponseDto {
|
|
|
81
81
|
executionTime?: string;
|
|
82
82
|
chunksScheduled?: number;
|
|
83
83
|
}
|
|
84
|
-
export declare function closePosition(baseUrl: string,
|
|
84
|
+
export declare function closePosition(baseUrl: string, positionId: string, payload: ClosePositionRequestInput): Promise<ApiResponse<ClosePositionResponseDto>>;
|
|
85
85
|
export interface CloseAllPositionsResultDto {
|
|
86
86
|
positionId: string;
|
|
87
87
|
success: boolean;
|
|
@@ -91,7 +91,7 @@ export interface CloseAllPositionsResultDto {
|
|
|
91
91
|
export interface CloseAllPositionsResponseDto {
|
|
92
92
|
results: CloseAllPositionsResultDto[];
|
|
93
93
|
}
|
|
94
|
-
export declare function closeAllPositions(baseUrl: string,
|
|
94
|
+
export declare function closeAllPositions(baseUrl: string, payload: ClosePositionRequestInput): Promise<ApiResponse<CloseAllPositionsResponseDto>>;
|
|
95
95
|
export type AdjustExecutionType = "MARKET" | "LIMIT";
|
|
96
96
|
export type PositionAdjustmentType = "REDUCE" | "INCREASE";
|
|
97
97
|
export interface AdjustPositionRequestInput {
|
|
@@ -109,5 +109,5 @@ export interface AdjustPositionResponseDto {
|
|
|
109
109
|
newSize: number;
|
|
110
110
|
executedAt: string;
|
|
111
111
|
}
|
|
112
|
-
export declare function adjustPosition(baseUrl: string,
|
|
113
|
-
export declare function cancelTwap(baseUrl: string,
|
|
112
|
+
export declare function adjustPosition(baseUrl: string, positionId: string, payload: AdjustPositionRequestInput): Promise<ApiResponse<AdjustPositionResponseDto>>;
|
|
113
|
+
export declare function cancelTwap(baseUrl: string, orderId: string): Promise<ApiResponse<CancelTwapResponseDto>>;
|
package/dist/clients/sync.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import type { ApiResponse, AssetPosition, SyncFillsRequestDto, SyncFillsResponse
|
|
|
2
2
|
/**
|
|
3
3
|
* Sync external fills into Pear Hyperliquid service (POST /sync/fills)
|
|
4
4
|
*/
|
|
5
|
-
export declare const syncFills: (baseUrl: string,
|
|
5
|
+
export declare const syncFills: (baseUrl: string, payload: SyncFillsRequestDto) => Promise<ApiResponse<SyncFillsResponseDto>>;
|
|
6
6
|
/**
|
|
7
7
|
* Convenience: fetch user fills from HyperLiquid, then sync them to Pear backend
|
|
8
8
|
*/
|
|
9
|
-
export declare const syncUserFillsFromHyperliquid: (baseUrl: string,
|
|
9
|
+
export declare const syncUserFillsFromHyperliquid: (baseUrl: string, user: string, aggregateByTime: boolean | undefined, lastSyncAt: number | null | undefined, assetPositions: AssetPosition[]) => Promise<ApiResponse<SyncFillsResponseDto>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ApiResponse, ToggleWatchlistResponseDto, WatchlistAssetDto } from '../types';
|
|
2
|
-
export declare function toggleWatchlist(baseUrl: string,
|
|
2
|
+
export declare function toggleWatchlist(baseUrl: string, longAssets: WatchlistAssetDto[], shortAssets: WatchlistAssetDto[], displayToFull: Map<string, string>): Promise<ApiResponse<ToggleWatchlistResponseDto>>;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { GetEIP712MessageResponse } from '../types';
|
|
2
|
+
export declare function useAuth(): {
|
|
3
|
+
readonly isReady: boolean;
|
|
4
|
+
readonly isAuthenticated: any;
|
|
5
|
+
readonly accessToken: any;
|
|
6
|
+
readonly refreshToken: any;
|
|
7
|
+
readonly getEip712: (address: string) => Promise<GetEIP712MessageResponse>;
|
|
8
|
+
readonly loginWithSignedMessage: (address: string, signature: string, timestamp: number) => Promise<void>;
|
|
9
|
+
readonly loginWithPrivyToken: (address: string, appId: string, privyAccessToken: string) => Promise<void>;
|
|
10
|
+
readonly refreshTokens: () => Promise<import("../types").RefreshTokenResponse>;
|
|
11
|
+
readonly logout: () => Promise<void>;
|
|
12
|
+
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { SyncFillsResponseDto } from '../types';
|
|
2
2
|
export interface AutoSyncFillsOptions {
|
|
3
3
|
baseUrl: string;
|
|
4
|
-
accessToken: string;
|
|
5
4
|
address: string | null;
|
|
6
5
|
intervalMs?: number;
|
|
7
6
|
aggregateByTime?: boolean;
|
|
8
|
-
enabled?: boolean;
|
|
9
7
|
}
|
|
10
8
|
export interface AutoSyncFillsState {
|
|
11
9
|
lastRunAt: number | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
+
interface PearHyperliquidContextType {
|
|
4
|
+
clientId: string;
|
|
5
|
+
apiBaseUrl: string;
|
|
6
|
+
wsUrl: string;
|
|
7
|
+
isConnected: boolean;
|
|
8
|
+
lastError: string | null;
|
|
9
|
+
nativeIsConnected: boolean;
|
|
10
|
+
nativeLastError: string | null;
|
|
11
|
+
}
|
|
12
|
+
interface PearHyperliquidProviderProps {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
apiBaseUrl?: string;
|
|
15
|
+
clientId?: string;
|
|
16
|
+
wsUrl?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* React Provider for PearHyperliquidClient
|
|
20
|
+
*/
|
|
21
|
+
declare const PearHyperliquidProvider: React.FC<PearHyperliquidProviderProps>;
|
|
22
|
+
/**
|
|
23
|
+
* Hook to access the entire Pear Hyperliquid context.
|
|
24
|
+
* Prefer using the more specific hooks below when possible.
|
|
25
|
+
*/
|
|
26
|
+
declare function usePearHyperliquid(): PearHyperliquidContextType;
|
|
27
|
+
|
|
3
28
|
interface ApiErrorResponse {
|
|
4
29
|
statusCode: number;
|
|
5
30
|
message: string;
|
|
@@ -317,12 +342,6 @@ interface AccountSummaryResponseDto {
|
|
|
317
342
|
balanceSummary: BalanceSummaryDto;
|
|
318
343
|
agentWallet?: AgentWalletDto;
|
|
319
344
|
}
|
|
320
|
-
declare enum AuthStatus {
|
|
321
|
-
Idle = "idle",
|
|
322
|
-
Authenticating = "authenticating",
|
|
323
|
-
Authenticated = "authenticated",
|
|
324
|
-
Error = "error"
|
|
325
|
-
}
|
|
326
345
|
interface UseAuthOptions {
|
|
327
346
|
baseUrl: string;
|
|
328
347
|
clientId: string;
|
|
@@ -332,6 +351,29 @@ interface UserProfile {
|
|
|
332
351
|
address: string;
|
|
333
352
|
appId: string;
|
|
334
353
|
}
|
|
354
|
+
interface EIP712AuthDetails {
|
|
355
|
+
primaryType: string;
|
|
356
|
+
domain: {
|
|
357
|
+
name: string;
|
|
358
|
+
version: string;
|
|
359
|
+
chainId: number;
|
|
360
|
+
verifyingContract: `0x${string}`;
|
|
361
|
+
};
|
|
362
|
+
types: Record<string, Array<{
|
|
363
|
+
name: string;
|
|
364
|
+
type: string;
|
|
365
|
+
}>>;
|
|
366
|
+
message: Record<string, unknown>;
|
|
367
|
+
timestamp: number;
|
|
368
|
+
}
|
|
369
|
+
interface GetEIP712MessageResponse extends EIP712AuthDetails {
|
|
370
|
+
}
|
|
371
|
+
interface RefreshTokenResponse {
|
|
372
|
+
accessToken: string;
|
|
373
|
+
refreshToken: string;
|
|
374
|
+
tokenType: string;
|
|
375
|
+
expiresIn: number;
|
|
376
|
+
}
|
|
335
377
|
type AgentWalletStatus = 'ACTIVE' | 'EXPIRED' | 'NOT_FOUND';
|
|
336
378
|
interface CreateAgentWalletResponseDto {
|
|
337
379
|
agentWalletAddress: string;
|
|
@@ -639,57 +681,6 @@ interface TokenSelectorConfig {
|
|
|
639
681
|
index: number;
|
|
640
682
|
}
|
|
641
683
|
|
|
642
|
-
interface PearHyperliquidContextType {
|
|
643
|
-
apiBaseUrl: string;
|
|
644
|
-
wsUrl: string;
|
|
645
|
-
address: string | null;
|
|
646
|
-
setAddress: (address: string | null) => void;
|
|
647
|
-
isConnected: boolean;
|
|
648
|
-
lastError: string | null;
|
|
649
|
-
nativeIsConnected: boolean;
|
|
650
|
-
nativeLastError: string | null;
|
|
651
|
-
authStatus: AuthStatus;
|
|
652
|
-
isAuthenticated: boolean;
|
|
653
|
-
accessToken: string | null;
|
|
654
|
-
user: UserProfile | null;
|
|
655
|
-
authError: string | null;
|
|
656
|
-
getEip712: (address: string) => Promise<any>;
|
|
657
|
-
loginWithSignedMessage: (address: string, signature: string, timestamp: number) => Promise<void>;
|
|
658
|
-
loginWithPrivyToken: (address: string, appId: string, accessToken: string) => Promise<void>;
|
|
659
|
-
refreshTokens: () => Promise<any>;
|
|
660
|
-
logout: () => Promise<void>;
|
|
661
|
-
}
|
|
662
|
-
interface PearHyperliquidProviderProps {
|
|
663
|
-
children: ReactNode;
|
|
664
|
-
apiBaseUrl?: string;
|
|
665
|
-
clientId?: string;
|
|
666
|
-
wsUrl?: string;
|
|
667
|
-
}
|
|
668
|
-
/**
|
|
669
|
-
* React Provider for PearHyperliquidClient
|
|
670
|
-
*/
|
|
671
|
-
declare const PearHyperliquidProvider: React.FC<PearHyperliquidProviderProps>;
|
|
672
|
-
/**
|
|
673
|
-
* Hook to access the entire Pear Hyperliquid context.
|
|
674
|
-
* Prefer using the more specific hooks below when possible.
|
|
675
|
-
*/
|
|
676
|
-
declare function usePearHyperliquid(): PearHyperliquidContextType;
|
|
677
|
-
/**
|
|
678
|
-
* Provider-aware Auth hook. Uses auth state/actions provided by PearHyperliquidProvider.
|
|
679
|
-
* Callers do not need to pass baseUrl/clientId.
|
|
680
|
-
*/
|
|
681
|
-
declare function usePearAuth(): {
|
|
682
|
-
readonly status: AuthStatus;
|
|
683
|
-
readonly isAuthenticated: boolean;
|
|
684
|
-
readonly user: UserProfile | null;
|
|
685
|
-
readonly error: string | null;
|
|
686
|
-
readonly getEip712: (address: string) => Promise<any>;
|
|
687
|
-
readonly loginWithSignedMessage: (address: string, signature: string, timestamp: number) => Promise<void>;
|
|
688
|
-
readonly loginWithPrivyToken: (address: string, appId: string, accessToken: string) => Promise<void>;
|
|
689
|
-
readonly refreshTokens: () => Promise<any>;
|
|
690
|
-
readonly logout: () => Promise<void>;
|
|
691
|
-
};
|
|
692
|
-
|
|
693
684
|
declare const useAccountSummary: () => {
|
|
694
685
|
data: AccountSummaryResponseDto | null;
|
|
695
686
|
isLoading: boolean;
|
|
@@ -834,11 +825,9 @@ declare function useAgentWallet(): {
|
|
|
834
825
|
|
|
835
826
|
interface AutoSyncFillsOptions {
|
|
836
827
|
baseUrl: string;
|
|
837
|
-
accessToken: string;
|
|
838
828
|
address: string | null;
|
|
839
829
|
intervalMs?: number;
|
|
840
830
|
aggregateByTime?: boolean;
|
|
841
|
-
enabled?: boolean;
|
|
842
831
|
}
|
|
843
832
|
interface AutoSyncFillsState {
|
|
844
833
|
lastRunAt: number | null;
|
|
@@ -863,19 +852,19 @@ interface AdjustOrderResponseDto {
|
|
|
863
852
|
usdValue: number;
|
|
864
853
|
updatedAt: string;
|
|
865
854
|
}
|
|
866
|
-
declare function adjustOrder(baseUrl: string,
|
|
855
|
+
declare function adjustOrder(baseUrl: string, orderId: string, payload: AdjustOrderRequestInput): Promise<ApiResponse<AdjustOrderResponseDto>>;
|
|
867
856
|
interface CancelOrderResponseDto {
|
|
868
857
|
orderId: string;
|
|
869
858
|
status: string;
|
|
870
859
|
cancelledAt: string;
|
|
871
860
|
}
|
|
872
|
-
declare function cancelOrder(baseUrl: string,
|
|
861
|
+
declare function cancelOrder(baseUrl: string, orderId: string): Promise<ApiResponse<CancelOrderResponseDto>>;
|
|
873
862
|
interface CancelTwapResponseDto {
|
|
874
863
|
orderId: string;
|
|
875
864
|
status: string;
|
|
876
865
|
cancelledAt: string;
|
|
877
866
|
}
|
|
878
|
-
declare function cancelTwapOrder(baseUrl: string,
|
|
867
|
+
declare function cancelTwapOrder(baseUrl: string, orderId: string): Promise<ApiResponse<CancelTwapResponseDto>>;
|
|
879
868
|
|
|
880
869
|
type ExecutionType = "MARKET" | "LIMIT" | "TWAP" | "LADDER" | "LIMIT_BTCDOM";
|
|
881
870
|
type TpSlThresholdType = "PERCENTAGE" | "DOLLAR" | "POSITION_VALUE";
|
|
@@ -930,10 +919,10 @@ interface CreatePositionResponseDto {
|
|
|
930
919
|
}
|
|
931
920
|
/**
|
|
932
921
|
* Create a position (MARKET/LIMIT/TWAP) using Pear Hyperliquid service
|
|
933
|
-
*
|
|
922
|
+
* Authorization is derived from headers (Axios defaults or browser localStorage fallback)
|
|
934
923
|
* @throws MinimumPositionSizeError if any asset has less than $11 USD value
|
|
935
924
|
*/
|
|
936
|
-
declare function createPosition(baseUrl: string,
|
|
925
|
+
declare function createPosition(baseUrl: string, payload: CreatePositionRequestInput, displayToFull: Map<string, string>): Promise<ApiResponse<CreatePositionResponseDto>>;
|
|
937
926
|
interface UpdateRiskParametersRequestInput {
|
|
938
927
|
stopLoss?: TpSlThresholdInput | null;
|
|
939
928
|
takeProfit?: TpSlThresholdInput | null;
|
|
@@ -944,7 +933,7 @@ interface UpdateRiskParametersResponseDto {
|
|
|
944
933
|
takeProfit: TpSlThresholdInput | null;
|
|
945
934
|
updatedAt: string;
|
|
946
935
|
}
|
|
947
|
-
declare function updateRiskParameters(baseUrl: string,
|
|
936
|
+
declare function updateRiskParameters(baseUrl: string, positionId: string, payload: UpdateRiskParametersRequestInput): Promise<ApiResponse<UpdateRiskParametersResponseDto>>;
|
|
948
937
|
type CloseExecutionType = "MARKET" | "TWAP";
|
|
949
938
|
interface ClosePositionRequestInput {
|
|
950
939
|
executionType: CloseExecutionType;
|
|
@@ -958,7 +947,7 @@ interface ClosePositionResponseDto {
|
|
|
958
947
|
executionTime?: string;
|
|
959
948
|
chunksScheduled?: number;
|
|
960
949
|
}
|
|
961
|
-
declare function closePosition(baseUrl: string,
|
|
950
|
+
declare function closePosition(baseUrl: string, positionId: string, payload: ClosePositionRequestInput): Promise<ApiResponse<ClosePositionResponseDto>>;
|
|
962
951
|
interface CloseAllPositionsResultDto {
|
|
963
952
|
positionId: string;
|
|
964
953
|
success: boolean;
|
|
@@ -968,7 +957,7 @@ interface CloseAllPositionsResultDto {
|
|
|
968
957
|
interface CloseAllPositionsResponseDto {
|
|
969
958
|
results: CloseAllPositionsResultDto[];
|
|
970
959
|
}
|
|
971
|
-
declare function closeAllPositions(baseUrl: string,
|
|
960
|
+
declare function closeAllPositions(baseUrl: string, payload: ClosePositionRequestInput): Promise<ApiResponse<CloseAllPositionsResponseDto>>;
|
|
972
961
|
type AdjustExecutionType = "MARKET" | "LIMIT";
|
|
973
962
|
type PositionAdjustmentType = "REDUCE" | "INCREASE";
|
|
974
963
|
interface AdjustPositionRequestInput {
|
|
@@ -986,8 +975,8 @@ interface AdjustPositionResponseDto {
|
|
|
986
975
|
newSize: number;
|
|
987
976
|
executedAt: string;
|
|
988
977
|
}
|
|
989
|
-
declare function adjustPosition(baseUrl: string,
|
|
990
|
-
declare function cancelTwap(baseUrl: string,
|
|
978
|
+
declare function adjustPosition(baseUrl: string, positionId: string, payload: AdjustPositionRequestInput): Promise<ApiResponse<AdjustPositionResponseDto>>;
|
|
979
|
+
declare function cancelTwap(baseUrl: string, orderId: string): Promise<ApiResponse<CancelTwapResponseDto>>;
|
|
991
980
|
|
|
992
981
|
declare function usePosition(): {
|
|
993
982
|
readonly createPosition: (payload: CreatePositionRequestInput) => Promise<ApiResponse<CreatePositionResponseDto>>;
|
|
@@ -1079,9 +1068,9 @@ interface PortfolioResponseDto {
|
|
|
1079
1068
|
/**
|
|
1080
1069
|
* Get portfolio summary buckets and overall metrics
|
|
1081
1070
|
* Returns bucketed volume, open interest snapshot, win/loss trade counts, and overall metrics filtered to PEAR fills (cloid LIKE 0x50454152%)
|
|
1082
|
-
*
|
|
1071
|
+
* Authorization is derived from headers (Axios defaults or browser localStorage fallback)
|
|
1083
1072
|
*/
|
|
1084
|
-
declare function getPortfolio(baseUrl: string
|
|
1073
|
+
declare function getPortfolio(baseUrl: string): Promise<ApiResponse<PortfolioResponseDto>>;
|
|
1085
1074
|
|
|
1086
1075
|
interface UsePortfolioResult {
|
|
1087
1076
|
data: PortfolioResponseDto | null;
|
|
@@ -1096,6 +1085,18 @@ interface UsePortfolioResult {
|
|
|
1096
1085
|
*/
|
|
1097
1086
|
declare function usePortfolio(): UsePortfolioResult;
|
|
1098
1087
|
|
|
1088
|
+
declare function useAuth(): {
|
|
1089
|
+
readonly isReady: boolean;
|
|
1090
|
+
readonly isAuthenticated: any;
|
|
1091
|
+
readonly accessToken: any;
|
|
1092
|
+
readonly refreshToken: any;
|
|
1093
|
+
readonly getEip712: (address: string) => Promise<GetEIP712MessageResponse>;
|
|
1094
|
+
readonly loginWithSignedMessage: (address: string, signature: string, timestamp: number) => Promise<void>;
|
|
1095
|
+
readonly loginWithPrivyToken: (address: string, appId: string, privyAccessToken: string) => Promise<void>;
|
|
1096
|
+
readonly refreshTokens: () => Promise<RefreshTokenResponse>;
|
|
1097
|
+
readonly logout: () => Promise<void>;
|
|
1098
|
+
};
|
|
1099
|
+
|
|
1099
1100
|
interface UseHyperliquidWebSocketProps {
|
|
1100
1101
|
wsUrl: string;
|
|
1101
1102
|
address: string | null;
|
|
@@ -1120,17 +1121,17 @@ declare const useHyperliquidNativeWebSocket: ({ address, enabled, }: UseHyperliq
|
|
|
1120
1121
|
/**
|
|
1121
1122
|
* Mark notifications as read up to a given timestamp (ms)
|
|
1122
1123
|
*/
|
|
1123
|
-
declare function markNotificationsRead(baseUrl: string,
|
|
1124
|
+
declare function markNotificationsRead(baseUrl: string, timestampMs: number): Promise<ApiResponse<{
|
|
1124
1125
|
updated: number;
|
|
1125
1126
|
}>>;
|
|
1126
1127
|
/**
|
|
1127
1128
|
* Mark a single notification as read by id
|
|
1128
1129
|
*/
|
|
1129
|
-
declare function markNotificationReadById(baseUrl: string,
|
|
1130
|
+
declare function markNotificationReadById(baseUrl: string, id: string): Promise<ApiResponse<{
|
|
1130
1131
|
updated: number;
|
|
1131
1132
|
}>>;
|
|
1132
1133
|
|
|
1133
|
-
declare function toggleWatchlist(baseUrl: string,
|
|
1134
|
+
declare function toggleWatchlist(baseUrl: string, longAssets: WatchlistAssetDto[], shortAssets: WatchlistAssetDto[], displayToFull: Map<string, string>): Promise<ApiResponse<ToggleWatchlistResponseDto>>;
|
|
1134
1135
|
|
|
1135
1136
|
/**
|
|
1136
1137
|
* Account summary calculation utility class
|
|
@@ -1272,5 +1273,5 @@ declare function validatePositionSize(usdValue: number, longAssets?: PairAssetIn
|
|
|
1272
1273
|
|
|
1273
1274
|
declare const useMarketData: any;
|
|
1274
1275
|
|
|
1275
|
-
export { AccountSummaryCalculator,
|
|
1276
|
+
export { AccountSummaryCalculator, ConflictDetector, MINIMUM_ASSET_USD_VALUE, MinimumPositionSizeError, PearHyperliquidProvider, TokenMetadataExtractor, adjustOrder, adjustPosition, calculateMinimumPositionValue, calculateWeightedRatio, cancelOrder, cancelTwap, cancelTwapOrder, closeAllPositions, closePosition, computeBasketCandles, createCandleLookups, createPosition, getCompleteTimestamps, getPortfolio, mapCandleIntervalToTradingViewInterval, mapTradingViewIntervalToCandleInterval, markNotificationReadById, markNotificationsRead, toggleWatchlist, updateRiskParameters, useAccountSummary, useActiveBaskets, useAgentWallet, useAllBaskets, useAuth, useAutoSyncFills, useBasketCandles, useFindBasket, useHighlightedBaskets, useHistoricalPriceData, useHistoricalPriceDataStore, useHyperliquidNativeWebSocket, useHyperliquidWebSocket, useMarketData, useMarketDataAllPayload, useMarketDataPayload, useNotifications, useOpenOrders, useOrders, usePearHyperliquid, usePerformanceOverlays, usePortfolio, usePosition, useTokenSelectionMetadata, useTopGainers, useTopLosers, useTradeHistories, useTwap, useUserSelection, useWatchlist, useWatchlistBaskets, useWebData, validateMinimumAssetSize, validatePositionSize };
|
|
1276
1277
|
export type { AccountSummaryResponseDto, ActiveAssetGroupItem, ActiveAssetsResponse, AdjustExecutionType, AdjustOrderRequestInput, AdjustOrderResponseDto, AdjustPositionRequestInput, AdjustPositionResponseDto, AgentWalletDto, AgentWalletState, ApiErrorResponse, ApiResponse, AssetCtx, AssetInformationDetail, AssetMarketData, AssetPosition, AutoSyncFillsOptions, AutoSyncFillsState, BalanceSummaryDto, CancelOrderResponseDto, CancelTwapResponseDto, CandleChartData, CandleData, CandleInterval, CandleSnapshotRequest, ClearinghouseState, CloseAllPositionsResponseDto, CloseAllPositionsResultDto, CloseExecutionType, ClosePositionRequestInput, ClosePositionResponseDto, CreatePositionRequestInput, CreatePositionResponseDto, CrossMarginSummaryDto, CumFundingDto, ExecutionType, ExtraAgent, HLWebSocketResponse, HistoricalRange, LadderConfigInput, MarginSummaryDto, NotificationCategory, NotificationDto, OpenLimitOrderDto, OpenPositionDto, OrderAssetDto, OrderStatus, PairAssetDto, PairAssetInput, PerformanceOverlay, PlatformAccountSummaryResponseDto, PortfolioBucketDto, PortfolioInterval, PortfolioIntervalsDto, PortfolioOverallDto, PortfolioResponseDto, PositionAdjustmentType, PositionAssetDetailDto, PositionAssetSummaryDto, PositionResponseStatus, RealtimeBar, RealtimeBarsCallback, ToggleWatchlistResponseDto, TokenConflict, TokenHistoricalPriceData, TokenMetadata, TokenSelection, TpSlThresholdInput, TpSlThresholdType, TradeHistoryAssetDataDto, TradeHistoryDataDto, TwapChunkStatusDto, TwapMonitoringDto, TwapSliceFillResponseItem, UniverseAsset, UpdateRiskParametersRequestInput, UpdateRiskParametersResponseDto, UseAuthOptions, UseBasketCandlesReturn, UseHistoricalPriceDataReturn, UseNotificationsResult, UsePerformanceOverlaysReturn, UsePortfolioResult, UseTokenSelectionMetadataReturn, UserProfile, UserSelectionState, WatchlistItemDto, WebSocketAckResponse, WebSocketChannel, WebSocketConnectionState, WebSocketDataMessage, WebSocketMessage, WebSocketSubscribeMessage, WsAllMidsData };
|