@pear-protocol/hyperliquid-sdk 0.0.73-beta-2 → 0.0.73-beta-4
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.ts +47 -2
- package/dist/types.d.ts +46 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -114,7 +114,52 @@ interface WatchlistItemDto {
|
|
|
114
114
|
interface ToggleWatchlistResponseDto {
|
|
115
115
|
items: WatchlistItemDto[];
|
|
116
116
|
}
|
|
117
|
-
type NotificationCategory = 'TRADE_OPENED_OUTSIDE_PEAR' | 'TRADE_CLOSED_OUTSIDE_PEAR' | 'POSITION_LIQUIDATED' | 'LIMIT_ORDER_FILLED' | 'LIMIT_ORDER_FAILED' | 'TP_ORDER_FILLED' | 'TP_ORDER_FAILED' | 'SL_ORDER_FILLED' | 'SL_ORDER_FAILED';
|
|
117
|
+
type NotificationCategory = 'TRADE_OPENED_OUTSIDE_PEAR' | 'TRADE_CLOSED_OUTSIDE_PEAR' | 'POSITION_LIQUIDATED' | 'LIMIT_ORDER_FILLED' | 'LIMIT_ORDER_FAILED' | 'TP_ORDER_FILLED' | 'TP_ORDER_FAILED' | 'SL_ORDER_FILLED' | 'SL_ORDER_FAILED' | 'TRIGGER_ORDER_FILLED' | 'TRIGGER_ORDER_FAILED';
|
|
118
|
+
type TriggerOrderNotificationType = 'PRICE' | 'PRICE_RATIO' | 'WEIGHTED_RATIO' | 'CROSS_ASSET_PRICE' | 'PREDICTION_MARKET_OUTCOME' | 'BTC_DOM';
|
|
119
|
+
interface TriggerOrderNotificationAsset {
|
|
120
|
+
asset: string;
|
|
121
|
+
side: 'LONG' | 'SHORT';
|
|
122
|
+
weight: number;
|
|
123
|
+
}
|
|
124
|
+
interface BaseTriggerOrderNotificationParams {
|
|
125
|
+
order_id: string;
|
|
126
|
+
client_id: string;
|
|
127
|
+
order_type: 'TRIGGER';
|
|
128
|
+
trigger_type: TriggerOrderNotificationType;
|
|
129
|
+
usd_value: number;
|
|
130
|
+
leverage: number;
|
|
131
|
+
assets: TriggerOrderNotificationAsset[];
|
|
132
|
+
error?: string;
|
|
133
|
+
}
|
|
134
|
+
interface PriceTriggerParams extends BaseTriggerOrderNotificationParams {
|
|
135
|
+
trigger_type: 'PRICE';
|
|
136
|
+
direction: 'MORE_THAN' | 'LESS_THAN' | null;
|
|
137
|
+
trigger_value: number | null;
|
|
138
|
+
}
|
|
139
|
+
interface PriceRatioTriggerParams extends BaseTriggerOrderNotificationParams {
|
|
140
|
+
trigger_type: 'PRICE_RATIO' | 'WEIGHTED_RATIO';
|
|
141
|
+
direction: 'MORE_THAN' | 'LESS_THAN' | null;
|
|
142
|
+
trigger_value: number | null;
|
|
143
|
+
}
|
|
144
|
+
interface CrossAssetPriceTriggerParams extends BaseTriggerOrderNotificationParams {
|
|
145
|
+
trigger_type: 'CROSS_ASSET_PRICE';
|
|
146
|
+
direction: 'MORE_THAN' | 'LESS_THAN' | null;
|
|
147
|
+
trigger_value: number | null;
|
|
148
|
+
asset_name: string;
|
|
149
|
+
}
|
|
150
|
+
interface PredictionMarketOutcomeTriggerParams extends BaseTriggerOrderNotificationParams {
|
|
151
|
+
trigger_type: 'PREDICTION_MARKET_OUTCOME';
|
|
152
|
+
trigger_value: string | null;
|
|
153
|
+
market_code: string;
|
|
154
|
+
result: string;
|
|
155
|
+
}
|
|
156
|
+
interface BtcDomTriggerParams extends BaseTriggerOrderNotificationParams {
|
|
157
|
+
trigger_type: 'BTC_DOM';
|
|
158
|
+
direction: 'MORE_THAN' | 'LESS_THAN' | null;
|
|
159
|
+
trigger_value: number | null;
|
|
160
|
+
current_btc_dominance: number;
|
|
161
|
+
}
|
|
162
|
+
type TriggerOrderNotificationParams = PriceTriggerParams | PriceRatioTriggerParams | CrossAssetPriceTriggerParams | PredictionMarketOutcomeTriggerParams | BtcDomTriggerParams;
|
|
118
163
|
interface NotificationDto {
|
|
119
164
|
id: string;
|
|
120
165
|
address: string;
|
|
@@ -1729,4 +1774,4 @@ interface MarketDataState {
|
|
|
1729
1774
|
declare const useMarketData: zustand.UseBoundStore<zustand.StoreApi<MarketDataState>>;
|
|
1730
1775
|
|
|
1731
1776
|
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, getAvailableMarkets, getCompleteTimestamps, getKalshiMarkets, getMarketPrefix, getOrderDirection, getOrderLadderConfig, getOrderLeverage, getOrderReduceOnly, getOrderTpSlTriggerType, getOrderTrailingInfo, getOrderTriggerType, getOrderTriggerValue, getOrderTwapDuration, getOrderUsdValue, getPortfolio, isBtcDomOrder, isHip3Market, mapCandleIntervalToTradingViewInterval, mapTradingViewIntervalToCandleInterval, markNotificationReadById, markNotificationsRead, toBackendSymbol, toBackendSymbolWithMarket, toDisplaySymbol, toggleWatchlist, updateLeverage, updateRiskParameters, useAccountSummary, useActiveBaskets, useAgentWallet, useAllBaskets, useAllUserBalances, useAuth, useBasketCandles, useFindBasket, useHighlightedBaskets, useHistoricalPriceData, useHistoricalPriceDataStore, useHyperliquidNativeWebSocket, useHyperliquidUserFills, useHyperliquidWebSocket, useMarketData, useMarketDataAllPayload, useMarketDataPayload, useNotifications, useOpenOrders, useOrders, usePearHyperliquid, usePerformanceOverlays, usePerpMetaAssets, usePortfolio, usePosition, useSpotOrder, useTokenSelectionMetadata, useTopGainers, useTopLosers, useTradeHistories, useTwap, useUserSelection, useWatchlist, useWatchlistBaskets, useWebData, validateMaxAssetsPerLeg, validateMinimumAssetSize, validatePositionSize };
|
|
1732
|
-
export type { AccountSummaryResponseDto, ActiveAssetGroupItem, ActiveAssetsResponse, AdjustAdvanceAssetInput, AdjustAdvanceItemInput, AdjustAdvanceResponseDto, AdjustExecutionType, AdjustOrderRequestInput, AdjustOrderResponseDto, AdjustPositionRequestInput, AdjustPositionResponseDto, AgentWalletDto, AgentWalletState, ApiErrorResponse, ApiResponse, AssetCtx, AssetInformationDetail, AssetMarketData, AssetPosition, BalanceSummaryDto, CancelOrderResponseDto, CancelTwapResponseDto, CandleChartData, CandleData, CandleInterval, CandleSnapshotRequest, ClearinghouseState, CloseAllPositionsResponseDto, CloseAllPositionsResultDto, CloseExecutionType, ClosePositionRequestInput, ClosePositionResponseDto, CollateralFilter, CollateralToken, CreatePositionRequestInput, CreatePositionResponseDto, CrossMarginSummaryDto, CumFundingDto, ExecutionType, ExtraAgent, GetKalshiMarketsParams, HLWebSocketResponse, HistoricalRange, KalshiMarket, KalshiMarketsResponse, KalshiMveLeg, KalshiPriceRange, LadderConfigInput, MarginSummaryDto, MarketDataBySymbol, NotificationCategory, NotificationDto, OpenLimitOrderDto, OpenPositionDto, OrderAssetDto, OrderStatus, PairAssetDto, PairAssetInput, PerformanceOverlay, PlatformAccountSummaryResponseDto, PortfolioBucketDto, PortfolioInterval, PortfolioIntervalsDto, PortfolioOverallDto, PortfolioResponseDto, PositionAdjustmentType, PositionAssetDetailDto, RealtimeBar, RealtimeBarsCallback, SpotBalance, SpotOrderFilledStatus, SpotOrderHyperliquidData, SpotOrderHyperliquidResult, SpotOrderRequestInput, SpotOrderResponseDto, SpotState, ToggleWatchlistResponseDto, TokenConflict, TokenHistoricalPriceData, TokenMetadata, TokenSelection, TpSlOrderParameters, TpSlThresholdInput, TpSlThresholdType, TpSlTriggerType, TradeHistoryAssetDataDto, TradeHistoryDataDto, 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 };
|
|
1777
|
+
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, EnrichedOpenLimitOrderDto, ExecutionType, ExtraAgent, GetKalshiMarketsParams, HLWebSocketResponse, HistoricalRange, KalshiMarket, KalshiMarketsResponse, KalshiMveLeg, KalshiPriceRange, LadderConfigInput, MarginSummaryDto, MarketDataBySymbol, 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 };
|
package/dist/types.d.ts
CHANGED
|
@@ -97,7 +97,52 @@ export interface WatchlistItemDto {
|
|
|
97
97
|
export interface ToggleWatchlistResponseDto {
|
|
98
98
|
items: WatchlistItemDto[];
|
|
99
99
|
}
|
|
100
|
-
export type NotificationCategory = 'TRADE_OPENED_OUTSIDE_PEAR' | 'TRADE_CLOSED_OUTSIDE_PEAR' | 'POSITION_LIQUIDATED' | 'LIMIT_ORDER_FILLED' | 'LIMIT_ORDER_FAILED' | 'TP_ORDER_FILLED' | 'TP_ORDER_FAILED' | 'SL_ORDER_FILLED' | 'SL_ORDER_FAILED';
|
|
100
|
+
export type NotificationCategory = 'TRADE_OPENED_OUTSIDE_PEAR' | 'TRADE_CLOSED_OUTSIDE_PEAR' | 'POSITION_LIQUIDATED' | 'LIMIT_ORDER_FILLED' | 'LIMIT_ORDER_FAILED' | 'TP_ORDER_FILLED' | 'TP_ORDER_FAILED' | 'SL_ORDER_FILLED' | 'SL_ORDER_FAILED' | 'TRIGGER_ORDER_FILLED' | 'TRIGGER_ORDER_FAILED';
|
|
101
|
+
export type TriggerOrderNotificationType = 'PRICE' | 'PRICE_RATIO' | 'WEIGHTED_RATIO' | 'CROSS_ASSET_PRICE' | 'PREDICTION_MARKET_OUTCOME' | 'BTC_DOM';
|
|
102
|
+
export interface TriggerOrderNotificationAsset {
|
|
103
|
+
asset: string;
|
|
104
|
+
side: 'LONG' | 'SHORT';
|
|
105
|
+
weight: number;
|
|
106
|
+
}
|
|
107
|
+
export interface BaseTriggerOrderNotificationParams {
|
|
108
|
+
order_id: string;
|
|
109
|
+
client_id: string;
|
|
110
|
+
order_type: 'TRIGGER';
|
|
111
|
+
trigger_type: TriggerOrderNotificationType;
|
|
112
|
+
usd_value: number;
|
|
113
|
+
leverage: number;
|
|
114
|
+
assets: TriggerOrderNotificationAsset[];
|
|
115
|
+
error?: string;
|
|
116
|
+
}
|
|
117
|
+
export interface PriceTriggerParams extends BaseTriggerOrderNotificationParams {
|
|
118
|
+
trigger_type: 'PRICE';
|
|
119
|
+
direction: 'MORE_THAN' | 'LESS_THAN' | null;
|
|
120
|
+
trigger_value: number | null;
|
|
121
|
+
}
|
|
122
|
+
export interface PriceRatioTriggerParams extends BaseTriggerOrderNotificationParams {
|
|
123
|
+
trigger_type: 'PRICE_RATIO' | 'WEIGHTED_RATIO';
|
|
124
|
+
direction: 'MORE_THAN' | 'LESS_THAN' | null;
|
|
125
|
+
trigger_value: number | null;
|
|
126
|
+
}
|
|
127
|
+
export interface CrossAssetPriceTriggerParams extends BaseTriggerOrderNotificationParams {
|
|
128
|
+
trigger_type: 'CROSS_ASSET_PRICE';
|
|
129
|
+
direction: 'MORE_THAN' | 'LESS_THAN' | null;
|
|
130
|
+
trigger_value: number | null;
|
|
131
|
+
asset_name: string;
|
|
132
|
+
}
|
|
133
|
+
export interface PredictionMarketOutcomeTriggerParams extends BaseTriggerOrderNotificationParams {
|
|
134
|
+
trigger_type: 'PREDICTION_MARKET_OUTCOME';
|
|
135
|
+
trigger_value: string | null;
|
|
136
|
+
market_code: string;
|
|
137
|
+
result: string;
|
|
138
|
+
}
|
|
139
|
+
export interface BtcDomTriggerParams extends BaseTriggerOrderNotificationParams {
|
|
140
|
+
trigger_type: 'BTC_DOM';
|
|
141
|
+
direction: 'MORE_THAN' | 'LESS_THAN' | null;
|
|
142
|
+
trigger_value: number | null;
|
|
143
|
+
current_btc_dominance: number;
|
|
144
|
+
}
|
|
145
|
+
export type TriggerOrderNotificationParams = PriceTriggerParams | PriceRatioTriggerParams | CrossAssetPriceTriggerParams | PredictionMarketOutcomeTriggerParams | BtcDomTriggerParams;
|
|
101
146
|
export interface NotificationDto {
|
|
102
147
|
id: string;
|
|
103
148
|
address: string;
|