parent
							
								
									619eee9492
								
							
						
					
					
						commit
						ea5dc8738c
					
				@ -1,5 +1,6 @@
 | 
				
			|||||||
import config from '../config';
 | 
					import config from '../config';
 | 
				
			||||||
import { MempoolBlock } from '../mempool.interfaces';
 | 
					import { MempoolBlock } from '../mempool.interfaces';
 | 
				
			||||||
 | 
					import mempool from './mempool';
 | 
				
			||||||
import projectedBlocks from './mempool-blocks';
 | 
					import projectedBlocks from './mempool-blocks';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class FeeApi {
 | 
					class FeeApi {
 | 
				
			||||||
@ -9,12 +10,14 @@ class FeeApi {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  public getRecommendedFee() {
 | 
					  public getRecommendedFee() {
 | 
				
			||||||
    const pBlocks = projectedBlocks.getMempoolBlocks();
 | 
					    const pBlocks = projectedBlocks.getMempoolBlocks();
 | 
				
			||||||
 | 
					    const mPool = mempool.getMempoolInfo();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!pBlocks.length) {
 | 
					    if (!pBlocks.length) {
 | 
				
			||||||
      return {
 | 
					      return {
 | 
				
			||||||
        'fastestFee': this.defaultFee,
 | 
					        'fastestFee': this.defaultFee,
 | 
				
			||||||
        'halfHourFee': this.defaultFee,
 | 
					        'halfHourFee': this.defaultFee,
 | 
				
			||||||
        'hourFee': this.defaultFee,
 | 
					        'hourFee': this.defaultFee,
 | 
				
			||||||
 | 
					        'mempoolminfee': mPool.mempoolminfee,
 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -26,6 +29,7 @@ class FeeApi {
 | 
				
			|||||||
      'fastestFee': firstMedianFee,
 | 
					      'fastestFee': firstMedianFee,
 | 
				
			||||||
      'halfHourFee': secondMedianFee,
 | 
					      'halfHourFee': secondMedianFee,
 | 
				
			||||||
      'hourFee': thirdMedianFee,
 | 
					      'hourFee': thirdMedianFee,
 | 
				
			||||||
 | 
					      'mempoolminfee': mPool.mempoolminfee,
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -62,7 +62,7 @@ class Mempool {
 | 
				
			|||||||
    this.mempoolInfo = await bitcoinBaseApi.$getMempoolInfo();
 | 
					    this.mempoolInfo = await bitcoinBaseApi.$getMempoolInfo();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  public getMempoolInfo(): IBitcoinApi.MempoolInfo | undefined {
 | 
					  public getMempoolInfo(): IBitcoinApi.MempoolInfo {
 | 
				
			||||||
    return this.mempoolInfo;
 | 
					    return this.mempoolInfo;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user