@discomedia/utils 1.0.27 → 1.0.28
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/{alpaca-trading-api-6NxNgQBn.js → alpaca-trading-api-BMvFXbgI.js} +6 -5
- package/dist/{alpaca-trading-api-6NxNgQBn.js.map → alpaca-trading-api-BMvFXbgI.js.map} +1 -1
- package/dist/index-frontend.cjs +5 -4
- package/dist/index-frontend.cjs.map +1 -1
- package/dist/index-frontend.mjs +5 -4
- package/dist/index-frontend.mjs.map +1 -1
- package/dist/index.cjs +5 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +5 -4
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +1 -1
- package/dist/test.js +1 -1
- package/dist/types/alpaca-trading-api.d.ts.map +1 -1
- package/dist/types-frontend/alpaca-trading-api.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -17837,12 +17837,13 @@ class AlpacaTradingAPI {
|
|
|
17837
17837
|
* @returns Portfolio history data with daily timeframe, including the most recent day if available from hourly data
|
|
17838
17838
|
*/
|
|
17839
17839
|
async getPortfolioDailyHistory(params) {
|
|
17840
|
-
// Get daily history
|
|
17840
|
+
// Get daily and hourly history in parallel
|
|
17841
17841
|
const dailyParams = { ...params, timeframe: '1D' };
|
|
17842
|
-
const dailyHistory = await this.getPortfolioHistory(dailyParams);
|
|
17843
|
-
// Get hourly history for the last day to check for more recent data
|
|
17844
17842
|
const hourlyParams = { timeframe: '1H', period: '1D' };
|
|
17845
|
-
const hourlyHistory = await
|
|
17843
|
+
const [dailyHistory, hourlyHistory] = await Promise.all([
|
|
17844
|
+
this.getPortfolioHistory(dailyParams),
|
|
17845
|
+
this.getPortfolioHistory(hourlyParams)
|
|
17846
|
+
]);
|
|
17846
17847
|
// If no hourly history, return daily as-is
|
|
17847
17848
|
if (!hourlyHistory.timestamp || hourlyHistory.timestamp.length === 0) {
|
|
17848
17849
|
return dailyHistory;
|