@pear-protocol/hyperliquid-sdk 0.0.78 → 0.1.0
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/README.md +1141 -0
- package/dist/clients/hyperliquid.d.ts +1 -1
- package/dist/clients/positions.d.ts +2 -2
- package/dist/clients/watchlist.d.ts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/useMarket.d.ts +8 -0
- package/dist/hooks/useMarketData.d.ts +1 -4
- package/dist/hooks/useTrading.d.ts +1 -2
- package/dist/index.d.ts +26 -123
- package/dist/index.js +554 -1198
- package/dist/store/hyperliquidDataStore.d.ts +3 -7
- package/dist/store/marketDataStore.d.ts +1 -3
- package/dist/store/tokenSelectionMetadataStore.d.ts +2 -4
- package/dist/types.d.ts +12 -31
- package/dist/utils/market-symbol.d.ts +5 -0
- package/dist/utils/position-processor.d.ts +2 -2
- package/dist/utils/token-metadata-extractor.d.ts +5 -9
- package/dist/utils/token-metadata-selectors.d.ts +4 -0
- package/package.json +1 -1
- package/dist/hooks/useWebData.d.ts +0 -30
- package/dist/utils/symbol-translator.d.ts +0 -40
|
@@ -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
|
|
5
|
+
export declare const fetchHistoricalCandles: (coin: string, startTime: number, endTime: number, interval: CandleInterval) => Promise<ApiResponse<CandleData[]>>;
|
|
6
6
|
/**
|
|
7
7
|
* Retrieve recent user fills from HyperLiquid and map to ExternalFillDto[]
|
|
8
8
|
*/
|
|
@@ -49,7 +49,7 @@ export interface CreatePositionResponseDto {
|
|
|
49
49
|
* @throws MinimumPositionSizeError if any asset has less than $11 USD value
|
|
50
50
|
* @throws MaxAssetsPerLegError if any leg exceeds the maximum allowed assets (15)
|
|
51
51
|
*/
|
|
52
|
-
export declare function createPosition(baseUrl: string, payload: CreatePositionRequestInput
|
|
52
|
+
export declare function createPosition(baseUrl: string, payload: CreatePositionRequestInput): Promise<ApiResponse<CreatePositionResponseDto>>;
|
|
53
53
|
export interface UpdateRiskParametersRequestInput {
|
|
54
54
|
stopLoss?: TpSlThresholdInput | null;
|
|
55
55
|
takeProfit?: TpSlThresholdInput | null;
|
|
@@ -116,7 +116,7 @@ export interface AdjustAdvanceResponseDto {
|
|
|
116
116
|
status: string;
|
|
117
117
|
executedAt: string;
|
|
118
118
|
}
|
|
119
|
-
export declare function adjustAdvancePosition(baseUrl: string, positionId: string, payload: AdjustAdvanceItemInput[]
|
|
119
|
+
export declare function adjustAdvancePosition(baseUrl: string, positionId: string, payload: AdjustAdvanceItemInput[]): Promise<ApiResponse<AdjustAdvanceResponseDto>>;
|
|
120
120
|
export declare function cancelTwap(baseUrl: string, orderId: string): Promise<ApiResponse<CancelTwapResponseDto>>;
|
|
121
121
|
export interface UpdateLeverageRequestInput {
|
|
122
122
|
leverage: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ApiResponse, ToggleWatchlistResponseDto, WatchlistAssetDto } from '../types';
|
|
2
|
-
export declare function toggleWatchlist(baseUrl: string, longAssets: WatchlistAssetDto[], shortAssets: WatchlistAssetDto[]
|
|
2
|
+
export declare function toggleWatchlist(baseUrl: string, longAssets: WatchlistAssetDto[], shortAssets: WatchlistAssetDto[]): Promise<ApiResponse<ToggleWatchlistResponseDto>>;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './useAccountSummary';
|
|
2
2
|
export * from './useTrading';
|
|
3
3
|
export * from './useUserSelection';
|
|
4
|
-
export * from './
|
|
4
|
+
export * from './useMarket';
|
|
5
5
|
export * from './useTokenSelectionMetadata';
|
|
6
6
|
export * from './useHistoricalPriceData';
|
|
7
7
|
export * from './useBasketCandles';
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import type { ActiveAssetGroupItem, ActiveAssetsResponse
|
|
1
|
+
import type { ActiveAssetGroupItem, ActiveAssetsResponse } from '../types';
|
|
2
2
|
export type CollateralFilter = 'USDC' | 'USDH' | 'ALL';
|
|
3
3
|
export declare const useMarketDataPayload: () => ActiveAssetsResponse | null;
|
|
4
|
-
export declare const useMarketDataAllPayload: () => ActiveAssetsAllResponse | null;
|
|
5
|
-
export declare const usePerpMetaAssets: () => UniverseAsset[] | null;
|
|
6
4
|
export declare const useActiveBaskets: (collateralFilter?: CollateralFilter) => ActiveAssetGroupItem[];
|
|
7
5
|
export declare const useTopGainers: (limit?: number, collateralFilter?: CollateralFilter) => ActiveAssetGroupItem[];
|
|
8
6
|
export declare const useTopLosers: (limit?: number, collateralFilter?: CollateralFilter) => ActiveAssetGroupItem[];
|
|
9
7
|
export declare const useHighlightedBaskets: (collateralFilter?: CollateralFilter) => ActiveAssetGroupItem[];
|
|
10
8
|
export declare const useWatchlistBaskets: (collateralFilter?: CollateralFilter) => ActiveAssetGroupItem[];
|
|
11
|
-
export declare const useAllBaskets: (collateralFilter?: CollateralFilter) => ActiveAssetGroupItem[];
|
|
12
9
|
export declare const useFindBasket: (longs: string[], shorts: string[]) => ActiveAssetGroupItem | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { OpenLimitOrderDto } from '../types';
|
|
2
|
-
import type { TradeHistoryDataDto } from '../types';
|
|
1
|
+
import type { OpenLimitOrderDto, TradeHistoryDataDto } from '../types';
|
|
3
2
|
export declare const useTradeHistories: () => {
|
|
4
3
|
data: TradeHistoryDataDto[] | null;
|
|
5
4
|
isLoading: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -224,8 +224,7 @@ interface TradeHistoryAssetDataDto {
|
|
|
224
224
|
externalFeePaid: number;
|
|
225
225
|
builderFeePaid: number;
|
|
226
226
|
realizedPnl: number;
|
|
227
|
-
|
|
228
|
-
collateralToken?: CollateralToken;
|
|
227
|
+
metadata?: TokenMetadata | null;
|
|
229
228
|
}
|
|
230
229
|
/**
|
|
231
230
|
* Trade history data structure
|
|
@@ -274,8 +273,7 @@ interface PositionAssetDetailDto {
|
|
|
274
273
|
liquidationPrice: number;
|
|
275
274
|
initialWeight: number;
|
|
276
275
|
fundingPaid?: number;
|
|
277
|
-
|
|
278
|
-
collateralToken?: CollateralToken;
|
|
276
|
+
metadata?: TokenMetadata | null;
|
|
279
277
|
}
|
|
280
278
|
interface TpSlThreshold {
|
|
281
279
|
type: 'PERCENTAGE' | 'DOLLAR' | 'POSITION_VALUE' | 'PRICE' | 'PRICE_RATIO' | 'WEIGHTED_RATIO';
|
|
@@ -312,8 +310,7 @@ interface OpenPositionDto {
|
|
|
312
310
|
interface OrderAssetDto {
|
|
313
311
|
asset: string;
|
|
314
312
|
weight: number;
|
|
315
|
-
|
|
316
|
-
collateralToken?: CollateralToken;
|
|
313
|
+
metadata?: TokenMetadata | null;
|
|
317
314
|
}
|
|
318
315
|
/**
|
|
319
316
|
* Order status
|
|
@@ -613,8 +610,7 @@ interface UniverseAsset {
|
|
|
613
610
|
maxLeverage: number;
|
|
614
611
|
onlyIsolated?: boolean;
|
|
615
612
|
isDelisted?: boolean;
|
|
616
|
-
|
|
617
|
-
collateralToken?: CollateralToken;
|
|
613
|
+
collateralToken: CollateralToken;
|
|
618
614
|
}
|
|
619
615
|
interface ClearinghouseState {
|
|
620
616
|
assetPositions: AssetPosition[];
|
|
@@ -685,8 +681,6 @@ interface RawAssetDto {
|
|
|
685
681
|
size: number;
|
|
686
682
|
side: string;
|
|
687
683
|
fundingPaid?: number;
|
|
688
|
-
marketPrefix?: string | null;
|
|
689
|
-
collateralToken?: CollateralToken;
|
|
690
684
|
leverage: number;
|
|
691
685
|
}
|
|
692
686
|
/**
|
|
@@ -722,6 +716,10 @@ interface ActiveAssetData {
|
|
|
722
716
|
markPx: string;
|
|
723
717
|
}
|
|
724
718
|
interface TokenMetadata {
|
|
719
|
+
assetName: string;
|
|
720
|
+
symbolName: string;
|
|
721
|
+
marketName: string;
|
|
722
|
+
isAtOiCaps: boolean;
|
|
725
723
|
currentPrice: number;
|
|
726
724
|
prevDayPrice: number;
|
|
727
725
|
priceChange24h: number;
|
|
@@ -756,30 +754,9 @@ interface AssetMarketData {
|
|
|
756
754
|
asset: WebData3AssetCtx | AssetCtx;
|
|
757
755
|
universe: UniverseAsset;
|
|
758
756
|
}
|
|
759
|
-
/**
|
|
760
|
-
* Nested market data structure for multi-market assets.
|
|
761
|
-
* Each symbol maps to its market variants (keyed by prefix).
|
|
762
|
-
* For non-HIP3 assets, use "default" as the key.
|
|
763
|
-
*
|
|
764
|
-
* @example
|
|
765
|
-
* ```ts
|
|
766
|
-
* {
|
|
767
|
-
* "TSLA": {
|
|
768
|
-
* "xyz": { asset: {...}, universe: { collateralToken: "USDC", ... } },
|
|
769
|
-
* "flx": { asset: {...}, universe: { collateralToken: "USDH", ... } }
|
|
770
|
-
* },
|
|
771
|
-
* "BTC": {
|
|
772
|
-
* "default": { asset: {...}, universe: {...} }
|
|
773
|
-
* }
|
|
774
|
-
* }
|
|
775
|
-
* ```
|
|
776
|
-
*/
|
|
777
|
-
type MarketDataBySymbol = Record<string, Record<string, AssetMarketData>>;
|
|
778
757
|
interface PairAssetDto {
|
|
779
758
|
asset: string;
|
|
780
759
|
weight: number;
|
|
781
|
-
collateralToken: CollateralToken;
|
|
782
|
-
marketPrefix: string | null;
|
|
783
760
|
}
|
|
784
761
|
interface ActiveAssetGroupItem {
|
|
785
762
|
longAssets: PairAssetDto[];
|
|
@@ -802,12 +779,6 @@ interface ActiveAssetsResponse {
|
|
|
802
779
|
highlighted: ActiveAssetGroupItem[];
|
|
803
780
|
watchlist: ActiveAssetGroupItem[];
|
|
804
781
|
}
|
|
805
|
-
interface ActiveAssetsAllResponse {
|
|
806
|
-
active: ActiveAssetGroupItem[];
|
|
807
|
-
all: ActiveAssetGroupItem[];
|
|
808
|
-
highlighted: ActiveAssetGroupItem[];
|
|
809
|
-
watchlist: ActiveAssetGroupItem[];
|
|
810
|
-
}
|
|
811
782
|
/**
|
|
812
783
|
* Candle interval options
|
|
813
784
|
*/
|
|
@@ -899,33 +870,11 @@ interface UserSelectionState {
|
|
|
899
870
|
declare const useUserSelection: () => UserSelectionState;
|
|
900
871
|
|
|
901
872
|
/**
|
|
902
|
-
* Hook to access webData
|
|
873
|
+
* Hook to access webData
|
|
903
874
|
*/
|
|
904
|
-
declare const
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
/**
|
|
908
|
-
* Market data keyed by symbol, with nested market variants.
|
|
909
|
-
* Each symbol maps to its market variants (keyed by prefix).
|
|
910
|
-
* For non-HIP3 assets, use "default" as the key.
|
|
911
|
-
*
|
|
912
|
-
* @example
|
|
913
|
-
* ```ts
|
|
914
|
-
* // HIP-3 asset with multiple markets
|
|
915
|
-
* marketDataBySymbol["TSLA"]["xyz"] // { asset, universe: { collateralToken: "USDC" } }
|
|
916
|
-
* marketDataBySymbol["TSLA"]["flx"] // { asset, universe: { collateralToken: "USDH" } }
|
|
917
|
-
*
|
|
918
|
-
* // Regular asset
|
|
919
|
-
* marketDataBySymbol["BTC"]["default"] // { asset, universe }
|
|
920
|
-
* ```
|
|
921
|
-
*/
|
|
922
|
-
marketDataBySymbol: MarketDataBySymbol;
|
|
923
|
-
/** Map of display name -> all full market names (e.g., "TSLA" -> ["xyz:TSLA", "flx:TSLA"]) */
|
|
924
|
-
hip3Assets: Map<string, string[]>;
|
|
925
|
-
/** Map of full market name -> prefix (e.g., "xyz:TSLA" -> "xyz") */
|
|
926
|
-
hip3MarketPrefixes: Map<string, string>;
|
|
927
|
-
isConnected: boolean;
|
|
928
|
-
error: string | null;
|
|
875
|
+
declare const useMarket: () => {
|
|
876
|
+
allTokenMetadata: TokenMetadata[];
|
|
877
|
+
getAssetByName: (symbol: string) => TokenMetadata | null;
|
|
929
878
|
};
|
|
930
879
|
|
|
931
880
|
interface UseTokenSelectionMetadataReturn {
|
|
@@ -1140,7 +1089,7 @@ interface CreatePositionResponseDto {
|
|
|
1140
1089
|
* @throws MinimumPositionSizeError if any asset has less than $11 USD value
|
|
1141
1090
|
* @throws MaxAssetsPerLegError if any leg exceeds the maximum allowed assets (15)
|
|
1142
1091
|
*/
|
|
1143
|
-
declare function createPosition(baseUrl: string, payload: CreatePositionRequestInput
|
|
1092
|
+
declare function createPosition(baseUrl: string, payload: CreatePositionRequestInput): Promise<ApiResponse<CreatePositionResponseDto>>;
|
|
1144
1093
|
interface UpdateRiskParametersRequestInput {
|
|
1145
1094
|
stopLoss?: TpSlThresholdInput | null;
|
|
1146
1095
|
takeProfit?: TpSlThresholdInput | null;
|
|
@@ -1207,7 +1156,7 @@ interface AdjustAdvanceResponseDto {
|
|
|
1207
1156
|
status: string;
|
|
1208
1157
|
executedAt: string;
|
|
1209
1158
|
}
|
|
1210
|
-
declare function adjustAdvancePosition(baseUrl: string, positionId: string, payload: AdjustAdvanceItemInput[]
|
|
1159
|
+
declare function adjustAdvancePosition(baseUrl: string, positionId: string, payload: AdjustAdvanceItemInput[]): Promise<ApiResponse<AdjustAdvanceResponseDto>>;
|
|
1211
1160
|
declare function cancelTwap(baseUrl: string, orderId: string): Promise<ApiResponse<CancelTwapResponseDto>>;
|
|
1212
1161
|
interface UpdateLeverageRequestInput {
|
|
1213
1162
|
leverage: number;
|
|
@@ -1272,14 +1221,11 @@ declare function useNotifications(): UseNotificationsResult;
|
|
|
1272
1221
|
|
|
1273
1222
|
type CollateralFilter = 'USDC' | 'USDH' | 'ALL';
|
|
1274
1223
|
declare const useMarketDataPayload: () => ActiveAssetsResponse | null;
|
|
1275
|
-
declare const useMarketDataAllPayload: () => ActiveAssetsAllResponse | null;
|
|
1276
|
-
declare const usePerpMetaAssets: () => UniverseAsset[] | null;
|
|
1277
1224
|
declare const useActiveBaskets: (collateralFilter?: CollateralFilter) => ActiveAssetGroupItem[];
|
|
1278
1225
|
declare const useTopGainers: (limit?: number, collateralFilter?: CollateralFilter) => ActiveAssetGroupItem[];
|
|
1279
1226
|
declare const useTopLosers: (limit?: number, collateralFilter?: CollateralFilter) => ActiveAssetGroupItem[];
|
|
1280
1227
|
declare const useHighlightedBaskets: (collateralFilter?: CollateralFilter) => ActiveAssetGroupItem[];
|
|
1281
1228
|
declare const useWatchlistBaskets: (collateralFilter?: CollateralFilter) => ActiveAssetGroupItem[];
|
|
1282
|
-
declare const useAllBaskets: (collateralFilter?: CollateralFilter) => ActiveAssetGroupItem[];
|
|
1283
1229
|
declare const useFindBasket: (longs: string[], shorts: string[]) => ActiveAssetGroupItem | undefined;
|
|
1284
1230
|
|
|
1285
1231
|
declare function useWatchlist(): {
|
|
@@ -1413,7 +1359,7 @@ declare function markNotificationReadById(baseUrl: string, id: string): Promise<
|
|
|
1413
1359
|
updated: number;
|
|
1414
1360
|
}>>;
|
|
1415
1361
|
|
|
1416
|
-
declare function toggleWatchlist(baseUrl: string, longAssets: WatchlistAssetDto[], shortAssets: WatchlistAssetDto[]
|
|
1362
|
+
declare function toggleWatchlist(baseUrl: string, longAssets: WatchlistAssetDto[], shortAssets: WatchlistAssetDto[]): Promise<ApiResponse<ToggleWatchlistResponseDto>>;
|
|
1417
1363
|
|
|
1418
1364
|
interface KalshiPriceRange {
|
|
1419
1365
|
start: string;
|
|
@@ -1539,28 +1485,24 @@ declare class ConflictDetector {
|
|
|
1539
1485
|
declare class TokenMetadataExtractor {
|
|
1540
1486
|
/**
|
|
1541
1487
|
* Extracts comprehensive token metadata
|
|
1542
|
-
* @param symbol - Token symbol (
|
|
1488
|
+
* @param symbol - Token symbol (e.g., "BTC", "TSLA")
|
|
1543
1489
|
* @param perpMetaAssets - Aggregated universe assets (flattened across dexes)
|
|
1544
1490
|
* @param finalAssetContexts - Aggregated asset contexts (flattened across dexes)
|
|
1545
1491
|
* @param allMids - AllMids data containing current prices
|
|
1546
1492
|
* @param activeAssetData - Optional active asset data containing leverage information
|
|
1547
|
-
* @param marketPrefix - Optional market prefix (e.g., "xyz", "flx") for HIP3 multi-market assets
|
|
1548
1493
|
* @returns TokenMetadata or null if token not found
|
|
1549
1494
|
*/
|
|
1550
|
-
static extractTokenMetadata(symbol: string, perpMetaAssets: UniverseAsset[] | null, finalAssetContexts: WebData3AssetCtx[] | null, allMids: WsAllMidsData | null, activeAssetData?: Record<string, ActiveAssetData> | null,
|
|
1495
|
+
static extractTokenMetadata(symbol: string, perpMetaAssets: UniverseAsset[] | null, finalAssetContexts: WebData3AssetCtx[] | null, allMids: WsAllMidsData | null, activeAssetData?: Record<string, ActiveAssetData> | null, finalAtOICaps?: string[] | null): TokenMetadata | null;
|
|
1551
1496
|
/**
|
|
1552
1497
|
* Extracts metadata for multiple tokens
|
|
1553
|
-
* @param tokens - Array of token
|
|
1498
|
+
* @param tokens - Array of token strings (e.g., "BTC", "TSLA")
|
|
1554
1499
|
* @param perpMetaAssets - Aggregated universe assets
|
|
1555
1500
|
* @param finalAssetContexts - Aggregated asset contexts
|
|
1556
1501
|
* @param allMids - AllMids data
|
|
1557
1502
|
* @param activeAssetData - Optional active asset data containing leverage information
|
|
1558
|
-
* @returns Record of
|
|
1503
|
+
* @returns Record of token string to TokenMetadata (keys match input tokens exactly)
|
|
1559
1504
|
*/
|
|
1560
|
-
static extractMultipleTokensMetadata(tokens:
|
|
1561
|
-
symbol: string;
|
|
1562
|
-
marketPrefix?: string | null;
|
|
1563
|
-
}>, perpMetaAssets: UniverseAsset[] | null, finalAssetContexts: WebData3AssetCtx[] | null, allMids: WsAllMidsData | null, activeAssetData?: Record<string, ActiveAssetData> | null): Record<string, TokenMetadata | null>;
|
|
1505
|
+
static extractMultipleTokensMetadata(tokens: string[], perpMetaAssets: UniverseAsset[] | null, finalAssetContexts: WebData3AssetCtx[] | null, allMids: WsAllMidsData | null, activeAssetData?: Record<string, ActiveAssetData> | null, finalAtOICaps?: string[] | null): Record<string, TokenMetadata | null>;
|
|
1564
1506
|
/**
|
|
1565
1507
|
* Checks if token data is available in aggregated universe assets
|
|
1566
1508
|
* @param symbol - Token symbol
|
|
@@ -1570,6 +1512,10 @@ declare class TokenMetadataExtractor {
|
|
|
1570
1512
|
static isTokenAvailable(symbol: string, perpMetaAssets: UniverseAsset[] | null): boolean;
|
|
1571
1513
|
}
|
|
1572
1514
|
|
|
1515
|
+
type TokenMetadataBySymbol = Record<string, TokenMetadata | null>;
|
|
1516
|
+
declare const selectTokenMetadataBySymbols: (tokenMetadata: TokenMetadataBySymbol, symbols: string[]) => TokenMetadataBySymbol;
|
|
1517
|
+
declare const getAssetByName: (tokenMetadata: TokenMetadataBySymbol, symbol: string) => TokenMetadata | null;
|
|
1518
|
+
|
|
1573
1519
|
/**
|
|
1574
1520
|
* Create efficient timestamp-based lookup maps for candle data
|
|
1575
1521
|
*/
|
|
@@ -1664,47 +1610,6 @@ declare function validatePositionSize(usdValue: number, longAssets?: PairAssetIn
|
|
|
1664
1610
|
minimumRequired?: number;
|
|
1665
1611
|
};
|
|
1666
1612
|
|
|
1667
|
-
/**
|
|
1668
|
-
* Convert a full/prefixed symbol (e.g., "xyz:XYZ100") to a display symbol (e.g., "XYZ100").
|
|
1669
|
-
*/
|
|
1670
|
-
declare function toDisplaySymbol(symbol: string): string;
|
|
1671
|
-
/**
|
|
1672
|
-
* Convert a display symbol back to backend form using a provided map.
|
|
1673
|
-
* If mapping is missing, returns the original symbol.
|
|
1674
|
-
* For multi-market assets, returns the first available market.
|
|
1675
|
-
* @param displaySymbol e.g., "TSLA"
|
|
1676
|
-
* @param hip3Assets map of display -> all full market names (e.g., "TSLA" -> ["xyz:TSLA", "flx:TSLA"])
|
|
1677
|
-
*/
|
|
1678
|
-
declare function toBackendSymbol(displaySymbol: string, hip3Assets: Map<string, string[]>): string;
|
|
1679
|
-
/**
|
|
1680
|
-
* Convert a display symbol to backend form for a specific market prefix.
|
|
1681
|
-
* This is useful when an asset is available on multiple markets (e.g., xyz:TSLA and flx:TSLA).
|
|
1682
|
-
* @param displaySymbol e.g., "TSLA"
|
|
1683
|
-
* @param marketPrefix e.g., "xyz" or "flx"
|
|
1684
|
-
* @param hip3Assets map of display -> all full market names
|
|
1685
|
-
* @returns Full market name if found, null if prefix not specified for multi-market asset, otherwise displaySymbol with prefix
|
|
1686
|
-
*/
|
|
1687
|
-
declare function toBackendSymbolWithMarket(displaySymbol: string, marketPrefix: string | undefined, hip3Assets: Map<string, string[]>): string | null;
|
|
1688
|
-
/**
|
|
1689
|
-
* Get all available markets for a display symbol.
|
|
1690
|
-
* @param displaySymbol e.g., "TSLA"
|
|
1691
|
-
* @param hip3Assets map of display -> all full market names
|
|
1692
|
-
* @returns Array of full market names, e.g., ["xyz:TSLA", "flx:TSLA"]
|
|
1693
|
-
*/
|
|
1694
|
-
declare function getAvailableMarkets(displaySymbol: string, hip3Assets: Map<string, string[]>): string[];
|
|
1695
|
-
/**
|
|
1696
|
-
* Extract the market prefix from a full market name.
|
|
1697
|
-
* @param fullSymbol e.g., "xyz:TSLA"
|
|
1698
|
-
* @returns The prefix (e.g., "xyz") or undefined if no prefix
|
|
1699
|
-
*/
|
|
1700
|
-
declare function getMarketPrefix(fullSymbol: string): string | undefined;
|
|
1701
|
-
/**
|
|
1702
|
-
* Check if a symbol is a HIP-3 market (has a prefix).
|
|
1703
|
-
* @param symbol e.g., "xyz:TSLA" or "TSLA"
|
|
1704
|
-
* @returns true if the symbol has a market prefix
|
|
1705
|
-
*/
|
|
1706
|
-
declare function isHip3Market(symbol: string): boolean;
|
|
1707
|
-
|
|
1708
1613
|
/**
|
|
1709
1614
|
* Helper functions to safely extract values from order parameters
|
|
1710
1615
|
* based on the order type and parameter structure.
|
|
@@ -1764,12 +1669,10 @@ declare function getOrderTrailingInfo(order: OpenLimitOrderDto): {
|
|
|
1764
1669
|
|
|
1765
1670
|
interface MarketDataState {
|
|
1766
1671
|
marketData: ActiveAssetsResponse | null;
|
|
1767
|
-
marketDataAll: ActiveAssetsAllResponse | null;
|
|
1768
1672
|
setMarketData: (value: ActiveAssetsResponse | null) => void;
|
|
1769
|
-
setMarketDataAll: (value: ActiveAssetsAllResponse | null) => void;
|
|
1770
1673
|
clean: () => void;
|
|
1771
1674
|
}
|
|
1772
1675
|
declare const useMarketData: zustand.UseBoundStore<zustand.StoreApi<MarketDataState>>;
|
|
1773
1676
|
|
|
1774
|
-
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, executeSpotOrder,
|
|
1775
|
-
export type { AccountSummaryResponseDto, ActiveAssetGroupItem, ActiveAssetsResponse, AdjustAdvanceAssetInput, AdjustAdvanceItemInput, AdjustAdvanceResponseDto, AdjustExecutionType, AdjustOrderRequestInput, AdjustOrderResponseDto, AdjustPositionRequestInput, AdjustPositionResponseDto, AgentWalletDto, AgentWalletState, ApiErrorResponse, ApiResponse, AssetCtx, AssetInformationDetail, AssetMarketData, AssetPosition, BalanceSummaryDto, BaseTriggerOrderNotificationParams, BtcDomTriggerParams, CancelOrderResponseDto, CancelTwapResponseDto, CandleChartData, CandleData, CandleInterval, CandleSnapshotRequest, ClearinghouseState, CloseAllPositionsResponseDto, CloseAllPositionsResultDto, CloseExecutionType, ClosePositionRequestInput, ClosePositionResponseDto, CollateralFilter, CollateralToken, CreatePositionRequestInput, CreatePositionResponseDto, CrossAssetPriceTriggerParams, CrossMarginSummaryDto, CumFundingDto, ExecutionType, ExtraAgent, GetKalshiMarketsParams, HLWebSocketResponse, HistoricalRange, KalshiMarket, KalshiMarketsResponse, KalshiMveLeg, KalshiPriceRange, LadderConfigInput, MarginSummaryDto,
|
|
1677
|
+
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, executeSpotOrder, getAssetByName, getCompleteTimestamps, getKalshiMarkets, getOrderDirection, getOrderLadderConfig, getOrderLeverage, getOrderReduceOnly, getOrderTpSlTriggerType, getOrderTrailingInfo, getOrderTriggerType, getOrderTriggerValue, getOrderTwapDuration, getOrderUsdValue, getPortfolio, isBtcDomOrder, mapCandleIntervalToTradingViewInterval, mapTradingViewIntervalToCandleInterval, markNotificationReadById, markNotificationsRead, selectTokenMetadataBySymbols, toggleWatchlist, updateLeverage, updateRiskParameters, useAccountSummary, useActiveBaskets, useAgentWallet, useAllUserBalances, useAuth, useBasketCandles, useFindBasket, useHighlightedBaskets, useHistoricalPriceData, useHistoricalPriceDataStore, useHyperliquidNativeWebSocket, useHyperliquidUserFills, useHyperliquidWebSocket, useMarket, useMarketData, useMarketDataPayload, useNotifications, useOpenOrders, useOrders, usePearHyperliquid, usePerformanceOverlays, usePortfolio, usePosition, useSpotOrder, useTokenSelectionMetadata, useTopGainers, useTopLosers, useTradeHistories, useTwap, useUserSelection, useWatchlist, useWatchlistBaskets, validateMaxAssetsPerLeg, validateMinimumAssetSize, validatePositionSize };
|
|
1678
|
+
export type { AccountSummaryResponseDto, ActiveAssetGroupItem, ActiveAssetsResponse, AdjustAdvanceAssetInput, AdjustAdvanceItemInput, AdjustAdvanceResponseDto, AdjustExecutionType, AdjustOrderRequestInput, AdjustOrderResponseDto, AdjustPositionRequestInput, AdjustPositionResponseDto, AgentWalletDto, AgentWalletState, ApiErrorResponse, ApiResponse, AssetCtx, AssetInformationDetail, AssetMarketData, AssetPosition, BalanceSummaryDto, BaseTriggerOrderNotificationParams, BtcDomTriggerParams, CancelOrderResponseDto, CancelTwapResponseDto, CandleChartData, CandleData, CandleInterval, CandleSnapshotRequest, ClearinghouseState, CloseAllPositionsResponseDto, CloseAllPositionsResultDto, CloseExecutionType, ClosePositionRequestInput, ClosePositionResponseDto, CollateralFilter, CollateralToken, CreatePositionRequestInput, CreatePositionResponseDto, CrossAssetPriceTriggerParams, CrossMarginSummaryDto, CumFundingDto, ExecutionType, ExtraAgent, GetKalshiMarketsParams, HLWebSocketResponse, HistoricalRange, KalshiMarket, KalshiMarketsResponse, KalshiMveLeg, KalshiPriceRange, LadderConfigInput, MarginSummaryDto, NotificationCategory, NotificationDto, OpenLimitOrderDto, OpenPositionDto, OrderAssetDto, OrderStatus, PairAssetDto, PairAssetInput, PerformanceOverlay, PlatformAccountSummaryResponseDto, PortfolioBucketDto, PortfolioInterval, PortfolioIntervalsDto, PortfolioOverallDto, PortfolioResponseDto, PositionAdjustmentType, PositionAssetDetailDto, PredictionMarketOutcomeTriggerParams, PriceRatioTriggerParams, PriceTriggerParams, RealtimeBar, RealtimeBarsCallback, SpotBalance, SpotOrderFilledStatus, SpotOrderHyperliquidData, SpotOrderHyperliquidResult, SpotOrderRequestInput, SpotOrderResponseDto, SpotState, ToggleWatchlistResponseDto, TokenConflict, TokenHistoricalPriceData, TokenMetadata, TokenSelection, TpSlOrderParameters, TpSlThresholdInput, TpSlThresholdType, TpSlTriggerType, TradeHistoryAssetDataDto, TradeHistoryDataDto, TriggerOrderNotificationAsset, TriggerOrderNotificationParams, TriggerOrderNotificationType, TriggerOrderParameters, TriggerType, TwapChunkStatusDto, TwapMonitoringDto, TwapSliceFillResponseItem, UniverseAsset, UpdateLeverageRequestInput, UpdateLeverageResponseDto, UpdateRiskParametersRequestInput, UpdateRiskParametersResponseDto, UseAuthOptions, UseBasketCandlesReturn, UseHistoricalPriceDataReturn, UseHyperliquidUserFillsOptions, UseHyperliquidUserFillsState, UseNotificationsResult, UsePerformanceOverlaysReturn, UsePortfolioResult, UseSpotOrderResult, UseTokenSelectionMetadataReturn, UserProfile, UserSelectionState, WatchlistItemDto, WebSocketAckResponse, WebSocketChannel, WebSocketConnectionState, WebSocketDataMessage, WebSocketMessage, WebSocketSubscribeMessage, WsAllMidsData };
|