@0xarchive/sdk 0.9.0 → 0.9.1

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.mjs CHANGED
@@ -1505,7 +1505,9 @@ var Hip3Client = class {
1505
1505
  * OHLCV candle data
1506
1506
  */
1507
1507
  candles;
1508
+ http;
1508
1509
  constructor(http) {
1510
+ this.http = http;
1509
1511
  const basePath = "/v1/hyperliquid/hip3";
1510
1512
  const coinTransform = (c) => c;
1511
1513
  this.instruments = new Hip3InstrumentsResource(http, basePath, coinTransform);
@@ -1515,6 +1517,52 @@ var Hip3Client = class {
1515
1517
  this.openInterest = new OpenInterestResource(http, basePath, coinTransform);
1516
1518
  this.candles = new CandlesResource(http, basePath, coinTransform);
1517
1519
  }
1520
+ /**
1521
+ * Get per-coin data freshness across all data types
1522
+ *
1523
+ * @param coin - The coin symbol (case-sensitive, e.g., 'km:US500')
1524
+ * @returns Per-coin freshness with last_updated and lag_ms for each data type
1525
+ */
1526
+ async freshness(coin) {
1527
+ const response = await this.http.get(
1528
+ `/v1/hyperliquid/hip3/freshness/${coin}`,
1529
+ void 0,
1530
+ this.http.validationEnabled ? CoinFreshnessResponseSchema : void 0
1531
+ );
1532
+ return response.data;
1533
+ }
1534
+ /**
1535
+ * Get combined market summary (price, funding, OI) in one call
1536
+ *
1537
+ * @param coin - The coin symbol (case-sensitive, e.g., 'km:US500')
1538
+ * @returns Combined market summary
1539
+ */
1540
+ async summary(coin) {
1541
+ const response = await this.http.get(
1542
+ `/v1/hyperliquid/hip3/summary/${coin}`,
1543
+ void 0,
1544
+ this.http.validationEnabled ? CoinSummaryResponseSchema : void 0
1545
+ );
1546
+ return response.data;
1547
+ }
1548
+ /**
1549
+ * Get mark/oracle/mid price history (projected from OI data)
1550
+ *
1551
+ * @param coin - The coin symbol (case-sensitive, e.g., 'km:US500')
1552
+ * @param params - Time range, cursor, and interval parameters
1553
+ * @returns CursorResponse with price snapshots
1554
+ */
1555
+ async priceHistory(coin, params) {
1556
+ const response = await this.http.get(
1557
+ `/v1/hyperliquid/hip3/prices/${coin}`,
1558
+ params,
1559
+ this.http.validationEnabled ? PriceSnapshotArrayResponseSchema : void 0
1560
+ );
1561
+ return {
1562
+ data: response.data,
1563
+ nextCursor: response.meta.nextCursor
1564
+ };
1565
+ }
1518
1566
  };
1519
1567
  var LighterClient = class {
1520
1568
  /**
@@ -1541,7 +1589,9 @@ var LighterClient = class {
1541
1589
  * OHLCV candle data
1542
1590
  */
1543
1591
  candles;
1592
+ http;
1544
1593
  constructor(http) {
1594
+ this.http = http;
1545
1595
  const basePath = "/v1/lighter";
1546
1596
  this.orderbook = new OrderBookResource(http, basePath);
1547
1597
  this.trades = new TradesResource(http, basePath);
@@ -1550,6 +1600,52 @@ var LighterClient = class {
1550
1600
  this.openInterest = new OpenInterestResource(http, basePath);
1551
1601
  this.candles = new CandlesResource(http, basePath);
1552
1602
  }
1603
+ /**
1604
+ * Get per-coin data freshness across all data types
1605
+ *
1606
+ * @param coin - The coin symbol (e.g., 'BTC', 'ETH')
1607
+ * @returns Per-coin freshness with last_updated and lag_ms for each data type
1608
+ */
1609
+ async freshness(coin) {
1610
+ const response = await this.http.get(
1611
+ `/v1/lighter/freshness/${coin.toUpperCase()}`,
1612
+ void 0,
1613
+ this.http.validationEnabled ? CoinFreshnessResponseSchema : void 0
1614
+ );
1615
+ return response.data;
1616
+ }
1617
+ /**
1618
+ * Get combined market summary (price, funding, OI) in one call
1619
+ *
1620
+ * @param coin - The coin symbol (e.g., 'BTC', 'ETH')
1621
+ * @returns Combined market summary
1622
+ */
1623
+ async summary(coin) {
1624
+ const response = await this.http.get(
1625
+ `/v1/lighter/summary/${coin.toUpperCase()}`,
1626
+ void 0,
1627
+ this.http.validationEnabled ? CoinSummaryResponseSchema : void 0
1628
+ );
1629
+ return response.data;
1630
+ }
1631
+ /**
1632
+ * Get mark/oracle price history (projected from OI data)
1633
+ *
1634
+ * @param coin - The coin symbol (e.g., 'BTC', 'ETH')
1635
+ * @param params - Time range, cursor, and interval parameters
1636
+ * @returns CursorResponse with price snapshots
1637
+ */
1638
+ async priceHistory(coin, params) {
1639
+ const response = await this.http.get(
1640
+ `/v1/lighter/prices/${coin.toUpperCase()}`,
1641
+ params,
1642
+ this.http.validationEnabled ? PriceSnapshotArrayResponseSchema : void 0
1643
+ );
1644
+ return {
1645
+ data: response.data,
1646
+ nextCursor: response.meta.nextCursor
1647
+ };
1648
+ }
1553
1649
  };
1554
1650
 
1555
1651
  // src/client.ts