@pear-protocol/hyperliquid-sdk 0.0.66-usdh-1 → 0.0.67

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.
@@ -2,7 +2,7 @@ import type { ApiResponse, CandleInterval, CandleData, ExternalFillDto, AllPerpM
2
2
  /**
3
3
  * Fetch historical candle data from HyperLiquid API
4
4
  */
5
- export declare const fetchHistoricalCandles: (coin: string, startTime: number, endTime: number, interval: CandleInterval, hip3Assets: Map<string, string[]>) => Promise<ApiResponse<CandleData[]>>;
5
+ export declare const fetchHistoricalCandles: (coin: string, startTime: number, endTime: number, interval: CandleInterval, displayToFull: Map<string, string>) => Promise<ApiResponse<CandleData[]>>;
6
6
  /**
7
7
  * Retrieve recent user fills from HyperLiquid and map to ExternalFillDto[]
8
8
  */
@@ -22,44 +22,3 @@ export interface CancelTwapResponseDto {
22
22
  cancelledAt: string;
23
23
  }
24
24
  export declare function cancelTwapOrder(baseUrl: string, orderId: string): Promise<ApiResponse<CancelTwapResponseDto>>;
25
- export interface SpotOrderRequestInput {
26
- /** Asset to buy/sell (e.g., "USDH") */
27
- asset: string;
28
- /** Whether to buy (true) or sell (false) the asset */
29
- isBuy: boolean;
30
- /** Amount of asset to buy/sell (minimum: 11) */
31
- amount: number;
32
- }
33
- /** Filled order status from Hyperliquid */
34
- export interface SpotOrderFilledStatus {
35
- filled: {
36
- totalSz: string;
37
- avgPx: string;
38
- oid: number;
39
- cloid: string;
40
- };
41
- }
42
- /** Hyperliquid order response data */
43
- export interface SpotOrderHyperliquidData {
44
- statuses: SpotOrderFilledStatus[];
45
- }
46
- /** Hyperliquid result from spot order execution */
47
- export interface SpotOrderHyperliquidResult {
48
- status: 'ok' | 'error';
49
- response: {
50
- type: 'order';
51
- data: SpotOrderHyperliquidData;
52
- };
53
- }
54
- export interface SpotOrderResponseDto {
55
- orderId: string;
56
- status: 'EXECUTED' | 'FAILED' | 'PENDING';
57
- asset: string;
58
- createdAt: string;
59
- hyperliquidResult?: SpotOrderHyperliquidResult;
60
- }
61
- /**
62
- * Execute a spot order (swap) using Pear Hyperliquid service
63
- * POST /orders/spot
64
- */
65
- export declare function executeSpotOrder(baseUrl: string, payload: SpotOrderRequestInput): Promise<ApiResponse<SpotOrderResponseDto>>;
@@ -57,7 +57,7 @@ export interface CreatePositionResponseDto {
57
57
  * @throws MinimumPositionSizeError if any asset has less than $11 USD value
58
58
  * @throws MaxAssetsPerLegError if any leg exceeds the maximum allowed assets (15)
59
59
  */
60
- export declare function createPosition(baseUrl: string, payload: CreatePositionRequestInput, hip3Assets: Map<string, string[]>): Promise<ApiResponse<CreatePositionResponseDto>>;
60
+ export declare function createPosition(baseUrl: string, payload: CreatePositionRequestInput, displayToFull: Map<string, string>): Promise<ApiResponse<CreatePositionResponseDto>>;
61
61
  export interface UpdateRiskParametersRequestInput {
62
62
  stopLoss?: TpSlThresholdInput | null;
63
63
  takeProfit?: TpSlThresholdInput | null;
@@ -124,5 +124,5 @@ export interface AdjustAdvanceResponseDto {
124
124
  status: string;
125
125
  executedAt: string;
126
126
  }
127
- export declare function adjustAdvancePosition(baseUrl: string, positionId: string, payload: AdjustAdvanceItemInput[], hip3Assets: Map<string, string[]>): Promise<ApiResponse<AdjustAdvanceResponseDto>>;
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>>;
@@ -1,2 +1,2 @@
1
1
  import type { ApiResponse, ToggleWatchlistResponseDto, WatchlistAssetDto } from '../types';
2
- export declare function toggleWatchlist(baseUrl: string, longAssets: WatchlistAssetDto[], shortAssets: WatchlistAssetDto[], hip3Assets: Map<string, string[]>): Promise<ApiResponse<ToggleWatchlistResponseDto>>;
2
+ export declare function toggleWatchlist(baseUrl: string, longAssets: WatchlistAssetDto[], shortAssets: WatchlistAssetDto[], displayToFull: Map<string, string>): Promise<ApiResponse<ToggleWatchlistResponseDto>>;
@@ -10,11 +10,9 @@ export * from './useAgentWallet';
10
10
  export * from './useAutoSyncFills';
11
11
  export * from './usePosition';
12
12
  export * from './useOrders';
13
- export * from './useSpotOrder';
14
13
  export * from './useTwap';
15
14
  export * from './useNotifications';
16
15
  export * from './useMarketData';
17
16
  export * from './useWatchlist';
18
17
  export * from './usePortfolio';
19
18
  export * from './useAuth';
20
- export * from './useSpotBalances';
@@ -1,12 +1,10 @@
1
- import type { ActiveAssetGroupItem, ActiveAssetsResponse, ActiveAssetsAllResponse, UniverseAsset } from '../types';
2
- export type CollateralFilter = 'USDC' | 'USDH' | 'ALL';
1
+ import type { ActiveAssetGroupItem, ActiveAssetsResponse, ActiveAssetsAllResponse } from '../types';
3
2
  export declare const useMarketDataPayload: () => ActiveAssetsResponse | null;
4
3
  export declare const useMarketDataAllPayload: () => ActiveAssetsAllResponse | null;
5
- export declare const usePerpMetaAssets: () => UniverseAsset[] | null;
6
- export declare const useActiveBaskets: (collateralFilter?: CollateralFilter) => ActiveAssetGroupItem[];
7
- export declare const useTopGainers: (limit?: number, collateralFilter?: CollateralFilter) => ActiveAssetGroupItem[];
8
- export declare const useTopLosers: (limit?: number, collateralFilter?: CollateralFilter) => ActiveAssetGroupItem[];
9
- export declare const useHighlightedBaskets: (collateralFilter?: CollateralFilter) => ActiveAssetGroupItem[];
10
- export declare const useWatchlistBaskets: (collateralFilter?: CollateralFilter) => ActiveAssetGroupItem[];
11
- export declare const useAllBaskets: (collateralFilter?: CollateralFilter) => ActiveAssetGroupItem[];
4
+ export declare const useActiveBaskets: () => ActiveAssetGroupItem[];
5
+ export declare const useTopGainers: (limit?: number) => ActiveAssetGroupItem[];
6
+ export declare const useTopLosers: (limit?: number) => ActiveAssetGroupItem[];
7
+ export declare const useHighlightedBaskets: () => ActiveAssetGroupItem[];
8
+ export declare const useWatchlistBaskets: () => ActiveAssetGroupItem[];
9
+ export declare const useAllBaskets: () => ActiveAssetGroupItem[];
12
10
  export declare const useFindBasket: (longs: string[], shorts: string[]) => ActiveAssetGroupItem | undefined;
@@ -4,6 +4,9 @@ export declare const useTradeHistories: () => {
4
4
  data: TradeHistoryDataDto[] | null;
5
5
  isLoading: boolean;
6
6
  };
7
+ /**
8
+ * Hook to access open orders with loading state
9
+ */
7
10
  export declare const useOpenOrders: () => {
8
11
  data: OpenLimitOrderDto[] | null;
9
12
  isLoading: boolean;
@@ -1,30 +1,12 @@
1
- import type { ClearinghouseState, MarketDataBySymbol } from '../types';
1
+ import type { AssetMarketData, ClearinghouseState } from '../types';
2
2
  /**
3
3
  * Hook to access webData and native WebSocket state
4
4
  */
5
5
  export declare const useWebData: () => {
6
6
  clearinghouseState: ClearinghouseState | null;
7
7
  perpsAtOpenInterestCap: string[] | null;
8
- /**
9
- * Market data keyed by symbol, with nested market variants.
10
- * Each symbol maps to its market variants (keyed by prefix).
11
- * For non-HIP3 assets, use "default" as the key.
12
- *
13
- * @example
14
- * ```ts
15
- * // HIP-3 asset with multiple markets
16
- * marketDataBySymbol["TSLA"]["xyz"] // { asset, universe: { collateralToken: "USDC" } }
17
- * marketDataBySymbol["TSLA"]["flx"] // { asset, universe: { collateralToken: "USDH" } }
18
- *
19
- * // Regular asset
20
- * marketDataBySymbol["BTC"]["default"] // { asset, universe }
21
- * ```
22
- */
23
- marketDataBySymbol: MarketDataBySymbol;
24
- /** Map of display name -> all full market names (e.g., "TSLA" -> ["xyz:TSLA", "flx:TSLA"]) */
25
- hip3Assets: Map<string, string[]>;
26
- /** Map of full market name -> prefix (e.g., "xyz:TSLA" -> "xyz") */
27
- hip3MarketPrefixes: Map<string, string>;
8
+ marketDataBySymbol: Record<string, AssetMarketData>;
9
+ hip3Assets: Map<string, string>;
28
10
  isConnected: boolean;
29
11
  error: string | null;
30
12
  };