HomePhabricator

[Cashtab] [Chronik] getTokenStats refactor

Description

[Cashtab] [Chronik] getTokenStats refactor

Summary: This diff migrates the getTokenStats() function from useBCH.js into the chronik.js hook and refactored it to retrieve token info via the chronik client and deprecates the use of bch-js' BCH.SLP.Utils.tokenStats() api call. sendToken.js is also refactored to directly reference chronik token object params.

Test Plan:

  • npm test
  • npm start
  • navigate to a token
  • validate token stats with bch-api's tokenStats

e.g. https://rest.kingbch.com/v4/slp/tokenStats/cc1f4b7feb98a3de8879bc9ceef69510c48868b3f6c11407fe8e2c9e42ec3120

  • validate token genesis info with explorer.e.cash
  • burn some of the token in the wallet's possession
  • refresh the sendToken component and ensure the circulating supply and total burned stats have been updated
  • test a newly created token and ensure the genesis date parsing shows holding text when block.timestamp is null (still in mempool)
  • wait till this newly created token genesis tx is mined and ensure the genesis date is displayed correctly
  • test tokens with various decimal points and ensure values are presented correctly.

Reviewers: bytesofman, #bitcoin_abc

Reviewed By: bytesofman, #bitcoin_abc

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

Details

Provenance
emackAuthored on Sep 21 2022, 16:00
emackPushed on Sep 23 2022, 15:33
Reviewer
Restricted Project
Differential Revision
D12025: [Cashtab] [Chronik] getTokenStats refactor
Parents
rABC31df2802ac38: [Chronik] Add `Chronik`, connect it to `CValidationInterface`
Branches
Unknown
Tags
Unknown