feat: mempool.space fee estimation
This commit is contained in:
parent
c3c5292123
commit
8bbbb136f1
2 changed files with 14 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
|||
const _ = require('lodash/fp')
|
||||
const jsonRpc = require('../../common/json-rpc')
|
||||
const { getEstimateFeeBtc } = require('../../../blockexplorers/mempool.space')
|
||||
|
||||
const BN = require('../../../bn')
|
||||
const E = require('../../../error')
|
||||
|
|
@ -55,9 +56,11 @@ function balance (account, cryptoCode, settings, operatorId) {
|
|||
}
|
||||
|
||||
function estimateFee () {
|
||||
return fetch('estimatesmartfee', [6, 'unset'])
|
||||
.then(result => BN(result.feerate))
|
||||
.catch(() => {})
|
||||
return getEstimateFeeBtc()
|
||||
.then(result => BN(result))
|
||||
.catch(err => {
|
||||
logger.error('failure estimating fes', err)
|
||||
})
|
||||
}
|
||||
|
||||
function calculateFeeDiscount (feeMultiplier) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue