I'm doing a transaction of BTC using bitcore-lib nodejs package. when I set 1 satoshi fee per byte it shows an error like "Fee is too small: expected more than x but got y". Is there any way to get that x value to set fee?
let tx = bitcore.Transaction();
tx.from(utxos);
tx.to(toAddress,sendAmountInSatoshi);
tx.change(fromAddress);
tx.fee(fee);
tx.sign(pKey);
While I'm not sure if it's part of the API specification you can use their
_estimateFee()method:https://github.com/bitpay/bitcore-lib/blob/86583608814dfc513e675d7b853806caf9bd95e7/lib/transaction/transaction.js#L242