HomePhabricator

[Cashtab] Improve form entry and validation for listing tokens on agora

Description

[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:

  1. How many tokens are you selling?
  2. What's the price per token?
  3. 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

Details

Provenance
bytesofmanAuthored on Tue, Jan 7, 13:34
bytesofmanPushed on Thu, Jan 9, 12:14
Reviewer
Restricted Project
Differential Revision
D17484: [Cashtab] Improve form entry and validation for listing tokens on agora
Parents
rABC5cea6272b9ba: [chronik] bump karyon_jsonrpc
Branches
Unknown
Tags
Unknown