@adaptic/utils 0.0.994 → 0.0.995
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs
CHANGED
|
@@ -9320,8 +9320,11 @@ const fetchTrades = async (symbol, options) => {
|
|
|
9320
9320
|
*
|
|
9321
9321
|
* This module provides functions to interact with the Massive.com Indices API.
|
|
9322
9322
|
*/
|
|
9323
|
-
// Constants from environment variables
|
|
9324
|
-
|
|
9323
|
+
// Constants from environment variables.
|
|
9324
|
+
// Backward-compat: ALPACA_INDICES_API_KEY is the pre-2026-Q2 name (vendor was
|
|
9325
|
+
// renamed Alpaca → Massive); MASSIVE_INDICES_API_KEY is preferred. The fallback
|
|
9326
|
+
// stays so consumers that haven't migrated env vars don't break.
|
|
9327
|
+
const { MASSIVE_INDICES_API_KEY, ALPACA_INDICES_API_KEY } = process.env;
|
|
9325
9328
|
// Define concurrency limits for API
|
|
9326
9329
|
const MASSIVE_INDICES_CONCURRENCY_LIMIT = 5;
|
|
9327
9330
|
const massiveIndicesLimit = pLimit(MASSIVE_INDICES_CONCURRENCY_LIMIT);
|
|
@@ -9333,7 +9336,7 @@ const MASSIVE_API_BASE_URL = "https://api.massive.com";
|
|
|
9333
9336
|
* @throws {Error} If no API key is available
|
|
9334
9337
|
*/
|
|
9335
9338
|
const validateApiKey = (apiKey) => {
|
|
9336
|
-
const key = apiKey || ALPACA_INDICES_API_KEY;
|
|
9339
|
+
const key = apiKey || MASSIVE_INDICES_API_KEY || ALPACA_INDICES_API_KEY;
|
|
9337
9340
|
if (!key) {
|
|
9338
9341
|
throw new Error("Massive Indices API key is missing");
|
|
9339
9342
|
}
|