feat: support new advanced wallet settings

This commit is contained in:
José Oliveira 2022-02-17 21:50:31 +00:00
parent 4120d58a1b
commit ba72786dcb
7 changed files with 32 additions and 27 deletions

View file

@ -11,6 +11,8 @@ const unitScale = cryptoRec.unitScale
const rpcConfig = jsonRpc.rpcConfig(cryptoRec)
const SUPPORTS_BATCHING = true
function fetch (method, params) {
return jsonRpc.fetch(rpcConfig, method, params)
}
@ -63,7 +65,10 @@ function sendCoins (account, tx, settings, operatorId, feeMultiplier) {
return checkCryptoCode(cryptoCode)
.then(() => calculateFeeDiscount(feeMultiplier))
.then(newFee => fetch('settxfee', [newFee]))
.then(newFee => {
console.log('** DEBUG MINERS FEE ** - Calculated fee discount: ', newFee)
return fetch('settxfee', [newFee])
})
.then(() => fetch('sendtoaddress', [toAddress, coins]))
.then((txId) => fetch('gettransaction', [txId]))
.then((res) => _.pick(['fee', 'txid'], res))
@ -186,5 +191,6 @@ module.exports = {
fetchRBF,
estimateFee,
sendCoinsBatch,
checkBlockchainStatus
checkBlockchainStatus,
SUPPORTS_BATCHING
}