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