@adaptic/utils 0.0.907 → 0.0.908
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 +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1404,7 +1404,7 @@ async function fetchNews$1(symbols, params) {
|
|
|
1404
1404
|
}
|
|
1405
1405
|
else {
|
|
1406
1406
|
APIKey = process.env.ALPACA_API_KEY;
|
|
1407
|
-
APISecret = process.env.ALPACA_SECRET_KEY;
|
|
1407
|
+
APISecret = process.env.ALPACA_API_SECRET || process.env.ALPACA_SECRET_KEY;
|
|
1408
1408
|
}
|
|
1409
1409
|
if (!APIKey || !APISecret) {
|
|
1410
1410
|
throw new Error("No valid Alpaca authentication found. Please provide either auth object or set ALPACA_API_KEY and ALPACA_API_SECRET environment variables.");
|
|
@@ -1594,7 +1594,7 @@ async function closePosition$1(auth, symbolOrAssetId, params) {
|
|
|
1594
1594
|
const alpacaAuth = {
|
|
1595
1595
|
type: "LIVE",
|
|
1596
1596
|
alpacaApiKey: process.env.ALPACA_API_KEY,
|
|
1597
|
-
alpacaApiSecret: process.env.ALPACA_SECRET_KEY,
|
|
1597
|
+
alpacaApiSecret: process.env.ALPACA_API_SECRET || process.env.ALPACA_SECRET_KEY,
|
|
1598
1598
|
};
|
|
1599
1599
|
const quotesResponse = await getLatestQuotes$1(alpacaAuth, {
|
|
1600
1600
|
symbols: [symbolOrAssetId],
|
|
@@ -1687,7 +1687,7 @@ async function closeAllPositions$1(auth, params = { cancel_orders: true, useLimi
|
|
|
1687
1687
|
const alpacaAuth = {
|
|
1688
1688
|
type: "LIVE",
|
|
1689
1689
|
alpacaApiKey: process.env.ALPACA_API_KEY,
|
|
1690
|
-
alpacaApiSecret: process.env.ALPACA_SECRET_KEY,
|
|
1690
|
+
alpacaApiSecret: process.env.ALPACA_API_SECRET || process.env.ALPACA_SECRET_KEY,
|
|
1691
1691
|
};
|
|
1692
1692
|
const symbols = positions.map((position) => position.symbol);
|
|
1693
1693
|
const quotesResponse = await getLatestQuotes$1(alpacaAuth, { symbols });
|
|
@@ -53469,7 +53469,7 @@ function createAlpacaClient(config) {
|
|
|
53469
53469
|
*/
|
|
53470
53470
|
function createClientFromEnv() {
|
|
53471
53471
|
const apiKey = process.env.ALPACA_API_KEY;
|
|
53472
|
-
const apiSecret = process.env.ALPACA_SECRET_KEY;
|
|
53472
|
+
const apiSecret = process.env.ALPACA_API_SECRET || process.env.ALPACA_SECRET_KEY;
|
|
53473
53473
|
const accountType = process.env.ALPACA_ACCOUNT_TYPE || "PAPER";
|
|
53474
53474
|
if (!apiKey || !apiSecret) {
|
|
53475
53475
|
throw new Error("ALPACA_API_KEY and ALPACA_SECRET_KEY environment variables are required");
|