thetadatadx 7.3.1 → 8.0.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 CHANGED
@@ -20,33 +20,82 @@ Pre-built binaries are downloaded automatically for your platform. Supported:
20
20
  ```js
21
21
  const { ThetaDataDx } = require('thetadatadx');
22
22
 
23
- // Connect (requires ThetaData credentials)
24
- const tdx = ThetaDataDx.connectFromFile('creds.txt');
25
- // Or: const tdx = ThetaDataDx.connect('user@example.com', 'password');
26
-
27
- // Historical: returns columnar object { close: number[], volume: number[], ... }
28
- const ohlc = tdx.stockHistoryOHLC('AAPL', '20240315', '60000');
29
- console.log(ohlc.close);
30
-
31
- // With timeout
32
- const snap = tdx.stockSnapshotQuote(['AAPL', 'MSFT'], null, null, 5000);
33
-
34
- // Streaming
35
- tdx.startStreaming();
36
- tdx.subscribeQuotes('AAPL');
37
- const event = tdx.nextEvent(1000); // poll with 1s timeout
38
- tdx.stopStreaming();
23
+ async function main() {
24
+ // Connect (requires ThetaData credentials)
25
+ const tdx = ThetaDataDx.connectFromFile('creds.txt');
26
+ // Or: const tdx = ThetaDataDx.connect('user@example.com', 'password');
27
+
28
+ // Historical endpoints return an array of typed tick objects
29
+ // (`OhlcTick[]`, `QuoteTick[]`, ...). Index into the array to
30
+ // read a per-row field.
31
+ const ohlc = tdx.stockHistoryOHLC('AAPL', '20240315', '60000');
32
+ console.log(ohlc.length, ohlc[0].close);
33
+
34
+ // With timeout
35
+ const snap = tdx.stockSnapshotQuote(['AAPL', 'MSFT'], null, null, 5000);
36
+
37
+ // Streaming `nextEvent` is async; `await` it or you'll get a
38
+ // `Promise` object back and `event.kind` will be `undefined`.
39
+ tdx.startStreaming();
40
+ tdx.subscribeQuotes('AAPL');
41
+ const event = await tdx.nextEvent(1000); // poll with 1s timeout
42
+ if (event && event.kind === 'quote') {
43
+ console.log(event.quote.bid, event.quote.ask);
44
+ }
45
+ tdx.stopStreaming();
46
+ }
47
+
48
+ main().catch(console.error);
39
49
  ```
40
50
 
41
51
  ## TypeScript types
42
52
 
43
- Generated interfaces for every tick type live in `src/types.ts`:
53
+ Every tick type and FPSS event is emitted as a `#[napi(object)]` struct on
54
+ the Rust side, so the full typed surface lives in `index.d.ts`
55
+ (auto-generated by napi-rs). Import directly from the package:
44
56
 
45
57
  ```ts
46
- import type { OhlcTickColumnar, GreeksTickColumnar } from 'thetadatadx/src/types';
58
+ import type { OhlcTick, GreeksTick, Quote, Trade, FpssEvent } from 'thetadatadx';
47
59
  ```
48
60
 
49
- Full type declarations for the `ThetaDataDx` class are in `index.d.ts` (auto-generated by napi-rs).
61
+ Historical endpoints return `Tick[]`; `nextEvent()` is async and resolves
62
+ to a discriminated `FpssEvent | null` union, narrowed on `event.kind`:
63
+
64
+ ```ts
65
+ const event = await tdx.nextEvent(1000);
66
+ if (!event) return; // timeout
67
+ switch (event.kind) {
68
+ case 'quote': /* event.quote is Quote */ break;
69
+ case 'trade': /* event.trade is Trade */ break;
70
+ case 'ohlcvc': /* event.ohlcvc is Ohlcvc */ break;
71
+ case 'open_interest': /* event.openInterest is OpenInterest */ break;
72
+ case 'simple': /* event.simple is FpssSimplePayload */ break;
73
+ case 'raw_data': /* event.rawData is FpssRawDataPayload */ break;
74
+ }
75
+ ```
76
+
77
+ The `kind` field is typed as the string-literal union
78
+ `'ohlcvc' | 'open_interest' | 'quote' | 'trade' | 'simple' | 'raw_data'`
79
+ — plain strings, not a TS `enum` (the previous `const enum FpssEventKind`
80
+ was removed in #376 because it broke downstream consumers with
81
+ `"isolatedModules": true`), so it works in every toolchain
82
+ including Vite, esbuild, ts-jest, and Next.js.
83
+
84
+ ### `bigint` fields
85
+
86
+ Anywhere a Rust `u64` or `i64` crosses the napi boundary it surfaces as
87
+ JavaScript `bigint` (not `number`): `volume` and `count` on every
88
+ OHLC / EOD tick, `droppedEvents()` on the streaming client, and
89
+ `received_at_ns` on every FPSS event. Use `bigint` literal syntax
90
+ (`42n`) for comparisons or widen to `Number(x)` at the point of
91
+ display (watch for loss of precision beyond 2^53).
92
+
93
+ `FpssSimplePayload.eventType` carries the concrete control-event name
94
+ (`"login_success"`, `"contract_assigned"`, `"disconnected"`,
95
+ `"market_open"`, `"market_close"`, ...). The wire tag set matches the
96
+ Python SDK's `next_event` pyclasses byte-for-byte — both surfaces are
97
+ generated from `fpss_event_schema.toml`, so consumer code ports between
98
+ the two languages without a discriminator rewrite.
50
99
 
51
100
  ## Building from source
52
101
 
package/index.d.ts CHANGED
@@ -8,32 +8,45 @@ export declare class ThetaDataDx {
8
8
  static connect(email: string, password: string): ThetaDataDx
9
9
  /** Connect with a credentials file (line 1 = email, line 2 = password). */
10
10
  static connectFromFile(path: string): ThetaDataDx
11
+ /**
12
+ * Cumulative count of FPSS events dropped because the JS polling
13
+ * side disconnected before the FPSS callback could hand them off.
14
+ *
15
+ * Counter lives on the client instance (not inside the
16
+ * `start_streaming` / `reconnect` closures), so the value survives
17
+ * reconnect and is observable at any point — before streaming,
18
+ * during, or after `shutdown()`.
19
+ *
20
+ * Returned as `bigint` so it can represent the full `u64` range
21
+ * (Number would top out at 2^53).
22
+ */
23
+ droppedEvents(): bigint
11
24
  /** List all available stock ticker symbols. */
12
25
  stockListSymbols(timeoutMs?: number | undefined | null): Array<string>
13
26
  /** List available dates for a stock by request type (EOD, TRADE, QUOTE, etc.). */
14
27
  stockListDates(requestType: string, symbol: string, timeoutMs?: number | undefined | null): Array<string>
15
28
  /** Get the latest OHLC snapshot for one or more stocks. */
16
- stockSnapshotOHLC(symbols: Array<string>, venue?: string | undefined | null, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): any
29
+ stockSnapshotOHLC(symbols: Array<string>, venue?: string | undefined | null, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): Array<OhlcTick>
17
30
  /** Get the latest trade snapshot for one or more stocks. */
18
- stockSnapshotTrade(symbols: Array<string>, venue?: string | undefined | null, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): any
31
+ stockSnapshotTrade(symbols: Array<string>, venue?: string | undefined | null, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): Array<TradeTick>
19
32
  /** Get the latest NBBO quote snapshot for one or more stocks. */
20
- stockSnapshotQuote(symbols: Array<string>, venue?: string | undefined | null, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): any
33
+ stockSnapshotQuote(symbols: Array<string>, venue?: string | undefined | null, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): Array<QuoteTick>
21
34
  /** Get the latest market value snapshot for one or more stocks. */
22
- stockSnapshotMarketValue(symbols: Array<string>, venue?: string | undefined | null, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): any
35
+ stockSnapshotMarketValue(symbols: Array<string>, venue?: string | undefined | null, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): Array<MarketValueTick>
23
36
  /** Fetch end-of-day stock data for a date range. Returns OHLCV + bid/ask per trading day. */
24
- stockHistoryEOD(symbol: string, startDate: string, endDate: string, timeoutMs?: number | undefined | null): any
37
+ stockHistoryEOD(symbol: string, startDate: string, endDate: string, timeoutMs?: number | undefined | null): Array<EodTick>
25
38
  /** Fetch intraday OHLC bars for a stock on a single date. */
26
- stockHistoryOHLC(symbol: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, venue?: string | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
39
+ stockHistoryOHLC(symbol: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, venue?: string | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<OhlcTick>
27
40
  /** Fetch all trades for a stock on a given date. */
28
- stockHistoryTrade(symbol: string, date: string, startTime?: string | undefined | null, endTime?: string | undefined | null, venue?: string | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
41
+ stockHistoryTrade(symbol: string, date: string, startTime?: string | undefined | null, endTime?: string | undefined | null, venue?: string | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<TradeTick>
29
42
  /** Fetch NBBO quotes for a stock on a given date at a given interval. */
30
- stockHistoryQuote(symbol: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, venue?: string | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
43
+ stockHistoryQuote(symbol: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, venue?: string | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<QuoteTick>
31
44
  /** Fetch combined trade + quote ticks for a stock on a given date. Returns raw DataTable. */
32
- stockHistoryTradeQuote(symbol: string, date: string, startTime?: string | undefined | null, endTime?: string | undefined | null, exclusive?: boolean | undefined | null, venue?: string | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
45
+ stockHistoryTradeQuote(symbol: string, date: string, startTime?: string | undefined | null, endTime?: string | undefined | null, exclusive?: boolean | undefined | null, venue?: string | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<TradeQuoteTick>
33
46
  /** Fetch the trade at a specific time of day across a date range. */
34
- stockAtTimeTrade(symbol: string, startDate: string, endDate: string, timeOfDay: string, venue?: string | undefined | null, timeoutMs?: number | undefined | null): any
47
+ stockAtTimeTrade(symbol: string, startDate: string, endDate: string, timeOfDay: string, venue?: string | undefined | null, timeoutMs?: number | undefined | null): Array<TradeTick>
35
48
  /** Fetch the quote at a specific time of day across a date range. */
36
- stockAtTimeQuote(symbol: string, startDate: string, endDate: string, timeOfDay: string, venue?: string | undefined | null, timeoutMs?: number | undefined | null): any
49
+ stockAtTimeQuote(symbol: string, startDate: string, endDate: string, timeOfDay: string, venue?: string | undefined | null, timeoutMs?: number | undefined | null): Array<QuoteTick>
37
50
  /** List all available option underlying symbols. */
38
51
  optionListSymbols(timeoutMs?: number | undefined | null): Array<string>
39
52
  /** List available dates for an option contract by request type. */
@@ -43,93 +56,93 @@ export declare class ThetaDataDx {
43
56
  /** List available strike prices for an option at a given expiration. */
44
57
  optionListStrikes(symbol: string, expiration: string, timeoutMs?: number | undefined | null): Array<string>
45
58
  /** List all option contracts for a symbol on a given date. */
46
- optionListContracts(requestType: string, symbol: string, date: string, maxDte?: number | undefined | null, timeoutMs?: number | undefined | null): any
59
+ optionListContracts(requestType: string, symbol: string, date: string, maxDte?: number | undefined | null, timeoutMs?: number | undefined | null): Array<OptionContract>
47
60
  /** Get the latest OHLC snapshot for an option contract. */
48
- optionSnapshotOHLC(symbol: string, expiration: string, strike: string, right: string, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): any
61
+ optionSnapshotOHLC(symbol: string, expiration: string, strike: string, right: string, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): Array<OhlcTick>
49
62
  /** Get the latest trade snapshot for an option contract. */
50
- optionSnapshotTrade(symbol: string, expiration: string, strike: string, right: string, strikeRange?: number | undefined | null, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): any
63
+ optionSnapshotTrade(symbol: string, expiration: string, strike: string, right: string, strikeRange?: number | undefined | null, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): Array<TradeTick>
51
64
  /** Get the latest NBBO quote snapshot for an option contract. */
52
- optionSnapshotQuote(symbol: string, expiration: string, strike: string, right: string, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): any
65
+ optionSnapshotQuote(symbol: string, expiration: string, strike: string, right: string, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): Array<QuoteTick>
53
66
  /** Get the latest open interest snapshot for an option contract. */
54
- optionSnapshotOpenInterest(symbol: string, expiration: string, strike: string, right: string, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): any
67
+ optionSnapshotOpenInterest(symbol: string, expiration: string, strike: string, right: string, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): Array<OpenInterestTick>
55
68
  /** Get the latest market value snapshot for an option contract. */
56
- optionSnapshotMarketValue(symbol: string, expiration: string, strike: string, right: string, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): any
69
+ optionSnapshotMarketValue(symbol: string, expiration: string, strike: string, right: string, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): Array<MarketValueTick>
57
70
  /** Get implied volatility snapshot for an option contract (from ThetaData server). */
58
- optionSnapshotGreeksImpliedVolatility(symbol: string, expiration: string, strike: string, right: string, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, stockPrice?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, minTime?: string | undefined | null, useMarketValue?: boolean | undefined | null, timeoutMs?: number | undefined | null): any
71
+ optionSnapshotGreeksImpliedVolatility(symbol: string, expiration: string, strike: string, right: string, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, stockPrice?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, minTime?: string | undefined | null, useMarketValue?: boolean | undefined | null, timeoutMs?: number | undefined | null): Array<IvTick>
59
72
  /** Get all Greeks snapshot for an option contract (from ThetaData server). */
60
- optionSnapshotGreeksAll(symbol: string, expiration: string, strike: string, right: string, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, stockPrice?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, minTime?: string | undefined | null, useMarketValue?: boolean | undefined | null, timeoutMs?: number | undefined | null): any
73
+ optionSnapshotGreeksAll(symbol: string, expiration: string, strike: string, right: string, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, stockPrice?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, minTime?: string | undefined | null, useMarketValue?: boolean | undefined | null, timeoutMs?: number | undefined | null): Array<GreeksTick>
61
74
  /** Get first-order Greeks snapshot (delta, theta, rho) for an option contract. */
62
- optionSnapshotGreeksFirstOrder(symbol: string, expiration: string, strike: string, right: string, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, stockPrice?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, minTime?: string | undefined | null, useMarketValue?: boolean | undefined | null, timeoutMs?: number | undefined | null): any
75
+ optionSnapshotGreeksFirstOrder(symbol: string, expiration: string, strike: string, right: string, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, stockPrice?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, minTime?: string | undefined | null, useMarketValue?: boolean | undefined | null, timeoutMs?: number | undefined | null): Array<GreeksTick>
63
76
  /** Get second-order Greeks snapshot (gamma, vanna, charm) for an option contract. */
64
- optionSnapshotGreeksSecondOrder(symbol: string, expiration: string, strike: string, right: string, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, stockPrice?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, minTime?: string | undefined | null, useMarketValue?: boolean | undefined | null, timeoutMs?: number | undefined | null): any
77
+ optionSnapshotGreeksSecondOrder(symbol: string, expiration: string, strike: string, right: string, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, stockPrice?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, minTime?: string | undefined | null, useMarketValue?: boolean | undefined | null, timeoutMs?: number | undefined | null): Array<GreeksTick>
65
78
  /** Get third-order Greeks snapshot (speed, color, ultima) for an option contract. */
66
- optionSnapshotGreeksThirdOrder(symbol: string, expiration: string, strike: string, right: string, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, stockPrice?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, minTime?: string | undefined | null, useMarketValue?: boolean | undefined | null, timeoutMs?: number | undefined | null): any
79
+ optionSnapshotGreeksThirdOrder(symbol: string, expiration: string, strike: string, right: string, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, stockPrice?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, minTime?: string | undefined | null, useMarketValue?: boolean | undefined | null, timeoutMs?: number | undefined | null): Array<GreeksTick>
67
80
  /** Fetch end-of-day option data for a contract over a date range. */
68
- optionHistoryEOD(symbol: string, expiration: string, strike: string, right: string, startDate: string, endDate: string, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, timeoutMs?: number | undefined | null): any
81
+ optionHistoryEOD(symbol: string, expiration: string, strike: string, right: string, startDate: string, endDate: string, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, timeoutMs?: number | undefined | null): Array<EodTick>
69
82
  /** Fetch intraday OHLC bars for an option contract. */
70
- optionHistoryOHLC(symbol: string, expiration: string, strike: string, right: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
83
+ optionHistoryOHLC(symbol: string, expiration: string, strike: string, right: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<OhlcTick>
71
84
  /** Fetch all trades for an option contract on a given date. */
72
- optionHistoryTrade(symbol: string, expiration: string, strike: string, right: string, date: string, startTime?: string | undefined | null, endTime?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
85
+ optionHistoryTrade(symbol: string, expiration: string, strike: string, right: string, date: string, startTime?: string | undefined | null, endTime?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<TradeTick>
73
86
  /** Fetch NBBO quotes for an option contract on a given date. */
74
- optionHistoryQuote(symbol: string, expiration: string, strike: string, right: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
87
+ optionHistoryQuote(symbol: string, expiration: string, strike: string, right: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<QuoteTick>
75
88
  /** Fetch combined trade + quote ticks for an option contract. */
76
- optionHistoryTradeQuote(symbol: string, expiration: string, strike: string, right: string, date: string, startTime?: string | undefined | null, endTime?: string | undefined | null, exclusive?: boolean | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
89
+ optionHistoryTradeQuote(symbol: string, expiration: string, strike: string, right: string, date: string, startTime?: string | undefined | null, endTime?: string | undefined | null, exclusive?: boolean | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<TradeQuoteTick>
77
90
  /** Fetch open interest history for an option contract. */
78
- optionHistoryOpenInterest(symbol: string, expiration: string, strike: string, right: string, date: string, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
91
+ optionHistoryOpenInterest(symbol: string, expiration: string, strike: string, right: string, date: string, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<OpenInterestTick>
79
92
  /** Fetch end-of-day Greeks history for an option contract. */
80
- optionHistoryGreeksEOD(symbol: string, expiration: string, strike: string, right: string, startDate: string, endDate: string, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, underlyerUseNbbo?: boolean | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, timeoutMs?: number | undefined | null): any
93
+ optionHistoryGreeksEOD(symbol: string, expiration: string, strike: string, right: string, startDate: string, endDate: string, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, underlyerUseNbbo?: boolean | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, timeoutMs?: number | undefined | null): Array<GreeksTick>
81
94
  /** Fetch all Greeks history for an option contract (intraday, sampled by interval). */
82
- optionHistoryGreeksAll(symbol: string, expiration: string, strike: string, right: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
95
+ optionHistoryGreeksAll(symbol: string, expiration: string, strike: string, right: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<GreeksTick>
83
96
  /** Fetch all Greeks on each trade for an option contract. */
84
- optionHistoryTradeGreeksAll(symbol: string, expiration: string, strike: string, right: string, date: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
97
+ optionHistoryTradeGreeksAll(symbol: string, expiration: string, strike: string, right: string, date: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<GreeksTick>
85
98
  /** Fetch first-order Greeks history (intraday, sampled by interval). */
86
- optionHistoryGreeksFirstOrder(symbol: string, expiration: string, strike: string, right: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
99
+ optionHistoryGreeksFirstOrder(symbol: string, expiration: string, strike: string, right: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<GreeksTick>
87
100
  /** Fetch first-order Greeks on each trade for an option contract. */
88
- optionHistoryTradeGreeksFirstOrder(symbol: string, expiration: string, strike: string, right: string, date: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
101
+ optionHistoryTradeGreeksFirstOrder(symbol: string, expiration: string, strike: string, right: string, date: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<GreeksTick>
89
102
  /** Fetch second-order Greeks history (intraday, sampled by interval). */
90
- optionHistoryGreeksSecondOrder(symbol: string, expiration: string, strike: string, right: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
103
+ optionHistoryGreeksSecondOrder(symbol: string, expiration: string, strike: string, right: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<GreeksTick>
91
104
  /** Fetch second-order Greeks on each trade for an option contract. */
92
- optionHistoryTradeGreeksSecondOrder(symbol: string, expiration: string, strike: string, right: string, date: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
105
+ optionHistoryTradeGreeksSecondOrder(symbol: string, expiration: string, strike: string, right: string, date: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<GreeksTick>
93
106
  /** Fetch third-order Greeks history (intraday, sampled by interval). */
94
- optionHistoryGreeksThirdOrder(symbol: string, expiration: string, strike: string, right: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
107
+ optionHistoryGreeksThirdOrder(symbol: string, expiration: string, strike: string, right: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<GreeksTick>
95
108
  /** Fetch third-order Greeks on each trade for an option contract. */
96
- optionHistoryTradeGreeksThirdOrder(symbol: string, expiration: string, strike: string, right: string, date: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
109
+ optionHistoryTradeGreeksThirdOrder(symbol: string, expiration: string, strike: string, right: string, date: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<GreeksTick>
97
110
  /** Fetch implied volatility history (intraday, sampled by interval). */
98
- optionHistoryGreeksImpliedVolatility(symbol: string, expiration: string, strike: string, right: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
111
+ optionHistoryGreeksImpliedVolatility(symbol: string, expiration: string, strike: string, right: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<IvTick>
99
112
  /** Fetch implied volatility on each trade for an option contract. */
100
- optionHistoryTradeGreeksImpliedVolatility(symbol: string, expiration: string, strike: string, right: string, date: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
113
+ optionHistoryTradeGreeksImpliedVolatility(symbol: string, expiration: string, strike: string, right: string, date: string, startTime?: string | undefined | null, endTime?: string | undefined | null, annualDividend?: number | undefined | null, rateType?: string | undefined | null, rateValue?: number | undefined | null, version?: string | undefined | null, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<IvTick>
101
114
  /** Fetch the trade at a specific time of day across a date range for an option. */
102
- optionAtTimeTrade(symbol: string, expiration: string, strike: string, right: string, startDate: string, endDate: string, timeOfDay: string, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, timeoutMs?: number | undefined | null): any
115
+ optionAtTimeTrade(symbol: string, expiration: string, strike: string, right: string, startDate: string, endDate: string, timeOfDay: string, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, timeoutMs?: number | undefined | null): Array<TradeTick>
103
116
  /** Fetch the quote at a specific time of day across a date range for an option. */
104
- optionAtTimeQuote(symbol: string, expiration: string, strike: string, right: string, startDate: string, endDate: string, timeOfDay: string, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, timeoutMs?: number | undefined | null): any
117
+ optionAtTimeQuote(symbol: string, expiration: string, strike: string, right: string, startDate: string, endDate: string, timeOfDay: string, maxDte?: number | undefined | null, strikeRange?: number | undefined | null, timeoutMs?: number | undefined | null): Array<QuoteTick>
105
118
  /** List all available index symbols. */
106
119
  indexListSymbols(timeoutMs?: number | undefined | null): Array<string>
107
120
  /** List available dates for an index symbol. */
108
121
  indexListDates(symbol: string, timeoutMs?: number | undefined | null): Array<string>
109
122
  /** Get the latest OHLC snapshot for one or more indices. */
110
- indexSnapshotOHLC(symbols: Array<string>, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): any
123
+ indexSnapshotOHLC(symbols: Array<string>, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): Array<OhlcTick>
111
124
  /** Get the latest price snapshot for one or more indices. */
112
- indexSnapshotPrice(symbols: Array<string>, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): any
125
+ indexSnapshotPrice(symbols: Array<string>, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): Array<PriceTick>
113
126
  /** Get the latest market value snapshot for one or more indices. */
114
- indexSnapshotMarketValue(symbols: Array<string>, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): any
127
+ indexSnapshotMarketValue(symbols: Array<string>, minTime?: string | undefined | null, timeoutMs?: number | undefined | null): Array<MarketValueTick>
115
128
  /** Fetch end-of-day index data for a date range. */
116
- indexHistoryEOD(symbol: string, startDate: string, endDate: string, timeoutMs?: number | undefined | null): any
129
+ indexHistoryEOD(symbol: string, startDate: string, endDate: string, timeoutMs?: number | undefined | null): Array<EodTick>
117
130
  /** Fetch intraday OHLC bars for an index. */
118
- indexHistoryOHLC(symbol: string, startDate: string, endDate: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, timeoutMs?: number | undefined | null): any
131
+ indexHistoryOHLC(symbol: string, startDate: string, endDate: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, timeoutMs?: number | undefined | null): Array<OhlcTick>
119
132
  /** Fetch intraday price history for an index. */
120
- indexHistoryPrice(symbol: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): any
133
+ indexHistoryPrice(symbol: string, date: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, startDate?: string | undefined | null, endDate?: string | undefined | null, timeoutMs?: number | undefined | null): Array<PriceTick>
121
134
  /** Fetch the index price at a specific time of day across a date range. */
122
- indexAtTimePrice(symbol: string, startDate: string, endDate: string, timeOfDay: string, timeoutMs?: number | undefined | null): any
135
+ indexAtTimePrice(symbol: string, startDate: string, endDate: string, timeOfDay: string, timeoutMs?: number | undefined | null): Array<PriceTick>
123
136
  /** Check whether the market is open today. */
124
- calendarOpenToday(timeoutMs?: number | undefined | null): any
137
+ calendarOpenToday(timeoutMs?: number | undefined | null): Array<CalendarDay>
125
138
  /** Get calendar information for a specific date. */
126
- calendarOnDate(date: string, timeoutMs?: number | undefined | null): any
139
+ calendarOnDate(date: string, timeoutMs?: number | undefined | null): Array<CalendarDay>
127
140
  /** Get calendar information for an entire year. */
128
- calendarYear(year: string, timeoutMs?: number | undefined | null): any
141
+ calendarYear(year: string, timeoutMs?: number | undefined | null): Array<CalendarDay>
129
142
  /** Fetch end-of-day interest rate history. */
130
- interestRateHistoryEOD(symbol: string, startDate: string, endDate: string, timeoutMs?: number | undefined | null): any
143
+ interestRateHistoryEOD(symbol: string, startDate: string, endDate: string, timeoutMs?: number | undefined | null): Array<InterestRateTick>
131
144
  /** Fetch intraday OHLC bars across a date range. */
132
- stockHistoryOHLCRange(symbol: string, startDate: string, endDate: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, venue?: string | undefined | null, timeoutMs?: number | undefined | null): any
145
+ stockHistoryOHLCRange(symbol: string, startDate: string, endDate: string, interval: string, startTime?: string | undefined | null, endTime?: string | undefined | null, venue?: string | undefined | null, timeoutMs?: number | undefined | null): Array<OhlcTick>
133
146
  /** Start FPSS streaming. Events are buffered; poll with next_event(). */
134
147
  startStreaming(): void
135
148
  /** Whether the streaming connection is active. */
@@ -173,7 +186,7 @@ export declare class ThetaDataDx {
173
186
  /** Get a snapshot of currently active subscriptions. */
174
187
  activeSubscriptions(): any
175
188
  /** Poll for the next FPSS event. */
176
- nextEvent(timeoutMs: number): any | null
189
+ nextEvent(timeoutMs: number): Promise<({ kind: 'ohlcvc'; ohlcvc: Ohlcvc } | { kind: 'open_interest'; openInterest: OpenInterest } | { kind: 'quote'; quote: Quote } | { kind: 'trade'; trade: Trade } | { kind: 'simple'; simple: FpssSimplePayload } | { kind: 'raw_data'; rawData: FpssRawDataPayload }) | null>
177
190
  /** Reconnect streaming and re-subscribe all previous subscriptions. */
178
191
  reconnect(): void
179
192
  /** Stop streaming while keeping the historical client usable. */
@@ -181,3 +194,312 @@ export declare class ThetaDataDx {
181
194
  /** Shut down the FPSS streaming connection. */
182
195
  shutdown(): void
183
196
  }
197
+
198
+ /** Calendar day. Market open/close schedule. */
199
+ export interface CalendarDay {
200
+ date: number
201
+ isOpen: number
202
+ openTime: number
203
+ closeTime: number
204
+ status: number
205
+ }
206
+
207
+ /** End-of-day tick. Full EOD snapshot with OHLC + quote. */
208
+ export interface EodTick {
209
+ msOfDay: number
210
+ msOfDay2: number
211
+ open: number
212
+ high: number
213
+ low: number
214
+ close: number
215
+ volume: bigint
216
+ count: bigint
217
+ bidSize: number
218
+ bidExchange: number
219
+ bid: number
220
+ bidCondition: number
221
+ askSize: number
222
+ askExchange: number
223
+ ask: number
224
+ askCondition: number
225
+ date: number
226
+ expiration: number
227
+ strike: number
228
+ right: string
229
+ }
230
+
231
+ /**
232
+ * A single FPSS event surfaced to JS/TS.
233
+ *
234
+ * `kind` is the discriminator — switch on it and read the matching
235
+ * payload field. The shape is stable and every payload is typed, so
236
+ * consumers never fall back to untyped `any`.
237
+ */
238
+ export interface FpssEvent {
239
+ /**
240
+ * Discriminator matching one of the typed payload fields below.
241
+ * Narrowed to a literal union in TS so `switch (event.kind)`
242
+ * correctly narrows the optional payload fields.
243
+ */
244
+ kind: 'ohlcvc' | 'open_interest' | 'quote' | 'raw_data' | 'simple' | 'trade'
245
+ ohlcvc?: Ohlcvc
246
+ openInterest?: OpenInterest
247
+ quote?: Quote
248
+ trade?: Trade
249
+ simple?: FpssSimplePayload
250
+ rawData?: FpssRawDataPayload
251
+ }
252
+
253
+ /** FPSS raw-bytes payload for frames the decoder did not recognise. */
254
+ export interface FpssRawDataPayload {
255
+ code: number
256
+ payload: Array<number>
257
+ }
258
+
259
+ /**
260
+ * FPSS simple / diagnostic payload (login, disconnect, market open,
261
+ * unknown-data fallback, ...). Mirrors `BufferedEvent::Simple`.
262
+ */
263
+ export interface FpssSimplePayload {
264
+ /**
265
+ * Concrete event kind (e.g. "login_success", "disconnected",
266
+ * "unknown_data", "unknown_control").
267
+ */
268
+ eventType: string
269
+ /** Free-form diagnostic detail; empty when the event carries no payload. */
270
+ detail?: string
271
+ /** Optional event id (req_id for ReqResponse, contract id for ContractAssigned). */
272
+ id?: number
273
+ }
274
+
275
+ /** Greeks tick. Full set of option greeks. */
276
+ export interface GreeksTick {
277
+ msOfDay: number
278
+ impliedVolatility: number
279
+ delta: number
280
+ gamma: number
281
+ theta: number
282
+ vega: number
283
+ rho: number
284
+ ivError: number
285
+ vanna: number
286
+ charm: number
287
+ vomma: number
288
+ veta: number
289
+ speed: number
290
+ zomma: number
291
+ color: number
292
+ ultima: number
293
+ d1: number
294
+ d2: number
295
+ dualDelta: number
296
+ dualGamma: number
297
+ epsilon: number
298
+ lambda: number
299
+ vera: number
300
+ date: number
301
+ expiration: number
302
+ strike: number
303
+ right: string
304
+ }
305
+
306
+ /** Interest rate tick. End-of-day interest rate. */
307
+ export interface InterestRateTick {
308
+ msOfDay: number
309
+ rate: number
310
+ date: number
311
+ }
312
+
313
+ /** Implied volatility tick. */
314
+ export interface IvTick {
315
+ msOfDay: number
316
+ impliedVolatility: number
317
+ ivError: number
318
+ date: number
319
+ expiration: number
320
+ strike: number
321
+ right: string
322
+ }
323
+
324
+ /** Market value tick -- quoted bid/ask/price for a symbol. */
325
+ export interface MarketValueTick {
326
+ msOfDay: number
327
+ marketBid: number
328
+ marketAsk: number
329
+ marketPrice: number
330
+ date: number
331
+ expiration: number
332
+ strike: number
333
+ right: string
334
+ }
335
+
336
+ /** OHLC tick. Aggregated bar data. */
337
+ export interface OhlcTick {
338
+ msOfDay: number
339
+ open: number
340
+ high: number
341
+ low: number
342
+ close: number
343
+ volume: bigint
344
+ count: bigint
345
+ date: number
346
+ expiration: number
347
+ strike: number
348
+ right: string
349
+ }
350
+
351
+ /** FPSS OHLCVC bar. Mirrors `FpssData::Ohlcvc`. */
352
+ export interface Ohlcvc {
353
+ contractId: number
354
+ msOfDay: number
355
+ open: number
356
+ high: number
357
+ low: number
358
+ close: number
359
+ volume: bigint
360
+ count: bigint
361
+ date: number
362
+ receivedAtNs: bigint
363
+ }
364
+
365
+ /** FPSS OpenInterest tick. Mirrors `FpssData::OpenInterest`. */
366
+ export interface OpenInterest {
367
+ contractId: number
368
+ msOfDay: number
369
+ openInterest: number
370
+ date: number
371
+ receivedAtNs: bigint
372
+ }
373
+
374
+ /** Open interest tick. */
375
+ export interface OpenInterestTick {
376
+ msOfDay: number
377
+ openInterest: number
378
+ date: number
379
+ expiration: number
380
+ strike: number
381
+ right: string
382
+ }
383
+
384
+ /** Option contract. Contract specification. */
385
+ export interface OptionContract {
386
+ root: string
387
+ expiration: number
388
+ strike: number
389
+ right: string
390
+ }
391
+
392
+ /** Price tick. Generic price data point. */
393
+ export interface PriceTick {
394
+ msOfDay: number
395
+ price: number
396
+ date: number
397
+ }
398
+
399
+ /** FPSS Quote tick. Mirrors `FpssData::Quote` (symbol-less — `contract_id` is the stable key). */
400
+ export interface Quote {
401
+ contractId: number
402
+ msOfDay: number
403
+ bidSize: number
404
+ bidExchange: number
405
+ bid: number
406
+ bidCondition: number
407
+ askSize: number
408
+ askExchange: number
409
+ ask: number
410
+ askCondition: number
411
+ date: number
412
+ receivedAtNs: bigint
413
+ }
414
+
415
+ /** Quote tick. NBBO quote data. */
416
+ export interface QuoteTick {
417
+ msOfDay: number
418
+ bidSize: number
419
+ bidExchange: number
420
+ bid: number
421
+ bidCondition: number
422
+ askSize: number
423
+ askExchange: number
424
+ ask: number
425
+ askCondition: number
426
+ date: number
427
+ midpoint: number
428
+ expiration: number
429
+ strike: number
430
+ right: string
431
+ }
432
+
433
+ /** FPSS Trade tick. Mirrors `FpssData::Trade`. */
434
+ export interface Trade {
435
+ contractId: number
436
+ msOfDay: number
437
+ sequence: number
438
+ extCondition1: number
439
+ extCondition2: number
440
+ extCondition3: number
441
+ extCondition4: number
442
+ condition: number
443
+ size: number
444
+ exchange: number
445
+ price: number
446
+ conditionFlags: number
447
+ priceFlags: number
448
+ volumeType: number
449
+ recordsBack: number
450
+ date: number
451
+ receivedAtNs: bigint
452
+ }
453
+
454
+ /** Combined trade + quote tick. */
455
+ export interface TradeQuoteTick {
456
+ msOfDay: number
457
+ sequence: number
458
+ extCondition1: number
459
+ extCondition2: number
460
+ extCondition3: number
461
+ extCondition4: number
462
+ condition: number
463
+ size: number
464
+ exchange: number
465
+ price: number
466
+ conditionFlags: number
467
+ priceFlags: number
468
+ volumeType: number
469
+ recordsBack: number
470
+ quoteMsOfDay: number
471
+ bidSize: number
472
+ bidExchange: number
473
+ bid: number
474
+ bidCondition: number
475
+ askSize: number
476
+ askExchange: number
477
+ ask: number
478
+ askCondition: number
479
+ date: number
480
+ expiration: number
481
+ strike: number
482
+ right: string
483
+ }
484
+
485
+ /** Trade tick. Core unit of trade data. */
486
+ export interface TradeTick {
487
+ msOfDay: number
488
+ sequence: number
489
+ extCondition1: number
490
+ extCondition2: number
491
+ extCondition3: number
492
+ extCondition4: number
493
+ condition: number
494
+ size: number
495
+ exchange: number
496
+ price: number
497
+ conditionFlags: number
498
+ priceFlags: number
499
+ volumeType: number
500
+ recordsBack: number
501
+ date: number
502
+ expiration: number
503
+ strike: number
504
+ right: string
505
+ }
package/index.js CHANGED
@@ -77,8 +77,8 @@ function requireNative() {
77
77
  try {
78
78
  const binding = require('thetadatadx-android-arm64')
79
79
  const bindingPackageVersion = require('thetadatadx-android-arm64/package.json').version
80
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
80
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
82
82
  }
83
83
  return binding
84
84
  } catch (e) {
@@ -93,8 +93,8 @@ function requireNative() {
93
93
  try {
94
94
  const binding = require('thetadatadx-android-arm-eabi')
95
95
  const bindingPackageVersion = require('thetadatadx-android-arm-eabi/package.json').version
96
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
96
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
98
98
  }
99
99
  return binding
100
100
  } catch (e) {
@@ -114,8 +114,8 @@ function requireNative() {
114
114
  try {
115
115
  const binding = require('thetadatadx-win32-x64-gnu')
116
116
  const bindingPackageVersion = require('thetadatadx-win32-x64-gnu/package.json').version
117
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
117
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
119
  }
120
120
  return binding
121
121
  } catch (e) {
@@ -130,8 +130,8 @@ function requireNative() {
130
130
  try {
131
131
  const binding = require('thetadatadx-win32-x64-msvc')
132
132
  const bindingPackageVersion = require('thetadatadx-win32-x64-msvc/package.json').version
133
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
133
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
135
  }
136
136
  return binding
137
137
  } catch (e) {
@@ -147,8 +147,8 @@ function requireNative() {
147
147
  try {
148
148
  const binding = require('thetadatadx-win32-ia32-msvc')
149
149
  const bindingPackageVersion = require('thetadatadx-win32-ia32-msvc/package.json').version
150
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
150
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
152
152
  }
153
153
  return binding
154
154
  } catch (e) {
@@ -163,8 +163,8 @@ function requireNative() {
163
163
  try {
164
164
  const binding = require('thetadatadx-win32-arm64-msvc')
165
165
  const bindingPackageVersion = require('thetadatadx-win32-arm64-msvc/package.json').version
166
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
166
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
168
168
  }
169
169
  return binding
170
170
  } catch (e) {
@@ -182,8 +182,8 @@ function requireNative() {
182
182
  try {
183
183
  const binding = require('thetadatadx-darwin-universal')
184
184
  const bindingPackageVersion = require('thetadatadx-darwin-universal/package.json').version
185
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
185
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
187
187
  }
188
188
  return binding
189
189
  } catch (e) {
@@ -198,8 +198,8 @@ function requireNative() {
198
198
  try {
199
199
  const binding = require('thetadatadx-darwin-x64')
200
200
  const bindingPackageVersion = require('thetadatadx-darwin-x64/package.json').version
201
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
201
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
203
  }
204
204
  return binding
205
205
  } catch (e) {
@@ -214,8 +214,8 @@ function requireNative() {
214
214
  try {
215
215
  const binding = require('thetadatadx-darwin-arm64')
216
216
  const bindingPackageVersion = require('thetadatadx-darwin-arm64/package.json').version
217
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
217
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
219
219
  }
220
220
  return binding
221
221
  } catch (e) {
@@ -234,8 +234,8 @@ function requireNative() {
234
234
  try {
235
235
  const binding = require('thetadatadx-freebsd-x64')
236
236
  const bindingPackageVersion = require('thetadatadx-freebsd-x64/package.json').version
237
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
237
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
239
239
  }
240
240
  return binding
241
241
  } catch (e) {
@@ -250,8 +250,8 @@ function requireNative() {
250
250
  try {
251
251
  const binding = require('thetadatadx-freebsd-arm64')
252
252
  const bindingPackageVersion = require('thetadatadx-freebsd-arm64/package.json').version
253
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
253
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
255
255
  }
256
256
  return binding
257
257
  } catch (e) {
@@ -271,8 +271,8 @@ function requireNative() {
271
271
  try {
272
272
  const binding = require('thetadatadx-linux-x64-musl')
273
273
  const bindingPackageVersion = require('thetadatadx-linux-x64-musl/package.json').version
274
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
274
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
276
276
  }
277
277
  return binding
278
278
  } catch (e) {
@@ -287,8 +287,8 @@ function requireNative() {
287
287
  try {
288
288
  const binding = require('thetadatadx-linux-x64-gnu')
289
289
  const bindingPackageVersion = require('thetadatadx-linux-x64-gnu/package.json').version
290
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
290
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
292
292
  }
293
293
  return binding
294
294
  } catch (e) {
@@ -305,8 +305,8 @@ function requireNative() {
305
305
  try {
306
306
  const binding = require('thetadatadx-linux-arm64-musl')
307
307
  const bindingPackageVersion = require('thetadatadx-linux-arm64-musl/package.json').version
308
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
308
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
310
310
  }
311
311
  return binding
312
312
  } catch (e) {
@@ -321,8 +321,8 @@ function requireNative() {
321
321
  try {
322
322
  const binding = require('thetadatadx-linux-arm64-gnu')
323
323
  const bindingPackageVersion = require('thetadatadx-linux-arm64-gnu/package.json').version
324
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
324
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
326
326
  }
327
327
  return binding
328
328
  } catch (e) {
@@ -339,8 +339,8 @@ function requireNative() {
339
339
  try {
340
340
  const binding = require('thetadatadx-linux-arm-musleabihf')
341
341
  const bindingPackageVersion = require('thetadatadx-linux-arm-musleabihf/package.json').version
342
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
342
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
344
344
  }
345
345
  return binding
346
346
  } catch (e) {
@@ -355,8 +355,8 @@ function requireNative() {
355
355
  try {
356
356
  const binding = require('thetadatadx-linux-arm-gnueabihf')
357
357
  const bindingPackageVersion = require('thetadatadx-linux-arm-gnueabihf/package.json').version
358
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
358
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
360
360
  }
361
361
  return binding
362
362
  } catch (e) {
@@ -373,8 +373,8 @@ function requireNative() {
373
373
  try {
374
374
  const binding = require('thetadatadx-linux-loong64-musl')
375
375
  const bindingPackageVersion = require('thetadatadx-linux-loong64-musl/package.json').version
376
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
376
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
378
378
  }
379
379
  return binding
380
380
  } catch (e) {
@@ -389,8 +389,8 @@ function requireNative() {
389
389
  try {
390
390
  const binding = require('thetadatadx-linux-loong64-gnu')
391
391
  const bindingPackageVersion = require('thetadatadx-linux-loong64-gnu/package.json').version
392
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
392
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
394
394
  }
395
395
  return binding
396
396
  } catch (e) {
@@ -407,8 +407,8 @@ function requireNative() {
407
407
  try {
408
408
  const binding = require('thetadatadx-linux-riscv64-musl')
409
409
  const bindingPackageVersion = require('thetadatadx-linux-riscv64-musl/package.json').version
410
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
410
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412
412
  }
413
413
  return binding
414
414
  } catch (e) {
@@ -423,8 +423,8 @@ function requireNative() {
423
423
  try {
424
424
  const binding = require('thetadatadx-linux-riscv64-gnu')
425
425
  const bindingPackageVersion = require('thetadatadx-linux-riscv64-gnu/package.json').version
426
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
426
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
428
  }
429
429
  return binding
430
430
  } catch (e) {
@@ -440,8 +440,8 @@ function requireNative() {
440
440
  try {
441
441
  const binding = require('thetadatadx-linux-ppc64-gnu')
442
442
  const bindingPackageVersion = require('thetadatadx-linux-ppc64-gnu/package.json').version
443
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
443
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
445
  }
446
446
  return binding
447
447
  } catch (e) {
@@ -456,8 +456,8 @@ function requireNative() {
456
456
  try {
457
457
  const binding = require('thetadatadx-linux-s390x-gnu')
458
458
  const bindingPackageVersion = require('thetadatadx-linux-s390x-gnu/package.json').version
459
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
459
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
461
461
  }
462
462
  return binding
463
463
  } catch (e) {
@@ -476,8 +476,8 @@ function requireNative() {
476
476
  try {
477
477
  const binding = require('thetadatadx-openharmony-arm64')
478
478
  const bindingPackageVersion = require('thetadatadx-openharmony-arm64/package.json').version
479
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
479
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
481
481
  }
482
482
  return binding
483
483
  } catch (e) {
@@ -492,8 +492,8 @@ function requireNative() {
492
492
  try {
493
493
  const binding = require('thetadatadx-openharmony-x64')
494
494
  const bindingPackageVersion = require('thetadatadx-openharmony-x64/package.json').version
495
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
495
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
497
497
  }
498
498
  return binding
499
499
  } catch (e) {
@@ -508,8 +508,8 @@ function requireNative() {
508
508
  try {
509
509
  const binding = require('thetadatadx-openharmony-arm')
510
510
  const bindingPackageVersion = require('thetadatadx-openharmony-arm/package.json').version
511
- if (bindingPackageVersion !== '7.3.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
- throw new Error(`Native binding package version mismatch, expected 7.3.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
511
+ if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
+ throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
513
  }
514
514
  return binding
515
515
  } catch (e) {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "thetadatadx",
3
- "version": "7.3.1",
3
+ "version": "8.0.0",
4
4
  "description": "Native ThetaData SDK for Node.js — powered by Rust via napi-rs",
5
- "license": "GPL-3.0-or-later",
5
+ "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/userFRM/ThetaDataDx"
@@ -23,23 +23,22 @@
23
23
  "scripts": {
24
24
  "build": "napi build --platform --release",
25
25
  "build:debug": "napi build --platform",
26
- "test": "node --test __tests__/basic.test.mjs",
26
+ "test": "node --test __tests__/basic.test.mjs __tests__/dropped_events.test.mjs",
27
27
  "version": "napi version"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@napi-rs/cli": "^3.6.2"
31
31
  },
32
32
  "optionalDependencies": {
33
- "thetadatadx-linux-x64-gnu": "7.3.1",
34
- "thetadatadx-darwin-arm64": "7.3.1",
35
- "thetadatadx-win32-x64-msvc": "7.3.1"
33
+ "thetadatadx-linux-x64-gnu": "8.0.0",
34
+ "thetadatadx-darwin-arm64": "8.0.0",
35
+ "thetadatadx-win32-x64-msvc": "8.0.0"
36
36
  },
37
37
  "engines": {
38
- "node": ">= 18"
38
+ "node": ">= 20"
39
39
  },
40
40
  "files": [
41
41
  "index.js",
42
- "index.d.ts",
43
- "src/types.ts"
42
+ "index.d.ts"
44
43
  ]
45
44
  }
package/src/types.ts DELETED
@@ -1,209 +0,0 @@
1
- // @generated DO NOT EDIT — regenerated by build.rs from tick_schema.toml
2
- // TypeScript interfaces for columnar tick data returned by the native addon.
3
- // Each property is an array — one entry per tick row.
4
-
5
- /** Calendar day. Market open/close schedule. */
6
- export interface CalendarDayColumnar {
7
- date: number[];
8
- is_open: number[];
9
- open_time: number[];
10
- close_time: number[];
11
- status: number[];
12
- }
13
-
14
- /** End-of-day tick. Full EOD snapshot with OHLC + quote. */
15
- export interface EodTickColumnar {
16
- ms_of_day: number[];
17
- ms_of_day2: number[];
18
- open: number[];
19
- high: number[];
20
- low: number[];
21
- close: number[];
22
- volume: number[];
23
- count: number[];
24
- bid_size: number[];
25
- bid_exchange: number[];
26
- bid: number[];
27
- bid_condition: number[];
28
- ask_size: number[];
29
- ask_exchange: number[];
30
- ask: number[];
31
- ask_condition: number[];
32
- date: number[];
33
- expiration: number[];
34
- strike: number[];
35
- right: string[];
36
- }
37
-
38
- /** Greeks tick. Full set of option greeks. */
39
- export interface GreeksTickColumnar {
40
- ms_of_day: number[];
41
- implied_volatility: number[];
42
- delta: number[];
43
- gamma: number[];
44
- theta: number[];
45
- vega: number[];
46
- rho: number[];
47
- iv_error: number[];
48
- vanna: number[];
49
- charm: number[];
50
- vomma: number[];
51
- veta: number[];
52
- speed: number[];
53
- zomma: number[];
54
- color: number[];
55
- ultima: number[];
56
- d1: number[];
57
- d2: number[];
58
- dual_delta: number[];
59
- dual_gamma: number[];
60
- epsilon: number[];
61
- lambda: number[];
62
- vera: number[];
63
- date: number[];
64
- expiration: number[];
65
- strike: number[];
66
- right: string[];
67
- }
68
-
69
- /** Interest rate tick. End-of-day interest rate. */
70
- export interface InterestRateTickColumnar {
71
- ms_of_day: number[];
72
- rate: number[];
73
- date: number[];
74
- }
75
-
76
- /** Implied volatility tick. */
77
- export interface IvTickColumnar {
78
- ms_of_day: number[];
79
- implied_volatility: number[];
80
- iv_error: number[];
81
- date: number[];
82
- expiration: number[];
83
- strike: number[];
84
- right: string[];
85
- }
86
-
87
- /** Market value tick -- quoted bid/ask/price for a symbol. */
88
- export interface MarketValueTickColumnar {
89
- ms_of_day: number[];
90
- market_bid: number[];
91
- market_ask: number[];
92
- market_price: number[];
93
- date: number[];
94
- expiration: number[];
95
- strike: number[];
96
- right: string[];
97
- }
98
-
99
- /** OHLC tick. Aggregated bar data. */
100
- export interface OhlcTickColumnar {
101
- ms_of_day: number[];
102
- open: number[];
103
- high: number[];
104
- low: number[];
105
- close: number[];
106
- volume: number[];
107
- count: number[];
108
- date: number[];
109
- expiration: number[];
110
- strike: number[];
111
- right: string[];
112
- }
113
-
114
- /** Open interest tick. */
115
- export interface OpenInterestTickColumnar {
116
- ms_of_day: number[];
117
- open_interest: number[];
118
- date: number[];
119
- expiration: number[];
120
- strike: number[];
121
- right: string[];
122
- }
123
-
124
- /** Option contract. Contract specification. */
125
- export interface OptionContractColumnar {
126
- root: string[];
127
- expiration: number[];
128
- strike: number[];
129
- right: number[];
130
- }
131
-
132
- /** Price tick. Generic price data point. */
133
- export interface PriceTickColumnar {
134
- ms_of_day: number[];
135
- price: number[];
136
- date: number[];
137
- }
138
-
139
- /** Quote tick. NBBO quote data. */
140
- export interface QuoteTickColumnar {
141
- ms_of_day: number[];
142
- bid_size: number[];
143
- bid_exchange: number[];
144
- bid: number[];
145
- bid_condition: number[];
146
- ask_size: number[];
147
- ask_exchange: number[];
148
- ask: number[];
149
- ask_condition: number[];
150
- date: number[];
151
- midpoint: number[];
152
- expiration: number[];
153
- strike: number[];
154
- right: string[];
155
- }
156
-
157
- /** Combined trade + quote tick. */
158
- export interface TradeQuoteTickColumnar {
159
- ms_of_day: number[];
160
- sequence: number[];
161
- ext_condition1: number[];
162
- ext_condition2: number[];
163
- ext_condition3: number[];
164
- ext_condition4: number[];
165
- condition: number[];
166
- size: number[];
167
- exchange: number[];
168
- price: number[];
169
- condition_flags: number[];
170
- price_flags: number[];
171
- volume_type: number[];
172
- records_back: number[];
173
- quote_ms_of_day: number[];
174
- bid_size: number[];
175
- bid_exchange: number[];
176
- bid: number[];
177
- bid_condition: number[];
178
- ask_size: number[];
179
- ask_exchange: number[];
180
- ask: number[];
181
- ask_condition: number[];
182
- date: number[];
183
- expiration: number[];
184
- strike: number[];
185
- right: string[];
186
- }
187
-
188
- /** Trade tick. Core unit of trade data. */
189
- export interface TradeTickColumnar {
190
- ms_of_day: number[];
191
- sequence: number[];
192
- ext_condition1: number[];
193
- ext_condition2: number[];
194
- ext_condition3: number[];
195
- ext_condition4: number[];
196
- condition: number[];
197
- size: number[];
198
- exchange: number[];
199
- price: number[];
200
- condition_flags: number[];
201
- price_flags: number[];
202
- volume_type: number[];
203
- records_back: number[];
204
- date: number[];
205
- expiration: number[];
206
- strike: number[];
207
- right: string[];
208
- }
209
-