@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/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 this.getPortfolioHistory(hourlyParams);
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;