Page MenuHomePhabricator

[Cashtab] Support one-click redemptions
Needs ReviewPublic

Authored by bytesofman on Tue, Feb 25, 21:53.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

Depends on D17650

Support redemptions of Firma for $1 of XEC

Test Plan

Diff Detail

Repository
rABC Bitcoin ABC
Branch
firma-redemptions
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 32520
Build 64528: Build Diffcashtab-tests
Build 64527: arc lint + arc unit

Event Timeline

bytesofman edited the test plan for this revision. (Show Details)

add test to confirm behavior on bad price API call

Since the button will only work based on the external api, it's better to not show the button if the api is unavailable for some reason.
I suggest you do this:

  1. Attempt to retrieve the price from that endpoint
  2. If not successful, don't show the button. Otherwise show the button with the actual price, like "Redeem FIRMA for 1234 XEC"
  3. Not sure if it's worth refreshing periodically (in the even the price changes quickly)

Another point: can the slider be adjusted so that it starts at the minimum quantity and not at zero ? So you cannot move the cursor to the invalid zone, better UX

Consider a 100% 50% 25% button above the Redeem button similar to binance. Easier for tax calculations when people are just partially selling rounded percentages.

cashtab/src/components/Etokens/Token/index.tsx
2377 ↗(On Diff #52772)

For the "Actual price", perhaps update to x,xxx XEC / FIRMA, otherwise it reads as if you'll be receiving that approximate amount selling a fraction of a FIRMA.

image.png (1×1 px, 156 KB)

Show "you receive" amount for FIRMA redemptions

Consider a 100% 50% 25% button above the Redeem button similar to binance. Easier for tax calculations when people are just partially selling rounded percentages.

yes, will need to get this in a separate diff. this is a generalized thing we need to put on the slider.

bytesofman added inline comments.
cashtab/src/components/Etokens/Token/index.tsx
2377 ↗(On Diff #52772)

added a "you receive" line that shows total amount

image.png (413×325 px, 49 KB)

image.png (1×685 px, 65 KB)

I no longer see the redeem button anymore even though I have a FIRMA balance and am on the FIRMA token landing page.

v3.14.0 on the netlify instance after multiple refreshes