@pear-protocol/hyperliquid-sdk 0.0.68-beta.1 → 0.0.69
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/positions.d.ts +7 -0
- package/dist/hooks/useAuth.d.ts +3 -5
- package/dist/hooks/usePosition.d.ts +2 -1
- package/dist/index.d.ts +15 -28
- package/dist/index.js +81 -113
- package/dist/store/historicalPriceDataStore.d.ts +1 -12
- package/dist/store/hyperliquidDataStore.d.ts +1 -25
- package/dist/store/marketDataStore.d.ts +1 -10
- package/dist/store/tokenSelectionMetadataStore.d.ts +1 -1
- package/dist/store/userDataStore.d.ts +1 -30
- package/dist/store/userSelection.d.ts +1 -1
- package/package.json +2 -3
|
@@ -126,3 +126,10 @@ export interface AdjustAdvanceResponseDto {
|
|
|
126
126
|
}
|
|
127
127
|
export declare function adjustAdvancePosition(baseUrl: string, positionId: string, payload: AdjustAdvanceItemInput[], displayToFull: Map<string, string>): Promise<ApiResponse<AdjustAdvanceResponseDto>>;
|
|
128
128
|
export declare function cancelTwap(baseUrl: string, orderId: string): Promise<ApiResponse<CancelTwapResponseDto>>;
|
|
129
|
+
export interface UpdateLeverageRequestInput {
|
|
130
|
+
leverage: number;
|
|
131
|
+
}
|
|
132
|
+
export interface UpdateLeverageResponseDto {
|
|
133
|
+
message?: string;
|
|
134
|
+
}
|
|
135
|
+
export declare function updateLeverage(baseUrl: string, positionId: string, payload: UpdateLeverageRequestInput): Promise<ApiResponse<UpdateLeverageResponseDto | null>>;
|
package/dist/hooks/useAuth.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import type { GetEIP712MessageResponse } from "../types";
|
|
2
2
|
export declare function useAuth(): {
|
|
3
3
|
readonly isReady: boolean;
|
|
4
|
-
readonly isAuthenticated:
|
|
5
|
-
readonly accessToken:
|
|
6
|
-
readonly refreshToken:
|
|
4
|
+
readonly isAuthenticated: any;
|
|
5
|
+
readonly accessToken: any;
|
|
6
|
+
readonly refreshToken: any;
|
|
7
7
|
readonly getEip712: (address: string) => Promise<GetEIP712MessageResponse>;
|
|
8
8
|
readonly loginWithSignedMessage: (address: string, signature: string, timestamp: number) => Promise<void>;
|
|
9
9
|
readonly loginWithPrivyToken: (address: string, appId: string, privyAccessToken: string) => Promise<void>;
|
|
10
10
|
readonly refreshTokens: () => Promise<import("../types").RefreshTokenResponse>;
|
|
11
11
|
readonly logout: () => Promise<void>;
|
|
12
|
-
readonly setAddress: (address: string | null) => void;
|
|
13
|
-
readonly address: string | null;
|
|
14
12
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CreatePositionRequestInput, type CreatePositionResponseDto, type UpdateRiskParametersRequestInput, type UpdateRiskParametersResponseDto, type ClosePositionRequestInput, type ClosePositionResponseDto, type CloseAllPositionsResponseDto, type AdjustPositionRequestInput, type AdjustPositionResponseDto, type AdjustAdvanceItemInput, type AdjustAdvanceResponseDto } from '../clients/positions';
|
|
1
|
+
import { type CreatePositionRequestInput, type CreatePositionResponseDto, type UpdateRiskParametersRequestInput, type UpdateRiskParametersResponseDto, type ClosePositionRequestInput, type ClosePositionResponseDto, type CloseAllPositionsResponseDto, type AdjustPositionRequestInput, type AdjustPositionResponseDto, type AdjustAdvanceItemInput, type AdjustAdvanceResponseDto, type UpdateLeverageResponseDto } from '../clients/positions';
|
|
2
2
|
import type { ApiResponse, OpenPositionDto } from '../types';
|
|
3
3
|
export declare function usePosition(): {
|
|
4
4
|
readonly createPosition: (payload: CreatePositionRequestInput) => Promise<ApiResponse<CreatePositionResponseDto>>;
|
|
@@ -7,6 +7,7 @@ export declare function usePosition(): {
|
|
|
7
7
|
readonly closeAllPositions: (payload: ClosePositionRequestInput) => Promise<ApiResponse<CloseAllPositionsResponseDto>>;
|
|
8
8
|
readonly adjustPosition: (positionId: string, payload: AdjustPositionRequestInput) => Promise<ApiResponse<AdjustPositionResponseDto>>;
|
|
9
9
|
readonly adjustAdvancePosition: (positionId: string, payload: AdjustAdvanceItemInput[]) => Promise<ApiResponse<AdjustAdvanceResponseDto>>;
|
|
10
|
+
readonly updateLeverage: (positionId: string, leverage: number) => Promise<ApiResponse<UpdateLeverageResponseDto | null>>;
|
|
10
11
|
readonly openPositions: OpenPositionDto[] | null;
|
|
11
12
|
readonly isLoading: boolean;
|
|
12
13
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import * as zustand from 'zustand';
|
|
3
2
|
|
|
4
3
|
interface PearHyperliquidContextType {
|
|
5
4
|
clientId: string;
|
|
@@ -782,18 +781,7 @@ interface TokenHistoricalPriceData {
|
|
|
782
781
|
oldestTime: number | null;
|
|
783
782
|
latestTime: number | null;
|
|
784
783
|
}
|
|
785
|
-
|
|
786
|
-
historicalPriceData: Record<string, TokenHistoricalPriceData>;
|
|
787
|
-
loadingTokens: Set<string>;
|
|
788
|
-
addHistoricalPriceData: (symbol: string, interval: CandleInterval, candles: CandleData[], range: HistoricalRange) => void;
|
|
789
|
-
hasHistoricalPriceData: (symbol: string, interval: CandleInterval, startTime: number, endTime: number) => boolean;
|
|
790
|
-
getHistoricalPriceData: (symbol: string, interval: CandleInterval, startTime: number, endTime: number) => CandleData[];
|
|
791
|
-
setTokenLoading: (symbol: string, loading: boolean) => void;
|
|
792
|
-
isTokenLoading: (symbol: string) => boolean;
|
|
793
|
-
removeTokenPriceData: (symbol: string, interval: CandleInterval) => void;
|
|
794
|
-
clearData: () => void;
|
|
795
|
-
}
|
|
796
|
-
declare const useHistoricalPriceDataStore: zustand.UseBoundStore<zustand.StoreApi<HistoricalPriceDataState>>;
|
|
784
|
+
declare const useHistoricalPriceDataStore: any;
|
|
797
785
|
|
|
798
786
|
interface UseHistoricalPriceDataReturn {
|
|
799
787
|
fetchHistoricalPriceData: (startTime: number, endTime: number, interval: CandleInterval, callback?: (data: Record<string, CandleData[]>) => void) => Promise<Record<string, CandleData[]>>;
|
|
@@ -1020,6 +1008,13 @@ interface AdjustAdvanceResponseDto {
|
|
|
1020
1008
|
}
|
|
1021
1009
|
declare function adjustAdvancePosition(baseUrl: string, positionId: string, payload: AdjustAdvanceItemInput[], displayToFull: Map<string, string>): Promise<ApiResponse<AdjustAdvanceResponseDto>>;
|
|
1022
1010
|
declare function cancelTwap(baseUrl: string, orderId: string): Promise<ApiResponse<CancelTwapResponseDto>>;
|
|
1011
|
+
interface UpdateLeverageRequestInput {
|
|
1012
|
+
leverage: number;
|
|
1013
|
+
}
|
|
1014
|
+
interface UpdateLeverageResponseDto {
|
|
1015
|
+
message?: string;
|
|
1016
|
+
}
|
|
1017
|
+
declare function updateLeverage(baseUrl: string, positionId: string, payload: UpdateLeverageRequestInput): Promise<ApiResponse<UpdateLeverageResponseDto | null>>;
|
|
1023
1018
|
|
|
1024
1019
|
declare function usePosition(): {
|
|
1025
1020
|
readonly createPosition: (payload: CreatePositionRequestInput) => Promise<ApiResponse<CreatePositionResponseDto>>;
|
|
@@ -1028,6 +1023,7 @@ declare function usePosition(): {
|
|
|
1028
1023
|
readonly closeAllPositions: (payload: ClosePositionRequestInput) => Promise<ApiResponse<CloseAllPositionsResponseDto>>;
|
|
1029
1024
|
readonly adjustPosition: (positionId: string, payload: AdjustPositionRequestInput) => Promise<ApiResponse<AdjustPositionResponseDto>>;
|
|
1030
1025
|
readonly adjustAdvancePosition: (positionId: string, payload: AdjustAdvanceItemInput[]) => Promise<ApiResponse<AdjustAdvanceResponseDto>>;
|
|
1026
|
+
readonly updateLeverage: (positionId: string, leverage: number) => Promise<ApiResponse<UpdateLeverageResponseDto | null>>;
|
|
1031
1027
|
readonly openPositions: OpenPositionDto[] | null;
|
|
1032
1028
|
readonly isLoading: boolean;
|
|
1033
1029
|
};
|
|
@@ -1131,16 +1127,14 @@ declare function usePortfolio(): UsePortfolioResult;
|
|
|
1131
1127
|
|
|
1132
1128
|
declare function useAuth(): {
|
|
1133
1129
|
readonly isReady: boolean;
|
|
1134
|
-
readonly isAuthenticated:
|
|
1135
|
-
readonly accessToken:
|
|
1136
|
-
readonly refreshToken:
|
|
1130
|
+
readonly isAuthenticated: any;
|
|
1131
|
+
readonly accessToken: any;
|
|
1132
|
+
readonly refreshToken: any;
|
|
1137
1133
|
readonly getEip712: (address: string) => Promise<GetEIP712MessageResponse>;
|
|
1138
1134
|
readonly loginWithSignedMessage: (address: string, signature: string, timestamp: number) => Promise<void>;
|
|
1139
1135
|
readonly loginWithPrivyToken: (address: string, appId: string, privyAccessToken: string) => Promise<void>;
|
|
1140
1136
|
readonly refreshTokens: () => Promise<RefreshTokenResponse>;
|
|
1141
1137
|
readonly logout: () => Promise<void>;
|
|
1142
|
-
readonly setAddress: (address: string | null) => void;
|
|
1143
|
-
readonly address: string | null;
|
|
1144
1138
|
};
|
|
1145
1139
|
|
|
1146
1140
|
interface UseHyperliquidWebSocketProps {
|
|
@@ -1337,14 +1331,7 @@ declare function validatePositionSize(usdValue: number, longAssets?: PairAssetIn
|
|
|
1337
1331
|
minimumRequired?: number;
|
|
1338
1332
|
};
|
|
1339
1333
|
|
|
1340
|
-
|
|
1341
|
-
marketData: ActiveAssetsResponse | null;
|
|
1342
|
-
marketDataAll: ActiveAssetsAllResponse | null;
|
|
1343
|
-
setMarketData: (value: ActiveAssetsResponse | null) => void;
|
|
1344
|
-
setMarketDataAll: (value: ActiveAssetsAllResponse | null) => void;
|
|
1345
|
-
clean: () => void;
|
|
1346
|
-
}
|
|
1347
|
-
declare const useMarketData: zustand.UseBoundStore<zustand.StoreApi<MarketDataState>>;
|
|
1334
|
+
declare const useMarketData: any;
|
|
1348
1335
|
|
|
1349
|
-
export { AccountSummaryCalculator, ConflictDetector, MAX_ASSETS_PER_LEG, MINIMUM_ASSET_USD_VALUE, MaxAssetsPerLegError, MinimumPositionSizeError, PearHyperliquidProvider, TokenMetadataExtractor, adjustAdvancePosition, 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, validateMaxAssetsPerLeg, validateMinimumAssetSize, validatePositionSize };
|
|
1350
|
-
export type { AccountSummaryResponseDto, ActiveAssetGroupItem, ActiveAssetsResponse, AdjustAdvanceAssetInput, AdjustAdvanceItemInput, AdjustAdvanceResponseDto, 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 };
|
|
1336
|
+
export { AccountSummaryCalculator, ConflictDetector, MAX_ASSETS_PER_LEG, MINIMUM_ASSET_USD_VALUE, MaxAssetsPerLegError, MinimumPositionSizeError, PearHyperliquidProvider, TokenMetadataExtractor, adjustAdvancePosition, adjustOrder, adjustPosition, calculateMinimumPositionValue, calculateWeightedRatio, cancelOrder, cancelTwap, cancelTwapOrder, closeAllPositions, closePosition, computeBasketCandles, createCandleLookups, createPosition, getCompleteTimestamps, getPortfolio, mapCandleIntervalToTradingViewInterval, mapTradingViewIntervalToCandleInterval, markNotificationReadById, markNotificationsRead, toggleWatchlist, updateLeverage, 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, validateMaxAssetsPerLeg, validateMinimumAssetSize, validatePositionSize };
|
|
1337
|
+
export type { AccountSummaryResponseDto, ActiveAssetGroupItem, ActiveAssetsResponse, AdjustAdvanceAssetInput, AdjustAdvanceItemInput, AdjustAdvanceResponseDto, 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, UpdateLeverageRequestInput, UpdateLeverageResponseDto, UpdateRiskParametersRequestInput, UpdateRiskParametersResponseDto, UseAuthOptions, UseBasketCandlesReturn, UseHistoricalPriceDataReturn, UseNotificationsResult, UsePerformanceOverlaysReturn, UsePortfolioResult, UseTokenSelectionMetadataReturn, UserProfile, UserSelectionState, WatchlistItemDto, WebSocketAckResponse, WebSocketChannel, WebSocketConnectionState, WebSocketDataMessage, WebSocketMessage, WebSocketSubscribeMessage, WsAllMidsData };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import { useState, useRef, useCallback, useEffect, useMemo, useContext, createContext } from 'react';
|
|
3
|
+
import { create } from 'zustand';
|
|
3
4
|
|
|
4
5
|
// Browser-compatible WebSocket ready state enum (mirrors native values)
|
|
5
6
|
var ReadyState;
|
|
@@ -10,52 +11,10 @@ var ReadyState;
|
|
|
10
11
|
ReadyState[ReadyState["CLOSED"] = 3] = "CLOSED";
|
|
11
12
|
})(ReadyState || (ReadyState = {}));
|
|
12
13
|
|
|
13
|
-
const createStoreImpl = (createState) => {
|
|
14
|
-
let state;
|
|
15
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
16
|
-
const setState = (partial, replace) => {
|
|
17
|
-
const nextState = typeof partial === "function" ? partial(state) : partial;
|
|
18
|
-
if (!Object.is(nextState, state)) {
|
|
19
|
-
const previousState = state;
|
|
20
|
-
state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
|
|
21
|
-
listeners.forEach((listener) => listener(state, previousState));
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
const getState = () => state;
|
|
25
|
-
const getInitialState = () => initialState;
|
|
26
|
-
const subscribe = (listener) => {
|
|
27
|
-
listeners.add(listener);
|
|
28
|
-
return () => listeners.delete(listener);
|
|
29
|
-
};
|
|
30
|
-
const api = { setState, getState, getInitialState, subscribe };
|
|
31
|
-
const initialState = state = createState(setState, getState, api);
|
|
32
|
-
return api;
|
|
33
|
-
};
|
|
34
|
-
const createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
|
|
35
|
-
|
|
36
|
-
const identity = (arg) => arg;
|
|
37
|
-
function useStore(api, selector = identity) {
|
|
38
|
-
const slice = React.useSyncExternalStore(
|
|
39
|
-
api.subscribe,
|
|
40
|
-
React.useCallback(() => selector(api.getState()), [api, selector]),
|
|
41
|
-
React.useCallback(() => selector(api.getInitialState()), [api, selector])
|
|
42
|
-
);
|
|
43
|
-
React.useDebugValue(slice);
|
|
44
|
-
return slice;
|
|
45
|
-
}
|
|
46
|
-
const createImpl = (createState) => {
|
|
47
|
-
const api = createStore(createState);
|
|
48
|
-
const useBoundStore = (selector) => useStore(api, selector);
|
|
49
|
-
Object.assign(useBoundStore, api);
|
|
50
|
-
return useBoundStore;
|
|
51
|
-
};
|
|
52
|
-
const create = ((createState) => createState ? createImpl(createState) : createImpl);
|
|
53
|
-
|
|
54
14
|
const useUserData = create((set) => ({
|
|
55
15
|
accessToken: null,
|
|
56
16
|
refreshToken: null,
|
|
57
17
|
isAuthenticated: false,
|
|
58
|
-
isReady: false,
|
|
59
18
|
address: null,
|
|
60
19
|
tradeHistories: null,
|
|
61
20
|
rawOpenPositions: null,
|
|
@@ -67,17 +26,17 @@ const useUserData = create((set) => ({
|
|
|
67
26
|
setAccessToken: (token) => set({ accessToken: token }),
|
|
68
27
|
setRefreshToken: (token) => set({ refreshToken: token }),
|
|
69
28
|
setIsAuthenticated: (value) => set({ isAuthenticated: value }),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
},
|
|
29
|
+
setAddress: (address) => set(() => {
|
|
30
|
+
if (typeof window !== 'undefined') {
|
|
31
|
+
if (address) {
|
|
32
|
+
window.localStorage.setItem('address', address);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
window.localStorage.removeItem('address');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return { address };
|
|
39
|
+
}),
|
|
81
40
|
setTradeHistories: (value) => set({ tradeHistories: value }),
|
|
82
41
|
setRawOpenPositions: (value) => set({ rawOpenPositions: value }),
|
|
83
42
|
setOpenOrders: (value) => set({ openOrders: value }),
|
|
@@ -85,11 +44,10 @@ const useUserData = create((set) => ({
|
|
|
85
44
|
setTwapDetails: (value) => set({ twapDetails: value }),
|
|
86
45
|
setNotifications: (value) => set({ notifications: value }),
|
|
87
46
|
clean: () => set({
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
// address: null,
|
|
47
|
+
accessToken: null,
|
|
48
|
+
refreshToken: null,
|
|
49
|
+
isAuthenticated: false,
|
|
50
|
+
address: null,
|
|
93
51
|
tradeHistories: null,
|
|
94
52
|
rawOpenPositions: null,
|
|
95
53
|
openOrders: null,
|
|
@@ -6642,6 +6600,28 @@ async function cancelTwap(baseUrl, orderId) {
|
|
|
6642
6600
|
throw toApiError(error);
|
|
6643
6601
|
}
|
|
6644
6602
|
}
|
|
6603
|
+
async function updateLeverage(baseUrl, positionId, payload) {
|
|
6604
|
+
var _a;
|
|
6605
|
+
const url = joinUrl(baseUrl, `/positions/${positionId}/adjust-leverage`);
|
|
6606
|
+
try {
|
|
6607
|
+
const resp = await apiClient.post(url, payload, {
|
|
6608
|
+
headers: {
|
|
6609
|
+
"Content-Type": "application/json",
|
|
6610
|
+
},
|
|
6611
|
+
timeout: 60000,
|
|
6612
|
+
});
|
|
6613
|
+
// If backend returns 204, resp.data may be empty; normalize to null for callers
|
|
6614
|
+
const normalizedData = ((_a = resp.data) !== null && _a !== void 0 ? _a : null);
|
|
6615
|
+
return {
|
|
6616
|
+
data: normalizedData,
|
|
6617
|
+
status: resp.status,
|
|
6618
|
+
headers: resp.headers,
|
|
6619
|
+
};
|
|
6620
|
+
}
|
|
6621
|
+
catch (error) {
|
|
6622
|
+
throw toApiError(error);
|
|
6623
|
+
}
|
|
6624
|
+
}
|
|
6645
6625
|
|
|
6646
6626
|
const calculatePositionAsset = (asset, currentPrice, totalInitialPositionSize, leverage, isLong = true) => {
|
|
6647
6627
|
var _a;
|
|
@@ -6755,6 +6735,9 @@ function usePosition() {
|
|
|
6755
6735
|
const adjustAdvancePosition$1 = async (positionId, payload) => {
|
|
6756
6736
|
return adjustAdvancePosition(apiBaseUrl, positionId, payload, displayToFull);
|
|
6757
6737
|
};
|
|
6738
|
+
const updateLeverage$1 = async (positionId, leverage) => {
|
|
6739
|
+
return updateLeverage(apiBaseUrl, positionId, { leverage });
|
|
6740
|
+
};
|
|
6758
6741
|
// Open positions using WS data, with derived values
|
|
6759
6742
|
const userOpenPositions = useUserData((state) => state.rawOpenPositions);
|
|
6760
6743
|
const aggregatedClearingHouseState = useHyperliquidData((state) => state.aggregatedClearingHouseState);
|
|
@@ -6767,7 +6750,7 @@ function usePosition() {
|
|
|
6767
6750
|
return null;
|
|
6768
6751
|
return buildPositionValue(userOpenPositions, aggregatedClearingHouseState, allMids);
|
|
6769
6752
|
}, [userOpenPositions, aggregatedClearingHouseState, allMids]);
|
|
6770
|
-
return { createPosition: createPosition$1, updateRiskParameters: updateRiskParameters$1, closePosition: closePosition$1, closeAllPositions: closeAllPositions$1, adjustPosition: adjustPosition$1, adjustAdvancePosition: adjustAdvancePosition$1, openPositions, isLoading };
|
|
6753
|
+
return { createPosition: createPosition$1, updateRiskParameters: updateRiskParameters$1, closePosition: closePosition$1, closeAllPositions: closeAllPositions$1, adjustPosition: adjustPosition$1, adjustAdvancePosition: adjustAdvancePosition$1, updateLeverage: updateLeverage$1, openPositions, isLoading };
|
|
6771
6754
|
}
|
|
6772
6755
|
|
|
6773
6756
|
async function adjustOrder(baseUrl, orderId, payload) {
|
|
@@ -7153,46 +7136,38 @@ async function logout(baseUrl, refreshTokenVal) {
|
|
|
7153
7136
|
function useAuth() {
|
|
7154
7137
|
const context = useContext(PearHyperliquidContext);
|
|
7155
7138
|
if (!context) {
|
|
7156
|
-
throw new Error("
|
|
7139
|
+
throw new Error("usePortfolio must be used within a PearHyperliquidProvider");
|
|
7157
7140
|
}
|
|
7158
7141
|
const { apiBaseUrl, clientId } = context;
|
|
7142
|
+
const [isReady, setIsReady] = useState(false);
|
|
7159
7143
|
const accessToken = useUserData((s) => s.accessToken);
|
|
7160
7144
|
const refreshToken$1 = useUserData((s) => s.refreshToken);
|
|
7161
|
-
const isReady = useUserData((s) => s.isReady);
|
|
7162
|
-
const isAuthenticated = useUserData((s) => s.isAuthenticated);
|
|
7163
|
-
const address = useUserData((s) => s.address);
|
|
7164
7145
|
const setAccessToken = useUserData((s) => s.setAccessToken);
|
|
7165
7146
|
const setRefreshToken = useUserData((s) => s.setRefreshToken);
|
|
7166
|
-
const
|
|
7147
|
+
const isAuthenticated = useUserData((s) => s.isAuthenticated);
|
|
7167
7148
|
const setIsAuthenticated = useUserData((s) => s.setIsAuthenticated);
|
|
7168
7149
|
const setAddress = useUserData((s) => s.setAddress);
|
|
7169
7150
|
useEffect(() => {
|
|
7170
7151
|
if (typeof window == "undefined") {
|
|
7171
7152
|
return;
|
|
7172
7153
|
}
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7181
|
-
setAccessToken(storedAccessToken);
|
|
7182
|
-
setRefreshToken(storedRefreshToken);
|
|
7183
|
-
setIsAuthenticated(true);
|
|
7184
|
-
}
|
|
7185
|
-
}
|
|
7154
|
+
const access = localStorage.getItem("accessToken");
|
|
7155
|
+
const refresh = localStorage.getItem("refreshToken");
|
|
7156
|
+
const addr = localStorage.getItem("address");
|
|
7157
|
+
setAccessToken(access);
|
|
7158
|
+
setRefreshToken(refresh);
|
|
7159
|
+
setAddress(addr);
|
|
7160
|
+
const authed = Boolean(access && addr);
|
|
7161
|
+
setIsAuthenticated(authed);
|
|
7186
7162
|
setIsReady(true);
|
|
7187
|
-
}, [
|
|
7163
|
+
}, [setAccessToken, setRefreshToken, setIsAuthenticated, setAddress]);
|
|
7188
7164
|
useEffect(() => {
|
|
7189
7165
|
const cleanup = addAuthInterceptors({
|
|
7190
7166
|
apiBaseUrl,
|
|
7191
7167
|
getAccessToken: () => {
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
return useUserData.getState().accessToken;
|
|
7168
|
+
return typeof window !== "undefined"
|
|
7169
|
+
? window.localStorage.getItem("accessToken")
|
|
7170
|
+
: null;
|
|
7196
7171
|
},
|
|
7197
7172
|
refreshTokens: async () => {
|
|
7198
7173
|
const data = await refreshTokens();
|
|
@@ -7218,12 +7193,12 @@ function useAuth() {
|
|
|
7218
7193
|
clientId,
|
|
7219
7194
|
details: { signature, timestamp },
|
|
7220
7195
|
});
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
window.localStorage.setItem(
|
|
7224
|
-
window.localStorage.setItem(refreshTokenKey, data.refreshToken);
|
|
7196
|
+
window.localStorage.setItem("accessToken", data.accessToken);
|
|
7197
|
+
window.localStorage.setItem("refreshToken", data.refreshToken);
|
|
7198
|
+
window.localStorage.setItem("address", address);
|
|
7225
7199
|
setAccessToken(data.accessToken);
|
|
7226
7200
|
setRefreshToken(data.refreshToken);
|
|
7201
|
+
setAddress(address);
|
|
7227
7202
|
setIsAuthenticated(true);
|
|
7228
7203
|
}
|
|
7229
7204
|
catch (e) {
|
|
@@ -7238,12 +7213,12 @@ function useAuth() {
|
|
|
7238
7213
|
appId,
|
|
7239
7214
|
accessToken: privyAccessToken,
|
|
7240
7215
|
});
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
window.localStorage.setItem(
|
|
7244
|
-
window.localStorage.setItem(refreshTokenKey, data.refreshToken);
|
|
7216
|
+
window.localStorage.setItem("accessToken", data.accessToken);
|
|
7217
|
+
window.localStorage.setItem("refreshToken", data.refreshToken);
|
|
7218
|
+
window.localStorage.setItem("address", address);
|
|
7245
7219
|
setAccessToken(data.accessToken);
|
|
7246
7220
|
setRefreshToken(data.refreshToken);
|
|
7221
|
+
setAddress(address);
|
|
7247
7222
|
setIsAuthenticated(true);
|
|
7248
7223
|
}
|
|
7249
7224
|
catch (e) {
|
|
@@ -7251,38 +7226,30 @@ function useAuth() {
|
|
|
7251
7226
|
}
|
|
7252
7227
|
}
|
|
7253
7228
|
async function refreshTokens() {
|
|
7254
|
-
const
|
|
7255
|
-
|
|
7256
|
-
if (!currentRefresh || !currentAddress)
|
|
7229
|
+
const refresh = window.localStorage.getItem("refreshToken");
|
|
7230
|
+
if (!refresh)
|
|
7257
7231
|
throw new Error("No refresh token");
|
|
7258
|
-
const { data } = await refreshToken(apiBaseUrl,
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
const refreshTokenKey = `${currentAddress}_refreshToken`;
|
|
7262
|
-
window.localStorage.setItem(accessTokenKey, data.accessToken);
|
|
7263
|
-
window.localStorage.setItem(refreshTokenKey, data.refreshToken);
|
|
7232
|
+
const { data } = await refreshToken(apiBaseUrl, refresh);
|
|
7233
|
+
window.localStorage.setItem("accessToken", data.accessToken);
|
|
7234
|
+
window.localStorage.setItem("refreshToken", data.refreshToken);
|
|
7264
7235
|
setAccessToken(data.accessToken);
|
|
7265
7236
|
setRefreshToken(data.refreshToken);
|
|
7266
7237
|
setIsAuthenticated(true);
|
|
7267
7238
|
return data;
|
|
7268
7239
|
}
|
|
7269
7240
|
async function logout$1() {
|
|
7270
|
-
const
|
|
7271
|
-
|
|
7272
|
-
if (currentRefresh) {
|
|
7241
|
+
const refresh = window.localStorage.getItem("refreshToken");
|
|
7242
|
+
if (refresh) {
|
|
7273
7243
|
try {
|
|
7274
|
-
await logout(apiBaseUrl,
|
|
7244
|
+
await logout(apiBaseUrl, refresh);
|
|
7275
7245
|
}
|
|
7276
7246
|
catch (_a) {
|
|
7277
7247
|
/* ignore */
|
|
7278
7248
|
}
|
|
7279
7249
|
}
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
window.localStorage.removeItem(accessTokenKey);
|
|
7284
|
-
window.localStorage.removeItem(refreshTokenKey);
|
|
7285
|
-
}
|
|
7250
|
+
window.localStorage.removeItem("accessToken");
|
|
7251
|
+
window.localStorage.removeItem("refreshToken");
|
|
7252
|
+
window.localStorage.removeItem("address");
|
|
7286
7253
|
setAccessToken(null);
|
|
7287
7254
|
setRefreshToken(null);
|
|
7288
7255
|
setAddress(null);
|
|
@@ -7298,8 +7265,6 @@ function useAuth() {
|
|
|
7298
7265
|
loginWithPrivyToken,
|
|
7299
7266
|
refreshTokens,
|
|
7300
7267
|
logout: logout$1,
|
|
7301
|
-
setAddress,
|
|
7302
|
-
address,
|
|
7303
7268
|
};
|
|
7304
7269
|
}
|
|
7305
7270
|
|
|
@@ -7309,6 +7274,7 @@ const PearHyperliquidContext = createContext(undefined);
|
|
|
7309
7274
|
*/
|
|
7310
7275
|
const PearHyperliquidProvider = ({ children, apiBaseUrl = "https://hl-ui.pearprotocol.io", clientId = "PEARPROTOCOLUI", wsUrl = "wss://hl-ui.pearprotocol.io/ws", }) => {
|
|
7311
7276
|
const address = useUserData((s) => s.address);
|
|
7277
|
+
const setAddress = useUserData((s) => s.setAddress);
|
|
7312
7278
|
const perpsMetaAssets = useHyperliquidData((state) => state.perpMetaAssets);
|
|
7313
7279
|
const setPerpMetaAssets = useHyperliquidData((state) => state.setPerpMetaAssets);
|
|
7314
7280
|
const setHip3DisplayToFull = useHyperliquidData((state) => state.setHip3DisplayToFull);
|
|
@@ -7373,6 +7339,8 @@ const PearHyperliquidProvider = ({ children, apiBaseUrl = "https://hl-ui.pearpro
|
|
|
7373
7339
|
}), [
|
|
7374
7340
|
apiBaseUrl,
|
|
7375
7341
|
wsUrl,
|
|
7342
|
+
address,
|
|
7343
|
+
setAddress,
|
|
7376
7344
|
isConnected,
|
|
7377
7345
|
lastError,
|
|
7378
7346
|
nativeIsConnected,
|
|
@@ -7478,4 +7446,4 @@ function mapCandleIntervalToTradingViewInterval(interval) {
|
|
|
7478
7446
|
}
|
|
7479
7447
|
}
|
|
7480
7448
|
|
|
7481
|
-
export { AccountSummaryCalculator, ConflictDetector, MAX_ASSETS_PER_LEG, MINIMUM_ASSET_USD_VALUE, MaxAssetsPerLegError, MinimumPositionSizeError, PearHyperliquidProvider, TokenMetadataExtractor, adjustAdvancePosition, 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, validateMaxAssetsPerLeg, validateMinimumAssetSize, validatePositionSize };
|
|
7449
|
+
export { AccountSummaryCalculator, ConflictDetector, MAX_ASSETS_PER_LEG, MINIMUM_ASSET_USD_VALUE, MaxAssetsPerLegError, MinimumPositionSizeError, PearHyperliquidProvider, TokenMetadataExtractor, adjustAdvancePosition, adjustOrder, adjustPosition, calculateMinimumPositionValue, calculateWeightedRatio, cancelOrder, cancelTwap, cancelTwapOrder, closeAllPositions, closePosition, computeBasketCandles, createCandleLookups, createPosition, getCompleteTimestamps, getPortfolio, mapCandleIntervalToTradingViewInterval, mapTradingViewIntervalToCandleInterval, markNotificationReadById, markNotificationsRead, toggleWatchlist, updateLeverage, 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, validateMaxAssetsPerLeg, validateMinimumAssetSize, validatePositionSize };
|
|
@@ -10,16 +10,5 @@ interface TokenHistoricalPriceData {
|
|
|
10
10
|
oldestTime: number | null;
|
|
11
11
|
latestTime: number | null;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
historicalPriceData: Record<string, TokenHistoricalPriceData>;
|
|
15
|
-
loadingTokens: Set<string>;
|
|
16
|
-
addHistoricalPriceData: (symbol: string, interval: CandleInterval, candles: CandleData[], range: HistoricalRange) => void;
|
|
17
|
-
hasHistoricalPriceData: (symbol: string, interval: CandleInterval, startTime: number, endTime: number) => boolean;
|
|
18
|
-
getHistoricalPriceData: (symbol: string, interval: CandleInterval, startTime: number, endTime: number) => CandleData[];
|
|
19
|
-
setTokenLoading: (symbol: string, loading: boolean) => void;
|
|
20
|
-
isTokenLoading: (symbol: string) => boolean;
|
|
21
|
-
removeTokenPriceData: (symbol: string, interval: CandleInterval) => void;
|
|
22
|
-
clearData: () => void;
|
|
23
|
-
}
|
|
24
|
-
export declare const useHistoricalPriceDataStore: import("zustand").UseBoundStore<import("zustand").StoreApi<HistoricalPriceDataState>>;
|
|
13
|
+
export declare const useHistoricalPriceDataStore: any;
|
|
25
14
|
export type { HistoricalRange, TokenHistoricalPriceData };
|
|
@@ -1,25 +1 @@
|
|
|
1
|
-
|
|
2
|
-
interface HyperliquidDataState {
|
|
3
|
-
allMids: WsAllMidsData | null;
|
|
4
|
-
activeAssetData: Record<string, ActiveAssetData> | null;
|
|
5
|
-
candleData: CandleChartData | null;
|
|
6
|
-
finalAssetContexts: WebData3AssetCtx[] | null;
|
|
7
|
-
finalAtOICaps: string[] | null;
|
|
8
|
-
aggregatedClearingHouseState: ClearinghouseState | null;
|
|
9
|
-
perpMetaAssets: UniverseAsset[] | null;
|
|
10
|
-
hip3DisplayToFull: Map<string, string>;
|
|
11
|
-
setAllMids: (value: WsAllMidsData | null) => void;
|
|
12
|
-
setActiveAssetData: (value: Record<string, ActiveAssetData> | null | ((prev: Record<string, ActiveAssetData> | null) => Record<string, ActiveAssetData> | null)) => void;
|
|
13
|
-
deleteActiveAssetData: (key: string) => void;
|
|
14
|
-
addCandleData: (symbol: string, candle: CandleData) => void;
|
|
15
|
-
deleteCandleSymbol: (symbol: string) => void;
|
|
16
|
-
setCandleData: (value: CandleChartData | null) => void;
|
|
17
|
-
upsertActiveAssetData: (key: string, value: ActiveAssetData) => void;
|
|
18
|
-
setFinalAssetContexts: (value: WebData3AssetCtx[] | null) => void;
|
|
19
|
-
setFinalAtOICaps: (value: string[] | null) => void;
|
|
20
|
-
setAggregatedClearingHouseState: (value: ClearinghouseState | null) => void;
|
|
21
|
-
setPerpMetaAssets: (value: UniverseAsset[] | null) => void;
|
|
22
|
-
setHip3DisplayToFull: (value: Map<string, string>) => void;
|
|
23
|
-
}
|
|
24
|
-
export declare const useHyperliquidData: import("zustand").UseBoundStore<import("zustand").StoreApi<HyperliquidDataState>>;
|
|
25
|
-
export {};
|
|
1
|
+
export declare const useHyperliquidData: any;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
interface MarketDataState {
|
|
3
|
-
marketData: ActiveAssetsResponse | null;
|
|
4
|
-
marketDataAll: ActiveAssetsAllResponse | null;
|
|
5
|
-
setMarketData: (value: ActiveAssetsResponse | null) => void;
|
|
6
|
-
setMarketDataAll: (value: ActiveAssetsAllResponse | null) => void;
|
|
7
|
-
clean: () => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const useMarketData: import("zustand").UseBoundStore<import("zustand").StoreApi<MarketDataState>>;
|
|
10
|
-
export {};
|
|
1
|
+
export declare const useMarketData: any;
|
|
@@ -24,4 +24,4 @@ export interface TokenSelectionMetadataState {
|
|
|
24
24
|
shortTokens: TokenSelection[];
|
|
25
25
|
}) => void;
|
|
26
26
|
}
|
|
27
|
-
export declare const useTokenSelectionMetadataStore:
|
|
27
|
+
export declare const useTokenSelectionMetadataStore: any;
|
|
@@ -1,30 +1 @@
|
|
|
1
|
-
|
|
2
|
-
interface UserDataState {
|
|
3
|
-
accessToken: string | null;
|
|
4
|
-
refreshToken: string | null;
|
|
5
|
-
isAuthenticated: boolean;
|
|
6
|
-
isReady: boolean;
|
|
7
|
-
address: string | null;
|
|
8
|
-
tradeHistories: TradeHistoryDataDto[] | null;
|
|
9
|
-
rawOpenPositions: RawPositionDto[] | null;
|
|
10
|
-
openOrders: OpenLimitOrderDto[] | null;
|
|
11
|
-
accountSummary: PlatformAccountSummaryResponseDto | null;
|
|
12
|
-
twapDetails: TwapMonitoringDto[] | null;
|
|
13
|
-
notifications: NotificationDto[] | null;
|
|
14
|
-
userExtraAgents: ExtraAgent[] | null;
|
|
15
|
-
setAccessToken: (token: string | null) => void;
|
|
16
|
-
setRefreshToken: (token: string | null) => void;
|
|
17
|
-
setIsAuthenticated: (value: boolean) => void;
|
|
18
|
-
setIsReady: (value: boolean) => void;
|
|
19
|
-
setAddress: (address: string | null) => void;
|
|
20
|
-
setTradeHistories: (value: TradeHistoryDataDto[] | null) => void;
|
|
21
|
-
setRawOpenPositions: (value: RawPositionDto[] | null) => void;
|
|
22
|
-
setOpenOrders: (value: OpenLimitOrderDto[] | null) => void;
|
|
23
|
-
setAccountSummary: (value: PlatformAccountSummaryResponseDto | null) => void;
|
|
24
|
-
setUserExtraAgents: (value: ExtraAgent[] | null) => void;
|
|
25
|
-
setTwapDetails: (value: TwapMonitoringDto[] | null) => void;
|
|
26
|
-
setNotifications: (value: NotificationDto[] | null) => void;
|
|
27
|
-
clean: () => void;
|
|
28
|
-
}
|
|
29
|
-
export declare const useUserData: import("zustand").UseBoundStore<import("zustand").StoreApi<UserDataState>>;
|
|
30
|
-
export {};
|
|
1
|
+
export declare const useUserData: any;
|
|
@@ -23,5 +23,5 @@ interface UserSelectionState {
|
|
|
23
23
|
setTokenSelections: (longTokens: TokenSelection[], shortTokens: TokenSelection[]) => void;
|
|
24
24
|
resetToDefaults: () => void;
|
|
25
25
|
}
|
|
26
|
-
export declare const useUserSelection:
|
|
26
|
+
export declare const useUserSelection: any;
|
|
27
27
|
export type { UserSelectionState };
|
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.69",
|
|
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
|
-
"zustand": "^5.0.8"
|
|
27
|
+
"axios": "^1.6.0"
|
|
29
28
|
},
|
|
30
29
|
"peerDependencies": {
|
|
31
30
|
"react": "^18.0.0",
|