MetaMask / eth-token-tracker

A JS module for tracking Ethereum token balances over block changes
ISC License
76 stars 44 forks source link

allow updating failed tokens #53

Closed brad-decker closed 3 years ago

brad-decker commented 3 years ago
  1. adds a new option flag (includeFailedToken)
  2. passes that flag to the Token constructor as throwOnBalanceError
  3. if throwOnBalanceError is false, do not throw an error when balance update fails
  4. always attach balanceError to the token when an error occurs, and clear it when update succeeds

This allows us to display failed tokens in the extension AND only show our tooltip warning about token balances on the tokens that did not successfully update. Put this behind a flag to allow the prior behavior to work by default