@0xarchive/sdk 0.5.2 → 0.5.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/README.md CHANGED
@@ -132,9 +132,6 @@ const history = await client.lighter.orderbook.history('BTC', {
132
132
  The trades API uses cursor-based pagination for efficient retrieval of large datasets.
133
133
 
134
134
  ```typescript
135
- // Get recent trades
136
- const recent = await client.hyperliquid.trades.recent('BTC', 100);
137
-
138
135
  // Get trade history with cursor-based pagination
139
136
  let result = await client.hyperliquid.trades.list('BTC', {
140
137
  start: Date.now() - 86400000,
@@ -153,6 +150,9 @@ while (result.nextCursor) {
153
150
  });
154
151
  allTrades.push(...result.data);
155
152
  }
153
+
154
+ // Get recent trades (Lighter only - has real-time data)
155
+ const recent = await client.lighter.trades.recent('BTC', 100);
156
156
  ```
157
157
 
158
158
  ### Instruments
@@ -218,6 +218,38 @@ const history = await client.hyperliquid.openInterest.history('ETH', {
218
218
  });
219
219
  ```
220
220
 
221
+ ### Liquidations (Hyperliquid only)
222
+
223
+ Get historical liquidation events. Data available from May 2025 onwards.
224
+
225
+ ```typescript
226
+ // Get liquidation history for a coin
227
+ const liquidations = await client.hyperliquid.liquidations.history('BTC', {
228
+ start: Date.now() - 86400000,
229
+ end: Date.now(),
230
+ limit: 100
231
+ });
232
+
233
+ // Paginate through all results
234
+ const allLiquidations = [...liquidations.data];
235
+ while (liquidations.nextCursor) {
236
+ const next = await client.hyperliquid.liquidations.history('BTC', {
237
+ start: Date.now() - 86400000,
238
+ end: Date.now(),
239
+ cursor: liquidations.nextCursor,
240
+ limit: 1000
241
+ });
242
+ allLiquidations.push(...next.data);
243
+ }
244
+
245
+ // Get liquidations for a specific user
246
+ const userLiquidations = await client.hyperliquid.liquidations.byUser('0x1234...', {
247
+ start: Date.now() - 86400000 * 7,
248
+ end: Date.now(),
249
+ coin: 'BTC' // optional filter
250
+ });
251
+ ```
252
+
221
253
  ### Candles (OHLCV)
222
254
 
223
255
  Get historical OHLCV candle data aggregated from trades.
@@ -532,11 +564,13 @@ import type {
532
564
  OrderBook,
533
565
  PriceLevel,
534
566
  Trade,
567
+ Candle,
535
568
  Instrument,
536
569
  LighterInstrument,
537
570
  LighterGranularity,
538
571
  FundingRate,
539
572
  OpenInterest,
573
+ Liquidation,
540
574
  CursorResponse,
541
575
  WsOptions,
542
576
  WsChannel,
package/dist/index.d.mts CHANGED
@@ -684,11 +684,8 @@ declare class OrderBookResource {
684
684
  *
685
685
  * @example
686
686
  * ```typescript
687
- * // Get recent trades
688
- * const trades = await client.trades.recent('BTC');
689
- *
690
687
  * // Get trade history with cursor-based pagination (recommended)
691
- * let result = await client.trades.list('BTC', {
688
+ * let result = await client.hyperliquid.trades.list('BTC', {
692
689
  * start: Date.now() - 86400000,
693
690
  * end: Date.now(),
694
691
  * limit: 1000
@@ -697,7 +694,7 @@ declare class OrderBookResource {
697
694
  * // Get all pages
698
695
  * const allTrades = [...result.data];
699
696
  * while (result.nextCursor) {
700
- * result = await client.trades.list('BTC', {
697
+ * result = await client.hyperliquid.trades.list('BTC', {
701
698
  * start: Date.now() - 86400000,
702
699
  * end: Date.now(),
703
700
  * cursor: result.nextCursor,
@@ -705,6 +702,9 @@ declare class OrderBookResource {
705
702
  * });
706
703
  * allTrades.push(...result.data);
707
704
  * }
705
+ *
706
+ * // Get recent trades (Lighter only - has real-time data)
707
+ * const recent = await client.lighter.trades.recent('BTC');
708
708
  * ```
709
709
  */
710
710
  declare class TradesResource {
@@ -743,7 +743,11 @@ declare class TradesResource {
743
743
  */
744
744
  list(coin: string, params: GetTradesCursorParams): Promise<CursorResponse<Trade[]>>;
745
745
  /**
746
- * Get most recent trades for a coin
746
+ * Get most recent trades for a coin.
747
+ *
748
+ * Note: This method is only available for Lighter (client.lighter.trades.recent())
749
+ * which has real-time data ingestion. Hyperliquid uses hourly backfill so this
750
+ * endpoint is not available for Hyperliquid.
747
751
  *
748
752
  * @param coin - The coin symbol (e.g., 'BTC', 'ETH')
749
753
  * @param limit - Number of trades to return (default: 100)
package/dist/index.d.ts CHANGED
@@ -684,11 +684,8 @@ declare class OrderBookResource {
684
684
  *
685
685
  * @example
686
686
  * ```typescript
687
- * // Get recent trades
688
- * const trades = await client.trades.recent('BTC');
689
- *
690
687
  * // Get trade history with cursor-based pagination (recommended)
691
- * let result = await client.trades.list('BTC', {
688
+ * let result = await client.hyperliquid.trades.list('BTC', {
692
689
  * start: Date.now() - 86400000,
693
690
  * end: Date.now(),
694
691
  * limit: 1000
@@ -697,7 +694,7 @@ declare class OrderBookResource {
697
694
  * // Get all pages
698
695
  * const allTrades = [...result.data];
699
696
  * while (result.nextCursor) {
700
- * result = await client.trades.list('BTC', {
697
+ * result = await client.hyperliquid.trades.list('BTC', {
701
698
  * start: Date.now() - 86400000,
702
699
  * end: Date.now(),
703
700
  * cursor: result.nextCursor,
@@ -705,6 +702,9 @@ declare class OrderBookResource {
705
702
  * });
706
703
  * allTrades.push(...result.data);
707
704
  * }
705
+ *
706
+ * // Get recent trades (Lighter only - has real-time data)
707
+ * const recent = await client.lighter.trades.recent('BTC');
708
708
  * ```
709
709
  */
710
710
  declare class TradesResource {
@@ -743,7 +743,11 @@ declare class TradesResource {
743
743
  */
744
744
  list(coin: string, params: GetTradesCursorParams): Promise<CursorResponse<Trade[]>>;
745
745
  /**
746
- * Get most recent trades for a coin
746
+ * Get most recent trades for a coin.
747
+ *
748
+ * Note: This method is only available for Lighter (client.lighter.trades.recent())
749
+ * which has real-time data ingestion. Hyperliquid uses hourly backfill so this
750
+ * endpoint is not available for Hyperliquid.
747
751
  *
748
752
  * @param coin - The coin symbol (e.g., 'BTC', 'ETH')
749
753
  * @param limit - Number of trades to return (default: 100)
package/dist/index.js CHANGED
@@ -521,7 +521,11 @@ var TradesResource = class {
521
521
  };
522
522
  }
523
523
  /**
524
- * Get most recent trades for a coin
524
+ * Get most recent trades for a coin.
525
+ *
526
+ * Note: This method is only available for Lighter (client.lighter.trades.recent())
527
+ * which has real-time data ingestion. Hyperliquid uses hourly backfill so this
528
+ * endpoint is not available for Hyperliquid.
525
529
  *
526
530
  * @param coin - The coin symbol (e.g., 'BTC', 'ETH')
527
531
  * @param limit - Number of trades to return (default: 100)