@pear-protocol/hyperliquid-sdk 0.0.9 → 0.0.10

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.
@@ -3,9 +3,9 @@ import { ReadyState } from 'react-use-websocket';
3
3
  import { PearHyperliquidClient } from './client';
4
4
  import { PearHyperliquidConfig } from './types';
5
5
  import { PearMigrationSDK } from './migration-sdk';
6
- import type { PaginatedTradeHistoryResponseDto, RawPositionDto, OpenLimitOrderDto, AccountSummaryResponseDto, WebData2Response, WsAllMidsData } from './types';
6
+ import type { RawPositionDto, OpenLimitOrderDto, AccountSummaryResponseDto, WebData2Response, WsAllMidsData, TradeHistoryDataDto } from './types';
7
7
  interface WebSocketData {
8
- tradeHistories: PaginatedTradeHistoryResponseDto | null;
8
+ tradeHistories: TradeHistoryDataDto[] | null;
9
9
  openPositions: RawPositionDto[] | null;
10
10
  openOrders: OpenLimitOrderDto[] | null;
11
11
  accountSummary: AccountSummaryResponseDto | null;
package/dist/types.d.ts CHANGED
@@ -265,15 +265,6 @@ export interface TradeHistoryDataDto {
265
265
  shortAssets: TradeHistoryAssetDataDto[];
266
266
  createdAt: string;
267
267
  }
268
- /**
269
- * Paginated trade history response
270
- */
271
- export interface PaginatedTradeHistoryResponseDto {
272
- data: TradeHistoryDataDto[];
273
- hasMore: boolean;
274
- nextCursor?: string;
275
- count: number;
276
- }
277
268
  /**
278
269
  * Cumulative funding information
279
270
  */
@@ -334,18 +325,31 @@ export interface OrderAssetDto {
334
325
  * Order status
335
326
  */
336
327
  export type OrderStatus = 'OPEN' | 'PARTIALLY_FILLED' | 'PROCESSING';
328
+ /**
329
+ * Order type
330
+ */
331
+ export type OrderType = 'TP' | 'SL' | 'LIMIT' | 'MARKET';
332
+ /**
333
+ * TP/SL trigger type
334
+ */
335
+ export type TpSlTriggerType = 'RATIO' | 'PERCENTAGE' | 'PNL';
337
336
  /**
338
337
  * Open limit order data structure
339
338
  */
340
339
  export interface OpenLimitOrderDto {
341
340
  orderId: string;
342
341
  address: string;
342
+ clientId: string | null;
343
+ positionId: string;
343
344
  leverage: number;
344
345
  usdValue: number;
345
- limitRatio: number;
346
- stopLoss: number | null;
347
- takeProfit: number | null;
346
+ triggerValue: number;
347
+ twapDuration: number | null;
348
+ tpSlTriggerType: TpSlTriggerType;
349
+ randomizeFlag: boolean;
350
+ reduceOnlyFlag: boolean;
348
351
  status: OrderStatus;
352
+ orderType: OrderType;
349
353
  longAssets: OrderAssetDto[];
350
354
  shortAssets: OrderAssetDto[];
351
355
  createdAt: string;
@@ -1,7 +1,7 @@
1
1
  import { ReadyState } from 'react-use-websocket';
2
- import type { PaginatedTradeHistoryResponseDto, OpenLimitOrderDto, AccountSummaryResponseDto, RawPositionDto } from './types';
2
+ import type { OpenLimitOrderDto, AccountSummaryResponseDto, RawPositionDto, TradeHistoryDataDto } from './types';
3
3
  interface WebSocketData {
4
- tradeHistories: PaginatedTradeHistoryResponseDto | null;
4
+ tradeHistories: TradeHistoryDataDto[] | null;
5
5
  openPositions: RawPositionDto[] | null;
6
6
  openOrders: OpenLimitOrderDto[] | null;
7
7
  accountSummary: AccountSummaryResponseDto | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/hyperliquid-sdk",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "React SDK for Pear Protocol Hyperliquid API integration",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",