HomePhabricator

[Cashtab] Add circulating supply to token stats

Description

[Cashtab] Add circulating supply to token stats

Summary:
Add routine to get current circulating supply and mint batons of a token.

Display supply and mint baton based on current on-chain state instead of genesis supply.

Note: I looked at also showing totalMinted and totalBurned. We should add this, but it needs to be in a separate diff. These quantities need to come from parsing tx history, which can be much larger. For example as of today GRUMPY has over 28,000 txs (about 150 megabytes to get them all from chronik).

The approach there will be along the lines of:

  • Calculate totalBurned and totalMinted through a certain numTxs/numPages of history
  • Cache this (change shape of token cache, though we will not need to migrate for this, will add a key that may be undefined)
  • on send token page load, check cache for these values up to page number and numTxs, then check tx history and update and re-cache them

Test Plan:
npm test

Loads instantly for pretty much every token except for GRP at the moment. Can look into improving the "Loading..." ux later, right now there isn't really any impact available.

image.png (744×719 px, 113 KB)

image.png (744×719 px, 143 KB)

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

Subscribers: emack

Differential Revision: https://reviews.bitcoinabc.org/D15847

Details

Provenance
bytesofmanAuthored on Apr 2 2024, 05:23
bytesofmanPushed on Apr 3 2024, 00:07
Reviewer
Restricted Project
Differential Revision
D15847: [Cashtab] Add circulating supply to token stats
Parents
rABCb5b2281eedf1: [Cashtab] Revamp UX and remove antd from SignVerifyMsg
Branches
Unknown
Tags
Unknown