Page MenuHomePhabricator

[Cashtab] Enable special features if wallet has specific eToken
ClosedPublic

Authored by bytesofman on Feb 20 2021, 22:07.

Details

Summary

Add a method to check the wallet for an arbitrary token. Conditionally render react component if token balance found. This diff includes one feature inspired by https://dogechain.info/

This can be extended for other token-enabled features e.g. dark mode, token minting, token icons.

Test Plan

npm test to verify new method

Ping me in slack with your eToken address and I'll send you some tabcash to enable testing this specific feature.

Verify feature is enabled for wallet with a balance of the tabcash eToken. Verify feature is disabled for wallets without a balance in tabcash.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

majcosta requested changes to this revision.Feb 22 2021, 19:50
majcosta added a subscriber: majcosta.
majcosta added inline comments.
web/cashtab/src/utils/tokenMethods.js
2–9 ↗(On Diff #27752)

the code is self-explanatory enough that these comments are just noise. I suggest using for..of instead of regular for to make it even simpler

This revision now requires changes to proceed.Feb 22 2021, 19:50

Implementing suggested changes

This revision is now accepted and ready to land.Feb 22 2021, 20:22