@ -51,20 +51,26 @@ export class GhostfolioService implements DataProviderInterface { 
				
			 
			
		
	
		
		
			
				
					 
					 
					    requestTimeout  =  this . configurationService . get ( 'REQUEST_TIMEOUT' ) ,  
					 
					 
					    requestTimeout  =  this . configurationService . get ( 'REQUEST_TIMEOUT' ) ,  
				
			 
			
		
	
		
		
			
				
					 
					 
					    symbol  
					 
					 
					    symbol  
				
			 
			
		
	
		
		
			
				
					 
					 
					  } :  GetAssetProfileParams ) :  Promise < Partial < SymbolProfile > >  {  
					 
					 
					  } :  GetAssetProfileParams ) :  Promise < Partial < SymbolProfile > >  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					    let  respons e : DataProviderGhostfolioAssetProfileResponse  =  { }  ;  
					 
					 
					    let  assetProfil e : DataProviderGhostfolioAssetProfileResponse ;  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					    try  {  
					 
					 
					    try  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					      const  assetProfile  =  ( await  fetch (  
					 
					 
					      const  response  =  await  fetch (  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					        ` ${ this . URL } /v1/data-providers/ghostfolio/asset-profile/ ${ symbol } ` ,  
					 
					 
					        ` ${ this . URL } /v1/data-providers/ghostfolio/asset-profile/ ${ symbol } ` ,  
				
			 
			
		
	
		
		
			
				
					 
					 
					        {  
					 
					 
					        {  
				
			 
			
		
	
		
		
			
				
					 
					 
					          headers : await  this . getRequestHeaders ( ) ,  
					 
					 
					          headers : await  this . getRequestHeaders ( ) ,  
				
			 
			
		
	
		
		
			
				
					 
					 
					          signal : AbortSignal.timeout ( requestTimeout )  
					 
					 
					          signal : AbortSignal.timeout ( requestTimeout )  
				
			 
			
		
	
		
		
			
				
					 
					 
					        }  
					 
					 
					        }  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					      ) . then ( ( res )  = >  
					 
					 
					      ) ;  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					        res . json ( )  
					 
					 
					
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					      ) )  as  DataProviderGhostfolioAssetProfileResponse ;  
					 
					 
					      if  ( ! response . ok )  {  
				
			 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 
					 
					 
					 
					 
					        throw  new  Response ( await  response . text ( ) ,  {  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					          status : response.status ,  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					          statusText : response.statusText  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					        } ) ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					      }  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					      response  =  assetProfile ;  
					 
					 
					      assetProfile  =  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					 
					 
					 
					        ( await  response . json ( ) )  as  DataProviderGhostfolioAssetProfileResponse ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					    }  catch  ( error )  {  
					 
					 
					    }  catch  ( error )  {  
				
			 
			
		
	
		
		
			
				
					 
					 
					      let  message  =  error ;  
					 
					 
					      let  message  =  error ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					@ -72,24 +78,21 @@ export class GhostfolioService implements DataProviderInterface { 
				
			 
			
		
	
		
		
			
				
					 
					 
					        message  =  ` RequestError: The operation to get the asset profile for  ${ symbol }  was aborted because the request to the data provider took more than  ${ (  
					 
					 
					        message  =  ` RequestError: The operation to get the asset profile for  ${ symbol }  was aborted because the request to the data provider took more than  ${ (  
				
			 
			
		
	
		
		
			
				
					 
					 
					          requestTimeout  /  1000  
					 
					 
					          requestTimeout  /  1000  
				
			 
			
		
	
		
		
			
				
					 
					 
					        ) . toFixed ( 3 ) }  seconds ` ;
  
					 
					 
					        ) . toFixed ( 3 ) }  seconds ` ;
  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					      }  else  if  ( error ? . status  ===  StatusCodes . TOO_MANY_REQUESTS )  {  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					        message  =  'RequestError: The daily request limit has been exceeded' ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					      }  else  if  (  
					 
					 
					      }  else  if  (  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					        error ? . response ? . statusCode  ===  StatusCodes . TOO_MANY_REQUESTS  
					 
					 
					        [ StatusCodes . FORBIDDEN ,  StatusCodes . UNAUTHORIZED ] . includes (  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					 
					 
					 
					          error ? . status  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					        )  
				
			 
			
		
	
		
		
			
				
					 
					 
					      )  {  
					 
					 
					      )  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					        message  =  'RequestError: The daily request limit has been exceeded' ;  
					 
					 
					        message  =  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					      }  else  if  ( error ? . response ? . statusCode  ===  StatusCodes . UNAUTHORIZED )  {  
					 
					 
					          'RequestError: The API key is invalid. Please update it in the Settings section of the Admin Control panel.' ;  
				
			 
			
				
				
			
		
	
		
		
			
				
					 
					 
					        if  ( ! error ? . request ? . options ? . headers ? . authorization ? . includes ( '-' ) )  {  
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					 
					 
					          message  =  
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					 
					 
					            'RequestError: The provided API key is invalid. Please update it in the Settings section of the Admin Control panel.' ;  
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					 
					 
					        }  else  {  
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					 
					 
					          message  =  
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					 
					 
					            'RequestError: The provided API key has expired. Please request a new one and update it in the Settings section of the Admin Control panel.' ;  
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					 
					 
					        }  
					 
					 
					 
				
			 
			
		
	
		
		
	
		
		
	
		
		
			
				
					 
					 
					      }  
					 
					 
					      }  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					      Logger . error ( message ,  'GhostfolioService' ) ;  
					 
					 
					      Logger . error ( message ,  'GhostfolioService' ) ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					    }  
					 
					 
					    }  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					    return  respons e;  
					 
					 
					    return  assetProfile ;  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					  }  
					 
					 
					  }  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					  public  getDataProviderInfo ( ) :  DataProviderInfo  {  
					 
					 
					  public  getDataProviderInfo ( ) :  DataProviderInfo  {  
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					@ -110,12 +113,12 @@ export class GhostfolioService implements DataProviderInterface { 
				
			 
			
		
	
		
		
			
				
					 
					 
					  } :  GetDividendsParams ) :  Promise < {  
					 
					 
					  } :  GetDividendsParams ) :  Promise < {  
				
			 
			
		
	
		
		
			
				
					 
					 
					    [ date : string ] :  IDataProviderHistoricalResponse ;  
					 
					 
					    [ date : string ] :  IDataProviderHistoricalResponse ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					  } >  {  
					 
					 
					  } >  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					    let  response :  {  
					 
					 
					    let  dividends :  {  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					      [ date : string ] :  IDataProviderHistoricalResponse ;  
					 
					 
					      [ date : string ] :  IDataProviderHistoricalResponse ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					    }  =  { } ;  
					 
					 
					    }  =  { } ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					    try  {  
					 
					 
					    try  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					      const  {  dividends  }  =  ( await  fetch (  
					 
					 
					      const  response  =  await  fetch (  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					        ` ${ this . URL } /v2/data-providers/ghostfolio/dividends/ ${ symbol } ?from= ${ format ( from ,  DATE_FORMAT ) } &granularity= ${ granularity } &to= ${ format (  
					 
					 
					        ` ${ this . URL } /v2/data-providers/ghostfolio/dividends/ ${ symbol } ?from= ${ format ( from ,  DATE_FORMAT ) } &granularity= ${ granularity } &to= ${ format (  
				
			 
			
		
	
		
		
			
				
					 
					 
					          to ,  
					 
					 
					          to ,  
				
			 
			
		
	
		
		
			
				
					 
					 
					          DATE_FORMAT  
					 
					 
					          DATE_FORMAT  
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					@ -124,28 +127,34 @@ export class GhostfolioService implements DataProviderInterface { 
				
			 
			
		
	
		
		
			
				
					 
					 
					          headers : await  this . getRequestHeaders ( ) ,  
					 
					 
					          headers : await  this . getRequestHeaders ( ) ,  
				
			 
			
		
	
		
		
			
				
					 
					 
					          signal : AbortSignal.timeout ( requestTimeout )  
					 
					 
					          signal : AbortSignal.timeout ( requestTimeout )  
				
			 
			
		
	
		
		
			
				
					 
					 
					        }  
					 
					 
					        }  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					      ) . then ( ( res )  = >  res . json ( ) ) )  as  DividendsResponse ;  
					 
					 
					      ) ;  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					      if  ( ! response . ok )  {  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					        throw  new  Response ( await  response . text ( ) ,  {  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					          status : response.status ,  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					          statusText : response.statusText  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					        } ) ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					      }  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					      response  =  dividends ;  
					 
					 
					      dividends  =  ( ( await  response . json ( ) )  as  DividendsResponse ) . dividends ;  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					    }  catch  ( error )  {  
					 
					 
					    }  catch  ( error )  {  
				
			 
			
		
	
		
		
			
				
					 
					 
					      let  message  =  error ;  
					 
					 
					      let  message  =  error ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					      if  ( error . response ? . statusCode  ===  StatusCodes . TOO_MANY_REQUESTS )  {  
					 
					 
					      if  ( error ? . status  ===  StatusCodes . TOO_MANY_REQUESTS )  {  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					        message  =  'RequestError: The daily request limit has been exceeded' ;  
					 
					 
					        message  =  'RequestError: The daily request limit has been exceeded' ;  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					      }  else  if  ( error . response ? . statusCode  ===  StatusCodes . UNAUTHORIZED )  {  
					 
					 
					      }  else  if  (  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					        if  ( ! error . request ? . options ? . headers ? . authorization ? . includes ( '-' ) )  {  
					 
					 
					        [ StatusCodes . FORBIDDEN ,  StatusCodes . UNAUTHORIZED ] . includes (  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					          message  =  
					 
					 
					          error ? . status  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					            'RequestError: The provided API key is invalid. Please update it in the Settings section of the Admin Control panel.' ;  
					 
					 
					        )  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					        }  else  {  
					 
					 
					      )  {  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					          message  =  
					 
					 
					        message  =  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					            'RequestError: The provided API key has expired. Please request a new one and update it in the Settings section of the Admin Control panel.' ;  
					 
					 
					          'RequestError: The API key is invalid. Please update it in the Settings section of the Admin Control panel.' ;  
				
			 
			
				
				
			
		
	
		
		
			
				
					 
					 
					        }  
					 
					 
					 
				
			 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 
					 
					      }  
					 
					 
					      }  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					      Logger . error ( message ,  'GhostfolioService' ) ;  
					 
					 
					      Logger . error ( message ,  'GhostfolioService' ) ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					    }  
					 
					 
					    }  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					    return  response ;  
					 
					 
					    return  dividends ;  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					  }  
					 
					 
					  }  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					  public  async  getHistorical ( {  
					 
					 
					  public  async  getHistorical ( {  
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					@ -158,7 +167,7 @@ export class GhostfolioService implements DataProviderInterface { 
				
			 
			
		
	
		
		
			
				
					 
					 
					    [ symbol :  string ] :  {  [ date : string ] :  IDataProviderHistoricalResponse  } ;  
					 
					 
					    [ symbol :  string ] :  {  [ date : string ] :  IDataProviderHistoricalResponse  } ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					  } >  {  
					 
					 
					  } >  {  
				
			 
			
		
	
		
		
			
				
					 
					 
					    try  {  
					 
					 
					    try  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					      const  {  historicalData  }  =  ( await  fetch (  
					 
					 
					      const  response  =  await  fetch (  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					        ` ${ this . URL } /v2/data-providers/ghostfolio/historical/ ${ symbol } ?from= ${ format ( from ,  DATE_FORMAT ) } &granularity= ${ granularity } &to= ${ format (  
					 
					 
					        ` ${ this . URL } /v2/data-providers/ghostfolio/historical/ ${ symbol } ?from= ${ format ( from ,  DATE_FORMAT ) } &granularity= ${ granularity } &to= ${ format (  
				
			 
			
		
	
		
		
			
				
					 
					 
					          to ,  
					 
					 
					          to ,  
				
			 
			
		
	
		
		
			
				
					 
					 
					          DATE_FORMAT  
					 
					 
					          DATE_FORMAT  
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					@ -167,27 +176,36 @@ export class GhostfolioService implements DataProviderInterface { 
				
			 
			
		
	
		
		
			
				
					 
					 
					          headers : await  this . getRequestHeaders ( ) ,  
					 
					 
					          headers : await  this . getRequestHeaders ( ) ,  
				
			 
			
		
	
		
		
			
				
					 
					 
					          signal : AbortSignal.timeout ( requestTimeout )  
					 
					 
					          signal : AbortSignal.timeout ( requestTimeout )  
				
			 
			
		
	
		
		
			
				
					 
					 
					        }  
					 
					 
					        }  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					      ) . then ( ( res )  = >  res . json ( ) ) )  as  HistoricalResponse ;  
					 
					 
					      ) ;  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					      if  ( ! response . ok )  {  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					        throw  new  Response ( await  response . text ( ) ,  {  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					          status : response.status ,  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					          statusText : response.statusText  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					        } ) ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					      }  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					      const  {  historicalData  }  =  ( await  response . json ( ) )  as  HistoricalResponse ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					      return  {  
					 
					 
					      return  {  
				
			 
			
		
	
		
		
			
				
					 
					 
					        [ symbol ] :  historicalData  
					 
					 
					        [ symbol ] :  historicalData  
				
			 
			
		
	
		
		
			
				
					 
					 
					      } ;  
					 
					 
					      } ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					    }  catch  ( error )  {  
					 
					 
					    }  catch  ( error )  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					      let  message  =  error ;  
					 
					 
					      if  ( error ? . status  ===  StatusCodes . TOO_MANY_REQUESTS )  {  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					
 
					 
					 
					        error . name  =  'RequestError' ;   
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					      if  ( error . response ? . statusCode  ===  StatusCodes . TOO_MANY_REQUESTS )  {  
					 
					 
					         error . message  =  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					        message  =  'RequestError: The daily request limit has been exceeded' ;  
					 
					 
					           'RequestError: The daily request limit has been exceeded' ;  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					      }  else  if  ( error . response ? . statusCode  ===  StatusCodes . UNAUTHORIZED )  {  
					 
					 
					      }  else  if  (  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					        if  ( ! error . request ? . options ? . headers ? . authorization ? . includes ( '-' ) )  {  
					 
					 
					        [ StatusCodes . FORBIDDEN ,  StatusCodes . UNAUTHORIZED ] . includes (  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					          message  =  
					 
					 
					          error ? . status  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					            'RequestError: The provided API key is invalid. Please update it in the Settings section of the Admin Control panel.' ;   
					 
					 
					        )  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					        }  else   {  
					 
					 
					      )   {  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					          message  =   
					 
					 
					        error . name  =  'RequestError' ;  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					            'RequestError: The provided API key has expired. Please request a new one and update it in the Settings section of the Admin Control panel.' ;   
					 
					 
					        error . message  =  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					        }  
					 
					 
					          'RequestError: The API key is invalid. Please update it in the Settings section of the Admin Control panel.' ;   
				
			 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 
					 
					      }  
					 
					 
					      }  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					      Logger . error ( message ,  'GhostfolioService' ) ;  
					 
					 
					      Logger . error ( error . message ,  'GhostfolioService' ) ;  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					      throw  new  Error (  
					 
					 
					      throw  new  Error (  
				
			 
			
		
	
		
		
			
				
					 
					 
					        ` Could not get historical market data for  ${ symbol }  ( ${ this . getName ( ) } ) from  ${ format (  
					 
					 
					        ` Could not get historical market data for  ${ symbol }  ( ${ this . getName ( ) } ) from  ${ format (  
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					@ -212,22 +230,29 @@ export class GhostfolioService implements DataProviderInterface { 
				
			 
			
		
	
		
		
			
				
					 
					 
					  } :  GetQuotesParams ) :  Promise < {  
					 
					 
					  } :  GetQuotesParams ) :  Promise < {  
				
			 
			
		
	
		
		
			
				
					 
					 
					    [ symbol :  string ] :  IDataProviderResponse ;  
					 
					 
					    [ symbol :  string ] :  IDataProviderResponse ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					  } >  {  
					 
					 
					  } >  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					    let  response :  {  [ symbol :  string ] :  IDataProviderResponse  }  =  { } ;  
					 
					 
					    let  quotes :  {  [ symbol :  string ] :  IDataProviderResponse  }  =  { } ;  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					    if  ( symbols . length  <=  0 )  {  
					 
					 
					    if  ( symbols . length  <=  0 )  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					      return  response ;  
					 
					 
					      return  quotes ;  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					    }  
					 
					 
					    }  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					    try  {  
					 
					 
					    try  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					      const  {  quotes  }  =  ( await  fetch (  
					 
					 
					      const  response  =  await  fetch (  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					        ` ${ this . URL } /v2/data-providers/ghostfolio/quotes?symbols= ${ symbols . join ( ',' ) } ` ,  
					 
					 
					        ` ${ this . URL } /v2/data-providers/ghostfolio/quotes?symbols= ${ symbols . join ( ',' ) } ` ,  
				
			 
			
		
	
		
		
			
				
					 
					 
					        {  
					 
					 
					        {  
				
			 
			
		
	
		
		
			
				
					 
					 
					          headers : await  this . getRequestHeaders ( ) ,  
					 
					 
					          headers : await  this . getRequestHeaders ( ) ,  
				
			 
			
		
	
		
		
			
				
					 
					 
					          signal : AbortSignal.timeout ( requestTimeout )  
					 
					 
					          signal : AbortSignal.timeout ( requestTimeout )  
				
			 
			
		
	
		
		
			
				
					 
					 
					        }  
					 
					 
					        }  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					      ) . then ( ( res )  = >  res . json ( ) ) )  as  QuotesResponse ;  
					 
					 
					      ) ;  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					      if  ( ! response . ok )  {  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					        throw  new  Response ( await  response . text ( ) ,  {  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					          status : response.status ,  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					          statusText : response.statusText  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					        } ) ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					      }  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					      response  =  quotes ;  
					 
					 
					      quotes  =  ( ( await  response . json ( ) )  as   QuotesResponse ) . quotes ;  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					    }  catch  ( error )  {  
					 
					 
					    }  catch  ( error )  {  
				
			 
			
		
	
		
		
			
				
					 
					 
					      let  message  =  error ;  
					 
					 
					      let  message  =  error ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					@ -237,24 +262,21 @@ export class GhostfolioService implements DataProviderInterface { 
				
			 
			
		
	
		
		
			
				
					 
					 
					        ) }  was  aborted  because  the  request  to  the  data  provider  took  more  than  $ { (  
					 
					 
					        ) }  was  aborted  because  the  request  to  the  data  provider  took  more  than  $ { (  
				
			 
			
		
	
		
		
			
				
					 
					 
					          requestTimeout  /  1000  
					 
					 
					          requestTimeout  /  1000  
				
			 
			
		
	
		
		
			
				
					 
					 
					        ) . toFixed ( 3 ) }  seconds ` ;
  
					 
					 
					        ) . toFixed ( 3 ) }  seconds ` ;
  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					      }  else  if  ( error ? . status  ===  StatusCodes . TOO_MANY_REQUESTS )  {  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					        message  =  'RequestError: The daily request limit has been exceeded' ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					      }  else  if  (  
					 
					 
					      }  else  if  (  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					        error ? . response ? . statusCode  ===  StatusCodes . TOO_MANY_REQUESTS  
					 
					 
					        [ StatusCodes . FORBIDDEN ,  StatusCodes . UNAUTHORIZED ] . includes (  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					 
					 
					 
					          error ? . status  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					        )  
				
			 
			
		
	
		
		
			
				
					 
					 
					      )  {  
					 
					 
					      )  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					        message  =  'RequestError: The daily request limit has been exceeded' ;  
					 
					 
					        message  =  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					      }  else  if  ( error ? . response ? . statusCode  ===  StatusCodes . UNAUTHORIZED )  {  
					 
					 
					          'RequestError: The API key is invalid. Please update it in the Settings section of the Admin Control panel.' ;  
				
			 
			
				
				
			
		
	
		
		
			
				
					 
					 
					        if  ( ! error ? . request ? . options ? . headers ? . authorization ? . includes ( '-' ) )  {  
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					 
					 
					          message  =  
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					 
					 
					            'RequestError: The provided API key is invalid. Please update it in the Settings section of the Admin Control panel.' ;  
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					 
					 
					        }  else  {  
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					 
					 
					          message  =  
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					 
					 
					            'RequestError: The provided API key has expired. Please request a new one and update it in the Settings section of the Admin Control panel.' ;  
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					 
					 
					        }  
					 
					 
					 
				
			 
			
		
	
		
		
	
		
		
	
		
		
			
				
					 
					 
					      }  
					 
					 
					      }  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					      Logger . error ( message ,  'GhostfolioService' ) ;  
					 
					 
					      Logger . error ( message ,  'GhostfolioService' ) ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					    }  
					 
					 
					    }  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					    return  response ;  
					 
					 
					    return  quotes ;  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					  }  
					 
					 
					  }  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					  public  getTestSymbol() {  
					 
					 
					  public  getTestSymbol() {  
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					@ -268,13 +290,22 @@ export class GhostfolioService implements DataProviderInterface { 
				
			 
			
		
	
		
		
			
				
					 
					 
					    let  searchResult : LookupResponse  =  {  items :  [ ]  } ;  
					 
					 
					    let  searchResult : LookupResponse  =  {  items :  [ ]  } ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					    try  {  
					 
					 
					    try  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					      searchResult  =  ( await  fetch (  
					 
					 
					      const  response  =  await  fetch (  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					        ` ${ this . URL } /v2/data-providers/ghostfolio/lookup?query= ${ query } ` ,  
					 
					 
					        ` ${ this . URL } /v2/data-providers/ghostfolio/lookup?query= ${ query } ` ,  
				
			 
			
		
	
		
		
			
				
					 
					 
					        {  
					 
					 
					        {  
				
			 
			
		
	
		
		
			
				
					 
					 
					          headers : await  this . getRequestHeaders ( ) ,  
					 
					 
					          headers : await  this . getRequestHeaders ( ) ,  
				
			 
			
		
	
		
		
			
				
					 
					 
					          signal : AbortSignal.timeout ( requestTimeout )  
					 
					 
					          signal : AbortSignal.timeout ( requestTimeout )  
				
			 
			
		
	
		
		
			
				
					 
					 
					        }  
					 
					 
					        }  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					      ) . then ( ( res )  = >  res . json ( ) ) )  as  LookupResponse ;  
					 
					 
					      ) ;  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					      if  ( ! response . ok )  {  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					        throw  new  Response ( await  response . text ( ) ,  {  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					          status : response.status ,  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					          statusText : response.statusText  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					        } ) ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					      }  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					      searchResult  =  ( await  response . json ( ) )  as  LookupResponse ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					    }  catch  ( error )  {  
					 
					 
					    }  catch  ( error )  {  
				
			 
			
		
	
		
		
			
				
					 
					 
					      let  message  =  error ;  
					 
					 
					      let  message  =  error ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					@ -282,18 +313,15 @@ export class GhostfolioService implements DataProviderInterface { 
				
			 
			
		
	
		
		
			
				
					 
					 
					        message  =  ` RequestError: The operation to search for  ${ query }  was aborted because the request to the data provider took more than  ${ (  
					 
					 
					        message  =  ` RequestError: The operation to search for  ${ query }  was aborted because the request to the data provider took more than  ${ (  
				
			 
			
		
	
		
		
			
				
					 
					 
					          requestTimeout  /  1000  
					 
					 
					          requestTimeout  /  1000  
				
			 
			
		
	
		
		
			
				
					 
					 
					        ) . toFixed ( 3 ) }  seconds ` ;
  
					 
					 
					        ) . toFixed ( 3 ) }  seconds ` ;
  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					      }  else  if  ( error ? . status  ===  StatusCodes . TOO_MANY_REQUESTS )  {  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					        message  =  'RequestError: The daily request limit has been exceeded' ;  
				
			 
			
		
	
		
		
			
				
					 
					 
					      }  else  if  (  
					 
					 
					      }  else  if  (  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					        error ? . response ? . statusCode  ===  StatusCodes . TOO_MANY_REQUESTS  
					 
					 
					        [ StatusCodes . FORBIDDEN ,  StatusCodes . UNAUTHORIZED ] . includes (  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					 
					 
					 
					 
					 
					          error ? . status  
				
			 
			
		
	
		
		
			
				
					 
					 
					 
					 
					 
					        )  
				
			 
			
		
	
		
		
			
				
					 
					 
					      )  {  
					 
					 
					      )  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					        message  =  'RequestError: The daily request limit has been exceeded' ;  
					 
					 
					        message  =  
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					      }  else  if  ( error . response ? . statusCode  ===  StatusCodes . UNAUTHORIZED )  {  
					 
					 
					          'RequestError: The API key is invalid. Please update it in the Settings section of the Admin Control panel.' ;  
				
			 
			
				
				
			
		
	
		
		
			
				
					 
					 
					        if  ( ! error ? . request ? . options ? . headers ? . authorization ? . includes ( '-' ) )  {  
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					 
					 
					          message  =  
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					 
					 
					            'RequestError: The provided API key is invalid. Please update it in the Settings section of the Admin Control panel.' ;  
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					 
					 
					        }  else  {  
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					 
					 
					          message  =  
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					 
					 
					            'RequestError: The provided API key has expired. Please request a new one and update it in the Settings section of the Admin Control panel.' ;  
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					 
					 
					        }  
					 
					 
					 
				
			 
			
		
	
		
		
	
		
		
	
		
		
			
				
					 
					 
					      }  
					 
					 
					      }  
				
			 
			
		
	
		
		
			
				
					 
					 
					
 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					 
					 
					      Logger . error ( message ,  'GhostfolioService' ) ;  
					 
					 
					      Logger . error ( message ,  'GhostfolioService' ) ;