district0x / StreamTide

An open-source, Web3-based patronage tool amplifying community support for creators through grant matching. Transform small streams into tidal waves of support.
https://streamtide.io/
GNU Affero General Public License v3.0
6 stars 3 forks source link

NSF error needs better error handling #27

Closed Bradymck closed 6 months ago

Bradymck commented 9 months ago

Is your feature request related to a problem? Please describe. Insufficient funds leads to a gas error, this needs to be the UI side and not sent to Metamask. it currently displays an error that should be in UI not metamask. gas error

Describe the solution you'd like This shouldld be displayed in the normal notification box and never show a transaction window.

Describe alternatives you've considered Possibly sending a better error text to metamask if possible. Additional context To reproduce create a fresh account without ETH and try to donate to a creator.

ginesdt commented 9 months ago

@Bradymck this is a bit tricky, as we don't know (or is hard to know) the gas consumption a transaction is going to make. I mean, we can show an error message if you have 1 ETH and you want to make a donation of 2 ETH as this is obvious. But for example, imagine you have 1 ETH and you want to donate 0.995 ETH, then, depending on the gas price at that moment you might or might not have enough funds to make the transaction and it will be metamask the best one to know that.