sui icon indicating copy to clipboard operation
sui copied to clipboard

[wallet-ext] Add feature-flagged denomination to wallet

Open Jordan-Mysten opened this issue 1 year ago • 1 comments

This is an extension of #4661, updated based on recent SDK changes.

The key change here from the previous PR:

  • Added feature gating, based on our existing feature gating setup (I simplified the setup a bit though). This is enabled in dev and disabled in prod.
  • Moves all formatting logic to be async and hook-based. We need to fetch denomination from the API (it currently only supports SUI but will be updated to call RPC for other token types). I opted to pull in Tanstack Query to do the data fetching, which we've recently started to do on the Explorer, and I've been meaning to add it to the wallet as well. It keeps this information in cache (for up to 24 hours, although we need to set up cache persisting at some point), and de-dupes requests.
  • Pull in bignumber.js for all number formatting and parsing. This solves the precision loss with the previous number-based approach.

Jordan-Mysten avatar Oct 20 '22 03:10 Jordan-Mysten

💳 Wallet Extension has been built, you can download the packaged extension here: https://github.com/MystenLabs/sui/actions/runs/3322112382#artifacts

github-actions[bot] avatar Oct 20 '22 20:10 github-actions[bot]