@pear-protocol/hyperliquid-sdk 0.0.30 → 0.0.31

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 CHANGED
@@ -53,6 +53,46 @@ interface WebSocketDataMessage<T = unknown> {
53
53
  channel: WebSocketChannel;
54
54
  data: T;
55
55
  }
56
+ interface ChunkFillDto {
57
+ fillId: string;
58
+ assetName: string;
59
+ price: number;
60
+ size: number;
61
+ executedAt: string;
62
+ }
63
+ type TwapChunkStatus = 'PENDING' | 'SCHEDULED' | 'EXECUTING' | 'COMPLETED' | 'FAILED' | 'CANCELLED';
64
+ interface TwapChunkStatusDto {
65
+ chunkId: string;
66
+ chunkIndex: number;
67
+ scheduledTime: string;
68
+ executedTime?: string;
69
+ status: TwapChunkStatus;
70
+ chunkSize: number;
71
+ fills: ChunkFillDto[];
72
+ errorMessage?: string;
73
+ }
74
+ type TwapOrderOverallStatus = 'OPEN' | 'EXECUTING' | 'COMPLETED' | 'PARTIALLY_COMPLETED' | 'FAILED' | 'CANCELLED';
75
+ interface TwapMonitoringDto {
76
+ orderId: string;
77
+ positionId?: string;
78
+ address: string;
79
+ orderType: string;
80
+ status: TwapOrderOverallStatus;
81
+ totalUsdValue: number;
82
+ filledUsdValue: number;
83
+ remainingUsdValue: number;
84
+ twapDuration: string;
85
+ randomizeExecution: boolean;
86
+ reduceOnly: boolean;
87
+ chunks: TwapChunkStatusDto[];
88
+ estimatedCompletionTime?: string;
89
+ actualCompletionTime?: string;
90
+ remainingChunks: number;
91
+ longAssets: OrderAssetDto[];
92
+ shortAssets: OrderAssetDto[];
93
+ createdAt: string;
94
+ updatedAt: string;
95
+ }
56
96
  /**
57
97
  * Trade history asset data
58
98
  */
@@ -1021,4 +1061,4 @@ declare function mapTradingViewIntervalToCandleInterval(interval: string): Candl
1021
1061
  declare function mapCandleIntervalToTradingViewInterval(interval: CandleInterval): string;
1022
1062
 
1023
1063
  export { AccountSummaryCalculator, AuthStatus, ConflictDetector, PearHyperliquidProvider, TokenMetadataExtractor, adjustOrder, adjustPosition, calculateWeightedRatio, cancelOrder, cancelTwap, cancelTwapOrder, closePosition, computeBasketCandles, createCandleLookups, createPosition, getCompleteTimestamps, mapCandleIntervalToTradingViewInterval, mapTradingViewIntervalToCandleInterval, updateRiskParameters, useAccountSummary, useAddress, useAgentWallet, useAuth, useAutoSyncFills, useBasketCandles, useHistoricalPriceData, useHistoricalPriceDataStore, useHyperliquidNativeWebSocket, useHyperliquidWebSocket, useOpenOrders, useOrders, usePearAgentWallet, usePearAuth, usePearHyperliquid, usePerformanceOverlays, usePosition, useTokenSelectionMetadata, useTradeHistories, useTwap, useUserSelection, useWebData };
1024
- export type { AccountSummaryResponseDto, AdjustExecutionType, AdjustOrderRequestInput, AdjustOrderResponseDto, AdjustPositionRequestInput, AdjustPositionResponseDto, AgentWalletDto, AgentWalletState, ApiErrorResponse, ApiResponse, AssetCtx, AssetInformationDetail, AssetMarketData, AssetPosition, AutoSyncFillsOptions, AutoSyncFillsState, BalanceSummaryDto, CancelOrderResponseDto, CancelTwapResponseDto, CandleChartData, CandleData, CandleInterval, CandleSnapshotRequest, ClearinghouseState, CloseExecutionType, ClosePositionRequestInput, ClosePositionResponseDto, CreatePositionRequestInput, CreatePositionResponseDto, CrossMarginSummaryDto, CumFundingDto, ExecutionType, HLWebSocketResponse, HistoricalRange, LadderConfigInput, MarginSummaryDto, OpenLimitOrderDto, OpenPositionDto, OrderAssetDto, OrderStatus, PairAssetInput, PerformanceOverlay, PositionAdjustmentType, PositionAssetDetailDto, PositionAssetSummaryDto, PositionResponseStatus, RealtimeBar, RealtimeBarsCallback, TokenConflict, TokenHistoricalPriceData, TokenMetadata, TokenSelection, TpSlThresholdInput, TpSlThresholdType, TradeHistoryAssetDataDto, TradeHistoryDataDto, UniverseAsset, UpdateRiskParametersRequestInput, UpdateRiskParametersResponseDto, UseAgentWalletOptions, UseAuthOptions, UseBasketCandlesReturn, UseHistoricalPriceDataReturn, UsePerformanceOverlaysReturn, UseTokenSelectionMetadataReturn, UserProfile, UserSelectionState, WebData2Response, WebSocketAckResponse, WebSocketChannel, WebSocketConnectionState, WebSocketDataMessage, WebSocketMessage, WebSocketSubscribeMessage, WsAllMidsData };
1064
+ export type { AccountSummaryResponseDto, AdjustExecutionType, AdjustOrderRequestInput, AdjustOrderResponseDto, AdjustPositionRequestInput, AdjustPositionResponseDto, AgentWalletDto, AgentWalletState, ApiErrorResponse, ApiResponse, AssetCtx, AssetInformationDetail, AssetMarketData, AssetPosition, AutoSyncFillsOptions, AutoSyncFillsState, BalanceSummaryDto, CancelOrderResponseDto, CancelTwapResponseDto, CandleChartData, CandleData, CandleInterval, CandleSnapshotRequest, ClearinghouseState, CloseExecutionType, ClosePositionRequestInput, ClosePositionResponseDto, CreatePositionRequestInput, CreatePositionResponseDto, CrossMarginSummaryDto, CumFundingDto, ExecutionType, HLWebSocketResponse, HistoricalRange, LadderConfigInput, MarginSummaryDto, OpenLimitOrderDto, OpenPositionDto, OrderAssetDto, OrderStatus, PairAssetInput, PerformanceOverlay, PositionAdjustmentType, PositionAssetDetailDto, PositionAssetSummaryDto, PositionResponseStatus, RealtimeBar, RealtimeBarsCallback, TokenConflict, TokenHistoricalPriceData, TokenMetadata, TokenSelection, TpSlThresholdInput, TpSlThresholdType, TradeHistoryAssetDataDto, TradeHistoryDataDto, TwapChunkStatusDto, TwapMonitoringDto, UniverseAsset, UpdateRiskParametersRequestInput, UpdateRiskParametersResponseDto, UseAgentWalletOptions, UseAuthOptions, UseBasketCandlesReturn, UseHistoricalPriceDataReturn, UsePerformanceOverlaysReturn, UseTokenSelectionMetadataReturn, UserProfile, UserSelectionState, WebData2Response, WebSocketAckResponse, WebSocketChannel, WebSocketConnectionState, WebSocketDataMessage, WebSocketMessage, WebSocketSubscribeMessage, WsAllMidsData };
package/dist/index.js CHANGED
@@ -2491,8 +2491,7 @@ const useHyperliquidWebSocket = ({ wsUrl, address }) => {
2491
2491
  setAccountSummary(dataMessage.data);
2492
2492
  break;
2493
2493
  case 'twap-details':
2494
- // @ts-ignore: setTwapDetails exists in store
2495
- setTwapDetails && setTwapDetails(dataMessage.data);
2494
+ setTwapDetails(dataMessage.data);
2496
2495
  break;
2497
2496
  }
2498
2497
  }
package/dist/types.d.ts CHANGED
@@ -109,6 +109,8 @@ export interface TwapMonitoringDto {
109
109
  estimatedCompletionTime?: string;
110
110
  actualCompletionTime?: string;
111
111
  remainingChunks: number;
112
+ longAssets: OrderAssetDto[];
113
+ shortAssets: OrderAssetDto[];
112
114
  createdAt: string;
113
115
  updatedAt: string;
114
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/hyperliquid-sdk",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "description": "React SDK for Pear Protocol Hyperliquid API integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",