@0xarchive/sdk 0.4.6 → 0.5.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 +92 -6
- package/dist/index.d.mts +249 -57
- package/dist/index.d.ts +249 -57
- package/dist/index.js +55 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +52 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -264,8 +264,38 @@ interface OpenInterest {
|
|
|
264
264
|
*/
|
|
265
265
|
interface OpenInterestHistoryParams extends CursorPaginationParams {
|
|
266
266
|
}
|
|
267
|
+
/** Candle interval for OHLCV data */
|
|
268
|
+
type CandleInterval = '1m' | '5m' | '15m' | '30m' | '1h' | '4h' | '1d' | '1w';
|
|
269
|
+
/**
|
|
270
|
+
* OHLCV candle data
|
|
271
|
+
*/
|
|
272
|
+
interface Candle {
|
|
273
|
+
/** Candle open timestamp (UTC) */
|
|
274
|
+
timestamp: string;
|
|
275
|
+
/** Opening price */
|
|
276
|
+
open: number;
|
|
277
|
+
/** Highest price during the interval */
|
|
278
|
+
high: number;
|
|
279
|
+
/** Lowest price during the interval */
|
|
280
|
+
low: number;
|
|
281
|
+
/** Closing price */
|
|
282
|
+
close: number;
|
|
283
|
+
/** Total volume traded during the interval */
|
|
284
|
+
volume: number;
|
|
285
|
+
/** Total quote volume (volume * price) */
|
|
286
|
+
quoteVolume?: number;
|
|
287
|
+
/** Number of trades during the interval */
|
|
288
|
+
tradeCount?: number;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Parameters for getting candle history
|
|
292
|
+
*/
|
|
293
|
+
interface CandleHistoryParams extends CursorPaginationParams {
|
|
294
|
+
/** Candle interval (default: 1h) */
|
|
295
|
+
interval?: CandleInterval;
|
|
296
|
+
}
|
|
267
297
|
/** WebSocket channel types. Note: ticker/all_tickers are real-time only. */
|
|
268
|
-
type WsChannel = 'orderbook' | 'trades' | 'ticker' | 'all_tickers';
|
|
298
|
+
type WsChannel = 'orderbook' | 'trades' | 'candles' | 'ticker' | 'all_tickers';
|
|
269
299
|
/** Subscribe message from client */
|
|
270
300
|
interface WsSubscribe {
|
|
271
301
|
op: 'subscribe';
|
|
@@ -840,6 +870,52 @@ declare class OpenInterestResource {
|
|
|
840
870
|
current(coin: string): Promise<OpenInterest>;
|
|
841
871
|
}
|
|
842
872
|
|
|
873
|
+
/**
|
|
874
|
+
* Candles (OHLCV) API resource
|
|
875
|
+
*
|
|
876
|
+
* @example
|
|
877
|
+
* ```typescript
|
|
878
|
+
* // Get candle history with cursor-based pagination
|
|
879
|
+
* let result = await client.hyperliquid.candles.history('BTC', {
|
|
880
|
+
* start: Date.now() - 86400000,
|
|
881
|
+
* end: Date.now(),
|
|
882
|
+
* interval: '1h',
|
|
883
|
+
* limit: 1000
|
|
884
|
+
* });
|
|
885
|
+
*
|
|
886
|
+
* // Get all pages
|
|
887
|
+
* const allCandles = [...result.data];
|
|
888
|
+
* while (result.nextCursor) {
|
|
889
|
+
* result = await client.hyperliquid.candles.history('BTC', {
|
|
890
|
+
* start: Date.now() - 86400000,
|
|
891
|
+
* end: Date.now(),
|
|
892
|
+
* interval: '1h',
|
|
893
|
+
* cursor: result.nextCursor,
|
|
894
|
+
* limit: 1000
|
|
895
|
+
* });
|
|
896
|
+
* allCandles.push(...result.data);
|
|
897
|
+
* }
|
|
898
|
+
*
|
|
899
|
+
* // Iterate through candles
|
|
900
|
+
* for (const candle of allCandles) {
|
|
901
|
+
* console.log(`${candle.timestamp}: O=${candle.open} H=${candle.high} L=${candle.low} C=${candle.close}`);
|
|
902
|
+
* }
|
|
903
|
+
* ```
|
|
904
|
+
*/
|
|
905
|
+
declare class CandlesResource {
|
|
906
|
+
private http;
|
|
907
|
+
private basePath;
|
|
908
|
+
constructor(http: HttpClient, basePath?: string);
|
|
909
|
+
/**
|
|
910
|
+
* Get historical OHLCV candle data with cursor-based pagination
|
|
911
|
+
*
|
|
912
|
+
* @param coin - The coin symbol (e.g., 'BTC', 'ETH')
|
|
913
|
+
* @param params - Time range, interval, and cursor pagination parameters (start and end are required)
|
|
914
|
+
* @returns CursorResponse with candle records and nextCursor for pagination
|
|
915
|
+
*/
|
|
916
|
+
history(coin: string, params: CandleHistoryParams): Promise<CursorResponse<Candle[]>>;
|
|
917
|
+
}
|
|
918
|
+
|
|
843
919
|
/**
|
|
844
920
|
* Hyperliquid exchange client
|
|
845
921
|
*
|
|
@@ -873,6 +949,10 @@ declare class HyperliquidClient {
|
|
|
873
949
|
* Open interest
|
|
874
950
|
*/
|
|
875
951
|
readonly openInterest: OpenInterestResource;
|
|
952
|
+
/**
|
|
953
|
+
* OHLCV candle data
|
|
954
|
+
*/
|
|
955
|
+
readonly candles: CandlesResource;
|
|
876
956
|
constructor(http: HttpClient);
|
|
877
957
|
}
|
|
878
958
|
/**
|
|
@@ -910,6 +990,10 @@ declare class LighterClient {
|
|
|
910
990
|
* Open interest
|
|
911
991
|
*/
|
|
912
992
|
readonly openInterest: OpenInterestResource;
|
|
993
|
+
/**
|
|
994
|
+
* OHLCV candle data
|
|
995
|
+
*/
|
|
996
|
+
readonly candles: CandlesResource;
|
|
913
997
|
constructor(http: HttpClient);
|
|
914
998
|
}
|
|
915
999
|
|
|
@@ -1534,32 +1618,61 @@ declare const OpenInterestSchema: z.ZodObject<{
|
|
|
1534
1618
|
impactBidPrice?: string | undefined;
|
|
1535
1619
|
impactAskPrice?: string | undefined;
|
|
1536
1620
|
}>;
|
|
1537
|
-
declare const
|
|
1621
|
+
declare const CandleIntervalSchema: z.ZodEnum<["1m", "5m", "15m", "30m", "1h", "4h", "1d", "1w"]>;
|
|
1622
|
+
declare const CandleSchema: z.ZodObject<{
|
|
1623
|
+
timestamp: z.ZodString;
|
|
1624
|
+
open: z.ZodNumber;
|
|
1625
|
+
high: z.ZodNumber;
|
|
1626
|
+
low: z.ZodNumber;
|
|
1627
|
+
close: z.ZodNumber;
|
|
1628
|
+
volume: z.ZodNumber;
|
|
1629
|
+
quoteVolume: z.ZodOptional<z.ZodNumber>;
|
|
1630
|
+
tradeCount: z.ZodOptional<z.ZodNumber>;
|
|
1631
|
+
}, "strip", z.ZodTypeAny, {
|
|
1632
|
+
timestamp: string;
|
|
1633
|
+
open: number;
|
|
1634
|
+
high: number;
|
|
1635
|
+
low: number;
|
|
1636
|
+
close: number;
|
|
1637
|
+
volume: number;
|
|
1638
|
+
quoteVolume?: number | undefined;
|
|
1639
|
+
tradeCount?: number | undefined;
|
|
1640
|
+
}, {
|
|
1641
|
+
timestamp: string;
|
|
1642
|
+
open: number;
|
|
1643
|
+
high: number;
|
|
1644
|
+
low: number;
|
|
1645
|
+
close: number;
|
|
1646
|
+
volume: number;
|
|
1647
|
+
quoteVolume?: number | undefined;
|
|
1648
|
+
tradeCount?: number | undefined;
|
|
1649
|
+
}>;
|
|
1650
|
+
declare const WsChannelSchema: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
|
|
1538
1651
|
declare const WsConnectionStateSchema: z.ZodEnum<["connecting", "connected", "disconnected", "reconnecting"]>;
|
|
1539
1652
|
declare const WsSubscribedSchema: z.ZodObject<{
|
|
1540
1653
|
type: z.ZodLiteral<"subscribed">;
|
|
1541
|
-
channel: z.ZodEnum<["orderbook", "trades", "ticker", "all_tickers"]>;
|
|
1654
|
+
channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
|
|
1542
1655
|
coin: z.ZodOptional<z.ZodString>;
|
|
1543
1656
|
}, "strip", z.ZodTypeAny, {
|
|
1544
1657
|
type: "subscribed";
|
|
1545
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1658
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1546
1659
|
coin?: string | undefined;
|
|
1547
1660
|
}, {
|
|
1548
1661
|
type: "subscribed";
|
|
1549
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1662
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1550
1663
|
coin?: string | undefined;
|
|
1551
1664
|
}>;
|
|
1552
1665
|
declare const WsUnsubscribedSchema: z.ZodObject<{
|
|
1553
1666
|
type: z.ZodLiteral<"unsubscribed">;
|
|
1554
|
-
channel: z.ZodEnum<["orderbook", "trades", "ticker", "all_tickers"]>;
|
|
1667
|
+
channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
|
|
1555
1668
|
coin: z.ZodOptional<z.ZodString>;
|
|
1556
1669
|
}, "strip", z.ZodTypeAny, {
|
|
1557
1670
|
type: "unsubscribed";
|
|
1558
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1671
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1559
1672
|
coin?: string | undefined;
|
|
1560
1673
|
}, {
|
|
1561
1674
|
type: "unsubscribed";
|
|
1562
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1675
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1563
1676
|
coin?: string | undefined;
|
|
1564
1677
|
}>;
|
|
1565
1678
|
declare const WsPongSchema: z.ZodObject<{
|
|
@@ -1581,23 +1694,23 @@ declare const WsErrorSchema: z.ZodObject<{
|
|
|
1581
1694
|
}>;
|
|
1582
1695
|
declare const WsDataSchema: z.ZodObject<{
|
|
1583
1696
|
type: z.ZodLiteral<"data">;
|
|
1584
|
-
channel: z.ZodEnum<["orderbook", "trades", "ticker", "all_tickers"]>;
|
|
1697
|
+
channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
|
|
1585
1698
|
coin: z.ZodString;
|
|
1586
1699
|
data: z.ZodUnknown;
|
|
1587
1700
|
}, "strip", z.ZodTypeAny, {
|
|
1588
1701
|
type: "data";
|
|
1589
1702
|
coin: string;
|
|
1590
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1703
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1591
1704
|
data?: unknown;
|
|
1592
1705
|
}, {
|
|
1593
1706
|
type: "data";
|
|
1594
1707
|
coin: string;
|
|
1595
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1708
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1596
1709
|
data?: unknown;
|
|
1597
1710
|
}>;
|
|
1598
1711
|
declare const WsReplayStartedSchema: z.ZodObject<{
|
|
1599
1712
|
type: z.ZodLiteral<"replay_started">;
|
|
1600
|
-
channel: z.ZodEnum<["orderbook", "trades", "ticker", "all_tickers"]>;
|
|
1713
|
+
channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
|
|
1601
1714
|
coin: z.ZodString;
|
|
1602
1715
|
start: z.ZodNumber;
|
|
1603
1716
|
end: z.ZodNumber;
|
|
@@ -1605,14 +1718,14 @@ declare const WsReplayStartedSchema: z.ZodObject<{
|
|
|
1605
1718
|
}, "strip", z.ZodTypeAny, {
|
|
1606
1719
|
type: "replay_started";
|
|
1607
1720
|
coin: string;
|
|
1608
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1721
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1609
1722
|
start: number;
|
|
1610
1723
|
end: number;
|
|
1611
1724
|
speed: number;
|
|
1612
1725
|
}, {
|
|
1613
1726
|
type: "replay_started";
|
|
1614
1727
|
coin: string;
|
|
1615
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1728
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1616
1729
|
start: number;
|
|
1617
1730
|
end: number;
|
|
1618
1731
|
speed: number;
|
|
@@ -1639,18 +1752,18 @@ declare const WsReplayResumedSchema: z.ZodObject<{
|
|
|
1639
1752
|
}>;
|
|
1640
1753
|
declare const WsReplayCompletedSchema: z.ZodObject<{
|
|
1641
1754
|
type: z.ZodLiteral<"replay_completed">;
|
|
1642
|
-
channel: z.ZodEnum<["orderbook", "trades", "ticker", "all_tickers"]>;
|
|
1755
|
+
channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
|
|
1643
1756
|
coin: z.ZodString;
|
|
1644
1757
|
snapshotsSent: z.ZodNumber;
|
|
1645
1758
|
}, "strip", z.ZodTypeAny, {
|
|
1646
1759
|
type: "replay_completed";
|
|
1647
1760
|
coin: string;
|
|
1648
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1761
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1649
1762
|
snapshotsSent: number;
|
|
1650
1763
|
}, {
|
|
1651
1764
|
type: "replay_completed";
|
|
1652
1765
|
coin: string;
|
|
1653
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1766
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1654
1767
|
snapshotsSent: number;
|
|
1655
1768
|
}>;
|
|
1656
1769
|
declare const WsReplayStoppedSchema: z.ZodObject<{
|
|
@@ -1662,7 +1775,7 @@ declare const WsReplayStoppedSchema: z.ZodObject<{
|
|
|
1662
1775
|
}>;
|
|
1663
1776
|
declare const WsHistoricalDataSchema: z.ZodObject<{
|
|
1664
1777
|
type: z.ZodLiteral<"historical_data">;
|
|
1665
|
-
channel: z.ZodEnum<["orderbook", "trades", "ticker", "all_tickers"]>;
|
|
1778
|
+
channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
|
|
1666
1779
|
coin: z.ZodString;
|
|
1667
1780
|
timestamp: z.ZodNumber;
|
|
1668
1781
|
data: z.ZodUnknown;
|
|
@@ -1670,31 +1783,31 @@ declare const WsHistoricalDataSchema: z.ZodObject<{
|
|
|
1670
1783
|
type: "historical_data";
|
|
1671
1784
|
coin: string;
|
|
1672
1785
|
timestamp: number;
|
|
1673
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1786
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1674
1787
|
data?: unknown;
|
|
1675
1788
|
}, {
|
|
1676
1789
|
type: "historical_data";
|
|
1677
1790
|
coin: string;
|
|
1678
1791
|
timestamp: number;
|
|
1679
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1792
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1680
1793
|
data?: unknown;
|
|
1681
1794
|
}>;
|
|
1682
1795
|
declare const WsStreamStartedSchema: z.ZodObject<{
|
|
1683
1796
|
type: z.ZodLiteral<"stream_started">;
|
|
1684
|
-
channel: z.ZodEnum<["orderbook", "trades", "ticker", "all_tickers"]>;
|
|
1797
|
+
channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
|
|
1685
1798
|
coin: z.ZodString;
|
|
1686
1799
|
start: z.ZodNumber;
|
|
1687
1800
|
end: z.ZodNumber;
|
|
1688
1801
|
}, "strip", z.ZodTypeAny, {
|
|
1689
1802
|
type: "stream_started";
|
|
1690
1803
|
coin: string;
|
|
1691
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1804
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1692
1805
|
start: number;
|
|
1693
1806
|
end: number;
|
|
1694
1807
|
}, {
|
|
1695
1808
|
type: "stream_started";
|
|
1696
1809
|
coin: string;
|
|
1697
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1810
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1698
1811
|
start: number;
|
|
1699
1812
|
end: number;
|
|
1700
1813
|
}>;
|
|
@@ -1720,7 +1833,7 @@ declare const TimestampedRecordSchema: z.ZodObject<{
|
|
|
1720
1833
|
}>;
|
|
1721
1834
|
declare const WsHistoricalBatchSchema: z.ZodObject<{
|
|
1722
1835
|
type: z.ZodLiteral<"historical_batch">;
|
|
1723
|
-
channel: z.ZodEnum<["orderbook", "trades", "ticker", "all_tickers"]>;
|
|
1836
|
+
channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
|
|
1724
1837
|
coin: z.ZodString;
|
|
1725
1838
|
data: z.ZodArray<z.ZodObject<{
|
|
1726
1839
|
timestamp: z.ZodNumber;
|
|
@@ -1739,7 +1852,7 @@ declare const WsHistoricalBatchSchema: z.ZodObject<{
|
|
|
1739
1852
|
}[];
|
|
1740
1853
|
type: "historical_batch";
|
|
1741
1854
|
coin: string;
|
|
1742
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1855
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1743
1856
|
}, {
|
|
1744
1857
|
data: {
|
|
1745
1858
|
timestamp: number;
|
|
@@ -1747,22 +1860,22 @@ declare const WsHistoricalBatchSchema: z.ZodObject<{
|
|
|
1747
1860
|
}[];
|
|
1748
1861
|
type: "historical_batch";
|
|
1749
1862
|
coin: string;
|
|
1750
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1863
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1751
1864
|
}>;
|
|
1752
1865
|
declare const WsStreamCompletedSchema: z.ZodObject<{
|
|
1753
1866
|
type: z.ZodLiteral<"stream_completed">;
|
|
1754
|
-
channel: z.ZodEnum<["orderbook", "trades", "ticker", "all_tickers"]>;
|
|
1867
|
+
channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
|
|
1755
1868
|
coin: z.ZodString;
|
|
1756
1869
|
snapshotsSent: z.ZodNumber;
|
|
1757
1870
|
}, "strip", z.ZodTypeAny, {
|
|
1758
1871
|
type: "stream_completed";
|
|
1759
1872
|
coin: string;
|
|
1760
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1873
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1761
1874
|
snapshotsSent: number;
|
|
1762
1875
|
}, {
|
|
1763
1876
|
type: "stream_completed";
|
|
1764
1877
|
coin: string;
|
|
1765
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1878
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1766
1879
|
snapshotsSent: number;
|
|
1767
1880
|
}>;
|
|
1768
1881
|
declare const WsStreamStoppedSchema: z.ZodObject<{
|
|
@@ -1777,27 +1890,27 @@ declare const WsStreamStoppedSchema: z.ZodObject<{
|
|
|
1777
1890
|
}>;
|
|
1778
1891
|
declare const WsServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1779
1892
|
type: z.ZodLiteral<"subscribed">;
|
|
1780
|
-
channel: z.ZodEnum<["orderbook", "trades", "ticker", "all_tickers"]>;
|
|
1893
|
+
channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
|
|
1781
1894
|
coin: z.ZodOptional<z.ZodString>;
|
|
1782
1895
|
}, "strip", z.ZodTypeAny, {
|
|
1783
1896
|
type: "subscribed";
|
|
1784
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1897
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1785
1898
|
coin?: string | undefined;
|
|
1786
1899
|
}, {
|
|
1787
1900
|
type: "subscribed";
|
|
1788
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1901
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1789
1902
|
coin?: string | undefined;
|
|
1790
1903
|
}>, z.ZodObject<{
|
|
1791
1904
|
type: z.ZodLiteral<"unsubscribed">;
|
|
1792
|
-
channel: z.ZodEnum<["orderbook", "trades", "ticker", "all_tickers"]>;
|
|
1905
|
+
channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
|
|
1793
1906
|
coin: z.ZodOptional<z.ZodString>;
|
|
1794
1907
|
}, "strip", z.ZodTypeAny, {
|
|
1795
1908
|
type: "unsubscribed";
|
|
1796
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1909
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1797
1910
|
coin?: string | undefined;
|
|
1798
1911
|
}, {
|
|
1799
1912
|
type: "unsubscribed";
|
|
1800
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1913
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1801
1914
|
coin?: string | undefined;
|
|
1802
1915
|
}>, z.ZodObject<{
|
|
1803
1916
|
type: z.ZodLiteral<"pong">;
|
|
@@ -1816,22 +1929,22 @@ declare const WsServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
|
|
|
1816
1929
|
type: "error";
|
|
1817
1930
|
}>, z.ZodObject<{
|
|
1818
1931
|
type: z.ZodLiteral<"data">;
|
|
1819
|
-
channel: z.ZodEnum<["orderbook", "trades", "ticker", "all_tickers"]>;
|
|
1932
|
+
channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
|
|
1820
1933
|
coin: z.ZodString;
|
|
1821
1934
|
data: z.ZodUnknown;
|
|
1822
1935
|
}, "strip", z.ZodTypeAny, {
|
|
1823
1936
|
type: "data";
|
|
1824
1937
|
coin: string;
|
|
1825
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1938
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1826
1939
|
data?: unknown;
|
|
1827
1940
|
}, {
|
|
1828
1941
|
type: "data";
|
|
1829
1942
|
coin: string;
|
|
1830
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1943
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1831
1944
|
data?: unknown;
|
|
1832
1945
|
}>, z.ZodObject<{
|
|
1833
1946
|
type: z.ZodLiteral<"replay_started">;
|
|
1834
|
-
channel: z.ZodEnum<["orderbook", "trades", "ticker", "all_tickers"]>;
|
|
1947
|
+
channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
|
|
1835
1948
|
coin: z.ZodString;
|
|
1836
1949
|
start: z.ZodNumber;
|
|
1837
1950
|
end: z.ZodNumber;
|
|
@@ -1839,14 +1952,14 @@ declare const WsServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
|
|
|
1839
1952
|
}, "strip", z.ZodTypeAny, {
|
|
1840
1953
|
type: "replay_started";
|
|
1841
1954
|
coin: string;
|
|
1842
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1955
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1843
1956
|
start: number;
|
|
1844
1957
|
end: number;
|
|
1845
1958
|
speed: number;
|
|
1846
1959
|
}, {
|
|
1847
1960
|
type: "replay_started";
|
|
1848
1961
|
coin: string;
|
|
1849
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1962
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1850
1963
|
start: number;
|
|
1851
1964
|
end: number;
|
|
1852
1965
|
speed: number;
|
|
@@ -1870,18 +1983,18 @@ declare const WsServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
|
|
|
1870
1983
|
currentTimestamp: number;
|
|
1871
1984
|
}>, z.ZodObject<{
|
|
1872
1985
|
type: z.ZodLiteral<"replay_completed">;
|
|
1873
|
-
channel: z.ZodEnum<["orderbook", "trades", "ticker", "all_tickers"]>;
|
|
1986
|
+
channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
|
|
1874
1987
|
coin: z.ZodString;
|
|
1875
1988
|
snapshotsSent: z.ZodNumber;
|
|
1876
1989
|
}, "strip", z.ZodTypeAny, {
|
|
1877
1990
|
type: "replay_completed";
|
|
1878
1991
|
coin: string;
|
|
1879
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1992
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1880
1993
|
snapshotsSent: number;
|
|
1881
1994
|
}, {
|
|
1882
1995
|
type: "replay_completed";
|
|
1883
1996
|
coin: string;
|
|
1884
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
1997
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1885
1998
|
snapshotsSent: number;
|
|
1886
1999
|
}>, z.ZodObject<{
|
|
1887
2000
|
type: z.ZodLiteral<"replay_stopped">;
|
|
@@ -1891,7 +2004,7 @@ declare const WsServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
|
|
|
1891
2004
|
type: "replay_stopped";
|
|
1892
2005
|
}>, z.ZodObject<{
|
|
1893
2006
|
type: z.ZodLiteral<"historical_data">;
|
|
1894
|
-
channel: z.ZodEnum<["orderbook", "trades", "ticker", "all_tickers"]>;
|
|
2007
|
+
channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
|
|
1895
2008
|
coin: z.ZodString;
|
|
1896
2009
|
timestamp: z.ZodNumber;
|
|
1897
2010
|
data: z.ZodUnknown;
|
|
@@ -1899,30 +2012,30 @@ declare const WsServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
|
|
|
1899
2012
|
type: "historical_data";
|
|
1900
2013
|
coin: string;
|
|
1901
2014
|
timestamp: number;
|
|
1902
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
2015
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1903
2016
|
data?: unknown;
|
|
1904
2017
|
}, {
|
|
1905
2018
|
type: "historical_data";
|
|
1906
2019
|
coin: string;
|
|
1907
2020
|
timestamp: number;
|
|
1908
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
2021
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1909
2022
|
data?: unknown;
|
|
1910
2023
|
}>, z.ZodObject<{
|
|
1911
2024
|
type: z.ZodLiteral<"stream_started">;
|
|
1912
|
-
channel: z.ZodEnum<["orderbook", "trades", "ticker", "all_tickers"]>;
|
|
2025
|
+
channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
|
|
1913
2026
|
coin: z.ZodString;
|
|
1914
2027
|
start: z.ZodNumber;
|
|
1915
2028
|
end: z.ZodNumber;
|
|
1916
2029
|
}, "strip", z.ZodTypeAny, {
|
|
1917
2030
|
type: "stream_started";
|
|
1918
2031
|
coin: string;
|
|
1919
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
2032
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1920
2033
|
start: number;
|
|
1921
2034
|
end: number;
|
|
1922
2035
|
}, {
|
|
1923
2036
|
type: "stream_started";
|
|
1924
2037
|
coin: string;
|
|
1925
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
2038
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1926
2039
|
start: number;
|
|
1927
2040
|
end: number;
|
|
1928
2041
|
}>, z.ZodObject<{
|
|
@@ -1936,7 +2049,7 @@ declare const WsServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
|
|
|
1936
2049
|
snapshotsSent: number;
|
|
1937
2050
|
}>, z.ZodObject<{
|
|
1938
2051
|
type: z.ZodLiteral<"historical_batch">;
|
|
1939
|
-
channel: z.ZodEnum<["orderbook", "trades", "ticker", "all_tickers"]>;
|
|
2052
|
+
channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
|
|
1940
2053
|
coin: z.ZodString;
|
|
1941
2054
|
data: z.ZodArray<z.ZodObject<{
|
|
1942
2055
|
timestamp: z.ZodNumber;
|
|
@@ -1955,7 +2068,7 @@ declare const WsServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
|
|
|
1955
2068
|
}[];
|
|
1956
2069
|
type: "historical_batch";
|
|
1957
2070
|
coin: string;
|
|
1958
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
2071
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1959
2072
|
}, {
|
|
1960
2073
|
data: {
|
|
1961
2074
|
timestamp: number;
|
|
@@ -1963,21 +2076,21 @@ declare const WsServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
|
|
|
1963
2076
|
}[];
|
|
1964
2077
|
type: "historical_batch";
|
|
1965
2078
|
coin: string;
|
|
1966
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
2079
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1967
2080
|
}>, z.ZodObject<{
|
|
1968
2081
|
type: z.ZodLiteral<"stream_completed">;
|
|
1969
|
-
channel: z.ZodEnum<["orderbook", "trades", "ticker", "all_tickers"]>;
|
|
2082
|
+
channel: z.ZodEnum<["orderbook", "trades", "candles", "ticker", "all_tickers"]>;
|
|
1970
2083
|
coin: z.ZodString;
|
|
1971
2084
|
snapshotsSent: z.ZodNumber;
|
|
1972
2085
|
}, "strip", z.ZodTypeAny, {
|
|
1973
2086
|
type: "stream_completed";
|
|
1974
2087
|
coin: string;
|
|
1975
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
2088
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1976
2089
|
snapshotsSent: number;
|
|
1977
2090
|
}, {
|
|
1978
2091
|
type: "stream_completed";
|
|
1979
2092
|
coin: string;
|
|
1980
|
-
channel: "orderbook" | "trades" | "ticker" | "all_tickers";
|
|
2093
|
+
channel: "orderbook" | "trades" | "candles" | "ticker" | "all_tickers";
|
|
1981
2094
|
snapshotsSent: number;
|
|
1982
2095
|
}>, z.ZodObject<{
|
|
1983
2096
|
type: z.ZodLiteral<"stream_stopped">;
|
|
@@ -2798,6 +2911,84 @@ declare const OpenInterestArrayResponseSchema: z.ZodObject<{
|
|
|
2798
2911
|
nextCursor?: string | undefined;
|
|
2799
2912
|
};
|
|
2800
2913
|
}>;
|
|
2914
|
+
declare const CandleArrayResponseSchema: z.ZodObject<{
|
|
2915
|
+
success: z.ZodBoolean;
|
|
2916
|
+
data: z.ZodArray<z.ZodObject<{
|
|
2917
|
+
timestamp: z.ZodString;
|
|
2918
|
+
open: z.ZodNumber;
|
|
2919
|
+
high: z.ZodNumber;
|
|
2920
|
+
low: z.ZodNumber;
|
|
2921
|
+
close: z.ZodNumber;
|
|
2922
|
+
volume: z.ZodNumber;
|
|
2923
|
+
quoteVolume: z.ZodOptional<z.ZodNumber>;
|
|
2924
|
+
tradeCount: z.ZodOptional<z.ZodNumber>;
|
|
2925
|
+
}, "strip", z.ZodTypeAny, {
|
|
2926
|
+
timestamp: string;
|
|
2927
|
+
open: number;
|
|
2928
|
+
high: number;
|
|
2929
|
+
low: number;
|
|
2930
|
+
close: number;
|
|
2931
|
+
volume: number;
|
|
2932
|
+
quoteVolume?: number | undefined;
|
|
2933
|
+
tradeCount?: number | undefined;
|
|
2934
|
+
}, {
|
|
2935
|
+
timestamp: string;
|
|
2936
|
+
open: number;
|
|
2937
|
+
high: number;
|
|
2938
|
+
low: number;
|
|
2939
|
+
close: number;
|
|
2940
|
+
volume: number;
|
|
2941
|
+
quoteVolume?: number | undefined;
|
|
2942
|
+
tradeCount?: number | undefined;
|
|
2943
|
+
}>, "many">;
|
|
2944
|
+
meta: z.ZodObject<{
|
|
2945
|
+
count: z.ZodNumber;
|
|
2946
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
2947
|
+
requestId: z.ZodString;
|
|
2948
|
+
}, "strip", z.ZodTypeAny, {
|
|
2949
|
+
count: number;
|
|
2950
|
+
requestId: string;
|
|
2951
|
+
nextCursor?: string | undefined;
|
|
2952
|
+
}, {
|
|
2953
|
+
count: number;
|
|
2954
|
+
requestId: string;
|
|
2955
|
+
nextCursor?: string | undefined;
|
|
2956
|
+
}>;
|
|
2957
|
+
}, "strip", z.ZodTypeAny, {
|
|
2958
|
+
data: {
|
|
2959
|
+
timestamp: string;
|
|
2960
|
+
open: number;
|
|
2961
|
+
high: number;
|
|
2962
|
+
low: number;
|
|
2963
|
+
close: number;
|
|
2964
|
+
volume: number;
|
|
2965
|
+
quoteVolume?: number | undefined;
|
|
2966
|
+
tradeCount?: number | undefined;
|
|
2967
|
+
}[];
|
|
2968
|
+
success: boolean;
|
|
2969
|
+
meta: {
|
|
2970
|
+
count: number;
|
|
2971
|
+
requestId: string;
|
|
2972
|
+
nextCursor?: string | undefined;
|
|
2973
|
+
};
|
|
2974
|
+
}, {
|
|
2975
|
+
data: {
|
|
2976
|
+
timestamp: string;
|
|
2977
|
+
open: number;
|
|
2978
|
+
high: number;
|
|
2979
|
+
low: number;
|
|
2980
|
+
close: number;
|
|
2981
|
+
volume: number;
|
|
2982
|
+
quoteVolume?: number | undefined;
|
|
2983
|
+
tradeCount?: number | undefined;
|
|
2984
|
+
}[];
|
|
2985
|
+
success: boolean;
|
|
2986
|
+
meta: {
|
|
2987
|
+
count: number;
|
|
2988
|
+
requestId: string;
|
|
2989
|
+
nextCursor?: string | undefined;
|
|
2990
|
+
};
|
|
2991
|
+
}>;
|
|
2801
2992
|
type ValidatedApiMeta = z.infer<typeof ApiMetaSchema>;
|
|
2802
2993
|
type ValidatedPriceLevel = z.infer<typeof PriceLevelSchema>;
|
|
2803
2994
|
type ValidatedOrderBook = z.infer<typeof OrderBookSchema>;
|
|
@@ -2805,6 +2996,7 @@ type ValidatedTrade = z.infer<typeof TradeSchema>;
|
|
|
2805
2996
|
type ValidatedInstrument = z.infer<typeof InstrumentSchema>;
|
|
2806
2997
|
type ValidatedFundingRate = z.infer<typeof FundingRateSchema>;
|
|
2807
2998
|
type ValidatedOpenInterest = z.infer<typeof OpenInterestSchema>;
|
|
2999
|
+
type ValidatedCandle = z.infer<typeof CandleSchema>;
|
|
2808
3000
|
type ValidatedWsServerMessage = z.infer<typeof WsServerMessageSchema>;
|
|
2809
3001
|
|
|
2810
|
-
export { type ApiError, type ApiMeta, ApiMetaSchema, type ApiResponse, ApiResponseSchema, 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 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 };
|
|
3002
|
+
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 };
|