@0xarchive/sdk 0.5.1 → 0.5.2

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.mts CHANGED
@@ -264,6 +264,47 @@ interface OpenInterest {
264
264
  */
265
265
  interface OpenInterestHistoryParams extends CursorPaginationParams {
266
266
  }
267
+ /**
268
+ * Liquidation event record
269
+ */
270
+ interface Liquidation {
271
+ /** Trading pair symbol */
272
+ coin: string;
273
+ /** Liquidation timestamp (UTC) */
274
+ timestamp: string;
275
+ /** Address of the liquidated user */
276
+ liquidatedUser: string;
277
+ /** Address of the liquidator */
278
+ liquidatorUser: string;
279
+ /** Liquidation execution price */
280
+ price: string;
281
+ /** Liquidation size */
282
+ size: string;
283
+ /** Side: 'B' (buy) or 'S' (sell) */
284
+ side: 'B' | 'S';
285
+ /** Mark price at time of liquidation */
286
+ markPrice?: string;
287
+ /** Realized PnL from the liquidation */
288
+ closedPnl?: string;
289
+ /** Position direction (e.g., 'Open Long', 'Close Short') */
290
+ direction?: string;
291
+ /** Unique trade ID */
292
+ tradeId?: number;
293
+ /** Blockchain transaction hash */
294
+ txHash?: string;
295
+ }
296
+ /**
297
+ * Parameters for getting liquidation history
298
+ */
299
+ interface LiquidationHistoryParams extends CursorPaginationParams {
300
+ }
301
+ /**
302
+ * Parameters for getting liquidations by user
303
+ */
304
+ interface LiquidationsByUserParams extends CursorPaginationParams {
305
+ /** Optional coin filter */
306
+ coin?: string;
307
+ }
267
308
  /** Candle interval for OHLCV data */
268
309
  type CandleInterval = '1m' | '5m' | '15m' | '30m' | '1h' | '4h' | '1d' | '1w';
269
310
  /**
@@ -294,8 +335,8 @@ interface CandleHistoryParams extends CursorPaginationParams {
294
335
  /** Candle interval (default: 1h) */
295
336
  interval?: CandleInterval;
296
337
  }
297
- /** WebSocket channel types. Note: ticker/all_tickers are real-time only. */
298
- type WsChannel = 'orderbook' | 'trades' | 'candles' | 'ticker' | 'all_tickers';
338
+ /** WebSocket channel types. Note: ticker/all_tickers are real-time only. Liquidations is historical only (May 2025+). */
339
+ type WsChannel = 'orderbook' | 'trades' | 'candles' | 'liquidations' | 'ticker' | 'all_tickers';
299
340
  /** Subscribe message from client */
300
341
  interface WsSubscribe {
301
342
  op: 'subscribe';
@@ -920,6 +961,67 @@ declare class CandlesResource {
920
961
  history(coin: string, params: CandleHistoryParams): Promise<CursorResponse<Candle[]>>;
921
962
  }
922
963
 
964
+ /**
965
+ * Liquidations API resource
966
+ *
967
+ * Retrieve historical liquidation events from Hyperliquid.
968
+ *
969
+ * Note: Liquidation data is available from May 25, 2025 onwards.
970
+ *
971
+ * @example
972
+ * ```typescript
973
+ * // Get recent liquidations for a coin
974
+ * let result = await client.hyperliquid.liquidations.history('BTC', {
975
+ * start: Date.now() - 86400000,
976
+ * end: Date.now(),
977
+ * limit: 1000
978
+ * });
979
+ *
980
+ * // Get all pages
981
+ * const allLiquidations = [...result.data];
982
+ * while (result.nextCursor) {
983
+ * result = await client.hyperliquid.liquidations.history('BTC', {
984
+ * start: Date.now() - 86400000,
985
+ * end: Date.now(),
986
+ * cursor: result.nextCursor,
987
+ * limit: 1000
988
+ * });
989
+ * allLiquidations.push(...result.data);
990
+ * }
991
+ *
992
+ * // Get liquidations for a specific user
993
+ * const userLiquidations = await client.hyperliquid.liquidations.byUser('0x1234...', {
994
+ * start: Date.now() - 86400000 * 7,
995
+ * end: Date.now()
996
+ * });
997
+ * ```
998
+ */
999
+ declare class LiquidationsResource {
1000
+ private http;
1001
+ private basePath;
1002
+ constructor(http: HttpClient, basePath?: string);
1003
+ /**
1004
+ * Get liquidation history for a coin with cursor-based pagination
1005
+ *
1006
+ * @param coin - The coin symbol (e.g., 'BTC', 'ETH')
1007
+ * @param params - Time range and cursor pagination parameters (start and end are required)
1008
+ * @returns CursorResponse with liquidation records and nextCursor for pagination
1009
+ */
1010
+ history(coin: string, params: LiquidationHistoryParams): Promise<CursorResponse<Liquidation[]>>;
1011
+ /**
1012
+ * Get liquidation history for a specific user
1013
+ *
1014
+ * This returns liquidations where the user was either:
1015
+ * - The liquidated party (their position was liquidated)
1016
+ * - The liquidator (they executed the liquidation)
1017
+ *
1018
+ * @param userAddress - User's wallet address (e.g., '0x1234...')
1019
+ * @param params - Time range and cursor pagination parameters (start and end are required)
1020
+ * @returns CursorResponse with liquidation records and nextCursor for pagination
1021
+ */
1022
+ byUser(userAddress: string, params: LiquidationsByUserParams): Promise<CursorResponse<Liquidation[]>>;
1023
+ }
1024
+
923
1025
  /**
924
1026
  * Hyperliquid exchange client
925
1027
  *
@@ -957,6 +1059,10 @@ declare class HyperliquidClient {
957
1059
  * OHLCV candle data
958
1060
  */
959
1061
  readonly candles: CandlesResource;
1062
+ /**
1063
+ * Liquidation events (May 2025+)
1064
+ */
1065
+ readonly liquidations: LiquidationsResource;
960
1066
  constructor(http: HttpClient);
961
1067
  }
962
1068
  /**
@@ -1626,6 +1732,47 @@ declare const OpenInterestSchema: z.ZodObject<{
1626
1732
  impactBidPrice?: string | undefined;
1627
1733
  impactAskPrice?: string | undefined;
1628
1734
  }>;
1735
+ declare const LiquidationSideSchema: z.ZodEnum<["B", "S"]>;
1736
+ declare const LiquidationSchema: z.ZodObject<{
1737
+ coin: z.ZodString;
1738
+ timestamp: z.ZodString;
1739
+ liquidatedUser: z.ZodString;
1740
+ liquidatorUser: z.ZodString;
1741
+ price: z.ZodString;
1742
+ size: z.ZodString;
1743
+ side: z.ZodEnum<["B", "S"]>;
1744
+ markPrice: z.ZodOptional<z.ZodString>;
1745
+ closedPnl: z.ZodOptional<z.ZodString>;
1746
+ direction: z.ZodOptional<z.ZodString>;
1747
+ tradeId: z.ZodOptional<z.ZodNumber>;
1748
+ txHash: z.ZodOptional<z.ZodString>;
1749
+ }, "strip", z.ZodTypeAny, {
1750
+ coin: string;
1751
+ timestamp: string;
1752
+ side: "B" | "S";
1753
+ price: string;
1754
+ size: string;
1755
+ liquidatedUser: string;
1756
+ liquidatorUser: string;
1757
+ txHash?: string | undefined;
1758
+ tradeId?: number | undefined;
1759
+ closedPnl?: string | undefined;
1760
+ direction?: string | undefined;
1761
+ markPrice?: string | undefined;
1762
+ }, {
1763
+ coin: string;
1764
+ timestamp: string;
1765
+ side: "B" | "S";
1766
+ price: string;
1767
+ size: string;
1768
+ liquidatedUser: string;
1769
+ liquidatorUser: string;
1770
+ txHash?: string | undefined;
1771
+ tradeId?: number | undefined;
1772
+ closedPnl?: string | undefined;
1773
+ direction?: string | undefined;
1774
+ markPrice?: string | undefined;
1775
+ }>;
1629
1776
  declare const CandleIntervalSchema: z.ZodEnum<["1m", "5m", "15m", "30m", "1h", "4h", "1d", "1w"]>;
1630
1777
  declare const CandleSchema: z.ZodObject<{
1631
1778
  timestamp: z.ZodString;
@@ -1655,32 +1802,32 @@ declare const CandleSchema: z.ZodObject<{
1655
1802
  quoteVolume?: number | undefined;
1656
1803
  tradeCount?: number | undefined;
1657
1804
  }>;
1658
- declare const WsChannelSchema: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
1805
+ declare const WsChannelSchema: z.ZodEnum<["orderbook", "trades", "candles", "liquidations", "ticker", "all_tickers"]>;
1659
1806
  declare const WsConnectionStateSchema: z.ZodEnum<["connecting", "connected", "disconnected", "reconnecting"]>;
1660
1807
  declare const WsSubscribedSchema: z.ZodObject<{
1661
1808
  type: z.ZodLiteral<"subscribed">;
1662
- channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
1809
+ channel: z.ZodEnum<["orderbook", "trades", "candles", "liquidations", "ticker", "all_tickers"]>;
1663
1810
  coin: z.ZodOptional<z.ZodString>;
1664
1811
  }, "strip", z.ZodTypeAny, {
1665
1812
  type: "subscribed";
1666
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
1813
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1667
1814
  coin?: string | undefined;
1668
1815
  }, {
1669
1816
  type: "subscribed";
1670
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
1817
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1671
1818
  coin?: string | undefined;
1672
1819
  }>;
1673
1820
  declare const WsUnsubscribedSchema: z.ZodObject<{
1674
1821
  type: z.ZodLiteral<"unsubscribed">;
1675
- channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
1822
+ channel: z.ZodEnum<["orderbook", "trades", "candles", "liquidations", "ticker", "all_tickers"]>;
1676
1823
  coin: z.ZodOptional<z.ZodString>;
1677
1824
  }, "strip", z.ZodTypeAny, {
1678
1825
  type: "unsubscribed";
1679
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
1826
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1680
1827
  coin?: string | undefined;
1681
1828
  }, {
1682
1829
  type: "unsubscribed";
1683
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
1830
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1684
1831
  coin?: string | undefined;
1685
1832
  }>;
1686
1833
  declare const WsPongSchema: z.ZodObject<{
@@ -1702,23 +1849,23 @@ declare const WsErrorSchema: z.ZodObject<{
1702
1849
  }>;
1703
1850
  declare const WsDataSchema: z.ZodObject<{
1704
1851
  type: z.ZodLiteral<"data">;
1705
- channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
1852
+ channel: z.ZodEnum<["orderbook", "trades", "candles", "liquidations", "ticker", "all_tickers"]>;
1706
1853
  coin: z.ZodString;
1707
1854
  data: z.ZodUnknown;
1708
1855
  }, "strip", z.ZodTypeAny, {
1709
1856
  type: "data";
1710
1857
  coin: string;
1711
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
1858
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1712
1859
  data?: unknown;
1713
1860
  }, {
1714
1861
  type: "data";
1715
1862
  coin: string;
1716
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
1863
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1717
1864
  data?: unknown;
1718
1865
  }>;
1719
1866
  declare const WsReplayStartedSchema: z.ZodObject<{
1720
1867
  type: z.ZodLiteral<"replay_started">;
1721
- channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
1868
+ channel: z.ZodEnum<["orderbook", "trades", "candles", "liquidations", "ticker", "all_tickers"]>;
1722
1869
  coin: z.ZodString;
1723
1870
  start: z.ZodNumber;
1724
1871
  end: z.ZodNumber;
@@ -1726,14 +1873,14 @@ declare const WsReplayStartedSchema: z.ZodObject<{
1726
1873
  }, "strip", z.ZodTypeAny, {
1727
1874
  type: "replay_started";
1728
1875
  coin: string;
1729
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
1876
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1730
1877
  start: number;
1731
1878
  end: number;
1732
1879
  speed: number;
1733
1880
  }, {
1734
1881
  type: "replay_started";
1735
1882
  coin: string;
1736
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
1883
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1737
1884
  start: number;
1738
1885
  end: number;
1739
1886
  speed: number;
@@ -1760,18 +1907,18 @@ declare const WsReplayResumedSchema: z.ZodObject<{
1760
1907
  }>;
1761
1908
  declare const WsReplayCompletedSchema: z.ZodObject<{
1762
1909
  type: z.ZodLiteral<"replay_completed">;
1763
- channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
1910
+ channel: z.ZodEnum<["orderbook", "trades", "candles", "liquidations", "ticker", "all_tickers"]>;
1764
1911
  coin: z.ZodString;
1765
1912
  snapshotsSent: z.ZodNumber;
1766
1913
  }, "strip", z.ZodTypeAny, {
1767
1914
  type: "replay_completed";
1768
1915
  coin: string;
1769
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
1916
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1770
1917
  snapshotsSent: number;
1771
1918
  }, {
1772
1919
  type: "replay_completed";
1773
1920
  coin: string;
1774
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
1921
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1775
1922
  snapshotsSent: number;
1776
1923
  }>;
1777
1924
  declare const WsReplayStoppedSchema: z.ZodObject<{
@@ -1783,7 +1930,7 @@ declare const WsReplayStoppedSchema: z.ZodObject<{
1783
1930
  }>;
1784
1931
  declare const WsHistoricalDataSchema: z.ZodObject<{
1785
1932
  type: z.ZodLiteral<"historical_data">;
1786
- channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
1933
+ channel: z.ZodEnum<["orderbook", "trades", "candles", "liquidations", "ticker", "all_tickers"]>;
1787
1934
  coin: z.ZodString;
1788
1935
  timestamp: z.ZodNumber;
1789
1936
  data: z.ZodUnknown;
@@ -1791,31 +1938,31 @@ declare const WsHistoricalDataSchema: z.ZodObject<{
1791
1938
  type: "historical_data";
1792
1939
  coin: string;
1793
1940
  timestamp: number;
1794
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
1941
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1795
1942
  data?: unknown;
1796
1943
  }, {
1797
1944
  type: "historical_data";
1798
1945
  coin: string;
1799
1946
  timestamp: number;
1800
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
1947
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1801
1948
  data?: unknown;
1802
1949
  }>;
1803
1950
  declare const WsStreamStartedSchema: z.ZodObject<{
1804
1951
  type: z.ZodLiteral<"stream_started">;
1805
- channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
1952
+ channel: z.ZodEnum<["orderbook", "trades", "candles", "liquidations", "ticker", "all_tickers"]>;
1806
1953
  coin: z.ZodString;
1807
1954
  start: z.ZodNumber;
1808
1955
  end: z.ZodNumber;
1809
1956
  }, "strip", z.ZodTypeAny, {
1810
1957
  type: "stream_started";
1811
1958
  coin: string;
1812
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
1959
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1813
1960
  start: number;
1814
1961
  end: number;
1815
1962
  }, {
1816
1963
  type: "stream_started";
1817
1964
  coin: string;
1818
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
1965
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1819
1966
  start: number;
1820
1967
  end: number;
1821
1968
  }>;
@@ -1841,7 +1988,7 @@ declare const TimestampedRecordSchema: z.ZodObject<{
1841
1988
  }>;
1842
1989
  declare const WsHistoricalBatchSchema: z.ZodObject<{
1843
1990
  type: z.ZodLiteral<"historical_batch">;
1844
- channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
1991
+ channel: z.ZodEnum<["orderbook", "trades", "candles", "liquidations", "ticker", "all_tickers"]>;
1845
1992
  coin: z.ZodString;
1846
1993
  data: z.ZodArray<z.ZodObject<{
1847
1994
  timestamp: z.ZodNumber;
@@ -1860,7 +2007,7 @@ declare const WsHistoricalBatchSchema: z.ZodObject<{
1860
2007
  }[];
1861
2008
  type: "historical_batch";
1862
2009
  coin: string;
1863
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2010
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1864
2011
  }, {
1865
2012
  data: {
1866
2013
  timestamp: number;
@@ -1868,22 +2015,22 @@ declare const WsHistoricalBatchSchema: z.ZodObject<{
1868
2015
  }[];
1869
2016
  type: "historical_batch";
1870
2017
  coin: string;
1871
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2018
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1872
2019
  }>;
1873
2020
  declare const WsStreamCompletedSchema: z.ZodObject<{
1874
2021
  type: z.ZodLiteral<"stream_completed">;
1875
- channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
2022
+ channel: z.ZodEnum<["orderbook", "trades", "candles", "liquidations", "ticker", "all_tickers"]>;
1876
2023
  coin: z.ZodString;
1877
2024
  snapshotsSent: z.ZodNumber;
1878
2025
  }, "strip", z.ZodTypeAny, {
1879
2026
  type: "stream_completed";
1880
2027
  coin: string;
1881
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2028
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1882
2029
  snapshotsSent: number;
1883
2030
  }, {
1884
2031
  type: "stream_completed";
1885
2032
  coin: string;
1886
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2033
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1887
2034
  snapshotsSent: number;
1888
2035
  }>;
1889
2036
  declare const WsStreamStoppedSchema: z.ZodObject<{
@@ -1898,27 +2045,27 @@ declare const WsStreamStoppedSchema: z.ZodObject<{
1898
2045
  }>;
1899
2046
  declare const WsServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1900
2047
  type: z.ZodLiteral<"subscribed">;
1901
- channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
2048
+ channel: z.ZodEnum<["orderbook", "trades", "candles", "liquidations", "ticker", "all_tickers"]>;
1902
2049
  coin: z.ZodOptional<z.ZodString>;
1903
2050
  }, "strip", z.ZodTypeAny, {
1904
2051
  type: "subscribed";
1905
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2052
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1906
2053
  coin?: string | undefined;
1907
2054
  }, {
1908
2055
  type: "subscribed";
1909
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2056
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1910
2057
  coin?: string | undefined;
1911
2058
  }>, z.ZodObject<{
1912
2059
  type: z.ZodLiteral<"unsubscribed">;
1913
- channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
2060
+ channel: z.ZodEnum<["orderbook", "trades", "candles", "liquidations", "ticker", "all_tickers"]>;
1914
2061
  coin: z.ZodOptional<z.ZodString>;
1915
2062
  }, "strip", z.ZodTypeAny, {
1916
2063
  type: "unsubscribed";
1917
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2064
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1918
2065
  coin?: string | undefined;
1919
2066
  }, {
1920
2067
  type: "unsubscribed";
1921
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2068
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1922
2069
  coin?: string | undefined;
1923
2070
  }>, z.ZodObject<{
1924
2071
  type: z.ZodLiteral<"pong">;
@@ -1937,22 +2084,22 @@ declare const WsServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
1937
2084
  type: "error";
1938
2085
  }>, z.ZodObject<{
1939
2086
  type: z.ZodLiteral<"data">;
1940
- channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
2087
+ channel: z.ZodEnum<["orderbook", "trades", "candles", "liquidations", "ticker", "all_tickers"]>;
1941
2088
  coin: z.ZodString;
1942
2089
  data: z.ZodUnknown;
1943
2090
  }, "strip", z.ZodTypeAny, {
1944
2091
  type: "data";
1945
2092
  coin: string;
1946
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2093
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1947
2094
  data?: unknown;
1948
2095
  }, {
1949
2096
  type: "data";
1950
2097
  coin: string;
1951
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2098
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1952
2099
  data?: unknown;
1953
2100
  }>, z.ZodObject<{
1954
2101
  type: z.ZodLiteral<"replay_started">;
1955
- channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
2102
+ channel: z.ZodEnum<["orderbook", "trades", "candles", "liquidations", "ticker", "all_tickers"]>;
1956
2103
  coin: z.ZodString;
1957
2104
  start: z.ZodNumber;
1958
2105
  end: z.ZodNumber;
@@ -1960,14 +2107,14 @@ declare const WsServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
1960
2107
  }, "strip", z.ZodTypeAny, {
1961
2108
  type: "replay_started";
1962
2109
  coin: string;
1963
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2110
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1964
2111
  start: number;
1965
2112
  end: number;
1966
2113
  speed: number;
1967
2114
  }, {
1968
2115
  type: "replay_started";
1969
2116
  coin: string;
1970
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2117
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
1971
2118
  start: number;
1972
2119
  end: number;
1973
2120
  speed: number;
@@ -1991,18 +2138,18 @@ declare const WsServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
1991
2138
  currentTimestamp: number;
1992
2139
  }>, z.ZodObject<{
1993
2140
  type: z.ZodLiteral<"replay_completed">;
1994
- channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
2141
+ channel: z.ZodEnum<["orderbook", "trades", "candles", "liquidations", "ticker", "all_tickers"]>;
1995
2142
  coin: z.ZodString;
1996
2143
  snapshotsSent: z.ZodNumber;
1997
2144
  }, "strip", z.ZodTypeAny, {
1998
2145
  type: "replay_completed";
1999
2146
  coin: string;
2000
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2147
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
2001
2148
  snapshotsSent: number;
2002
2149
  }, {
2003
2150
  type: "replay_completed";
2004
2151
  coin: string;
2005
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2152
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
2006
2153
  snapshotsSent: number;
2007
2154
  }>, z.ZodObject<{
2008
2155
  type: z.ZodLiteral<"replay_stopped">;
@@ -2012,7 +2159,7 @@ declare const WsServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2012
2159
  type: "replay_stopped";
2013
2160
  }>, z.ZodObject<{
2014
2161
  type: z.ZodLiteral<"historical_data">;
2015
- channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
2162
+ channel: z.ZodEnum<["orderbook", "trades", "candles", "liquidations", "ticker", "all_tickers"]>;
2016
2163
  coin: z.ZodString;
2017
2164
  timestamp: z.ZodNumber;
2018
2165
  data: z.ZodUnknown;
@@ -2020,30 +2167,30 @@ declare const WsServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2020
2167
  type: "historical_data";
2021
2168
  coin: string;
2022
2169
  timestamp: number;
2023
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2170
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
2024
2171
  data?: unknown;
2025
2172
  }, {
2026
2173
  type: "historical_data";
2027
2174
  coin: string;
2028
2175
  timestamp: number;
2029
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2176
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
2030
2177
  data?: unknown;
2031
2178
  }>, z.ZodObject<{
2032
2179
  type: z.ZodLiteral<"stream_started">;
2033
- channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
2180
+ channel: z.ZodEnum<["orderbook", "trades", "candles", "liquidations", "ticker", "all_tickers"]>;
2034
2181
  coin: z.ZodString;
2035
2182
  start: z.ZodNumber;
2036
2183
  end: z.ZodNumber;
2037
2184
  }, "strip", z.ZodTypeAny, {
2038
2185
  type: "stream_started";
2039
2186
  coin: string;
2040
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2187
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
2041
2188
  start: number;
2042
2189
  end: number;
2043
2190
  }, {
2044
2191
  type: "stream_started";
2045
2192
  coin: string;
2046
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2193
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
2047
2194
  start: number;
2048
2195
  end: number;
2049
2196
  }>, z.ZodObject<{
@@ -2057,7 +2204,7 @@ declare const WsServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2057
2204
  snapshotsSent: number;
2058
2205
  }>, z.ZodObject<{
2059
2206
  type: z.ZodLiteral<"historical_batch">;
2060
- channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
2207
+ channel: z.ZodEnum<["orderbook", "trades", "candles", "liquidations", "ticker", "all_tickers"]>;
2061
2208
  coin: z.ZodString;
2062
2209
  data: z.ZodArray<z.ZodObject<{
2063
2210
  timestamp: z.ZodNumber;
@@ -2076,7 +2223,7 @@ declare const WsServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2076
2223
  }[];
2077
2224
  type: "historical_batch";
2078
2225
  coin: string;
2079
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2226
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
2080
2227
  }, {
2081
2228
  data: {
2082
2229
  timestamp: number;
@@ -2084,21 +2231,21 @@ declare const WsServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2084
2231
  }[];
2085
2232
  type: "historical_batch";
2086
2233
  coin: string;
2087
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2234
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
2088
2235
  }>, z.ZodObject<{
2089
2236
  type: z.ZodLiteral<"stream_completed">;
2090
- channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
2237
+ channel: z.ZodEnum<["orderbook", "trades", "candles", "liquidations", "ticker", "all_tickers"]>;
2091
2238
  coin: z.ZodString;
2092
2239
  snapshotsSent: z.ZodNumber;
2093
2240
  }, "strip", z.ZodTypeAny, {
2094
2241
  type: "stream_completed";
2095
2242
  coin: string;
2096
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2243
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
2097
2244
  snapshotsSent: number;
2098
2245
  }, {
2099
2246
  type: "stream_completed";
2100
2247
  coin: string;
2101
- channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
2248
+ channel: "orderbook" | "trades" | "candles" | "liquidations" | "ticker" | "all_tickers";
2102
2249
  snapshotsSent: number;
2103
2250
  }>, z.ZodObject<{
2104
2251
  type: z.ZodLiteral<"stream_stopped">;
@@ -2997,6 +3144,104 @@ declare const CandleArrayResponseSchema: z.ZodObject<{
2997
3144
  nextCursor?: string | undefined;
2998
3145
  };
2999
3146
  }>;
3147
+ declare const LiquidationArrayResponseSchema: z.ZodObject<{
3148
+ success: z.ZodBoolean;
3149
+ data: z.ZodArray<z.ZodObject<{
3150
+ coin: z.ZodString;
3151
+ timestamp: z.ZodString;
3152
+ liquidatedUser: z.ZodString;
3153
+ liquidatorUser: z.ZodString;
3154
+ price: z.ZodString;
3155
+ size: z.ZodString;
3156
+ side: z.ZodEnum<["B", "S"]>;
3157
+ markPrice: z.ZodOptional<z.ZodString>;
3158
+ closedPnl: z.ZodOptional<z.ZodString>;
3159
+ direction: z.ZodOptional<z.ZodString>;
3160
+ tradeId: z.ZodOptional<z.ZodNumber>;
3161
+ txHash: z.ZodOptional<z.ZodString>;
3162
+ }, "strip", z.ZodTypeAny, {
3163
+ coin: string;
3164
+ timestamp: string;
3165
+ side: "B" | "S";
3166
+ price: string;
3167
+ size: string;
3168
+ liquidatedUser: string;
3169
+ liquidatorUser: string;
3170
+ txHash?: string | undefined;
3171
+ tradeId?: number | undefined;
3172
+ closedPnl?: string | undefined;
3173
+ direction?: string | undefined;
3174
+ markPrice?: string | undefined;
3175
+ }, {
3176
+ coin: string;
3177
+ timestamp: string;
3178
+ side: "B" | "S";
3179
+ price: string;
3180
+ size: string;
3181
+ liquidatedUser: string;
3182
+ liquidatorUser: string;
3183
+ txHash?: string | undefined;
3184
+ tradeId?: number | undefined;
3185
+ closedPnl?: string | undefined;
3186
+ direction?: string | undefined;
3187
+ markPrice?: string | undefined;
3188
+ }>, "many">;
3189
+ meta: z.ZodObject<{
3190
+ count: z.ZodNumber;
3191
+ nextCursor: z.ZodOptional<z.ZodString>;
3192
+ requestId: z.ZodString;
3193
+ }, "strip", z.ZodTypeAny, {
3194
+ count: number;
3195
+ requestId: string;
3196
+ nextCursor?: string | undefined;
3197
+ }, {
3198
+ count: number;
3199
+ requestId: string;
3200
+ nextCursor?: string | undefined;
3201
+ }>;
3202
+ }, "strip", z.ZodTypeAny, {
3203
+ data: {
3204
+ coin: string;
3205
+ timestamp: string;
3206
+ side: "B" | "S";
3207
+ price: string;
3208
+ size: string;
3209
+ liquidatedUser: string;
3210
+ liquidatorUser: string;
3211
+ txHash?: string | undefined;
3212
+ tradeId?: number | undefined;
3213
+ closedPnl?: string | undefined;
3214
+ direction?: string | undefined;
3215
+ markPrice?: string | undefined;
3216
+ }[];
3217
+ success: boolean;
3218
+ meta: {
3219
+ count: number;
3220
+ requestId: string;
3221
+ nextCursor?: string | undefined;
3222
+ };
3223
+ }, {
3224
+ data: {
3225
+ coin: string;
3226
+ timestamp: string;
3227
+ side: "B" | "S";
3228
+ price: string;
3229
+ size: string;
3230
+ liquidatedUser: string;
3231
+ liquidatorUser: string;
3232
+ txHash?: string | undefined;
3233
+ tradeId?: number | undefined;
3234
+ closedPnl?: string | undefined;
3235
+ direction?: string | undefined;
3236
+ markPrice?: string | undefined;
3237
+ }[];
3238
+ success: boolean;
3239
+ meta: {
3240
+ count: number;
3241
+ requestId: string;
3242
+ nextCursor?: string | undefined;
3243
+ };
3244
+ }>;
3000
3245
  type ValidatedApiMeta = z.infer<typeof ApiMetaSchema>;
3001
3246
  type ValidatedPriceLevel = z.infer<typeof PriceLevelSchema>;
3002
3247
  type ValidatedOrderBook = z.infer<typeof OrderBookSchema>;
@@ -3005,6 +3250,7 @@ type ValidatedInstrument = z.infer<typeof InstrumentSchema>;
3005
3250
  type ValidatedFundingRate = z.infer<typeof FundingRateSchema>;
3006
3251
  type ValidatedOpenInterest = z.infer<typeof OpenInterestSchema>;
3007
3252
  type ValidatedCandle = z.infer<typeof CandleSchema>;
3253
+ type ValidatedLiquidation = z.infer<typeof LiquidationSchema>;
3008
3254
  type ValidatedWsServerMessage = z.infer<typeof WsServerMessageSchema>;
3009
3255
 
3010
- export { type ApiError, type ApiMeta, ApiMetaSchema, type ApiResponse, ApiResponseSchema, type Candle, CandleArrayResponseSchema, type CandleHistoryParams, type CandleInterval, CandleIntervalSchema, CandleSchema, type ClientOptions, type CursorResponse, type FundingRate, FundingRateArrayResponseSchema, FundingRateResponseSchema, FundingRateSchema, type GetOrderBookParams, type GetTradesCursorParams, HyperliquidClient, type Instrument, InstrumentArrayResponseSchema, InstrumentResponseSchema, InstrumentSchema, type InstrumentType, InstrumentTypeSchema, LighterClient, type LighterGranularity, type LighterInstrument, type OpenInterest, OpenInterestArrayResponseSchema, OpenInterestResponseSchema, OpenInterestSchema, type OrderBook, OrderBookArrayResponseSchema, type OrderBookHistoryParams, OrderBookResponseSchema, OrderBookSchema, OxArchive, OxArchiveError, OxArchiveWs, type PriceLevel, PriceLevelSchema, type Timestamp, type TimestampedRecord, TimestampedRecordSchema, type Trade, TradeArrayResponseSchema, type TradeDirection, TradeDirectionSchema, TradeSchema, type TradeSide, TradeSideSchema, type ValidatedApiMeta, type ValidatedCandle, type ValidatedFundingRate, type ValidatedInstrument, type ValidatedOpenInterest, type ValidatedOrderBook, type ValidatedPriceLevel, type ValidatedTrade, type ValidatedWsServerMessage, type WsChannel, WsChannelSchema, type WsClientMessage, type WsConnectionState, WsConnectionStateSchema, type WsData, WsDataSchema, type WsError, WsErrorSchema, type WsEventHandlers, type WsHistoricalBatch, WsHistoricalBatchSchema, type WsHistoricalData, WsHistoricalDataSchema, 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 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 };
3256
+ export { type ApiError, type ApiMeta, ApiMetaSchema, type ApiResponse, ApiResponseSchema, type Candle, CandleArrayResponseSchema, type CandleHistoryParams, type CandleInterval, CandleIntervalSchema, CandleSchema, type ClientOptions, type CursorResponse, type FundingRate, FundingRateArrayResponseSchema, FundingRateResponseSchema, FundingRateSchema, type GetOrderBookParams, type GetTradesCursorParams, HyperliquidClient, type Instrument, InstrumentArrayResponseSchema, InstrumentResponseSchema, InstrumentSchema, type InstrumentType, InstrumentTypeSchema, LighterClient, type LighterGranularity, type LighterInstrument, type Liquidation, LiquidationArrayResponseSchema, type LiquidationHistoryParams, LiquidationSchema, LiquidationSideSchema, type LiquidationsByUserParams, type OpenInterest, OpenInterestArrayResponseSchema, OpenInterestResponseSchema, OpenInterestSchema, type OrderBook, OrderBookArrayResponseSchema, type OrderBookHistoryParams, OrderBookResponseSchema, OrderBookSchema, OxArchive, OxArchiveError, OxArchiveWs, type PriceLevel, PriceLevelSchema, 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 WsChannel, WsChannelSchema, type WsClientMessage, type WsConnectionState, WsConnectionStateSchema, type WsData, WsDataSchema, type WsError, WsErrorSchema, type WsEventHandlers, type WsHistoricalBatch, WsHistoricalBatchSchema, type WsHistoricalData, WsHistoricalDataSchema, 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 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 };