@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.cjs CHANGED
@@ -17839,12 +17839,13 @@ class AlpacaTradingAPI {
17839
17839
  * @returns Portfolio history data with daily timeframe, including the most recent day if available from hourly data
17840
17840
  */
17841
17841
  async getPortfolioDailyHistory(params) {
17842
- // Get daily history
17842
+ // Get daily and hourly history in parallel
17843
17843
  const dailyParams = { ...params, timeframe: '1D' };
17844
- const dailyHistory = await this.getPortfolioHistory(dailyParams);
17845
- // Get hourly history for the last day to check for more recent data
17846
17844
  const hourlyParams = { timeframe: '1H', period: '1D' };
17847
- const hourlyHistory = await this.getPortfolioHistory(hourlyParams);
17845
+ const [dailyHistory, hourlyHistory] = await Promise.all([
17846
+ this.getPortfolioHistory(dailyParams),
17847
+ this.getPortfolioHistory(hourlyParams)
17848
+ ]);
17848
17849
  // If no hourly history, return daily as-is
17849
17850
  if (!hourlyHistory.timestamp || hourlyHistory.timestamp.length === 0) {
17850
17851
  return dailyHistory;