daistats icon indicating copy to clipboard operation
daistats copied to clipboard

Improved metamask

Open brianmcmichael opened this issue 5 years ago • 4 comments

Overhaul to all of the metamask buttons to have a more reactive behavior.

  • Restores the old ethers.js functionality for page display
  • Adds ConsenSys/react-metamask dependency
  • Rewrite of { Heal, Burn, Flap } button handling to use MetaMask context
  • Updates addresses.json to 1.0.2 with checksummed addresses

brianmcmichael avatar Feb 08 '20 19:02 brianmcmichael

I don't like adding web3 if we're using ethers already. Is there a way to make this happen? Trying to minimize dependencies

nanexcool avatar Feb 22 '20 05:02 nanexcool

Hmm, probably not in this PR. It's baked in to the https://github.com/ConsenSys/react-metamask dependency and is used within the context. In fact it requires this specific version of web3.

brianmcmichael avatar Feb 22 '20 05:02 brianmcmichael

Looks like they're deprecating it in favor of web3-react, which is way overkill for daistats at the moment

https://github.com/ConsenSys/react-metamask#deprecated

nanexcool avatar Feb 22 '20 06:02 nanexcool

Lol, yeah, I just noticed that they added the deprecation 3 days ago.

Let me think about this. This PR gives the buttons an entire lifecycle around the metamask state, which is nice. The current page still has some issues with metamask not being ready on load, so the provider doesn't get set.

brianmcmichael avatar Feb 22 '20 06:02 brianmcmichael