[Cashtab] Improve form entry and validation for listing tokens on agora
Summary:
Right now, users enter price last. This means we validate the price field for the minimum buy being at least dust. This is confusing to users because it looks like they need to charge more per token in order to list, when in reality they need to offer more of the token.
A better workflow here is to enter the price 2nd. That way it's:
- How many tokens are you selling?
- What's the price per token?
- What's the min buy?
In this diff, we automatically set the min buy after the user enters (1) and (2). The min buy must be such that the min buy of the offer is at least 546 satoshis.
A price is valid as long as it is at least 1 nanosat per token sat. We do not want to encourage users to try a higher price if they are attached to a low min qty.
Test Plan:
npm test
This diff is deployed at https://cashtab-local-dev.netlify.app/
Reviewers: #bitcoin_abc, emack
Reviewed By: #bitcoin_abc, emack
Subscribers: emack, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D17484