@adaptic/utils 0.0.945 → 0.0.947
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 +6 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +6 -15
- package/dist/index.mjs.map +1 -1
- package/dist/types/alpaca/legacy/positions.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5841,14 +5841,9 @@ async function closePosition$1(auth, symbolOrAssetId, params) {
|
|
|
5841
5841
|
if (!position) {
|
|
5842
5842
|
throw new Error(`Position not found for ${symbolOrAssetId}`);
|
|
5843
5843
|
}
|
|
5844
|
-
//
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
alpacaApiKey: process.env.ALPACA_API_KEY,
|
|
5848
|
-
alpacaApiSecret: process.env.ALPACA_API_SECRET || process.env.ALPACA_SECRET_KEY,
|
|
5849
|
-
};
|
|
5850
|
-
const alpacaAuth = alpacaAuthData;
|
|
5851
|
-
const quotesResponse = await getLatestQuotes$1(alpacaAuth, {
|
|
5844
|
+
// Use the passed auth for quote fetching so multi-account setups
|
|
5845
|
+
// use the correct credentials per account
|
|
5846
|
+
const quotesResponse = await getLatestQuotes$1(auth, {
|
|
5852
5847
|
symbols: [symbolOrAssetId],
|
|
5853
5848
|
});
|
|
5854
5849
|
const quote = quotesResponse.quotes[symbolOrAssetId];
|
|
@@ -6116,14 +6111,10 @@ async function closeAllPositionsAfterHours$1(auth, params = { cancel_orders: tru
|
|
|
6116
6111
|
if (equityPositions.length === 0) {
|
|
6117
6112
|
return;
|
|
6118
6113
|
}
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
alpacaApiKey: process.env.ALPACA_API_KEY,
|
|
6122
|
-
alpacaApiSecret: process.env.ALPACA_SECRET_KEY,
|
|
6123
|
-
};
|
|
6124
|
-
const alpacaAuth = alpacaAuthObj;
|
|
6114
|
+
// Use the passed auth for quote fetching (not hardcoded env vars)
|
|
6115
|
+
// so multi-account setups use the correct credentials per account
|
|
6125
6116
|
const symbols = equityPositions.map((position) => position.symbol);
|
|
6126
|
-
const quotesResponse = await getLatestQuotes$1(
|
|
6117
|
+
const quotesResponse = await getLatestQuotes$1(auth, { symbols });
|
|
6127
6118
|
for (const position of equityPositions) {
|
|
6128
6119
|
const quote = quotesResponse.quotes[position.symbol];
|
|
6129
6120
|
if (!quote) {
|