@liberfi.io/ui-perpetuals 0.2.14 → 0.2.16
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/index.d.mts +64 -14
- package/dist/index.d.ts +64 -14
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.d.mts
CHANGED
|
@@ -12,7 +12,7 @@ declare global {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
declare const _default: "0.2.
|
|
15
|
+
declare const _default: "0.2.16";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Trading pair symbol format
|
|
@@ -105,6 +105,25 @@ interface Kline {
|
|
|
105
105
|
/** Kline end timestamp (milliseconds) */
|
|
106
106
|
closeTimestamp: number;
|
|
107
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Optional query window for {@link IPerpetualsClient.getKlines}.
|
|
110
|
+
*
|
|
111
|
+
* - `from` / `to` are millisecond epochs. When both are provided, providers
|
|
112
|
+
* return candles whose open timestamp falls inside `[from, to]`.
|
|
113
|
+
* - `limit` (when provided alongside a range) caps the response size on the
|
|
114
|
+
* client side; without `limit`, the provider returns whatever the backend
|
|
115
|
+
* allows for the given window.
|
|
116
|
+
*
|
|
117
|
+
* Required by chart UIs (e.g. TradingView) for backward history pagination.
|
|
118
|
+
*/
|
|
119
|
+
interface KlineQueryOptions {
|
|
120
|
+
/** Start of the window (ms epoch). */
|
|
121
|
+
from?: number;
|
|
122
|
+
/** End of the window (ms epoch, exclusive). */
|
|
123
|
+
to?: number;
|
|
124
|
+
/** Optional cap on the number of candles returned. */
|
|
125
|
+
limit?: number;
|
|
126
|
+
}
|
|
108
127
|
/**
|
|
109
128
|
* Order book price level
|
|
110
129
|
*/
|
|
@@ -446,14 +465,25 @@ interface IPerpetualsClient {
|
|
|
446
465
|
*/
|
|
447
466
|
getMarkets(symbols?: string[]): Promise<MarketData[]>;
|
|
448
467
|
/**
|
|
449
|
-
* Get kline data
|
|
468
|
+
* Get kline data.
|
|
469
|
+
*
|
|
470
|
+
* Two call shapes are supported:
|
|
471
|
+
*
|
|
472
|
+
* - `getKlines(symbol, interval, limit)` — legacy form: returns the last
|
|
473
|
+
* `limit` candles ending at "now". Defaults to 100.
|
|
474
|
+
* - `getKlines(symbol, interval, { from, to, limit? })` — range form:
|
|
475
|
+
* returns candles whose open timestamp falls inside `[from, to]`
|
|
476
|
+
* (millisecond epochs). Required for TradingView-style backward
|
|
477
|
+
* history pagination.
|
|
478
|
+
*
|
|
450
479
|
* @param symbol Trading pair symbol, e.g. "BTC-USDC"
|
|
451
480
|
* @param interval Time interval, e.g. "1h"
|
|
452
|
-
* @param
|
|
453
|
-
*
|
|
481
|
+
* @param limitOrOptions Either a `limit` number (legacy) or a
|
|
482
|
+
* `{ from, to, limit? }` options object (range form).
|
|
483
|
+
* @returns Array of kline data, ascending by timestamp.
|
|
454
484
|
* @throws {Error} Network error or API error
|
|
455
485
|
*/
|
|
456
|
-
getKlines(symbol: string, interval: KlineInterval,
|
|
486
|
+
getKlines(symbol: string, interval: KlineInterval, limitOrOptions?: number | KlineQueryOptions): Promise<Kline[]>;
|
|
457
487
|
/**
|
|
458
488
|
* Get order book
|
|
459
489
|
* @param symbol Trading pair symbol, e.g. "BTC-USDC"
|
|
@@ -668,14 +698,21 @@ declare class HyperliquidPerpetualsClient implements IPerpetualsClient {
|
|
|
668
698
|
*/
|
|
669
699
|
getMarkets(symbols?: string[]): Promise<MarketData[]>;
|
|
670
700
|
/**
|
|
671
|
-
*
|
|
672
|
-
*
|
|
673
|
-
*
|
|
674
|
-
* @
|
|
675
|
-
*
|
|
676
|
-
*
|
|
701
|
+
* Fetch kline / candlestick data.
|
|
702
|
+
*
|
|
703
|
+
* Supports both shapes documented on
|
|
704
|
+
* {@link IPerpetualsClient.getKlines}:
|
|
705
|
+
*
|
|
706
|
+
* - `getKlines(symbol, interval, limit)` — last `limit` candles ending now.
|
|
707
|
+
* - `getKlines(symbol, interval, { from, to, limit? })` — explicit window
|
|
708
|
+
* for backward history pagination (TradingView pan).
|
|
709
|
+
*
|
|
710
|
+
* Maps to Hyperliquid's `candleSnapshot` which natively accepts
|
|
711
|
+
* `startTime` / `endTime` (ms epochs).
|
|
712
|
+
*
|
|
713
|
+
* @throws {HyperliquidApiError}
|
|
677
714
|
*/
|
|
678
|
-
getKlines(symbol: string, interval: KlineInterval,
|
|
715
|
+
getKlines(symbol: string, interval: KlineInterval, limitOrOptions?: number | KlineQueryOptions): Promise<Kline[]>;
|
|
679
716
|
/**
|
|
680
717
|
* Get the order book.
|
|
681
718
|
*
|
|
@@ -1151,7 +1188,7 @@ declare class LiberFiPerpetualsClient implements IPerpetualsClient {
|
|
|
1151
1188
|
getSupportedCoins(): Promise<string[]>;
|
|
1152
1189
|
getMarket(symbol: string): Promise<MarketData | null>;
|
|
1153
1190
|
getMarkets(symbols?: string[]): Promise<MarketData[]>;
|
|
1154
|
-
getKlines(symbol: string, interval: KlineInterval,
|
|
1191
|
+
getKlines(symbol: string, interval: KlineInterval, limitOrOptions?: number | KlineQueryOptions): Promise<Kline[]>;
|
|
1155
1192
|
getOrderBook(symbol: string, maxLevel?: number, options?: {
|
|
1156
1193
|
nSigFigs?: number;
|
|
1157
1194
|
mantissa?: number;
|
|
@@ -1972,6 +2009,19 @@ type UseCoinInfoReturnType = {
|
|
|
1972
2009
|
};
|
|
1973
2010
|
declare function useCoinInfo(symbol: string): UseCoinInfoReturnType;
|
|
1974
2011
|
|
|
2012
|
+
/**
|
|
2013
|
+
* Skeleton placeholder for {@link CoinInfoUI}.
|
|
2014
|
+
*
|
|
2015
|
+
* Mirrors the real component's flex layout so the loading shell occupies
|
|
2016
|
+
* exactly the same footprint (no layout jump on data arrival):
|
|
2017
|
+
* `[price + 24h%] [Oracle] [24h Volume] [Open Interest] [Funding / Countdown]`
|
|
2018
|
+
*
|
|
2019
|
+
* The container is intentionally transparent — coin-info renders inside
|
|
2020
|
+
* the perpetuals chart column whose host page provides the background
|
|
2021
|
+
* (e.g. `#000000` on the perpetuals page). A separate gray wash here
|
|
2022
|
+
* would clash with that. Only the individual `Skeleton` cells carry the
|
|
2023
|
+
* shimmer to indicate loading.
|
|
2024
|
+
*/
|
|
1975
2025
|
declare function CoinInfoSkeletonsUI(): react_jsx_runtime.JSX.Element;
|
|
1976
2026
|
|
|
1977
2027
|
declare function CoinInfoNotFoundUI(): react_jsx_runtime.JSX.Element;
|
|
@@ -2585,4 +2635,4 @@ interface HyperliquidInitWidgetProps extends Pick<UseHyperliquidSetupOptions, "a
|
|
|
2585
2635
|
}
|
|
2586
2636
|
declare function HyperliquidInitWidget({ adapter, userAddress, steps, autoLoad, onComplete, onError, onDismiss, className, }: HyperliquidInitWidgetProps): react_jsx_runtime.JSX.Element;
|
|
2587
2637
|
|
|
2588
|
-
export { type Account, type ApproveBuilderFeeParams, type CancelOrderParams, type CancelOrderResult, type Coin, CoinInfoNotFoundUI, CoinInfoSkeletonsUI, CoinInfoUI, type CoinInfoUIProps, CoinInfoWidget, type CoinInfoWidgetProps, DEFAULT_ORDER_BOOK_PRECISION_OPTIONS, type DepositBreakdown, DepositConfirmUI, type DepositConfirmUIProps, type DepositErrorInfo, type DepositEvent, DepositFlowWidget, type DepositFlowWidgetProps, DepositFormUI, type DepositFormUIProps, type DepositPhase, type DepositQuoteRequest, type DepositQuoteResponse, type DepositSource, type DepositState, type DepositStatus, type DepositStatusResponse, type DepositStatusTransition, DepositStatusUI, type DepositStatusUIProps, type DepositSubmitRequest, type DepositSubmitResponse, type ExecuteDepositInput, type GetOpenOrdersParams, type GetOpenOrdersResult, type GetPositionsParams, type GetPositionsResult, type GetTradesParams, type GetTradesResult, HL_USDC_DECIMALS, type HyperliquidAccountState, HyperliquidApiError, type HyperliquidClientConfig, type HyperliquidEnvironment, HyperliquidInitUI, type HyperliquidInitUIProps, HyperliquidInitWidget, type HyperliquidInitWidgetProps, HyperliquidPerpetualsClient, type HyperliquidSetupActionResult, type IHyperliquidSetupAdapter, type IPerpDepositClient, type IPerpetualsClient, type Kline, type KlineInterval, LiberFiApiError, type LiberFiHttpMethod, type RequestOptions as LiberFiHttpRequestOptions, LiberFiHttpTransport, type LiberFiHttpTransportConfig, LiberFiPerpDepositClient, type LiberFiPerpDepositClientConfig, LiberFiPerpetualsClient, type LiberFiPerpetualsClientConfig, type MarketData, type MarketDataType, OpenOrdersEmpty, OpenOrdersSkeleton, OpenOrdersUI, type OpenOrdersUIProps, OpenOrdersWidget, type OpenOrdersWidgetProps, type Order, type OrderBook, type OrderBookAggregationOptions, type OrderBookLevel, OrderBookUI, type OrderBookUIProps, OrderBookWidget, type OrderBookWidgetProps, type OrderSide, type OrderStatus, type OrderType, PerpetualsContext, type PerpetualsContextValue, PerpetualsProvider, type PerpetualsProviderProps, type PlaceOrderFormData, PlaceOrderFormUI, type PlaceOrderFormUIProps, PlaceOrderFormWidget, type PlaceOrderFormWidgetProps, type PlaceOrderParams, type PlaceOrderResult, type Position, PositionsEmpty, PositionsSkeleton, PositionsUI, type PositionsUIProps, PositionsWidget, type PositionsWidgetProps, type PriceLevel, SearchCoinsUI, type SearchCoinsUIProps, SearchCoinsWidget, type SearchCoinsWidgetProps, type SetReferrerParams, type SetupAction, type SetupPhase, type SetupState, type SetupStep, type SetupStepId, type SignAndBroadcastSolanaTx, type SignTypedDataFn, type StepRecord, type StepStatus, type Symbol, TERMINAL_DEPOSIT_STATUSES, type TimeRange, type Trade, type TradeHistory, TradeHistoryEmpty, TradeHistorySkeleton, TradeHistoryUI, type TradeHistoryUIProps, TradeHistoryWidget, type TradeHistoryWidgetProps, type TradeSide, TradesUI, type TradesUIProps, TradesWidget, type TradesWidgetProps, type TradingProvider, type UpdateLeverageParams, type UseCancelOrderMutationParams, type UseCandlesSubscriptionParams, type UseCandlesSubscriptionResult, type UseCoinInfoReturnType, type UseCreateOrderMutationParams, type UseHyperliquidSetupOptions, type UseHyperliquidSetupResult, type UseKlinesQueryParams, type UseMarketDataSubscriptionParams, type UseMarketDataSubscriptionResult, type UseMarketQueryParams, type UseMarketsQueryParams, type UseOpenOrdersScriptParams, type UseOpenOrdersScriptResult, type UseOrderBookQueryParams, type UseOrderBookScriptParams, type UseOrderBookScriptResult, type UseOrdersQueryParams, type UsePerpDepositExecuteResult, type UsePerpDepositQuoteOptions, type UsePerpDepositStatusOptions, type UsePlaceOrderFormScriptParams, type UsePlaceOrderFormScriptResult, type UsePositionsQueryParams, type UsePositionsScriptParams, type UsePositionsScriptResult, type UseRecentTradesQueryParams, type UseSearchCoinsScriptParams, type UseSearchCoinsScriptResult, type UseTradeHistoryScriptParams, type UseTradeHistoryScriptResult, type UseTradesQueryParams, type UseTradesScriptParams, type UseTradesScriptResult, type UseUserDataSubscriptionParams, type UseUserDataSubscriptionResult, type UserDataType, aggregationFromStep, cancelOrder, classifyStep, coinsQueryKey, createOrder, currentBreakdown as currentDepositBreakdown, currentStatus as currentDepositStatus, fetchCoins, fetchKlines, fetchMarket, fetchMarkets, fetchOrderBook, fetchOrders, fetchPerpDepositQuote, fetchPerpDepositStatus, fetchPositions, fetchRecentTrades, fetchTrades, hlUsdcRawToUsdc, initialDepositState, initialSetupState, isPolling as isDepositPolling, isTerminal as isDepositTerminal, isTerminalLifecycle as isTerminalDepositLifecycle, klinesQueryKey, lamportsToSol, marketQueryKey, marketsQueryKey, microUsdcToUsdc, nextRunnableStep, orderBookQueryKey, ordersQueryKey, perpDepositQuoteQueryKey, perpDepositStatusQueryKey, positionsQueryKey, recentTradesQueryKey, reduceDepositState, reduceSetupState, secondsUntil, shortAddress, solToLamports, tradesQueryKey, useCancelOrderMutation, useCandlesSubscription, useCoinInfo, useCoinsQuery, useCreateOrderMutation, useHyperliquidSetup, useKlinesQuery, useMarketDataSubscription, useMarketQuery, useMarketsQuery, useOpenOrdersScript, useOrderBookQuery, useOrderBookScript, useOrdersQuery, usePerpDepositClient, usePerpDepositClientMaybe, usePerpDepositExecute, usePerpDepositQuote, usePerpDepositStatus, usePerpetualsClient, usePlaceOrderFormScript, usePositionsQuery, usePositionsScript, useRecentTradesQuery, useSearchCoinsScript, useTradeHistoryScript, useTradesQuery, useTradesScript, useUserDataSubscription, _default as version };
|
|
2638
|
+
export { type Account, type ApproveBuilderFeeParams, type CancelOrderParams, type CancelOrderResult, type Coin, CoinInfoNotFoundUI, CoinInfoSkeletonsUI, CoinInfoUI, type CoinInfoUIProps, CoinInfoWidget, type CoinInfoWidgetProps, DEFAULT_ORDER_BOOK_PRECISION_OPTIONS, type DepositBreakdown, DepositConfirmUI, type DepositConfirmUIProps, type DepositErrorInfo, type DepositEvent, DepositFlowWidget, type DepositFlowWidgetProps, DepositFormUI, type DepositFormUIProps, type DepositPhase, type DepositQuoteRequest, type DepositQuoteResponse, type DepositSource, type DepositState, type DepositStatus, type DepositStatusResponse, type DepositStatusTransition, DepositStatusUI, type DepositStatusUIProps, type DepositSubmitRequest, type DepositSubmitResponse, type ExecuteDepositInput, type GetOpenOrdersParams, type GetOpenOrdersResult, type GetPositionsParams, type GetPositionsResult, type GetTradesParams, type GetTradesResult, HL_USDC_DECIMALS, type HyperliquidAccountState, HyperliquidApiError, type HyperliquidClientConfig, type HyperliquidEnvironment, HyperliquidInitUI, type HyperliquidInitUIProps, HyperliquidInitWidget, type HyperliquidInitWidgetProps, HyperliquidPerpetualsClient, type HyperliquidSetupActionResult, type IHyperliquidSetupAdapter, type IPerpDepositClient, type IPerpetualsClient, type Kline, type KlineInterval, type KlineQueryOptions, LiberFiApiError, type LiberFiHttpMethod, type RequestOptions as LiberFiHttpRequestOptions, LiberFiHttpTransport, type LiberFiHttpTransportConfig, LiberFiPerpDepositClient, type LiberFiPerpDepositClientConfig, LiberFiPerpetualsClient, type LiberFiPerpetualsClientConfig, type MarketData, type MarketDataType, OpenOrdersEmpty, OpenOrdersSkeleton, OpenOrdersUI, type OpenOrdersUIProps, OpenOrdersWidget, type OpenOrdersWidgetProps, type Order, type OrderBook, type OrderBookAggregationOptions, type OrderBookLevel, OrderBookUI, type OrderBookUIProps, OrderBookWidget, type OrderBookWidgetProps, type OrderSide, type OrderStatus, type OrderType, PerpetualsContext, type PerpetualsContextValue, PerpetualsProvider, type PerpetualsProviderProps, type PlaceOrderFormData, PlaceOrderFormUI, type PlaceOrderFormUIProps, PlaceOrderFormWidget, type PlaceOrderFormWidgetProps, type PlaceOrderParams, type PlaceOrderResult, type Position, PositionsEmpty, PositionsSkeleton, PositionsUI, type PositionsUIProps, PositionsWidget, type PositionsWidgetProps, type PriceLevel, SearchCoinsUI, type SearchCoinsUIProps, SearchCoinsWidget, type SearchCoinsWidgetProps, type SetReferrerParams, type SetupAction, type SetupPhase, type SetupState, type SetupStep, type SetupStepId, type SignAndBroadcastSolanaTx, type SignTypedDataFn, type StepRecord, type StepStatus, type Symbol, TERMINAL_DEPOSIT_STATUSES, type TimeRange, type Trade, type TradeHistory, TradeHistoryEmpty, TradeHistorySkeleton, TradeHistoryUI, type TradeHistoryUIProps, TradeHistoryWidget, type TradeHistoryWidgetProps, type TradeSide, TradesUI, type TradesUIProps, TradesWidget, type TradesWidgetProps, type TradingProvider, type UpdateLeverageParams, type UseCancelOrderMutationParams, type UseCandlesSubscriptionParams, type UseCandlesSubscriptionResult, type UseCoinInfoReturnType, type UseCreateOrderMutationParams, type UseHyperliquidSetupOptions, type UseHyperliquidSetupResult, type UseKlinesQueryParams, type UseMarketDataSubscriptionParams, type UseMarketDataSubscriptionResult, type UseMarketQueryParams, type UseMarketsQueryParams, type UseOpenOrdersScriptParams, type UseOpenOrdersScriptResult, type UseOrderBookQueryParams, type UseOrderBookScriptParams, type UseOrderBookScriptResult, type UseOrdersQueryParams, type UsePerpDepositExecuteResult, type UsePerpDepositQuoteOptions, type UsePerpDepositStatusOptions, type UsePlaceOrderFormScriptParams, type UsePlaceOrderFormScriptResult, type UsePositionsQueryParams, type UsePositionsScriptParams, type UsePositionsScriptResult, type UseRecentTradesQueryParams, type UseSearchCoinsScriptParams, type UseSearchCoinsScriptResult, type UseTradeHistoryScriptParams, type UseTradeHistoryScriptResult, type UseTradesQueryParams, type UseTradesScriptParams, type UseTradesScriptResult, type UseUserDataSubscriptionParams, type UseUserDataSubscriptionResult, type UserDataType, aggregationFromStep, cancelOrder, classifyStep, coinsQueryKey, createOrder, currentBreakdown as currentDepositBreakdown, currentStatus as currentDepositStatus, fetchCoins, fetchKlines, fetchMarket, fetchMarkets, fetchOrderBook, fetchOrders, fetchPerpDepositQuote, fetchPerpDepositStatus, fetchPositions, fetchRecentTrades, fetchTrades, hlUsdcRawToUsdc, initialDepositState, initialSetupState, isPolling as isDepositPolling, isTerminal as isDepositTerminal, isTerminalLifecycle as isTerminalDepositLifecycle, klinesQueryKey, lamportsToSol, marketQueryKey, marketsQueryKey, microUsdcToUsdc, nextRunnableStep, orderBookQueryKey, ordersQueryKey, perpDepositQuoteQueryKey, perpDepositStatusQueryKey, positionsQueryKey, recentTradesQueryKey, reduceDepositState, reduceSetupState, secondsUntil, shortAddress, solToLamports, tradesQueryKey, useCancelOrderMutation, useCandlesSubscription, useCoinInfo, useCoinsQuery, useCreateOrderMutation, useHyperliquidSetup, useKlinesQuery, useMarketDataSubscription, useMarketQuery, useMarketsQuery, useOpenOrdersScript, useOrderBookQuery, useOrderBookScript, useOrdersQuery, usePerpDepositClient, usePerpDepositClientMaybe, usePerpDepositExecute, usePerpDepositQuote, usePerpDepositStatus, usePerpetualsClient, usePlaceOrderFormScript, usePositionsQuery, usePositionsScript, useRecentTradesQuery, useSearchCoinsScript, useTradeHistoryScript, useTradesQuery, useTradesScript, useUserDataSubscription, _default as version };
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ declare global {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
declare const _default: "0.2.
|
|
15
|
+
declare const _default: "0.2.16";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Trading pair symbol format
|
|
@@ -105,6 +105,25 @@ interface Kline {
|
|
|
105
105
|
/** Kline end timestamp (milliseconds) */
|
|
106
106
|
closeTimestamp: number;
|
|
107
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Optional query window for {@link IPerpetualsClient.getKlines}.
|
|
110
|
+
*
|
|
111
|
+
* - `from` / `to` are millisecond epochs. When both are provided, providers
|
|
112
|
+
* return candles whose open timestamp falls inside `[from, to]`.
|
|
113
|
+
* - `limit` (when provided alongside a range) caps the response size on the
|
|
114
|
+
* client side; without `limit`, the provider returns whatever the backend
|
|
115
|
+
* allows for the given window.
|
|
116
|
+
*
|
|
117
|
+
* Required by chart UIs (e.g. TradingView) for backward history pagination.
|
|
118
|
+
*/
|
|
119
|
+
interface KlineQueryOptions {
|
|
120
|
+
/** Start of the window (ms epoch). */
|
|
121
|
+
from?: number;
|
|
122
|
+
/** End of the window (ms epoch, exclusive). */
|
|
123
|
+
to?: number;
|
|
124
|
+
/** Optional cap on the number of candles returned. */
|
|
125
|
+
limit?: number;
|
|
126
|
+
}
|
|
108
127
|
/**
|
|
109
128
|
* Order book price level
|
|
110
129
|
*/
|
|
@@ -446,14 +465,25 @@ interface IPerpetualsClient {
|
|
|
446
465
|
*/
|
|
447
466
|
getMarkets(symbols?: string[]): Promise<MarketData[]>;
|
|
448
467
|
/**
|
|
449
|
-
* Get kline data
|
|
468
|
+
* Get kline data.
|
|
469
|
+
*
|
|
470
|
+
* Two call shapes are supported:
|
|
471
|
+
*
|
|
472
|
+
* - `getKlines(symbol, interval, limit)` — legacy form: returns the last
|
|
473
|
+
* `limit` candles ending at "now". Defaults to 100.
|
|
474
|
+
* - `getKlines(symbol, interval, { from, to, limit? })` — range form:
|
|
475
|
+
* returns candles whose open timestamp falls inside `[from, to]`
|
|
476
|
+
* (millisecond epochs). Required for TradingView-style backward
|
|
477
|
+
* history pagination.
|
|
478
|
+
*
|
|
450
479
|
* @param symbol Trading pair symbol, e.g. "BTC-USDC"
|
|
451
480
|
* @param interval Time interval, e.g. "1h"
|
|
452
|
-
* @param
|
|
453
|
-
*
|
|
481
|
+
* @param limitOrOptions Either a `limit` number (legacy) or a
|
|
482
|
+
* `{ from, to, limit? }` options object (range form).
|
|
483
|
+
* @returns Array of kline data, ascending by timestamp.
|
|
454
484
|
* @throws {Error} Network error or API error
|
|
455
485
|
*/
|
|
456
|
-
getKlines(symbol: string, interval: KlineInterval,
|
|
486
|
+
getKlines(symbol: string, interval: KlineInterval, limitOrOptions?: number | KlineQueryOptions): Promise<Kline[]>;
|
|
457
487
|
/**
|
|
458
488
|
* Get order book
|
|
459
489
|
* @param symbol Trading pair symbol, e.g. "BTC-USDC"
|
|
@@ -668,14 +698,21 @@ declare class HyperliquidPerpetualsClient implements IPerpetualsClient {
|
|
|
668
698
|
*/
|
|
669
699
|
getMarkets(symbols?: string[]): Promise<MarketData[]>;
|
|
670
700
|
/**
|
|
671
|
-
*
|
|
672
|
-
*
|
|
673
|
-
*
|
|
674
|
-
* @
|
|
675
|
-
*
|
|
676
|
-
*
|
|
701
|
+
* Fetch kline / candlestick data.
|
|
702
|
+
*
|
|
703
|
+
* Supports both shapes documented on
|
|
704
|
+
* {@link IPerpetualsClient.getKlines}:
|
|
705
|
+
*
|
|
706
|
+
* - `getKlines(symbol, interval, limit)` — last `limit` candles ending now.
|
|
707
|
+
* - `getKlines(symbol, interval, { from, to, limit? })` — explicit window
|
|
708
|
+
* for backward history pagination (TradingView pan).
|
|
709
|
+
*
|
|
710
|
+
* Maps to Hyperliquid's `candleSnapshot` which natively accepts
|
|
711
|
+
* `startTime` / `endTime` (ms epochs).
|
|
712
|
+
*
|
|
713
|
+
* @throws {HyperliquidApiError}
|
|
677
714
|
*/
|
|
678
|
-
getKlines(symbol: string, interval: KlineInterval,
|
|
715
|
+
getKlines(symbol: string, interval: KlineInterval, limitOrOptions?: number | KlineQueryOptions): Promise<Kline[]>;
|
|
679
716
|
/**
|
|
680
717
|
* Get the order book.
|
|
681
718
|
*
|
|
@@ -1151,7 +1188,7 @@ declare class LiberFiPerpetualsClient implements IPerpetualsClient {
|
|
|
1151
1188
|
getSupportedCoins(): Promise<string[]>;
|
|
1152
1189
|
getMarket(symbol: string): Promise<MarketData | null>;
|
|
1153
1190
|
getMarkets(symbols?: string[]): Promise<MarketData[]>;
|
|
1154
|
-
getKlines(symbol: string, interval: KlineInterval,
|
|
1191
|
+
getKlines(symbol: string, interval: KlineInterval, limitOrOptions?: number | KlineQueryOptions): Promise<Kline[]>;
|
|
1155
1192
|
getOrderBook(symbol: string, maxLevel?: number, options?: {
|
|
1156
1193
|
nSigFigs?: number;
|
|
1157
1194
|
mantissa?: number;
|
|
@@ -1972,6 +2009,19 @@ type UseCoinInfoReturnType = {
|
|
|
1972
2009
|
};
|
|
1973
2010
|
declare function useCoinInfo(symbol: string): UseCoinInfoReturnType;
|
|
1974
2011
|
|
|
2012
|
+
/**
|
|
2013
|
+
* Skeleton placeholder for {@link CoinInfoUI}.
|
|
2014
|
+
*
|
|
2015
|
+
* Mirrors the real component's flex layout so the loading shell occupies
|
|
2016
|
+
* exactly the same footprint (no layout jump on data arrival):
|
|
2017
|
+
* `[price + 24h%] [Oracle] [24h Volume] [Open Interest] [Funding / Countdown]`
|
|
2018
|
+
*
|
|
2019
|
+
* The container is intentionally transparent — coin-info renders inside
|
|
2020
|
+
* the perpetuals chart column whose host page provides the background
|
|
2021
|
+
* (e.g. `#000000` on the perpetuals page). A separate gray wash here
|
|
2022
|
+
* would clash with that. Only the individual `Skeleton` cells carry the
|
|
2023
|
+
* shimmer to indicate loading.
|
|
2024
|
+
*/
|
|
1975
2025
|
declare function CoinInfoSkeletonsUI(): react_jsx_runtime.JSX.Element;
|
|
1976
2026
|
|
|
1977
2027
|
declare function CoinInfoNotFoundUI(): react_jsx_runtime.JSX.Element;
|
|
@@ -2585,4 +2635,4 @@ interface HyperliquidInitWidgetProps extends Pick<UseHyperliquidSetupOptions, "a
|
|
|
2585
2635
|
}
|
|
2586
2636
|
declare function HyperliquidInitWidget({ adapter, userAddress, steps, autoLoad, onComplete, onError, onDismiss, className, }: HyperliquidInitWidgetProps): react_jsx_runtime.JSX.Element;
|
|
2587
2637
|
|
|
2588
|
-
export { type Account, type ApproveBuilderFeeParams, type CancelOrderParams, type CancelOrderResult, type Coin, CoinInfoNotFoundUI, CoinInfoSkeletonsUI, CoinInfoUI, type CoinInfoUIProps, CoinInfoWidget, type CoinInfoWidgetProps, DEFAULT_ORDER_BOOK_PRECISION_OPTIONS, type DepositBreakdown, DepositConfirmUI, type DepositConfirmUIProps, type DepositErrorInfo, type DepositEvent, DepositFlowWidget, type DepositFlowWidgetProps, DepositFormUI, type DepositFormUIProps, type DepositPhase, type DepositQuoteRequest, type DepositQuoteResponse, type DepositSource, type DepositState, type DepositStatus, type DepositStatusResponse, type DepositStatusTransition, DepositStatusUI, type DepositStatusUIProps, type DepositSubmitRequest, type DepositSubmitResponse, type ExecuteDepositInput, type GetOpenOrdersParams, type GetOpenOrdersResult, type GetPositionsParams, type GetPositionsResult, type GetTradesParams, type GetTradesResult, HL_USDC_DECIMALS, type HyperliquidAccountState, HyperliquidApiError, type HyperliquidClientConfig, type HyperliquidEnvironment, HyperliquidInitUI, type HyperliquidInitUIProps, HyperliquidInitWidget, type HyperliquidInitWidgetProps, HyperliquidPerpetualsClient, type HyperliquidSetupActionResult, type IHyperliquidSetupAdapter, type IPerpDepositClient, type IPerpetualsClient, type Kline, type KlineInterval, LiberFiApiError, type LiberFiHttpMethod, type RequestOptions as LiberFiHttpRequestOptions, LiberFiHttpTransport, type LiberFiHttpTransportConfig, LiberFiPerpDepositClient, type LiberFiPerpDepositClientConfig, LiberFiPerpetualsClient, type LiberFiPerpetualsClientConfig, type MarketData, type MarketDataType, OpenOrdersEmpty, OpenOrdersSkeleton, OpenOrdersUI, type OpenOrdersUIProps, OpenOrdersWidget, type OpenOrdersWidgetProps, type Order, type OrderBook, type OrderBookAggregationOptions, type OrderBookLevel, OrderBookUI, type OrderBookUIProps, OrderBookWidget, type OrderBookWidgetProps, type OrderSide, type OrderStatus, type OrderType, PerpetualsContext, type PerpetualsContextValue, PerpetualsProvider, type PerpetualsProviderProps, type PlaceOrderFormData, PlaceOrderFormUI, type PlaceOrderFormUIProps, PlaceOrderFormWidget, type PlaceOrderFormWidgetProps, type PlaceOrderParams, type PlaceOrderResult, type Position, PositionsEmpty, PositionsSkeleton, PositionsUI, type PositionsUIProps, PositionsWidget, type PositionsWidgetProps, type PriceLevel, SearchCoinsUI, type SearchCoinsUIProps, SearchCoinsWidget, type SearchCoinsWidgetProps, type SetReferrerParams, type SetupAction, type SetupPhase, type SetupState, type SetupStep, type SetupStepId, type SignAndBroadcastSolanaTx, type SignTypedDataFn, type StepRecord, type StepStatus, type Symbol, TERMINAL_DEPOSIT_STATUSES, type TimeRange, type Trade, type TradeHistory, TradeHistoryEmpty, TradeHistorySkeleton, TradeHistoryUI, type TradeHistoryUIProps, TradeHistoryWidget, type TradeHistoryWidgetProps, type TradeSide, TradesUI, type TradesUIProps, TradesWidget, type TradesWidgetProps, type TradingProvider, type UpdateLeverageParams, type UseCancelOrderMutationParams, type UseCandlesSubscriptionParams, type UseCandlesSubscriptionResult, type UseCoinInfoReturnType, type UseCreateOrderMutationParams, type UseHyperliquidSetupOptions, type UseHyperliquidSetupResult, type UseKlinesQueryParams, type UseMarketDataSubscriptionParams, type UseMarketDataSubscriptionResult, type UseMarketQueryParams, type UseMarketsQueryParams, type UseOpenOrdersScriptParams, type UseOpenOrdersScriptResult, type UseOrderBookQueryParams, type UseOrderBookScriptParams, type UseOrderBookScriptResult, type UseOrdersQueryParams, type UsePerpDepositExecuteResult, type UsePerpDepositQuoteOptions, type UsePerpDepositStatusOptions, type UsePlaceOrderFormScriptParams, type UsePlaceOrderFormScriptResult, type UsePositionsQueryParams, type UsePositionsScriptParams, type UsePositionsScriptResult, type UseRecentTradesQueryParams, type UseSearchCoinsScriptParams, type UseSearchCoinsScriptResult, type UseTradeHistoryScriptParams, type UseTradeHistoryScriptResult, type UseTradesQueryParams, type UseTradesScriptParams, type UseTradesScriptResult, type UseUserDataSubscriptionParams, type UseUserDataSubscriptionResult, type UserDataType, aggregationFromStep, cancelOrder, classifyStep, coinsQueryKey, createOrder, currentBreakdown as currentDepositBreakdown, currentStatus as currentDepositStatus, fetchCoins, fetchKlines, fetchMarket, fetchMarkets, fetchOrderBook, fetchOrders, fetchPerpDepositQuote, fetchPerpDepositStatus, fetchPositions, fetchRecentTrades, fetchTrades, hlUsdcRawToUsdc, initialDepositState, initialSetupState, isPolling as isDepositPolling, isTerminal as isDepositTerminal, isTerminalLifecycle as isTerminalDepositLifecycle, klinesQueryKey, lamportsToSol, marketQueryKey, marketsQueryKey, microUsdcToUsdc, nextRunnableStep, orderBookQueryKey, ordersQueryKey, perpDepositQuoteQueryKey, perpDepositStatusQueryKey, positionsQueryKey, recentTradesQueryKey, reduceDepositState, reduceSetupState, secondsUntil, shortAddress, solToLamports, tradesQueryKey, useCancelOrderMutation, useCandlesSubscription, useCoinInfo, useCoinsQuery, useCreateOrderMutation, useHyperliquidSetup, useKlinesQuery, useMarketDataSubscription, useMarketQuery, useMarketsQuery, useOpenOrdersScript, useOrderBookQuery, useOrderBookScript, useOrdersQuery, usePerpDepositClient, usePerpDepositClientMaybe, usePerpDepositExecute, usePerpDepositQuote, usePerpDepositStatus, usePerpetualsClient, usePlaceOrderFormScript, usePositionsQuery, usePositionsScript, useRecentTradesQuery, useSearchCoinsScript, useTradeHistoryScript, useTradesQuery, useTradesScript, useUserDataSubscription, _default as version };
|
|
2638
|
+
export { type Account, type ApproveBuilderFeeParams, type CancelOrderParams, type CancelOrderResult, type Coin, CoinInfoNotFoundUI, CoinInfoSkeletonsUI, CoinInfoUI, type CoinInfoUIProps, CoinInfoWidget, type CoinInfoWidgetProps, DEFAULT_ORDER_BOOK_PRECISION_OPTIONS, type DepositBreakdown, DepositConfirmUI, type DepositConfirmUIProps, type DepositErrorInfo, type DepositEvent, DepositFlowWidget, type DepositFlowWidgetProps, DepositFormUI, type DepositFormUIProps, type DepositPhase, type DepositQuoteRequest, type DepositQuoteResponse, type DepositSource, type DepositState, type DepositStatus, type DepositStatusResponse, type DepositStatusTransition, DepositStatusUI, type DepositStatusUIProps, type DepositSubmitRequest, type DepositSubmitResponse, type ExecuteDepositInput, type GetOpenOrdersParams, type GetOpenOrdersResult, type GetPositionsParams, type GetPositionsResult, type GetTradesParams, type GetTradesResult, HL_USDC_DECIMALS, type HyperliquidAccountState, HyperliquidApiError, type HyperliquidClientConfig, type HyperliquidEnvironment, HyperliquidInitUI, type HyperliquidInitUIProps, HyperliquidInitWidget, type HyperliquidInitWidgetProps, HyperliquidPerpetualsClient, type HyperliquidSetupActionResult, type IHyperliquidSetupAdapter, type IPerpDepositClient, type IPerpetualsClient, type Kline, type KlineInterval, type KlineQueryOptions, LiberFiApiError, type LiberFiHttpMethod, type RequestOptions as LiberFiHttpRequestOptions, LiberFiHttpTransport, type LiberFiHttpTransportConfig, LiberFiPerpDepositClient, type LiberFiPerpDepositClientConfig, LiberFiPerpetualsClient, type LiberFiPerpetualsClientConfig, type MarketData, type MarketDataType, OpenOrdersEmpty, OpenOrdersSkeleton, OpenOrdersUI, type OpenOrdersUIProps, OpenOrdersWidget, type OpenOrdersWidgetProps, type Order, type OrderBook, type OrderBookAggregationOptions, type OrderBookLevel, OrderBookUI, type OrderBookUIProps, OrderBookWidget, type OrderBookWidgetProps, type OrderSide, type OrderStatus, type OrderType, PerpetualsContext, type PerpetualsContextValue, PerpetualsProvider, type PerpetualsProviderProps, type PlaceOrderFormData, PlaceOrderFormUI, type PlaceOrderFormUIProps, PlaceOrderFormWidget, type PlaceOrderFormWidgetProps, type PlaceOrderParams, type PlaceOrderResult, type Position, PositionsEmpty, PositionsSkeleton, PositionsUI, type PositionsUIProps, PositionsWidget, type PositionsWidgetProps, type PriceLevel, SearchCoinsUI, type SearchCoinsUIProps, SearchCoinsWidget, type SearchCoinsWidgetProps, type SetReferrerParams, type SetupAction, type SetupPhase, type SetupState, type SetupStep, type SetupStepId, type SignAndBroadcastSolanaTx, type SignTypedDataFn, type StepRecord, type StepStatus, type Symbol, TERMINAL_DEPOSIT_STATUSES, type TimeRange, type Trade, type TradeHistory, TradeHistoryEmpty, TradeHistorySkeleton, TradeHistoryUI, type TradeHistoryUIProps, TradeHistoryWidget, type TradeHistoryWidgetProps, type TradeSide, TradesUI, type TradesUIProps, TradesWidget, type TradesWidgetProps, type TradingProvider, type UpdateLeverageParams, type UseCancelOrderMutationParams, type UseCandlesSubscriptionParams, type UseCandlesSubscriptionResult, type UseCoinInfoReturnType, type UseCreateOrderMutationParams, type UseHyperliquidSetupOptions, type UseHyperliquidSetupResult, type UseKlinesQueryParams, type UseMarketDataSubscriptionParams, type UseMarketDataSubscriptionResult, type UseMarketQueryParams, type UseMarketsQueryParams, type UseOpenOrdersScriptParams, type UseOpenOrdersScriptResult, type UseOrderBookQueryParams, type UseOrderBookScriptParams, type UseOrderBookScriptResult, type UseOrdersQueryParams, type UsePerpDepositExecuteResult, type UsePerpDepositQuoteOptions, type UsePerpDepositStatusOptions, type UsePlaceOrderFormScriptParams, type UsePlaceOrderFormScriptResult, type UsePositionsQueryParams, type UsePositionsScriptParams, type UsePositionsScriptResult, type UseRecentTradesQueryParams, type UseSearchCoinsScriptParams, type UseSearchCoinsScriptResult, type UseTradeHistoryScriptParams, type UseTradeHistoryScriptResult, type UseTradesQueryParams, type UseTradesScriptParams, type UseTradesScriptResult, type UseUserDataSubscriptionParams, type UseUserDataSubscriptionResult, type UserDataType, aggregationFromStep, cancelOrder, classifyStep, coinsQueryKey, createOrder, currentBreakdown as currentDepositBreakdown, currentStatus as currentDepositStatus, fetchCoins, fetchKlines, fetchMarket, fetchMarkets, fetchOrderBook, fetchOrders, fetchPerpDepositQuote, fetchPerpDepositStatus, fetchPositions, fetchRecentTrades, fetchTrades, hlUsdcRawToUsdc, initialDepositState, initialSetupState, isPolling as isDepositPolling, isTerminal as isDepositTerminal, isTerminalLifecycle as isTerminalDepositLifecycle, klinesQueryKey, lamportsToSol, marketQueryKey, marketsQueryKey, microUsdcToUsdc, nextRunnableStep, orderBookQueryKey, ordersQueryKey, perpDepositQuoteQueryKey, perpDepositStatusQueryKey, positionsQueryKey, recentTradesQueryKey, reduceDepositState, reduceSetupState, secondsUntil, shortAddress, solToLamports, tradesQueryKey, useCancelOrderMutation, useCandlesSubscription, useCoinInfo, useCoinsQuery, useCreateOrderMutation, useHyperliquidSetup, useKlinesQuery, useMarketDataSubscription, useMarketQuery, useMarketsQuery, useOpenOrdersScript, useOrderBookQuery, useOrderBookScript, useOrdersQuery, usePerpDepositClient, usePerpDepositClientMaybe, usePerpDepositExecute, usePerpDepositQuote, usePerpDepositStatus, usePerpetualsClient, usePlaceOrderFormScript, usePositionsQuery, usePositionsScript, useRecentTradesQuery, useSearchCoinsScript, useTradeHistoryScript, useTradesQuery, useTradesScript, useUserDataSubscription, _default as version };
|