Send mempoolminfee in fee api.

fixes #357
This commit is contained in:
softsimon 2021-02-24 12:26:55 +07:00
parent 619eee9492
commit ea5dc8738c
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
2 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import config from '../config';
import { MempoolBlock } from '../mempool.interfaces';
import mempool from './mempool';
import projectedBlocks from './mempool-blocks';
class FeeApi {
@ -9,12 +10,14 @@ class FeeApi {
public getRecommendedFee() {
const pBlocks = projectedBlocks.getMempoolBlocks();
const mPool = mempool.getMempoolInfo();
if (!pBlocks.length) {
return {
'fastestFee': this.defaultFee,
'halfHourFee': this.defaultFee,
'hourFee': this.defaultFee,
'mempoolminfee': mPool.mempoolminfee,
};
}
@ -26,6 +29,7 @@ class FeeApi {
'fastestFee': firstMedianFee,
'halfHourFee': secondMedianFee,
'hourFee': thirdMedianFee,
'mempoolminfee': mPool.mempoolminfee,
};
}

View File

@ -62,7 +62,7 @@ class Mempool {
this.mempoolInfo = await bitcoinBaseApi.$getMempoolInfo();
}
public getMempoolInfo(): IBitcoinApi.MempoolInfo | undefined {
public getMempoolInfo(): IBitcoinApi.MempoolInfo {
return this.mempoolInfo;
}