HomePhabricator

[Cashtab] Use in-node chronik to calculate airdrops

Description

[Cashtab] Use in-node chronik to calculate airdrops

Summary:
Use in-node chronik to calculate airdrop txs instead of SLPDB

This dramatically increases the speed of airdrop calculations. What used to take 30s to 90s, depending on the token history, is now instantaneous or within 10s.

Large diff, but

  • All new functions are unit tested
  • Integration tests are added to Airdrop.js confirming expected behavior

Various knock-on impacts of this diff

  • mock-chronik-client had to be updated to properly mock the features used (new tokenId endpoint)
  • lots of etoken: address conversion functions no longer necessary (these worked with the format returned by etoken-list)
  • etoken-list is no longer used and can be deprecated
  • tokendb.kingbch.com is officially obsolete and will be shut down
  • we do not need a progress bar for the airdrop calculation. This will almost always be "instant," and only takes some time for tokens with a large amount of holders. we continue to lock the UI and show a spinner while Cashtab is calculating an airdrop.

Test Plan:
npm test

This diff is live at https://cashtab-local-dev.netlify.app/

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

Subscribers: emack

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

Details

Provenance
bytesofmanAuthored on Mar 22 2024, 10:34
bytesofmanPushed on Mar 23 2024, 12:35
Reviewer
Restricted Project
Differential Revision
D15766: [Cashtab] Use in-node chronik to calculate airdrops
Parents
rABC793a136d26c3: [Cashtab] Change wallet from dropdown menu in header
Branches
Unknown
Tags
Unknown