- Follow up enhancement to D10912 which upgrades Tx History to recognize and uniquely render eToken burn transactions.
- useBCH.parseTokenInfoForTxHistory() has been updated to an asyc function as it needs to call bch-api to retrieve eToken decimals and call async parseTokenTxForBurnData() to retrieve the token burn data via Chronik-client (which is failing the unit tests but I'll ping you on telegram on how best to refactor the eToken tests)
- new parseTokenTxForBurnData() function added to useBCH.js which uses Chronik-client to retrieve the corresponding eToken burn data
- new formatLongValueTokenByDecimal() function added to useBCH.js which uses the eToken's decimal point to format the eToken's burn amount
- Since eTokens can have decimal points between 0 - 9, there is an additional bch-api call to retrieve the decimal point of the eToken via BCH.SLP.Utils.tokenStats() since Chronik only returns the eToken's decimal point as part of the [[ https://github.com/EyeOfPython/chronik-indexer-sample/blob/9a0127d8074c48446e847620af33d822c4c20993/proto/chronik.proto#L133-L139 | genesis tx only ]]. In non-genesis txs, the 'SlpGenesisInfo' attribute in the Chronik tx response object is undefined.
Dependencies:
- Chronik-client (https://www.npmjs.com/package/chronik-client)
- Long.js for representing a 64 bit two's-complement integer values(https://www.npmjs.com/package//long)
- D10912 to land first
Manifest: T2208