blockstack-browser
blockstack-browser copied to clipboard
Improve error message when BTC tx amount too low
I'm seeing a weird issue with sending a BTC payment. I have $30 USD in my wallet, about 0.004 BTC, and no matter how much I try and send, I get "Not enough coin to fund fees transaction fees. Fees would be 5824, specified spend is 10". I see this comes from
blockstack.js- is this an issue of not having the right UXTO's to put together a TX?
Originally posted by @hstove in https://github.com/blockstack/blockstack-browser/pull/1966#issuecomment-555358616
Sending small amounts of btc can trigger this error: https://github.com/blockstack/blockstack.js/blob/b2ade3ca5b0519d330430b9bb3b5125da879496b/src/operations/txbuild.ts#L1174-L1177
const outputAmount = amount - feesToPay
if (outputAmount < DUST_MINIMUM) {
throw new InvalidAmountError(feesToPay, amount)
}
The error message displayed by the browser is incorrect and confusing.