@0xarchive/sdk 0.9.2 → 1.2.0
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/README.md +192 -111
- package/dist/index.d.mts +283 -64
- package/dist/index.d.ts +283 -64
- package/dist/index.js +254 -84
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +254 -84
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -464,10 +464,11 @@ interface PriceHistoryParams extends CursorPaginationParams {
|
|
|
464
464
|
*
|
|
465
465
|
* - ticker/all_tickers: real-time only
|
|
466
466
|
* - liquidations: historical only (May 2025+)
|
|
467
|
+
* - hip3_liquidations: historical only (Feb 2026+)
|
|
467
468
|
* - open_interest, funding, lighter_open_interest, lighter_funding,
|
|
468
469
|
* hip3_open_interest, hip3_funding: historical only (replay/stream)
|
|
469
470
|
*/
|
|
470
|
-
type WsChannel = 'orderbook' | 'trades' | 'candles' | 'liquidations' | 'ticker' | 'all_tickers' | 'open_interest' | 'funding' | 'lighter_orderbook' | 'lighter_trades' | 'lighter_candles' | 'lighter_open_interest' | 'lighter_funding' | 'hip3_orderbook' | 'hip3_trades' | 'hip3_candles' | 'hip3_open_interest' | 'hip3_funding';
|
|
471
|
+
type WsChannel = 'orderbook' | 'trades' | 'candles' | 'liquidations' | 'ticker' | 'all_tickers' | 'open_interest' | 'funding' | 'lighter_orderbook' | 'lighter_trades' | 'lighter_candles' | 'lighter_open_interest' | 'lighter_funding' | 'lighter_l3_orderbook' | 'hip3_orderbook' | 'hip3_trades' | 'hip3_candles' | 'hip3_open_interest' | 'hip3_funding' | 'hip3_liquidations' | 'l4_diffs' | 'l4_orders' | 'hip3_l4_diffs' | 'hip3_l4_orders';
|
|
471
472
|
/** Subscribe message from client */
|
|
472
473
|
interface WsSubscribe {
|
|
473
474
|
op: 'subscribe';
|
|
@@ -703,8 +704,24 @@ interface WsGapDetected {
|
|
|
703
704
|
/** Gap duration in minutes */
|
|
704
705
|
duration_minutes: number;
|
|
705
706
|
}
|
|
707
|
+
/** L4 snapshot (sent on l4_diffs/hip3_l4_diffs subscription) */
|
|
708
|
+
interface WsL4Snapshot {
|
|
709
|
+
type: 'l4_snapshot';
|
|
710
|
+
channel: WsChannel;
|
|
711
|
+
coin: string;
|
|
712
|
+
last_block_number: number;
|
|
713
|
+
timestamp: number;
|
|
714
|
+
data: any;
|
|
715
|
+
}
|
|
716
|
+
/** L4 batched data (all L4 channels) */
|
|
717
|
+
interface WsL4Batch {
|
|
718
|
+
type: 'l4_batch';
|
|
719
|
+
channel: WsChannel;
|
|
720
|
+
coin: string;
|
|
721
|
+
data: any[];
|
|
722
|
+
}
|
|
706
723
|
/** Server message union type */
|
|
707
|
-
type WsServerMessage = WsSubscribed | WsUnsubscribed | WsPong | WsError | WsData | WsReplayStarted | WsReplayPaused | WsReplayResumed | WsReplayCompleted | WsReplayStopped | WsReplaySnapshot | WsHistoricalData | WsHistoricalTickData | WsStreamStarted | WsStreamProgress | WsHistoricalBatch | WsStreamCompleted | WsStreamStopped | WsGapDetected;
|
|
724
|
+
type WsServerMessage = WsSubscribed | WsUnsubscribed | WsPong | WsError | WsData | WsReplayStarted | WsReplayPaused | WsReplayResumed | WsReplayCompleted | WsReplayStopped | WsReplaySnapshot | WsHistoricalData | WsHistoricalTickData | WsStreamStarted | WsStreamProgress | WsHistoricalBatch | WsStreamCompleted | WsStreamStopped | WsGapDetected | WsL4Snapshot | WsL4Batch;
|
|
708
725
|
/**
|
|
709
726
|
* WebSocket connection options.
|
|
710
727
|
*
|
|
@@ -1332,17 +1349,17 @@ declare class OrderBookResource {
|
|
|
1332
1349
|
private coinTransform;
|
|
1333
1350
|
constructor(http: HttpClient, basePath?: string, coinTransform?: (coin: string) => string);
|
|
1334
1351
|
/**
|
|
1335
|
-
* Get order book snapshot for a
|
|
1352
|
+
* Get order book snapshot for a symbol
|
|
1336
1353
|
*
|
|
1337
|
-
* @param
|
|
1354
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
1338
1355
|
* @param params - Optional parameters
|
|
1339
1356
|
* @returns Order book snapshot
|
|
1340
1357
|
*/
|
|
1341
|
-
get(
|
|
1358
|
+
get(symbol: string, params?: GetOrderBookParams): Promise<OrderBook>;
|
|
1342
1359
|
/**
|
|
1343
1360
|
* Get historical order book snapshots with cursor-based pagination
|
|
1344
1361
|
*
|
|
1345
|
-
* @param
|
|
1362
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
1346
1363
|
* @param params - Time range and cursor pagination parameters (start and end are required)
|
|
1347
1364
|
* @returns CursorResponse with order book snapshots and nextCursor for pagination
|
|
1348
1365
|
*
|
|
@@ -1366,7 +1383,7 @@ declare class OrderBookResource {
|
|
|
1366
1383
|
* }
|
|
1367
1384
|
* ```
|
|
1368
1385
|
*/
|
|
1369
|
-
history(
|
|
1386
|
+
history(symbol: string, params: OrderBookHistoryParams): Promise<CursorResponse<OrderBook[]>>;
|
|
1370
1387
|
/**
|
|
1371
1388
|
* Get raw tick-level orderbook data (Enterprise tier only).
|
|
1372
1389
|
*
|
|
@@ -1376,7 +1393,7 @@ declare class OrderBookResource {
|
|
|
1376
1393
|
*
|
|
1377
1394
|
* For automatic reconstruction, use `historyReconstructed()` instead.
|
|
1378
1395
|
*
|
|
1379
|
-
* @param
|
|
1396
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
1380
1397
|
* @param params - Time range parameters
|
|
1381
1398
|
* @returns Tick data with checkpoint and deltas
|
|
1382
1399
|
*
|
|
@@ -1396,7 +1413,7 @@ declare class OrderBookResource {
|
|
|
1396
1413
|
* }
|
|
1397
1414
|
* ```
|
|
1398
1415
|
*/
|
|
1399
|
-
historyTick(
|
|
1416
|
+
historyTick(symbol: string, params: TickHistoryParams): Promise<TickData>;
|
|
1400
1417
|
/**
|
|
1401
1418
|
* Get reconstructed tick-level orderbook history (Enterprise tier only).
|
|
1402
1419
|
*
|
|
@@ -1406,7 +1423,7 @@ declare class OrderBookResource {
|
|
|
1406
1423
|
* For large time ranges, consider using `historyTick()` with the
|
|
1407
1424
|
* `OrderBookReconstructor.iterate()` method for memory efficiency.
|
|
1408
1425
|
*
|
|
1409
|
-
* @param
|
|
1426
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
1410
1427
|
* @param params - Time range parameters
|
|
1411
1428
|
* @param options - Reconstruction options
|
|
1412
1429
|
* @returns Array of reconstructed orderbook snapshots
|
|
@@ -1430,7 +1447,7 @@ declare class OrderBookResource {
|
|
|
1430
1447
|
* );
|
|
1431
1448
|
* ```
|
|
1432
1449
|
*/
|
|
1433
|
-
historyReconstructed(
|
|
1450
|
+
historyReconstructed(symbol: string, params: TickHistoryParams, options?: ReconstructOptions): Promise<ReconstructedOrderBook[]>;
|
|
1434
1451
|
/**
|
|
1435
1452
|
* Create a reconstructor for streaming tick-level data.
|
|
1436
1453
|
*
|
|
@@ -1465,7 +1482,7 @@ declare class OrderBookResource {
|
|
|
1465
1482
|
* per API request and yielding reconstructed orderbook snapshots one at a time.
|
|
1466
1483
|
* Memory-efficient for processing large time ranges.
|
|
1467
1484
|
*
|
|
1468
|
-
* @param
|
|
1485
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
1469
1486
|
* @param params - Time range parameters
|
|
1470
1487
|
* @param depth - Maximum price levels to include in output snapshots
|
|
1471
1488
|
* @yields Reconstructed orderbook snapshots
|
|
@@ -1488,7 +1505,7 @@ declare class OrderBookResource {
|
|
|
1488
1505
|
* }
|
|
1489
1506
|
* ```
|
|
1490
1507
|
*/
|
|
1491
|
-
iterateTickHistory(
|
|
1508
|
+
iterateTickHistory(symbol: string, params: TickHistoryParams, depth?: number): AsyncGenerator<ReconstructedOrderBook, void, undefined>;
|
|
1492
1509
|
}
|
|
1493
1510
|
|
|
1494
1511
|
/**
|
|
@@ -1525,12 +1542,12 @@ declare class TradesResource {
|
|
|
1525
1542
|
private coinTransform;
|
|
1526
1543
|
constructor(http: HttpClient, basePath?: string, coinTransform?: (coin: string) => string);
|
|
1527
1544
|
/**
|
|
1528
|
-
* Get trade history for a
|
|
1545
|
+
* Get trade history for a symbol using cursor-based pagination
|
|
1529
1546
|
*
|
|
1530
1547
|
* Uses cursor-based pagination by default, which is more efficient for large datasets.
|
|
1531
1548
|
* Use the `nextCursor` from the response as the `cursor` parameter to get the next page.
|
|
1532
1549
|
*
|
|
1533
|
-
* @param
|
|
1550
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
1534
1551
|
* @param params - Time range and cursor pagination parameters (start and end are required)
|
|
1535
1552
|
* @returns Object with trades array and nextCursor for pagination
|
|
1536
1553
|
*
|
|
@@ -1554,20 +1571,20 @@ declare class TradesResource {
|
|
|
1554
1571
|
* }
|
|
1555
1572
|
* ```
|
|
1556
1573
|
*/
|
|
1557
|
-
list(
|
|
1574
|
+
list(symbol: string, params: GetTradesCursorParams): Promise<CursorResponse<Trade[]>>;
|
|
1558
1575
|
/**
|
|
1559
|
-
* Get most recent trades for a
|
|
1576
|
+
* Get most recent trades for a symbol.
|
|
1560
1577
|
*
|
|
1561
1578
|
* Note: This method is available for Lighter (client.lighter.trades.recent())
|
|
1562
1579
|
* and HIP-3 (client.hyperliquid.hip3.trades.recent()) which have real-time data
|
|
1563
1580
|
* ingestion. Hyperliquid uses hourly backfill so this endpoint is not available
|
|
1564
1581
|
* for Hyperliquid.
|
|
1565
1582
|
*
|
|
1566
|
-
* @param
|
|
1583
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
1567
1584
|
* @param limit - Number of trades to return (default: 100)
|
|
1568
1585
|
* @returns Array of recent trades
|
|
1569
1586
|
*/
|
|
1570
|
-
recent(
|
|
1587
|
+
recent(symbol: string, limit?: number): Promise<Trade[]>;
|
|
1571
1588
|
}
|
|
1572
1589
|
|
|
1573
1590
|
/**
|
|
@@ -1704,20 +1721,20 @@ declare class FundingResource {
|
|
|
1704
1721
|
private coinTransform;
|
|
1705
1722
|
constructor(http: HttpClient, basePath?: string, coinTransform?: (coin: string) => string);
|
|
1706
1723
|
/**
|
|
1707
|
-
* Get funding rate history for a
|
|
1724
|
+
* Get funding rate history for a symbol with cursor-based pagination
|
|
1708
1725
|
*
|
|
1709
|
-
* @param
|
|
1726
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
1710
1727
|
* @param params - Time range and cursor pagination parameters (start and end are required)
|
|
1711
1728
|
* @returns CursorResponse with funding rate records and nextCursor for pagination
|
|
1712
1729
|
*/
|
|
1713
|
-
history(
|
|
1730
|
+
history(symbol: string, params: FundingHistoryParams): Promise<CursorResponse<FundingRate[]>>;
|
|
1714
1731
|
/**
|
|
1715
|
-
* Get current funding rate for a
|
|
1732
|
+
* Get current funding rate for a symbol
|
|
1716
1733
|
*
|
|
1717
|
-
* @param
|
|
1734
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
1718
1735
|
* @returns Current funding rate
|
|
1719
1736
|
*/
|
|
1720
|
-
current(
|
|
1737
|
+
current(symbol: string): Promise<FundingRate>;
|
|
1721
1738
|
}
|
|
1722
1739
|
|
|
1723
1740
|
/**
|
|
@@ -1754,20 +1771,20 @@ declare class OpenInterestResource {
|
|
|
1754
1771
|
private coinTransform;
|
|
1755
1772
|
constructor(http: HttpClient, basePath?: string, coinTransform?: (coin: string) => string);
|
|
1756
1773
|
/**
|
|
1757
|
-
* Get open interest history for a
|
|
1774
|
+
* Get open interest history for a symbol with cursor-based pagination
|
|
1758
1775
|
*
|
|
1759
|
-
* @param
|
|
1776
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
1760
1777
|
* @param params - Time range and cursor pagination parameters (start and end are required)
|
|
1761
1778
|
* @returns CursorResponse with open interest records and nextCursor for pagination
|
|
1762
1779
|
*/
|
|
1763
|
-
history(
|
|
1780
|
+
history(symbol: string, params: OpenInterestHistoryParams): Promise<CursorResponse<OpenInterest[]>>;
|
|
1764
1781
|
/**
|
|
1765
|
-
* Get current open interest for a
|
|
1782
|
+
* Get current open interest for a symbol
|
|
1766
1783
|
*
|
|
1767
|
-
* @param
|
|
1784
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
1768
1785
|
* @returns Current open interest
|
|
1769
1786
|
*/
|
|
1770
|
-
current(
|
|
1787
|
+
current(symbol: string): Promise<OpenInterest>;
|
|
1771
1788
|
}
|
|
1772
1789
|
|
|
1773
1790
|
/**
|
|
@@ -1810,11 +1827,11 @@ declare class CandlesResource {
|
|
|
1810
1827
|
/**
|
|
1811
1828
|
* Get historical OHLCV candle data with cursor-based pagination
|
|
1812
1829
|
*
|
|
1813
|
-
* @param
|
|
1830
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
1814
1831
|
* @param params - Time range, interval, and cursor pagination parameters (start and end are required)
|
|
1815
1832
|
* @returns CursorResponse with candle records and nextCursor for pagination
|
|
1816
1833
|
*/
|
|
1817
|
-
history(
|
|
1834
|
+
history(symbol: string, params: CandleHistoryParams): Promise<CursorResponse<Candle[]>>;
|
|
1818
1835
|
}
|
|
1819
1836
|
|
|
1820
1837
|
/**
|
|
@@ -1855,15 +1872,16 @@ declare class CandlesResource {
|
|
|
1855
1872
|
declare class LiquidationsResource {
|
|
1856
1873
|
private http;
|
|
1857
1874
|
private basePath;
|
|
1858
|
-
|
|
1875
|
+
private coinTransform;
|
|
1876
|
+
constructor(http: HttpClient, basePath?: string, coinTransform?: (coin: string) => string);
|
|
1859
1877
|
/**
|
|
1860
|
-
* Get liquidation history for a
|
|
1878
|
+
* Get liquidation history for a symbol with cursor-based pagination
|
|
1861
1879
|
*
|
|
1862
|
-
* @param
|
|
1880
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
1863
1881
|
* @param params - Time range and cursor pagination parameters (start and end are required)
|
|
1864
1882
|
* @returns CursorResponse with liquidation records and nextCursor for pagination
|
|
1865
1883
|
*/
|
|
1866
|
-
history(
|
|
1884
|
+
history(symbol: string, params: LiquidationHistoryParams): Promise<CursorResponse<Liquidation[]>>;
|
|
1867
1885
|
/**
|
|
1868
1886
|
* Get liquidation history for a specific user
|
|
1869
1887
|
*
|
|
@@ -1882,11 +1900,11 @@ declare class LiquidationsResource {
|
|
|
1882
1900
|
* Returns pre-aggregated data with total/long/short USD volumes per bucket,
|
|
1883
1901
|
* reducing data transfer by 100-1000x compared to individual liquidation records.
|
|
1884
1902
|
*
|
|
1885
|
-
* @param
|
|
1903
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
1886
1904
|
* @param params - Time range, cursor, and interval parameters
|
|
1887
1905
|
* @returns CursorResponse with liquidation volume buckets
|
|
1888
1906
|
*/
|
|
1889
|
-
volume(
|
|
1907
|
+
volume(symbol: string, params: LiquidationVolumeParams): Promise<CursorResponse<LiquidationVolume[]>>;
|
|
1890
1908
|
}
|
|
1891
1909
|
|
|
1892
1910
|
/**
|
|
@@ -2138,6 +2156,183 @@ declare class Web3Resource {
|
|
|
2138
2156
|
subscribe(tier: 'build' | 'pro', paymentSignature: string): Promise<Web3SubscribeResult>;
|
|
2139
2157
|
}
|
|
2140
2158
|
|
|
2159
|
+
interface OrderHistoryParams extends CursorPaginationParams {
|
|
2160
|
+
user?: string;
|
|
2161
|
+
status?: string;
|
|
2162
|
+
order_type?: string;
|
|
2163
|
+
}
|
|
2164
|
+
interface OrderFlowParams {
|
|
2165
|
+
start: number | string;
|
|
2166
|
+
end: number | string;
|
|
2167
|
+
interval?: string;
|
|
2168
|
+
limit?: number;
|
|
2169
|
+
}
|
|
2170
|
+
interface TpslParams extends CursorPaginationParams {
|
|
2171
|
+
user?: string;
|
|
2172
|
+
triggered?: boolean;
|
|
2173
|
+
}
|
|
2174
|
+
/**
|
|
2175
|
+
* Orders API resource
|
|
2176
|
+
*
|
|
2177
|
+
* @example
|
|
2178
|
+
* ```typescript
|
|
2179
|
+
* // Get order history
|
|
2180
|
+
* const result = await client.hyperliquid.orders.history('BTC', {
|
|
2181
|
+
* start: Date.now() - 86400000,
|
|
2182
|
+
* end: Date.now(),
|
|
2183
|
+
* limit: 1000
|
|
2184
|
+
* });
|
|
2185
|
+
*
|
|
2186
|
+
* // Get order flow
|
|
2187
|
+
* const flow = await client.hyperliquid.orders.flow('BTC', {
|
|
2188
|
+
* start: Date.now() - 86400000,
|
|
2189
|
+
* end: Date.now(),
|
|
2190
|
+
* interval: '1h'
|
|
2191
|
+
* });
|
|
2192
|
+
*
|
|
2193
|
+
* // Get TP/SL orders
|
|
2194
|
+
* const tpsl = await client.hyperliquid.orders.tpsl('BTC', {
|
|
2195
|
+
* start: Date.now() - 86400000,
|
|
2196
|
+
* end: Date.now()
|
|
2197
|
+
* });
|
|
2198
|
+
* ```
|
|
2199
|
+
*/
|
|
2200
|
+
declare class OrdersResource {
|
|
2201
|
+
private http;
|
|
2202
|
+
private basePath;
|
|
2203
|
+
private coinTransform;
|
|
2204
|
+
constructor(http: HttpClient, basePath?: string, coinTransform?: (s: string) => string);
|
|
2205
|
+
/**
|
|
2206
|
+
* Get order history for a symbol with cursor-based pagination
|
|
2207
|
+
*
|
|
2208
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
2209
|
+
* @param params - Time range, cursor pagination, and filter parameters
|
|
2210
|
+
* @returns CursorResponse with order records and nextCursor for pagination
|
|
2211
|
+
*/
|
|
2212
|
+
history(symbol: string, params: OrderHistoryParams): Promise<CursorResponse<any[]>>;
|
|
2213
|
+
/**
|
|
2214
|
+
* Get order flow for a symbol
|
|
2215
|
+
*
|
|
2216
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
2217
|
+
* @param params - Time range and interval parameters
|
|
2218
|
+
* @returns CursorResponse with order flow records
|
|
2219
|
+
*/
|
|
2220
|
+
flow(symbol: string, params: OrderFlowParams): Promise<CursorResponse<any[]>>;
|
|
2221
|
+
/**
|
|
2222
|
+
* Get TP/SL orders for a symbol with cursor-based pagination
|
|
2223
|
+
*
|
|
2224
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
2225
|
+
* @param params - Time range, cursor pagination, and filter parameters
|
|
2226
|
+
* @returns CursorResponse with TP/SL order records
|
|
2227
|
+
*/
|
|
2228
|
+
tpsl(symbol: string, params: TpslParams): Promise<CursorResponse<any[]>>;
|
|
2229
|
+
}
|
|
2230
|
+
|
|
2231
|
+
interface L4OrderBookParams {
|
|
2232
|
+
timestamp?: number | string;
|
|
2233
|
+
depth?: number;
|
|
2234
|
+
}
|
|
2235
|
+
/**
|
|
2236
|
+
* L4 Order Book API resource
|
|
2237
|
+
*
|
|
2238
|
+
* Access L4 orderbook snapshots, diffs, and history.
|
|
2239
|
+
*
|
|
2240
|
+
* @example
|
|
2241
|
+
* ```typescript
|
|
2242
|
+
* // Get current L4 orderbook
|
|
2243
|
+
* const orderbook = await client.hyperliquid.l4Orderbook.get('BTC');
|
|
2244
|
+
*
|
|
2245
|
+
* // Get L4 orderbook diffs
|
|
2246
|
+
* const diffs = await client.hyperliquid.l4Orderbook.diffs('BTC', {
|
|
2247
|
+
* start: Date.now() - 86400000,
|
|
2248
|
+
* end: Date.now(),
|
|
2249
|
+
* limit: 1000
|
|
2250
|
+
* });
|
|
2251
|
+
*
|
|
2252
|
+
* // Get L4 orderbook history
|
|
2253
|
+
* const history = await client.hyperliquid.l4Orderbook.history('BTC', {
|
|
2254
|
+
* start: Date.now() - 86400000,
|
|
2255
|
+
* end: Date.now(),
|
|
2256
|
+
* limit: 1000
|
|
2257
|
+
* });
|
|
2258
|
+
* ```
|
|
2259
|
+
*/
|
|
2260
|
+
declare class L4OrderBookResource {
|
|
2261
|
+
private http;
|
|
2262
|
+
private basePath;
|
|
2263
|
+
private coinTransform;
|
|
2264
|
+
constructor(http: HttpClient, basePath?: string, coinTransform?: (s: string) => string);
|
|
2265
|
+
/**
|
|
2266
|
+
* Get L4 order book snapshot for a symbol
|
|
2267
|
+
*
|
|
2268
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
2269
|
+
* @param params - Optional parameters (timestamp, depth)
|
|
2270
|
+
* @returns L4 order book snapshot
|
|
2271
|
+
*/
|
|
2272
|
+
get(symbol: string, params?: L4OrderBookParams): Promise<any>;
|
|
2273
|
+
/**
|
|
2274
|
+
* Get L4 order book diffs with cursor-based pagination
|
|
2275
|
+
*
|
|
2276
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
2277
|
+
* @param params - Time range and cursor pagination parameters
|
|
2278
|
+
* @returns CursorResponse with L4 orderbook diffs and nextCursor for pagination
|
|
2279
|
+
*/
|
|
2280
|
+
diffs(symbol: string, params: CursorPaginationParams): Promise<CursorResponse<any[]>>;
|
|
2281
|
+
/**
|
|
2282
|
+
* Get L4 order book history with cursor-based pagination
|
|
2283
|
+
*
|
|
2284
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
2285
|
+
* @param params - Time range and cursor pagination parameters
|
|
2286
|
+
* @returns CursorResponse with L4 orderbook snapshots and nextCursor for pagination
|
|
2287
|
+
*/
|
|
2288
|
+
history(symbol: string, params: CursorPaginationParams): Promise<CursorResponse<any[]>>;
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2291
|
+
interface L3OrderBookParams {
|
|
2292
|
+
timestamp?: number | string;
|
|
2293
|
+
depth?: number;
|
|
2294
|
+
}
|
|
2295
|
+
/**
|
|
2296
|
+
* L3 Order Book API resource (Lighter only)
|
|
2297
|
+
*
|
|
2298
|
+
* Access L3 orderbook snapshots and history from Lighter.xyz.
|
|
2299
|
+
*
|
|
2300
|
+
* @example
|
|
2301
|
+
* ```typescript
|
|
2302
|
+
* // Get current L3 orderbook
|
|
2303
|
+
* const orderbook = await client.lighter.l3Orderbook.get('BTC');
|
|
2304
|
+
*
|
|
2305
|
+
* // Get L3 orderbook history
|
|
2306
|
+
* const history = await client.lighter.l3Orderbook.history('BTC', {
|
|
2307
|
+
* start: Date.now() - 86400000,
|
|
2308
|
+
* end: Date.now(),
|
|
2309
|
+
* limit: 1000
|
|
2310
|
+
* });
|
|
2311
|
+
* ```
|
|
2312
|
+
*/
|
|
2313
|
+
declare class L3OrderBookResource {
|
|
2314
|
+
private http;
|
|
2315
|
+
private basePath;
|
|
2316
|
+
private coinTransform;
|
|
2317
|
+
constructor(http: HttpClient, basePath?: string, coinTransform?: (s: string) => string);
|
|
2318
|
+
/**
|
|
2319
|
+
* Get L3 order book snapshot for a symbol
|
|
2320
|
+
*
|
|
2321
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
2322
|
+
* @param params - Optional parameters (timestamp, depth)
|
|
2323
|
+
* @returns L3 order book snapshot
|
|
2324
|
+
*/
|
|
2325
|
+
get(symbol: string, params?: L3OrderBookParams): Promise<any>;
|
|
2326
|
+
/**
|
|
2327
|
+
* Get L3 order book history with cursor-based pagination
|
|
2328
|
+
*
|
|
2329
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
2330
|
+
* @param params - Time range and cursor pagination parameters
|
|
2331
|
+
* @returns CursorResponse with L3 orderbook snapshots and nextCursor for pagination
|
|
2332
|
+
*/
|
|
2333
|
+
history(symbol: string, params: CursorPaginationParams): Promise<CursorResponse<any[]>>;
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2141
2336
|
/**
|
|
2142
2337
|
* Hyperliquid exchange client
|
|
2143
2338
|
*
|
|
@@ -2179,6 +2374,14 @@ declare class HyperliquidClient {
|
|
|
2179
2374
|
* Liquidation events (May 2025+)
|
|
2180
2375
|
*/
|
|
2181
2376
|
readonly liquidations: LiquidationsResource;
|
|
2377
|
+
/**
|
|
2378
|
+
* Order history, flow, and TP/SL
|
|
2379
|
+
*/
|
|
2380
|
+
readonly orders: OrdersResource;
|
|
2381
|
+
/**
|
|
2382
|
+
* L4 order book (snapshots, diffs, history)
|
|
2383
|
+
*/
|
|
2384
|
+
readonly l4Orderbook: L4OrderBookResource;
|
|
2182
2385
|
/**
|
|
2183
2386
|
* HIP-3 builder-deployed perpetuals (February 2026+)
|
|
2184
2387
|
*/
|
|
@@ -2186,27 +2389,27 @@ declare class HyperliquidClient {
|
|
|
2186
2389
|
private http;
|
|
2187
2390
|
constructor(http: HttpClient);
|
|
2188
2391
|
/**
|
|
2189
|
-
* Get per-
|
|
2392
|
+
* Get per-symbol data freshness across all data types
|
|
2190
2393
|
*
|
|
2191
|
-
* @param
|
|
2192
|
-
* @returns Per-
|
|
2394
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
2395
|
+
* @returns Per-symbol freshness with last_updated and lag_ms for each data type
|
|
2193
2396
|
*/
|
|
2194
|
-
freshness(
|
|
2397
|
+
freshness(symbol: string): Promise<CoinFreshness>;
|
|
2195
2398
|
/**
|
|
2196
2399
|
* Get combined market summary (price, funding, OI, volume, liquidations) in one call
|
|
2197
2400
|
*
|
|
2198
|
-
* @param
|
|
2401
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
2199
2402
|
* @returns Combined market summary
|
|
2200
2403
|
*/
|
|
2201
|
-
summary(
|
|
2404
|
+
summary(symbol: string): Promise<CoinSummary>;
|
|
2202
2405
|
/**
|
|
2203
2406
|
* Get mark/oracle/mid price history (projected from OI data)
|
|
2204
2407
|
*
|
|
2205
|
-
* @param
|
|
2408
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
2206
2409
|
* @param params - Time range, cursor, and interval parameters
|
|
2207
2410
|
* @returns CursorResponse with price snapshots
|
|
2208
2411
|
*/
|
|
2209
|
-
priceHistory(
|
|
2412
|
+
priceHistory(symbol: string, params: PriceHistoryParams): Promise<CursorResponse<PriceSnapshot[]>>;
|
|
2210
2413
|
}
|
|
2211
2414
|
/**
|
|
2212
2415
|
* HIP-3 builder-deployed perpetuals client
|
|
@@ -2246,30 +2449,42 @@ declare class Hip3Client {
|
|
|
2246
2449
|
* OHLCV candle data
|
|
2247
2450
|
*/
|
|
2248
2451
|
readonly candles: CandlesResource;
|
|
2452
|
+
/**
|
|
2453
|
+
* Liquidation events
|
|
2454
|
+
*/
|
|
2455
|
+
readonly liquidations: LiquidationsResource;
|
|
2456
|
+
/**
|
|
2457
|
+
* Order history, flow, and TP/SL
|
|
2458
|
+
*/
|
|
2459
|
+
readonly orders: OrdersResource;
|
|
2460
|
+
/**
|
|
2461
|
+
* L4 order book (snapshots, diffs, history)
|
|
2462
|
+
*/
|
|
2463
|
+
readonly l4Orderbook: L4OrderBookResource;
|
|
2249
2464
|
private http;
|
|
2250
2465
|
constructor(http: HttpClient);
|
|
2251
2466
|
/**
|
|
2252
|
-
* Get per-
|
|
2467
|
+
* Get per-symbol data freshness across all data types
|
|
2253
2468
|
*
|
|
2254
|
-
* @param
|
|
2255
|
-
* @returns Per-
|
|
2469
|
+
* @param symbol - The symbol (case-sensitive, e.g., 'km:US500')
|
|
2470
|
+
* @returns Per-symbol freshness with last_updated and lag_ms for each data type
|
|
2256
2471
|
*/
|
|
2257
|
-
freshness(
|
|
2472
|
+
freshness(symbol: string): Promise<CoinFreshness>;
|
|
2258
2473
|
/**
|
|
2259
2474
|
* Get combined market summary (price, funding, OI) in one call
|
|
2260
2475
|
*
|
|
2261
|
-
* @param
|
|
2476
|
+
* @param symbol - The symbol (case-sensitive, e.g., 'km:US500')
|
|
2262
2477
|
* @returns Combined market summary
|
|
2263
2478
|
*/
|
|
2264
|
-
summary(
|
|
2479
|
+
summary(symbol: string): Promise<CoinSummary>;
|
|
2265
2480
|
/**
|
|
2266
2481
|
* Get mark/oracle/mid price history (projected from OI data)
|
|
2267
2482
|
*
|
|
2268
|
-
* @param
|
|
2483
|
+
* @param symbol - The symbol (case-sensitive, e.g., 'km:US500')
|
|
2269
2484
|
* @param params - Time range, cursor, and interval parameters
|
|
2270
2485
|
* @returns CursorResponse with price snapshots
|
|
2271
2486
|
*/
|
|
2272
|
-
priceHistory(
|
|
2487
|
+
priceHistory(symbol: string, params: PriceHistoryParams): Promise<CursorResponse<PriceSnapshot[]>>;
|
|
2273
2488
|
}
|
|
2274
2489
|
/**
|
|
2275
2490
|
* Lighter.xyz exchange client
|
|
@@ -2310,30 +2525,34 @@ declare class LighterClient {
|
|
|
2310
2525
|
* OHLCV candle data
|
|
2311
2526
|
*/
|
|
2312
2527
|
readonly candles: CandlesResource;
|
|
2528
|
+
/**
|
|
2529
|
+
* L3 order book (Lighter only)
|
|
2530
|
+
*/
|
|
2531
|
+
readonly l3Orderbook: L3OrderBookResource;
|
|
2313
2532
|
private http;
|
|
2314
2533
|
constructor(http: HttpClient);
|
|
2315
2534
|
/**
|
|
2316
|
-
* Get per-
|
|
2535
|
+
* Get per-symbol data freshness across all data types
|
|
2317
2536
|
*
|
|
2318
|
-
* @param
|
|
2319
|
-
* @returns Per-
|
|
2537
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
2538
|
+
* @returns Per-symbol freshness with last_updated and lag_ms for each data type
|
|
2320
2539
|
*/
|
|
2321
|
-
freshness(
|
|
2540
|
+
freshness(symbol: string): Promise<CoinFreshness>;
|
|
2322
2541
|
/**
|
|
2323
2542
|
* Get combined market summary (price, funding, OI) in one call
|
|
2324
2543
|
*
|
|
2325
|
-
* @param
|
|
2544
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
2326
2545
|
* @returns Combined market summary
|
|
2327
2546
|
*/
|
|
2328
|
-
summary(
|
|
2547
|
+
summary(symbol: string): Promise<CoinSummary>;
|
|
2329
2548
|
/**
|
|
2330
2549
|
* Get mark/oracle price history (projected from OI data)
|
|
2331
2550
|
*
|
|
2332
|
-
* @param
|
|
2551
|
+
* @param symbol - The symbol (e.g., 'BTC', 'ETH')
|
|
2333
2552
|
* @param params - Time range, cursor, and interval parameters
|
|
2334
2553
|
* @returns CursorResponse with price snapshots
|
|
2335
2554
|
*/
|
|
2336
|
-
priceHistory(
|
|
2555
|
+
priceHistory(symbol: string, params: PriceHistoryParams): Promise<CursorResponse<PriceSnapshot[]>>;
|
|
2337
2556
|
}
|
|
2338
2557
|
|
|
2339
2558
|
/**
|
|
@@ -5243,4 +5462,4 @@ type ValidatedCandle = z.infer<typeof CandleSchema>;
|
|
|
5243
5462
|
type ValidatedLiquidation = z.infer<typeof LiquidationSchema>;
|
|
5244
5463
|
type ValidatedWsServerMessage = z.infer<typeof WsServerMessageSchema>;
|
|
5245
5464
|
|
|
5246
|
-
export { type ApiError, type ApiMeta, ApiMetaSchema, type ApiResponse, ApiResponseSchema, type Candle, CandleArrayResponseSchema, type CandleHistoryParams, type CandleInterval, CandleIntervalSchema, CandleSchema, type ClientOptions, type CoinFreshness, CoinFreshnessResponseSchema, CoinFreshnessSchema, type CoinSummary, CoinSummaryResponseSchema, CoinSummarySchema, type CompletenessMetrics, type CoverageGap, type CoverageResponse, type CursorResponse, type DataCadence, type DataFreshness, type DataTypeCoverage, type DataTypeFreshnessInfo, DataTypeFreshnessInfoSchema, type DataTypeStatus, type ExchangeCoverage, type ExchangeLatency, type ExchangeStatus, type FundingHistoryParams, type FundingRate, FundingRateArrayResponseSchema, FundingRateResponseSchema, FundingRateSchema, type GetOrderBookParams, type GetTradesCursorParams, Hip3Client, type Hip3Instrument, HyperliquidClient, type Incident, type IncidentSeverityValue, type IncidentStatusValue, type IncidentsResponse, type Instrument, InstrumentArrayResponseSchema, InstrumentResponseSchema, InstrumentSchema, type InstrumentType, InstrumentTypeSchema, type LatencyResponse, LighterClient, type LighterGranularity, type LighterInstrument, type Liquidation, LiquidationArrayResponseSchema, type LiquidationHistoryParams, LiquidationSchema, LiquidationSideSchema, type LiquidationVolume, LiquidationVolumeArrayResponseSchema, type LiquidationVolumeParams, LiquidationVolumeSchema, type LiquidationsByUserParams, type ListIncidentsParams, type OiFundingInterval, type OpenInterest, OpenInterestArrayResponseSchema, type OpenInterestHistoryParams, OpenInterestResponseSchema, OpenInterestSchema, type OrderBook, OrderBookArrayResponseSchema, type OrderBookHistoryParams, OrderBookReconstructor, OrderBookResponseSchema, OrderBookSchema, type OrderbookDelta, OxArchive, OxArchiveError, OxArchiveWs, type Pagination, type PriceHistoryParams, type PriceLevel, PriceLevelSchema, type PriceSnapshot, PriceSnapshotArrayResponseSchema, PriceSnapshotSchema, type ReconstructOptions, type ReconstructedOrderBook, type RestApiLatency, type SiweChallenge, type SlaActual, type SlaParams, type SlaResponse, type SlaTargets, type StatusResponse, type SymbolCoverageOptions, type SymbolCoverageResponse, type SymbolDataTypeCoverage, type SystemStatusValue, type TickData, type TickHistoryParams, type Timestamp, type TimestampedRecord, TimestampedRecordSchema, type Trade, TradeArrayResponseSchema, type TradeDirection, TradeDirectionSchema, TradeSchema, type TradeSide, TradeSideSchema, type ValidatedApiMeta, type ValidatedCandle, type ValidatedFundingRate, type ValidatedInstrument, type ValidatedLiquidation, type ValidatedOpenInterest, type ValidatedOrderBook, type ValidatedPriceLevel, type ValidatedTrade, type ValidatedWsServerMessage, type Web3ApiKey, type Web3KeysList, type Web3PaymentRequired, type Web3RevokeResult, type Web3SignupResult, type Web3SubscribeResult, type WebSocketLatency, type WsChannel, WsChannelSchema, type WsClientMessage, type WsConnectionState, WsConnectionStateSchema, type WsData, WsDataSchema, type WsError, WsErrorSchema, type WsEventHandlers, type WsGapDetected, type WsHistoricalBatch, WsHistoricalBatchSchema, type WsHistoricalData, WsHistoricalDataSchema, type WsHistoricalTickData, type WsOptions, type WsPing, type WsPong, WsPongSchema, type WsReplay, type WsReplayCompleted, WsReplayCompletedSchema, type WsReplayPause, type WsReplayPaused, WsReplayPausedSchema, type WsReplayResume, type WsReplayResumed, WsReplayResumedSchema, type WsReplaySeek, type WsReplaySnapshot, WsReplaySnapshotSchema, type WsReplayStarted, WsReplayStartedSchema, type WsReplayStop, type WsReplayStopped, WsReplayStoppedSchema, type WsServerMessage, WsServerMessageSchema, type WsStream, type WsStreamCompleted, WsStreamCompletedSchema, type WsStreamProgress, WsStreamProgressSchema, type WsStreamStarted, WsStreamStartedSchema, type WsStreamStop, type WsStreamStopped, WsStreamStoppedSchema, type WsSubscribe, type WsSubscribed, WsSubscribedSchema, type WsUnsubscribe, type WsUnsubscribed, WsUnsubscribedSchema, OxArchive as default, reconstructFinal, reconstructOrderBook };
|
|
5465
|
+
export { type ApiError, type ApiMeta, ApiMetaSchema, type ApiResponse, ApiResponseSchema, type Candle, CandleArrayResponseSchema, type CandleHistoryParams, type CandleInterval, CandleIntervalSchema, CandleSchema, type ClientOptions, type CoinFreshness, CoinFreshnessResponseSchema, CoinFreshnessSchema, type CoinSummary, CoinSummaryResponseSchema, CoinSummarySchema, type CompletenessMetrics, type CoverageGap, type CoverageResponse, type CursorResponse, type DataCadence, type DataFreshness, type DataTypeCoverage, type DataTypeFreshnessInfo, DataTypeFreshnessInfoSchema, type DataTypeStatus, type ExchangeCoverage, type ExchangeLatency, type ExchangeStatus, type FundingHistoryParams, type FundingRate, FundingRateArrayResponseSchema, FundingRateResponseSchema, FundingRateSchema, type GetOrderBookParams, type GetTradesCursorParams, Hip3Client, type Hip3Instrument, HyperliquidClient, type Incident, type IncidentSeverityValue, type IncidentStatusValue, type IncidentsResponse, type Instrument, InstrumentArrayResponseSchema, InstrumentResponseSchema, InstrumentSchema, type InstrumentType, InstrumentTypeSchema, type LatencyResponse, LighterClient, type LighterGranularity, type LighterInstrument, type Liquidation, LiquidationArrayResponseSchema, type LiquidationHistoryParams, LiquidationSchema, LiquidationSideSchema, type LiquidationVolume, LiquidationVolumeArrayResponseSchema, type LiquidationVolumeParams, LiquidationVolumeSchema, type LiquidationsByUserParams, type ListIncidentsParams, type OiFundingInterval, type OpenInterest, OpenInterestArrayResponseSchema, type OpenInterestHistoryParams, OpenInterestResponseSchema, OpenInterestSchema, type OrderBook, OrderBookArrayResponseSchema, type OrderBookHistoryParams, OrderBookReconstructor, OrderBookResponseSchema, OrderBookSchema, type OrderbookDelta, OxArchive, OxArchiveError, OxArchiveWs, type Pagination, type PriceHistoryParams, type PriceLevel, PriceLevelSchema, type PriceSnapshot, PriceSnapshotArrayResponseSchema, PriceSnapshotSchema, type ReconstructOptions, type ReconstructedOrderBook, type RestApiLatency, type SiweChallenge, type SlaActual, type SlaParams, type SlaResponse, type SlaTargets, type StatusResponse, type SymbolCoverageOptions, type SymbolCoverageResponse, type SymbolDataTypeCoverage, type SystemStatusValue, type TickData, type TickHistoryParams, type Timestamp, type TimestampedRecord, TimestampedRecordSchema, type Trade, TradeArrayResponseSchema, type TradeDirection, TradeDirectionSchema, TradeSchema, type TradeSide, TradeSideSchema, type ValidatedApiMeta, type ValidatedCandle, type ValidatedFundingRate, type ValidatedInstrument, type ValidatedLiquidation, type ValidatedOpenInterest, type ValidatedOrderBook, type ValidatedPriceLevel, type ValidatedTrade, type ValidatedWsServerMessage, type Web3ApiKey, type Web3KeysList, type Web3PaymentRequired, type Web3RevokeResult, type Web3SignupResult, type Web3SubscribeResult, type WebSocketLatency, type WsChannel, WsChannelSchema, type WsClientMessage, type WsConnectionState, WsConnectionStateSchema, type WsData, WsDataSchema, type WsError, WsErrorSchema, type WsEventHandlers, type WsGapDetected, type WsHistoricalBatch, WsHistoricalBatchSchema, type WsHistoricalData, WsHistoricalDataSchema, type WsHistoricalTickData, type WsL4Batch, type WsL4Snapshot, type WsOptions, type WsPing, type WsPong, WsPongSchema, type WsReplay, type WsReplayCompleted, WsReplayCompletedSchema, type WsReplayPause, type WsReplayPaused, WsReplayPausedSchema, type WsReplayResume, type WsReplayResumed, WsReplayResumedSchema, type WsReplaySeek, type WsReplaySnapshot, WsReplaySnapshotSchema, type WsReplayStarted, WsReplayStartedSchema, type WsReplayStop, type WsReplayStopped, WsReplayStoppedSchema, type WsServerMessage, WsServerMessageSchema, type WsStream, type WsStreamCompleted, WsStreamCompletedSchema, type WsStreamProgress, WsStreamProgressSchema, type WsStreamStarted, WsStreamStartedSchema, type WsStreamStop, type WsStreamStopped, WsStreamStoppedSchema, type WsSubscribe, type WsSubscribed, WsSubscribedSchema, type WsUnsubscribe, type WsUnsubscribed, WsUnsubscribedSchema, OxArchive as default, reconstructFinal, reconstructOrderBook };
|