Browse Source
			
			
			Bugfix/fix cryptocurrency symbols with less than 3 characters (#1325)
			
				* Fix cryptocurrency symbols with less than 3 characters
* Update changelog
			
			
				pull/1326/head
			
			
		 
		
			
				
					
						 Thomas Kaul
					
					3 years ago
						Thomas Kaul
					
					3 years ago
					
						
							committed by
							
								 GitHub
								GitHub
							
						 
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: 4AEE18F83AFDEB23
						
					
				
			
		
		
		
	
		
			
				 2 changed files with 
13 additions and 
2 deletions
			 
			
		 
		
			
				- 
					
					
					 
					CHANGELOG.md
				
- 
					
					
					 
					apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts
				
				
				
					
						
							
								
									
	
		
		
			
				
					|  | @ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | - Improved the caching of the benchmarks in the markets overview (only cache if fetching was successful) |  |  | - Improved the caching of the benchmarks in the markets overview (only cache if fetching was successful) | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | ### Fixed | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | - Fixed the support for cryptocurrencies having a symbol with less than 3 characters (e.g. `SC-USD`) | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | ## 1.201.0 - 01.10.2022 |  |  | ## 1.201.0 - 01.10.2022 | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | ### Added |  |  | ### Added | 
			
		
	
	
		
		
			
				
					|  | 
 | 
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					|  | @ -58,8 +58,15 @@ export class YahooFinanceService implements DataProviderInterface { | 
			
		
	
		
		
			
				
					|  |  |    *                  DOGEUSD -> DOGE-USD |  |  |    *                  DOGEUSD -> DOGE-USD | 
			
		
	
		
		
			
				
					|  |  |    */ |  |  |    */ | 
			
		
	
		
		
			
				
					|  |  |   public convertToYahooFinanceSymbol(aSymbol: string) { |  |  |   public convertToYahooFinanceSymbol(aSymbol: string) { | 
			
		
	
		
		
			
				
					
					|  |  |     if (aSymbol.includes(this.baseCurrency) && aSymbol.length >= 6) { |  |  |     if ( | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |       if (isCurrency(aSymbol.substring(0, aSymbol.length - 3))) { |  |  |       aSymbol.includes(this.baseCurrency) && | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |       aSymbol.length > this.baseCurrency.length | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     ) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       if ( | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         isCurrency( | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           aSymbol.substring(0, aSymbol.length - this.baseCurrency.length) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         ) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       ) { | 
			
		
	
		
		
			
				
					|  |  |         return `${aSymbol}=X`; |  |  |         return `${aSymbol}=X`; | 
			
		
	
		
		
			
				
					|  |  |       } else if ( |  |  |       } else if ( | 
			
		
	
		
		
			
				
					|  |  |         this.cryptocurrencyService.isCryptocurrency( |  |  |         this.cryptocurrencyService.isCryptocurrency( | 
			
		
	
	
		
		
			
				
					|  | 
 |