@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.
- package/dist/hooks/useTrading.d.ts +20 -8
- package/dist/index.d.ts +38 -22
- package/dist/index.esm.js +144 -102
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +144 -102
- package/dist/index.js.map +1 -1
- package/dist/provider.d.ts +2 -2
- package/dist/types.d.ts +16 -12
- package/dist/websocket.d.ts +2 -2
- package/package.json +1 -1
package/dist/provider.d.ts
CHANGED
|
@@ -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 {
|
|
6
|
+
import type { RawPositionDto, OpenLimitOrderDto, AccountSummaryResponseDto, WebData2Response, WsAllMidsData, TradeHistoryDataDto } from './types';
|
|
7
7
|
interface WebSocketData {
|
|
8
|
-
tradeHistories:
|
|
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
|
-
|
|
346
|
-
|
|
347
|
-
|
|
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;
|
package/dist/websocket.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReadyState } from 'react-use-websocket';
|
|
2
|
-
import type {
|
|
2
|
+
import type { OpenLimitOrderDto, AccountSummaryResponseDto, RawPositionDto, TradeHistoryDataDto } from './types';
|
|
3
3
|
interface WebSocketData {
|
|
4
|
-
tradeHistories:
|
|
4
|
+
tradeHistories: TradeHistoryDataDto[] | null;
|
|
5
5
|
openPositions: RawPositionDto[] | null;
|
|
6
6
|
openOrders: OpenLimitOrderDto[] | null;
|
|
7
7
|
accountSummary: AccountSummaryResponseDto | null;
|