Page MenuHomePhabricator

[Cashtab] Support one-click redemptions
ClosedPublic

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

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABCbe5be3147e03: [Cashtab] Support one-click redemptions
Summary

Support redemptions of Firma for $1 of XEC

Test Plan

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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

bytesofman marked an inline comment as done.

rebase

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

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

it's back up now. I had pushed a different version to test the migration related to D17650

As per tg, noting the "minor price change in between clicking list and the listing getting published" issue that is for another diff, perhaps a relist on latest price button or some sort.

image.png (757×604 px, 919 KB)

This revision is now accepted and ready to land.Fri, Feb 28, 12:54

Show a spinner while the redeem listing is calculated

This revision was automatically updated to reflect the committed changes.