@adaptic/utils 0.1.47 → 0.1.49

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.
@@ -20,6 +20,8 @@ export * as tradingPolicy from "./trading-policy";
20
20
  export { DEFAULT_TRADING_POLICY, DEFAULT_TRADING_POLICY_UTILS_TUNED, getUtilsTunedTradingPolicy, type TradingPolicyJson, } from "./trading-policy";
21
21
  export { AlpacaTradingAPI } from "./alpaca-trading-api";
22
22
  export { AlpacaMarketDataAPI } from "./alpaca-market-data-api";
23
+ export { validateAlpacaCredentials, validateMassiveApiKey, validateAlphaVantageApiKey, } from "./utils/auth-validator";
24
+ export { KEEP_ALIVE_DEFAULTS, httpAgent, httpsAgent, getAgentPoolStatus, verifyFetchKeepAlive, type ConnectionPoolStatus, } from "./utils/http-keep-alive";
23
25
  export declare const createAlpacaTradingAPI: (credentials: Types.AlpacaCredentials) => Types.AlpacaTradingAPI;
24
26
  export declare const createAlpacaMarketDataAPI: () => Types.AlpacaMarketDataAPI;
25
27
  export type { TokenProvider } from "./adaptic";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,iBAAiB,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,IAAI,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrC,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AC;qBAAuB,CAAC;uBAAkC,CAAC;wBAAmC,CAAC;uBAAkC,CAAC;wBAAmC,CAAC;iBAA4B,CAAC;iBAA2B,CAAC;gBAAkB,CAAC;;;;;eAAz0X,CAAC;;;iBAAiE,CAAC;;kBAAmC,CAAC;;;;;kBAAkqR,CAAC;oBAAsB,CAAC;;;;;;kBA/Kj4R,CAAC;;;kBAoD9C,CAAA;;;kBA8CY,CAAC;;;kBAkCT,CAAC;;;kBA2CkF,CAAC;gBAAkB,CAAC;iBAAmB,CAAC;iBAAmB,CAAC;gBAAkB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CADhJ,CAAC"}
@@ -7,6 +7,8 @@ export * from "./alphavantage-types";
7
7
  export * from "./adaptic-types";
8
8
  export * from "./ta-types";
9
9
  export * from "./metrics-types";
10
+ export * from "./massive-types";
11
+ export * from "./massive-indices-types";
10
12
  export interface EquityPoint {
11
13
  time: Time;
12
14
  value: number;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAEhC,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AAExC,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,190 @@
1
+ /**
2
+ * Types for Massive Indices API
3
+ */
4
+ /**
5
+ * Base response interface for Massive API responses
6
+ */
7
+ export interface MassiveIndicesBaseResponse {
8
+ /** The status of the response. */
9
+ status: string;
10
+ /** The request ID. */
11
+ request_id: string;
12
+ }
13
+ /**
14
+ * Error response from Massive Indices API
15
+ */
16
+ export interface MassiveIndicesErrorResponse extends MassiveIndicesBaseResponse {
17
+ /** The status of the error response. */
18
+ status: "ERROR" | "NOT_AUTHORIZED" | string;
19
+ /** The error message. */
20
+ message: string;
21
+ }
22
+ /**
23
+ * Represents a single bar/aggregate data point for an index
24
+ */
25
+ export interface MassiveIndicesBar {
26
+ /** The close value for the index in the given time period. */
27
+ c: number;
28
+ /** The highest value for the index in the given time period. */
29
+ h: number;
30
+ /** The lowest value for the index in the given time period. */
31
+ l: number;
32
+ /** The open value for the index in the given time period. */
33
+ o: number;
34
+ /** The Unix Msec timestamp for the start of the aggregate window. */
35
+ t: number;
36
+ }
37
+ /**
38
+ * Response for the aggregates (bars) endpoint
39
+ */
40
+ export interface MassiveIndicesAggregatesResponse extends MassiveIndicesBaseResponse {
41
+ /** The ticker symbol of the index. */
42
+ ticker: string;
43
+ /** The number of aggregates used to generate the response. */
44
+ queryCount: number;
45
+ /** The total number of results for this request. */
46
+ resultsCount?: number;
47
+ /** The count of results returned. */
48
+ count?: number;
49
+ /** The array of aggregate results. */
50
+ results: MassiveIndicesBar[];
51
+ }
52
+ /**
53
+ * Represents a previous close result for an index
54
+ */
55
+ export interface MassiveIndicesPrevCloseResult {
56
+ /** The ticker symbol. */
57
+ T: string;
58
+ /** The close value for the index in the given time period. */
59
+ c: number;
60
+ /** The highest value for the index in the given time period. */
61
+ h: number;
62
+ /** The lowest value for the index in the given time period. */
63
+ l: number;
64
+ /** The open value for the index in the given time period. */
65
+ o: number;
66
+ /** The Unix Msec timestamp for the start of the aggregate window. */
67
+ t: number;
68
+ }
69
+ /**
70
+ * Response for the previous close endpoint
71
+ */
72
+ export interface MassiveIndicesPrevCloseResponse extends MassiveIndicesBaseResponse {
73
+ /** The ticker symbol of the index. */
74
+ ticker: string;
75
+ /** The number of aggregates used to generate the response. */
76
+ queryCount: number;
77
+ /** The total number of results for this request. */
78
+ resultsCount: number;
79
+ /** The array of previous close results. */
80
+ results: MassiveIndicesPrevCloseResult[];
81
+ }
82
+ /**
83
+ * Response for the daily open/close endpoint
84
+ */
85
+ export interface MassiveIndicesDailyOpenCloseResponse {
86
+ /** The after-hours value of the index, if available. */
87
+ afterHours?: number;
88
+ /** The close value for the index. */
89
+ close: number;
90
+ /** The date of the data in ISO format. */
91
+ from: string;
92
+ /** The highest value for the index during the day. */
93
+ high: number;
94
+ /** The lowest value for the index during the day. */
95
+ low: number;
96
+ /** The open value for the index. */
97
+ open: number;
98
+ /** The pre-market value of the index, if available. */
99
+ preMarket?: number;
100
+ /** The status of the response. */
101
+ status: string;
102
+ /** The ticker symbol of the index. */
103
+ symbol: string;
104
+ }
105
+ /**
106
+ * Represents a session data for an index in the snapshot
107
+ */
108
+ export interface MassiveIndicesSession {
109
+ /** The value of the change for the index from the previous trading day. */
110
+ change: number;
111
+ /** The percent of the change for the index from the previous trading day. */
112
+ change_percent: number;
113
+ /** The closing value for the index of the day. */
114
+ close: number;
115
+ /** The highest value for the index of the day. */
116
+ high: number;
117
+ /** The lowest value for the index of the day. */
118
+ low: number;
119
+ /** The open value for the index of the day. */
120
+ open: number;
121
+ /** The closing value for the index of previous trading day. */
122
+ previous_close: number;
123
+ }
124
+ /**
125
+ * Represents a single index result in the snapshot response
126
+ */
127
+ export interface MassiveIndicesSnapshotResult {
128
+ /** The nanosecond timestamp of when this information was updated. */
129
+ last_updated?: number;
130
+ /** The market status for the market that trades this index. */
131
+ market_status?: string;
132
+ /** Name of the index. */
133
+ name?: string;
134
+ /** Session data for the index. */
135
+ session?: MassiveIndicesSession;
136
+ /** Ticker of the index. */
137
+ ticker: string;
138
+ /** The time relevance of the data. */
139
+ timeframe?: "DELAYED" | "REAL-TIME";
140
+ /** The type of the asset. */
141
+ type?: "indices";
142
+ /** Value of the index. */
143
+ value?: number;
144
+ /** Error message if there was an issue with this ticker. */
145
+ error?: string;
146
+ /** Error message details. */
147
+ message?: string;
148
+ }
149
+ /**
150
+ * Response for the indices snapshot endpoint
151
+ */
152
+ export interface MassiveIndicesSnapshotResponse extends MassiveIndicesBaseResponse {
153
+ /** URL for the next page of results, if available. */
154
+ next_url?: string;
155
+ /** The array of index snapshot results. */
156
+ results: MassiveIndicesSnapshotResult[];
157
+ }
158
+ /**
159
+ * Parameters for fetching aggregates (bars) for an index
160
+ */
161
+ export interface MassiveIndicesAggregatesParams {
162
+ /** The ticker symbol of the index. */
163
+ indicesTicker: string;
164
+ /** The size of the timespan multiplier. */
165
+ multiplier: number;
166
+ /** The size of the time window (minute, hour, day, week, month, quarter, year). */
167
+ timespan: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year";
168
+ /** The start of the aggregate time window (YYYY-MM-DD or millisecond timestamp). */
169
+ from: string | number;
170
+ /** The end of the aggregate time window (YYYY-MM-DD or millisecond timestamp). */
171
+ to: string | number;
172
+ /** Sort the results by timestamp (asc or desc). */
173
+ sort?: "asc" | "desc";
174
+ /** Limits the number of base aggregates queried. */
175
+ limit?: number;
176
+ }
177
+ /**
178
+ * Parameters for fetching indices snapshot
179
+ */
180
+ export interface MassiveIndicesSnapshotParams {
181
+ /** Comma separated list of tickers. */
182
+ tickers?: string[];
183
+ /** Order results based on the sort field. */
184
+ order?: "asc" | "desc";
185
+ /** Limit the number of results returned. */
186
+ limit?: number;
187
+ /** Sort field used for ordering. */
188
+ sort?: string;
189
+ }
190
+ //# sourceMappingURL=massive-indices-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"massive-indices-types.d.ts","sourceRoot":"","sources":["../../../src/types/massive-indices-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,0BAA0B;IAC7E,wCAAwC;IACxC,MAAM,EAAE,OAAO,GAAG,gBAAgB,GAAG,MAAM,CAAC;IAC5C,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,8DAA8D;IAC9D,CAAC,EAAE,MAAM,CAAC;IACV,gEAAgE;IAChE,CAAC,EAAE,MAAM,CAAC;IACV,+DAA+D;IAC/D,CAAC,EAAE,MAAM,CAAC;IACV,6DAA6D;IAC7D,CAAC,EAAE,MAAM,CAAC;IACV,qEAAqE;IACrE,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;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C;IACtB,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,mFAAmF;IACnF,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IAC5E,oFAAoF;IACpF,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,kFAAkF;IAClF,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,mDAAmD;IACnD,IAAI,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACtB,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACvB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,314 @@
1
+ /**
2
+ * Freshness metadata attached to Massive responses so consumers can distinguish
3
+ * real-time data ("OK") from delayed-feed data ("DELAYED", e.g. free-tier
4
+ * plans). Producers should set this whenever they have observed the upstream
5
+ * `status` field; consumers can branch on `status` to gate latency-sensitive
6
+ * decisions (e.g. trade execution should refuse DELAYED quotes).
7
+ *
8
+ * DE-006: previously the DELAYED status was only emitted as a throttled INFO
9
+ * log inside `fetchPrices`, which made it impossible for downstream callers to
10
+ * tell whether a price was live or delayed. The flag is exposed on every
11
+ * returned bar (and surfaced as the discriminator on {@link MassiveResult}).
12
+ */
13
+ export interface MassiveFreshness {
14
+ /** Upstream status as reported by the Massive API. */
15
+ status: "OK" | "DELAYED";
16
+ /** Wall-clock time the response was received by this process. */
17
+ receivedAt: Date;
18
+ /**
19
+ * Best-effort time at which the upstream feed first started reporting
20
+ * DELAYED. May be `null` when not known (the Massive HTTP API does not
21
+ * currently return this; reserved for future enhancement).
22
+ */
23
+ delayedSince?: Date | null;
24
+ }
25
+ /**
26
+ * Discriminated wrapper that lets new consumers branch on freshness without
27
+ * inspecting the bar payload. Existing callers that consume
28
+ * {@link MassivePriceData} arrays directly are unaffected — see
29
+ * {@link MassivePriceData._freshness} for the non-breaking augmentation that
30
+ * propagates the same information.
31
+ */
32
+ export type MassiveResult<T> = {
33
+ status: "OK";
34
+ data: T;
35
+ receivedAt: Date;
36
+ } | {
37
+ status: "DELAYED";
38
+ data: T;
39
+ receivedAt: Date;
40
+ delayedSince: Date | null;
41
+ };
42
+ /**
43
+ * Represents a unit of price data for a specific symbol on a given date.
44
+ */
45
+ export type MassivePriceData = {
46
+ /** The symbol of the asset. */
47
+ symbol: string;
48
+ /** The date of the price data. */
49
+ date: string;
50
+ /** The timestamp of the price data. */
51
+ timeStamp: number;
52
+ /** The opening price. */
53
+ open: number;
54
+ /** The highest price during the period. */
55
+ high: number;
56
+ /** The lowest price during the period. */
57
+ low: number;
58
+ /** The closing price. */
59
+ close: number;
60
+ /** The volume of trades. */
61
+ vol: number;
62
+ /** The volume-weighted average price. */
63
+ vwap: number;
64
+ /** The number of trades. */
65
+ trades: number;
66
+ /**
67
+ * Optional freshness flag indicating whether the upstream feed reported the
68
+ * data as live ("OK") or delayed ("DELAYED"). Present when the response
69
+ * originated from an API endpoint that exposes a `status` field
70
+ * (e.g. `fetchPrices`, `fetchGroupedDaily`). Absent for legacy/hand-built
71
+ * fixtures and for endpoints that do not surface the status.
72
+ *
73
+ * @see MassiveFreshness
74
+ */
75
+ _freshness?: MassiveFreshness;
76
+ };
77
+ /**
78
+ * Represents a quote for a specific asset.
79
+ */
80
+ export type MassiveQuote = {
81
+ /** The price of the asset. */
82
+ price: number;
83
+ /** The volume of the asset. */
84
+ vol: number;
85
+ /** The time of the quote. */
86
+ time: Date;
87
+ };
88
+ /**
89
+ * The Massive API response for grouped daily data.
90
+ */
91
+ export type MassiveGroupedDailyResponse = {
92
+ /** Indicates if the data is adjusted. */
93
+ adjusted: boolean;
94
+ /** The count of queries made. */
95
+ queryCount: number;
96
+ /** The request ID. */
97
+ request_id: string;
98
+ /** The count of results returned. */
99
+ resultsCount: number;
100
+ /** The status of the response. */
101
+ status: string;
102
+ /** The array of price data results. */
103
+ results: MassivePriceData[];
104
+ };
105
+ /**
106
+ * Represents raw price data from Massive.
107
+ */
108
+ export interface RawMassivePriceData {
109
+ /** The ticker symbol. */
110
+ T: string;
111
+ /** The closing price. */
112
+ c: number;
113
+ /** The highest price. */
114
+ h: number;
115
+ /** The lowest price. */
116
+ l: number;
117
+ /** The number of trades. */
118
+ n: number;
119
+ /** The opening price. */
120
+ o: number;
121
+ /** The timestamp. */
122
+ t: number;
123
+ /** The volume. */
124
+ v: number;
125
+ /** The volume-weighted average price. */
126
+ vw: number;
127
+ }
128
+ /**
129
+ * Represents information about a ticker including its name, market cap, and outstanding shares.
130
+ */
131
+ export interface MassiveTickerInfo {
132
+ /** Indicates if the ticker is active. */
133
+ active: boolean;
134
+ /** The name of the currency. */
135
+ currency_name: string;
136
+ /** The UTC time when the ticker was delisted, if applicable. */
137
+ delisted_utc?: string;
138
+ /** A description of the ticker. */
139
+ description: string;
140
+ /** The locale of the ticker. */
141
+ locale: string;
142
+ /** The market in which the ticker operates. */
143
+ market: "stocks" | "crypto" | "indices" | "fx" | "otc";
144
+ /** The market capitalization. */
145
+ market_cap: number;
146
+ /** The name of the ticker. */
147
+ name: string;
148
+ /** The primary exchange for the ticker. */
149
+ primary_exchange: string;
150
+ /** The number of shares outstanding. */
151
+ share_class_shares_outstanding?: number | null;
152
+ /** The ticker symbol. */
153
+ ticker: string;
154
+ /** The type of asset - CS, PFD, ETF, etc. */
155
+ type: string;
156
+ }
157
+ /**
158
+ * Represents the Massive API response for ticker information.
159
+ */
160
+ export interface MassiveTickerResponse {
161
+ /** The count of tickers returned. */
162
+ count: number;
163
+ /** The next URL for pagination, if applicable. */
164
+ next_url: string | null;
165
+ /** The request ID. */
166
+ request_id: string;
167
+ /** The array of ticker information results. */
168
+ results: MassiveTickerInfo[];
169
+ /** The status of the response. */
170
+ status: string;
171
+ }
172
+ /**
173
+ * Represents daily open and close data for a ticker for grouped daily data.
174
+ */
175
+ export interface MassiveDailyOpenClose {
176
+ /** The after-hours price, if applicable. */
177
+ afterHours?: number;
178
+ /** The closing price. */
179
+ close: number;
180
+ /** The date from which the data is taken. */
181
+ from: string;
182
+ /** The highest price during the day. */
183
+ high: number;
184
+ /** The lowest price during the day. */
185
+ low: number;
186
+ /** The opening price. */
187
+ open: number;
188
+ /** The pre-market price, if applicable. */
189
+ preMarket?: number;
190
+ /** The status of the market. */
191
+ status: string;
192
+ /** The symbol of the asset. */
193
+ symbol: string;
194
+ /** The volume of trades. */
195
+ volume: number;
196
+ }
197
+ /**
198
+ * Represents a trade in the Massive system.
199
+ */
200
+ export interface MassiveTrade {
201
+ /** The conditions of the trade. */
202
+ conditions: number[];
203
+ /** The correction status, if applicable. */
204
+ correction?: number;
205
+ /** The exchange where the trade occurred. */
206
+ exchange: number;
207
+ /** The unique identifier for the trade. */
208
+ id: string;
209
+ /** The timestamp of the participant. */
210
+ participant_timestamp: number;
211
+ /** The price of the trade. */
212
+ price: number;
213
+ /** The sequence number of the trade. */
214
+ sequence_number: number;
215
+ /** The timestamp from the SIP. */
216
+ sip_timestamp: number;
217
+ /** The size of the trade. */
218
+ size: number;
219
+ /** The tape number, if applicable. */
220
+ tape?: number;
221
+ /** The transfer ID, if applicable. */
222
+ trf_id?: number;
223
+ /** The timestamp of the transfer, if applicable. */
224
+ trf_timestamp?: number;
225
+ }
226
+ /**
227
+ * Represents an NBBO (National Best Bid and Offer) quote from Massive v3 API.
228
+ */
229
+ export interface MassiveNBBOQuote {
230
+ /** The ask price. */
231
+ ask_price: number;
232
+ /** The ask size (number of round lots). */
233
+ ask_size: number;
234
+ /** The ask exchange ID. */
235
+ ask_exchange: number;
236
+ /** The bid price. */
237
+ bid_price: number;
238
+ /** The bid size (number of round lots). */
239
+ bid_size: number;
240
+ /** The bid exchange ID. */
241
+ bid_exchange: number;
242
+ /** The conditions of the quote. */
243
+ conditions?: number[];
244
+ /** The timestamp from the SIP in nanoseconds. */
245
+ sip_timestamp: number;
246
+ /** The timestamp of the participant in nanoseconds. */
247
+ participant_timestamp: number;
248
+ /** The sequence number. */
249
+ sequence_number: number;
250
+ /** The tape number. */
251
+ tape?: number;
252
+ }
253
+ /**
254
+ * Processed quote data with computed spread metrics.
255
+ */
256
+ export interface MassiveSpreadInfo {
257
+ /** The bid price. */
258
+ bid: number;
259
+ /** The ask price. */
260
+ ask: number;
261
+ /** The spread in dollars (ask - bid). */
262
+ spread: number;
263
+ /** The spread as a percentage of the mid price. */
264
+ spreadPercent: number;
265
+ /** The mid price ((bid + ask) / 2). */
266
+ midPrice: number;
267
+ /** The bid size in round lots. */
268
+ bidSize: number;
269
+ /** The ask size in round lots. */
270
+ askSize: number;
271
+ /** The timestamp of the quote. */
272
+ time: Date;
273
+ }
274
+ /**
275
+ * Represents the base response structure from Massive.
276
+ */
277
+ export interface MassiveBaseResponse {
278
+ /** The status of the response. */
279
+ status: string;
280
+ /** The request ID. */
281
+ request_id: string;
282
+ }
283
+ /**
284
+ * Represents the response for trades from Massive.
285
+ */
286
+ export interface MassiveTradesResponse extends MassiveBaseResponse {
287
+ /** The status of the response, which should be 'OK'. */
288
+ status: "OK";
289
+ /** The next URL for pagination, if applicable. */
290
+ next_url?: string;
291
+ /** The array of trade results. */
292
+ results: MassiveTrade[];
293
+ }
294
+ /**
295
+ * Represents the response for quotes from Massive v3 API.
296
+ */
297
+ export interface MassiveQuotesResponse extends MassiveBaseResponse {
298
+ /** The status of the response, which should be 'OK'. */
299
+ status: "OK";
300
+ /** The next URL for pagination, if applicable. */
301
+ next_url?: string;
302
+ /** The array of NBBO quote results. */
303
+ results: MassiveNBBOQuote[];
304
+ }
305
+ /**
306
+ * Represents an error response from Massive.
307
+ */
308
+ export interface MassiveErrorResponse extends MassiveBaseResponse {
309
+ /** The status of the error response. */
310
+ status: "ERROR" | "NOT_AUTHORIZED" | string;
311
+ /** The error message. */
312
+ message: string;
313
+ }
314
+ //# sourceMappingURL=massive-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"massive-types.d.ts","sourceRoot":"","sources":["../../../src/types/massive-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,gBAAgB;IAC/B,sDAAsD;IACtD,MAAM,EAAE,IAAI,GAAG,SAAS,CAAC;IACzB,iEAAiE;IACjE,UAAU,EAAE,IAAI,CAAC;IACjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IACvB;IACE,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,UAAU,EAAE,IAAI,CAAC;CAClB,GACD;IACE,MAAM,EAAE,SAAS,CAAC;IAClB,IAAI,EAAE,CAAC,CAAC;IACR,UAAU,EAAE,IAAI,CAAC;IACjB,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;CAC3B,CAAC;AAEN;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,MAAM,EAAE,MAAM,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AChC,qBAAqB;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,qBAAqB;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,aAAa,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,IAAI,EAAE,IAAI,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,mBAAmB;IAChE,wDAAwD;IACxD,MAAM,EAAE,IAAI,CAAC;IACb,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,mBAAmB;IAChE,wDAAwD;IACxD,MAAM,EAAE,IAAI,CAAC;IACb,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAC/D,wCAAwC;IACxC,MAAM,EAAE,OAAO,GAAG,gBAAgB,GAAG,MAAM,CAAC;IAC5C,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * API credential validation utilities
3
+ * Provides fast, synchronous validation of API credentials before making requests
4
+ */
5
+ /**
6
+ * Validates Alpaca API credentials
7
+ * @param auth - Authentication object containing API key and secret
8
+ * @param options - Validation options
9
+ * @param options.throwOnMissing - If false, missing credentials will log a warning instead of throwing (default: true)
10
+ * @throws {Error} If credentials are invalid (when throwOnMissing is true)
11
+ * @returns {boolean} True if credentials are valid, false if missing (when throwOnMissing is false)
12
+ */
13
+ export declare function validateAlpacaCredentials(auth: {
14
+ apiKey?: string;
15
+ apiSecret?: string;
16
+ isPaper?: boolean;
17
+ }, options?: {
18
+ throwOnMissing?: boolean;
19
+ }): boolean;
20
+ /**
21
+ * Validates Massive API key
22
+ * @param apiKey - Massive API key
23
+ * @throws {Error} If API key is invalid or missing
24
+ */
25
+ export declare function validateMassiveApiKey(apiKey: string): void;
26
+ /**
27
+ * Validates Alpha Vantage API key
28
+ * @param apiKey - Alpha Vantage API key
29
+ * @throws {Error} If API key is invalid or missing
30
+ */
31
+ export declare function validateAlphaVantageApiKey(apiKey: string): void;
32
+ //# sourceMappingURL=auth-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-validator.d.ts","sourceRoot":"","sources":["../../../src/utils/auth-validator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE;IACJ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,EACD,OAAO,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAA6B,GAC/D,OAAO,CA2CT;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAI1D;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAM/D"}