@discomedia/utils 1.0.76 → 1.0.78

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.
Files changed (86) hide show
  1. package/dist/index-frontend.cjs +2024 -15229
  2. package/dist/index-frontend.cjs.map +7 -1
  3. package/dist/index-frontend.mjs +1985 -15219
  4. package/dist/index-frontend.mjs.map +7 -1
  5. package/dist/index.cjs +5368 -24346
  6. package/dist/index.cjs.map +7 -1
  7. package/dist/index.mjs +5326 -24333
  8. package/dist/index.mjs.map +7 -1
  9. package/dist/package.json +10 -11
  10. package/dist/test.mjs +1977 -0
  11. package/dist/test.mjs.map +7 -0
  12. package/dist/types/alpaca-market-data-api.d.ts.map +1 -1
  13. package/dist/types/alpaca-trading-api.d.ts.map +1 -1
  14. package/dist/types/index-frontend.d.ts +2 -1
  15. package/dist/types/index-frontend.d.ts.map +1 -1
  16. package/dist/types/index.d.ts +7 -4
  17. package/dist/types/index.d.ts.map +1 -1
  18. package/dist/types/llm-config.d.ts +4 -2
  19. package/dist/types/llm-config.d.ts.map +1 -1
  20. package/dist/types/llm-deepseek.d.ts.map +1 -1
  21. package/dist/types/llm-images.d.ts.map +1 -1
  22. package/dist/types/llm-openai.d.ts +7 -4
  23. package/dist/types/llm-openai.d.ts.map +1 -1
  24. package/dist/types/llm-openrouter.d.ts.map +1 -1
  25. package/dist/types/market-time.d.ts +1 -1
  26. package/dist/types/market-time.d.ts.map +1 -1
  27. package/dist/types/misc-utils.d.ts +1 -1
  28. package/dist/types/misc-utils.d.ts.map +1 -1
  29. package/dist/types/performance-timer.d.ts.map +1 -1
  30. package/dist/types/types/llm-types.d.ts +8 -5
  31. package/dist/types/types/llm-types.d.ts.map +1 -1
  32. package/package.json +10 -11
  33. package/dist/test.js +0 -17459
  34. package/dist/test.js.map +0 -1
  35. package/dist/types-frontend/alpaca-market-data-api.d.ts +0 -451
  36. package/dist/types-frontend/alpaca-market-data-api.d.ts.map +0 -1
  37. package/dist/types-frontend/alpaca-trading-api.d.ts +0 -407
  38. package/dist/types-frontend/alpaca-trading-api.d.ts.map +0 -1
  39. package/dist/types-frontend/format-tools.d.ts +0 -46
  40. package/dist/types-frontend/format-tools.d.ts.map +0 -1
  41. package/dist/types-frontend/index-frontend.d.ts +0 -18
  42. package/dist/types-frontend/index-frontend.d.ts.map +0 -1
  43. package/dist/types-frontend/index.d.ts +0 -59
  44. package/dist/types-frontend/index.d.ts.map +0 -1
  45. package/dist/types-frontend/json-tools.d.ts +0 -31
  46. package/dist/types-frontend/json-tools.d.ts.map +0 -1
  47. package/dist/types-frontend/llm-config.d.ts +0 -51
  48. package/dist/types-frontend/llm-config.d.ts.map +0 -1
  49. package/dist/types-frontend/llm-deepseek.d.ts +0 -12
  50. package/dist/types-frontend/llm-deepseek.d.ts.map +0 -1
  51. package/dist/types-frontend/llm-images.d.ts +0 -52
  52. package/dist/types-frontend/llm-images.d.ts.map +0 -1
  53. package/dist/types-frontend/llm-openai.d.ts +0 -79
  54. package/dist/types-frontend/llm-openai.d.ts.map +0 -1
  55. package/dist/types-frontend/llm-openrouter.d.ts +0 -28
  56. package/dist/types-frontend/llm-openrouter.d.ts.map +0 -1
  57. package/dist/types-frontend/llm-utils.d.ts +0 -16
  58. package/dist/types-frontend/llm-utils.d.ts.map +0 -1
  59. package/dist/types-frontend/logging.d.ts +0 -12
  60. package/dist/types-frontend/logging.d.ts.map +0 -1
  61. package/dist/types-frontend/market-hours.d.ts +0 -24
  62. package/dist/types-frontend/market-hours.d.ts.map +0 -1
  63. package/dist/types-frontend/market-time.d.ts +0 -270
  64. package/dist/types-frontend/market-time.d.ts.map +0 -1
  65. package/dist/types-frontend/misc-utils.d.ts +0 -43
  66. package/dist/types-frontend/misc-utils.d.ts.map +0 -1
  67. package/dist/types-frontend/performance-timer.d.ts +0 -73
  68. package/dist/types-frontend/performance-timer.d.ts.map +0 -1
  69. package/dist/types-frontend/test.d.ts +0 -2
  70. package/dist/types-frontend/test.d.ts.map +0 -1
  71. package/dist/types-frontend/testing/market-time-refactor-test.d.ts +0 -1
  72. package/dist/types-frontend/testing/market-time-refactor-test.d.ts.map +0 -1
  73. package/dist/types-frontend/types/alpaca-crypto-pairs.d.ts +0 -11
  74. package/dist/types-frontend/types/alpaca-crypto-pairs.d.ts.map +0 -1
  75. package/dist/types-frontend/types/alpaca-types.d.ts +0 -1181
  76. package/dist/types-frontend/types/alpaca-types.d.ts.map +0 -1
  77. package/dist/types-frontend/types/index.d.ts +0 -6
  78. package/dist/types-frontend/types/index.d.ts.map +0 -1
  79. package/dist/types-frontend/types/llm-types.d.ts +0 -174
  80. package/dist/types-frontend/types/llm-types.d.ts.map +0 -1
  81. package/dist/types-frontend/types/logging-types.d.ts +0 -10
  82. package/dist/types-frontend/types/logging-types.d.ts.map +0 -1
  83. package/dist/types-frontend/types/market-time-types.d.ts +0 -64
  84. package/dist/types-frontend/types/market-time-types.d.ts.map +0 -1
  85. package/dist/types-frontend/types/ta-types.d.ts +0 -89
  86. package/dist/types-frontend/types/ta-types.d.ts.map +0 -1
@@ -1,451 +0,0 @@
1
- import 'dotenv/config';
2
- import { Bar, AlpacaQuote, TimeFrame, AlpacaAsset, GetAssetsParams, OptionBar, OptionsChainParams, OptionsChainResponse, LatestOptionsTradesParams, LatestOptionsTradesResponse, LatestOptionsQuotesParams, LatestOptionsQuotesResponse, LatestQuotesResponse, LatestTradesResponse, HistoricalOptionsBarsParams, HistoricalOptionsBarsResponse, HistoricalOptionsTradesParams, HistoricalOptionsTradesResponse, OptionsSnapshotsParams, OptionsSnapshotsResponse, OptionsConditionCodesResponse, OptionsExchangeCodesResponse, OptionTickType, SimpleNews, DataFeed, StockStreamEventName, OptionStreamEventName, StockStreamEventMap, OptionStreamEventMap, CryptoHistoricalBarsResponse, CryptoLatestBarsResponse, CryptoHistoricalQuotesResponse, CryptoLatestQuotesResponse, CryptoHistoricalTradesResponse, CryptoLatestTradesResponse, CryptoSnapshotsResponse, CryptoLatestOrderbooksResponse, CryptoHistoricalBarsParams, CryptoHistoricalQuotesParams, CryptoHistoricalTradesParams } from './types/alpaca-types';
3
- import { EventEmitter } from 'events';
4
- /**
5
- * Parameters for retrieving historical market data bars
6
- * @see https://data.alpaca.markets/v2/stocks/bars
7
- */
8
- export interface HistoricalBarsParams {
9
- /** Comma-separated list of stock symbols to query, e.g. 'AAPL,MSFT,TSLA' */
10
- symbols: string[];
11
- /**
12
- * Bar duration/timeframe
13
- * Format: [1-59]Min/T, [1-23]Hour/H, 1Day/D, 1Week/W, [1,2,3,4,6,12]Month/M
14
- * Examples: "1Min", "5Min", "1Hour", "1Day", "1Week", "1Month"
15
- */
16
- timeframe: TimeFrame;
17
- /**
18
- * Start datetime in RFC-3339 format (YYYY-MM-DD)
19
- * Example: "2024-02-11T09:00:00Z"
20
- */
21
- start?: string;
22
- /**
23
- * End datetime in RFC-3339 format (YYYY-MM-DD)
24
- * Example: "2024-02-11T16:00:00Z"
25
- */
26
- end?: string;
27
- /**
28
- * Number of bars to return (1-10000)
29
- * Default: 1000
30
- */
31
- limit?: number;
32
- /**
33
-
34
- /**
35
- * Pagination token for retrieving next page of results
36
- * Returned in the next_page_token field of the response
37
- */
38
- page_token?: string;
39
- /**
40
- * Specifies the price adjustments applied to the bars
41
- * - raw: no adjustments
42
- * - split: adjust for forward and reverse stock splits
43
- * - dividend: adjust for cash dividends
44
- * - spin-off: adjust for spin-offs
45
- * - all: apply all adjustments (default)
46
- * Can also be comma-separated combinations, e.g. 'split,spin-off'
47
- */
48
- adjustment?: 'raw' | 'split' | 'dividend' | 'spin-off' | 'all' | string;
49
- /**
50
- * Sort order of returned bars
51
- * - asc: Oldest to newest (default)
52
- * - desc: Newest to oldest
53
- */
54
- sort?: 'asc' | 'desc';
55
- }
56
- /**
57
- * Response from historical bars endpoint
58
- * Contains OHLCV (Open, High, Low, Close, Volume) data for requested symbols
59
- */
60
- export interface HistoricalBarsResponse {
61
- /**
62
- * Map of symbol to array of bar data
63
- * Each bar contains OHLCV data for the specified timeframe
64
- */
65
- bars: {
66
- [symbol: string]: Bar[];
67
- };
68
- /**
69
- * Token for retrieving the next page of results
70
- * null if there are no more results
71
- */
72
- next_page_token: string | null;
73
- /** Currency of the price data in ISO 4217 format */
74
- currency: string;
75
- }
76
- /**
77
- * Response from latest bars endpoint
78
- * Contains the most recent minute bar for each requested symbol
79
- */
80
- export interface LatestBarsResponse {
81
- /**
82
- * Map of symbol to latest bar data
83
- * Each bar contains OHLCV data for the most recent minute
84
- */
85
- bars: {
86
- [symbol: string]: Bar;
87
- };
88
- /** Currency of the price data in ISO 4217 format */
89
- currency: string;
90
- }
91
- /**
92
- * Response from last trade endpoint for a single symbol
93
- * Contains detailed information about the most recent trade
94
- */
95
- export interface LastTradeResponse {
96
- /** Status of the request */
97
- status: string;
98
- /** The stock symbol that was queried */
99
- symbol: string;
100
- /**
101
- * Details of the last trade
102
- * @property price - Trade price
103
- * @property size - Trade size (quantity)
104
- * @property exchange - Exchange where trade occurred (see Common Exchange Codes in docs)
105
- * @property cond1-4 - Trade conditions
106
- * @property timestamp - UNIX epoch timestamp in milliseconds
107
- */
108
- last: {
109
- price: number;
110
- size: number;
111
- exchange: number;
112
- cond1: number;
113
- cond2: number;
114
- cond3: number;
115
- cond4: number;
116
- timestamp: number;
117
- };
118
- }
119
- /**
120
- * Singleton class for interacting with Alpaca Market Data API
121
- * Provides methods for fetching historical bars, latest bars, last trades, latest trades, latest quotes, and latest quote for a single symbol
122
- */
123
- export declare class AlpacaMarketDataAPI extends EventEmitter {
124
- private static instance;
125
- private headers;
126
- private dataURL;
127
- private apiURL;
128
- private v1beta1url;
129
- private v1beta3url;
130
- private stockStreamUrl;
131
- private optionStreamUrl;
132
- private stockWs;
133
- private optionWs;
134
- private stockSubscriptions;
135
- private optionSubscriptions;
136
- private autoReconnect;
137
- private stockReconnectAttempts;
138
- private optionReconnectAttempts;
139
- private stockReconnectTimeout;
140
- private optionReconnectTimeout;
141
- setMode(mode?: 'sandbox' | 'test' | 'production'): void;
142
- getMode(): 'sandbox' | 'test' | 'production';
143
- setAutoReconnect(enabled: boolean): void;
144
- getAutoReconnect(): boolean;
145
- private constructor();
146
- static getInstance(): AlpacaMarketDataAPI;
147
- private getReconnectDelay;
148
- private scheduleReconnect;
149
- on<K extends StockStreamEventName>(event: K, listener: (data: StockStreamEventMap[K]) => void): this;
150
- on<K extends OptionStreamEventName>(event: K, listener: (data: OptionStreamEventMap[K]) => void): this;
151
- emit<K extends StockStreamEventName>(event: K, data: StockStreamEventMap[K]): boolean;
152
- emit<K extends OptionStreamEventName>(event: K, data: OptionStreamEventMap[K]): boolean;
153
- private connect;
154
- private getCloseCodeDescription;
155
- private sendSubscription;
156
- connectStockStream(): void;
157
- connectOptionStream(): void;
158
- disconnectStockStream(): void;
159
- disconnectOptionStream(): void;
160
- subscribe(streamType: 'stock' | 'option', subscriptions: {
161
- trades?: string[];
162
- quotes?: string[];
163
- bars?: string[];
164
- }): void;
165
- unsubscribe(streamType: 'stock' | 'option', subscriptions: {
166
- trades?: string[];
167
- quotes?: string[];
168
- bars?: string[];
169
- }): void;
170
- private makeRequest;
171
- /**
172
- * Get historical OHLCV bars for specified symbols, including pre-market and post-market data
173
- * Automatically handles pagination to fetch all available data
174
- * @param params Parameters for historical bars request
175
- * @returns Historical bars data with all pages combined
176
- */
177
- getHistoricalBars(params: HistoricalBarsParams): Promise<HistoricalBarsResponse>;
178
- /**
179
- * Get the most recent minute bar for requested symbols
180
- * @param symbols Array of stock symbols to query
181
- * @param currency Optional currency in ISO 4217 format
182
- * @returns Latest bar data for each symbol
183
-
184
- */
185
- getLatestBars(symbols: string[], currency?: string): Promise<LatestBarsResponse>;
186
- /**
187
- * Get the last trade for a single symbol
188
- * @param symbol The stock symbol to query
189
- * @returns Last trade details including price, size, exchange, and conditions
190
- */
191
- getLastTrade(symbol: string): Promise<LastTradeResponse>;
192
- /**
193
- * Get the most recent trades for requested symbols
194
- * @param symbols Array of stock symbols to query
195
- * @param feed Optional data source (sip/iex/delayed_sip)
196
- * @param currency Optional currency in ISO 4217 format
197
- * @returns Latest trade data for each symbol
198
-
199
- */
200
- getLatestTrades(symbols: string[], feed?: DataFeed, currency?: string): Promise<LatestTradesResponse>;
201
- /**
202
- * Get the most recent quotes for requested symbols
203
- * @param symbols Array of stock symbols to query
204
- * @param feed Optional data source (sip/iex/delayed_sip)
205
- * @param currency Optional currency in ISO 4217 format
206
- * @returns Latest quote data for each symbol
207
- */
208
- getLatestQuotes(symbols: string[], feed?: DataFeed, currency?: string): Promise<LatestQuotesResponse>;
209
- /**
210
- * Get the latest quote for a single symbol
211
- * @param symbol The stock symbol to query
212
- * @param feed Optional data source (sip/iex/delayed_sip)
213
- * @param currency Optional currency in ISO 4217 format
214
- * @returns Latest quote data with symbol and currency information
215
- */
216
- getLatestQuote(symbol: string, feed?: DataFeed, currency?: string): Promise<{
217
- quote: AlpacaQuote;
218
- symbol: string;
219
- currency: string;
220
- }>;
221
- /**
222
- * Get the previous day's closing price for a symbol
223
- * @param symbol The stock symbol to query
224
- * @param referenceDate Optional reference date to get the previous close for
225
- * @returns Previous day's closing price data
226
- */
227
- getPreviousClose(symbol: string, referenceDate?: Date): Promise<Bar | null>;
228
- /**
229
- * Get hourly price data for a symbol
230
- * @param symbol The stock symbol to query
231
- * @param start Start time in milliseconds
232
- * @param end End time in milliseconds
233
- * @returns Array of hourly price bars
234
- */
235
- getHourlyPrices(symbol: string, start: number, end: number): Promise<Bar[]>;
236
- /**
237
- * Get half-hourly price data for a symbol
238
- * @param symbol The stock symbol to query
239
- * @param start Start time in milliseconds
240
- * @param end End time in milliseconds
241
- * @returns Array of half-hourly price bars
242
- */
243
- getHalfHourlyPrices(symbol: string, start: number, end: number): Promise<Bar[]>;
244
- /**
245
- * Get daily price data for a symbol
246
- * @param symbol The stock symbol to query
247
- * @param start Start time in milliseconds
248
- * @param end End time in milliseconds
249
- * @returns Array of daily price bars
250
- */
251
- getDailyPrices(symbol: string, start: number, end: number): Promise<Bar[]>;
252
- /**
253
- * Get intraday price data for a symbol
254
- * @param symbol The stock symbol to query
255
- * @param minutePeriod Minutes per bar (1, 5, 15, etc.)
256
- * @param start Start time in milliseconds
257
- * @param end End time in milliseconds
258
- * @returns Array of intraday price bars
259
- */
260
- getIntradayPrices(symbol: string, minutePeriod: number, start: number, end: number): Promise<Bar[]>;
261
- /**
262
- * Analyzes an array of price bars and returns a summary string
263
- * @param bars Array of price bars to analyze
264
- * @returns A string summarizing the price data
265
- */
266
- static analyzeBars(bars: Bar[]): string;
267
- /**
268
- * Get assets available for trade and data consumption from Alpaca
269
- * @param params Optional query params
270
- * - status: 'active' | 'inactive' (default 'active')
271
- * - asset_class: 'us_equity' | 'us_option' | 'crypto' (default 'us_equity')
272
- * - shortable: if true (default), filters to assets with shortable=true and easy_to_borrow=true
273
- * @returns Array of AlpacaAsset objects
274
- * @see https://docs.alpaca.markets/reference/get-v2-assets-1
275
- */
276
- getAssets(params?: GetAssetsParams): Promise<AlpacaAsset[]>;
277
- /**
278
- * Get a single asset by symbol or asset_id
279
- * @param symbolOrAssetId Symbol or asset_id
280
- * @returns AlpacaAsset object
281
- * @see https://docs.alpaca.markets/reference/get-v2-assets-symbol_or_asset_id
282
- */
283
- getAsset(symbolOrAssetId: string): Promise<AlpacaAsset>;
284
- /**
285
- * Get options chain for an underlying symbol
286
- * Provides the latest trade, latest quote, and greeks for each contract symbol of the underlying symbol
287
- * @param params Options chain request parameters
288
- * @returns Options chain data with snapshots for each contract
289
- * @see https://docs.alpaca.markets/reference/optionchain
290
- */
291
- getOptionsChain(params: OptionsChainParams): Promise<OptionsChainResponse>;
292
- /**
293
- * Get the most recent trades for requested option contract symbols
294
- * @param params Latest options trades request parameters
295
- * @returns Latest trade data for each option contract symbol
296
-
297
- * @see https://docs.alpaca.markets/reference/optionlatesttrades
298
- */
299
- getLatestOptionsTrades(params: LatestOptionsTradesParams): Promise<LatestOptionsTradesResponse>;
300
- /**
301
- * Get the most recent quotes for requested option contract symbols
302
- * @param params Latest options quotes request parameters
303
- * @returns Latest quote data for each option contract symbol
304
-
305
- * @see https://docs.alpaca.markets/reference/optionlatestquotes
306
- */
307
- getLatestOptionsQuotes(params: LatestOptionsQuotesParams): Promise<LatestOptionsQuotesResponse>;
308
- /**
309
- * Get historical OHLCV bars for option contract symbols
310
- * Automatically handles pagination to fetch all available data
311
- * @param params Historical options bars request parameters
312
- * @returns Historical bar data for each option contract symbol with all pages combined
313
-
314
- * @see https://docs.alpaca.markets/reference/optionbars
315
- */
316
- getHistoricalOptionsBars(params: HistoricalOptionsBarsParams): Promise<HistoricalOptionsBarsResponse>;
317
- /**
318
- * Get historical trades for option contract symbols
319
- * Automatically handles pagination to fetch all available data
320
- * @param params Historical options trades request parameters
321
- * @returns Historical trade data for each option contract symbol with all pages combined
322
-
323
- * @see https://docs.alpaca.markets/reference/optiontrades
324
- */
325
- getHistoricalOptionsTrades(params: HistoricalOptionsTradesParams): Promise<HistoricalOptionsTradesResponse>;
326
- /**
327
- * Get snapshots for option contract symbols
328
- * Provides latest trade, latest quote, and greeks for each contract symbol
329
- * @param params Options snapshots request parameters
330
- * @returns Snapshot data for each option contract symbol
331
-
332
- * @see https://docs.alpaca.markets/reference/optionsnapshots
333
- */
334
- getOptionsSnapshot(params: OptionsSnapshotsParams): Promise<OptionsSnapshotsResponse>;
335
- /**
336
- * Get condition codes for options trades or quotes
337
- * Returns the mapping between condition codes and their descriptions
338
- * @param tickType The type of tick data ('trade' or 'quote')
339
- * @returns Mapping of condition codes to descriptions
340
-
341
- * @see https://docs.alpaca.markets/reference/optionmetaconditions
342
- */
343
- getOptionsConditionCodes(tickType: OptionTickType): Promise<OptionsConditionCodesResponse>;
344
- /**
345
- * Get exchange codes for options
346
- * Returns the mapping between option exchange codes and exchange names
347
- * @returns Mapping of exchange codes to exchange names
348
-
349
- * @see https://docs.alpaca.markets/reference/optionmetaexchanges
350
- */
351
- getOptionsExchangeCodes(): Promise<OptionsExchangeCodesResponse>;
352
- /**
353
- * Analyzes an array of option bars and returns a summary string
354
- * @param bars Array of option bars to analyze
355
- * @returns A string summarizing the option price data
356
- */
357
- static analyzeOptionBars(bars: OptionBar[]): string;
358
- /**
359
- * Formats option greeks for display
360
- * @param greeks Option greeks object
361
- * @returns Formatted string with greek values
362
- */
363
- static formatOptionGreeks(greeks: any): string;
364
- /**
365
- * Interprets condition codes using the provided condition codes mapping
366
- * @param conditionCodes Array of condition codes from trade or quote
367
- * @param conditionCodesMap Mapping of condition codes to descriptions
368
- * @returns Formatted string with condition descriptions
369
- */
370
- static interpretConditionCodes(conditionCodes: string[], conditionCodesMap: OptionsConditionCodesResponse): string;
371
- /**
372
- * Gets the exchange name from exchange code using the provided exchange codes mapping
373
- * @param exchangeCode Exchange code from trade or quote
374
- * @param exchangeCodesMap Mapping of exchange codes to names
375
- * @returns Exchange name or formatted unknown exchange
376
- */
377
- static getExchangeName(exchangeCode: string, exchangeCodesMap: OptionsExchangeCodesResponse): string;
378
- /**
379
- * Fetches news articles from Alpaca API for a symbol, paginating through all results.
380
- * @param symbol The symbol to fetch news for (e.g., 'AAPL')
381
- * @param params Optional parameters: start, end, limit, sort, include_content
382
- * @returns Array of SimpleNews articles
383
- */
384
- fetchNews(symbol: string, params?: {
385
- start?: Date | string;
386
- end?: Date | string;
387
- limit?: number;
388
- sort?: 'asc' | 'desc';
389
- include_content?: boolean;
390
- }): Promise<SimpleNews[]>;
391
- /**
392
- * Get historical OHLCV bars for crypto symbols
393
- * Automatically handles pagination to fetch all available data
394
- * @param params Parameters for crypto historical bars request
395
- * @returns Historical bars data with all pages combined
396
- */
397
- getCryptoHistoricalBars(params: CryptoHistoricalBarsParams): Promise<CryptoHistoricalBarsResponse>;
398
- /**
399
- * Get the most recent minute bar for requested crypto symbols
400
- * @param symbols Array of crypto symbols to query
401
- * @returns Latest bar data for each symbol
402
- */
403
- getCryptoLatestBars(symbols: string[]): Promise<CryptoLatestBarsResponse>;
404
- /**
405
- * Get historical quotes for crypto symbols
406
- * Automatically handles pagination to fetch all available data
407
- * @param params Parameters for crypto historical quotes request
408
- * @returns Historical quotes data with all pages combined
409
- */
410
- getCryptoHistoricalQuotes(params: CryptoHistoricalQuotesParams): Promise<CryptoHistoricalQuotesResponse>;
411
- /**
412
- * Get the most recent quotes for requested crypto symbols
413
- * @param symbols Array of crypto symbols to query
414
- * @returns Latest quote data for each symbol
415
- */
416
- getCryptoLatestQuotes(symbols: string[]): Promise<CryptoLatestQuotesResponse>;
417
- /**
418
- * Get historical trades for crypto symbols
419
- * Automatically handles pagination to fetch all available data
420
- * @param params Parameters for crypto historical trades request
421
- * @returns Historical trades data with all pages combined
422
- */
423
- getCryptoHistoricalTrades(params: CryptoHistoricalTradesParams): Promise<CryptoHistoricalTradesResponse>;
424
- /**
425
- * Get the most recent trades for requested crypto symbols
426
- * @param symbols Array of crypto symbols to query
427
- * @returns Latest trade data for each symbol
428
- */
429
- getCryptoLatestTrades(symbols: string[]): Promise<CryptoLatestTradesResponse>;
430
- /**
431
- * Get snapshots for crypto symbols
432
- * Returns the latest trade, latest quote, latest minute bar, latest daily bar, and previous daily bar data
433
- * @param symbols Array of crypto symbols to query
434
- * @returns Snapshot data for each symbol
435
- */
436
- getCryptoSnapshots(symbols: string[]): Promise<CryptoSnapshotsResponse>;
437
- /**
438
- * Get the latest orderbook for requested crypto symbols
439
- * @param symbols Array of crypto symbols to query
440
- * @returns Latest orderbook data for each symbol
441
- */
442
- getCryptoLatestOrderbooks(symbols: string[]): Promise<CryptoLatestOrderbooksResponse>;
443
- /**
444
- * Analyzes an array of crypto bars and returns a summary string
445
- * @param bars Array of crypto bars to analyze
446
- * @returns A string summarizing the crypto price data
447
- */
448
- static analyzeCryptoBars(bars: Bar[]): string;
449
- }
450
- export declare const marketDataAPI: AlpacaMarketDataAPI;
451
- //# sourceMappingURL=alpaca-market-data-api.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"alpaca-market-data-api.d.ts","sourceRoot":"","sources":["../../src/alpaca-market-data-api.ts"],"names":[],"mappings":"AAAA,OAAO,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