rainbow-me / browser-extension

An Ethereum wallet built for speed 🌈
https://rainbow.me/
GNU General Public License v3.0
170 stars 40 forks source link

fix: delete `isMetaMask` property and share same EIP-1193 instance with EIP-6963 #1614

Closed magiziz closed 4 months ago

magiziz commented 4 months ago

Fixes BX-#### Figma link (if any):

What changed (plus any additional context for devs)

EDIT: This is a small improvement from previous fix we did

Screen recordings / screenshots

What to test

github-actions[bot] commented 4 months ago

Here's the packed extension for this build: node_modules.tar.gz rainbowbx-1957759cc6f155ad6d8835015cd8b45eea661fe0 screenshots

magiziz commented 4 months ago

This PR is an alternative to https://github.com/rainbow-me/browser-extension/pull/1613#pullrequestreview-2157621157

DanielSinclair commented 4 months ago

@magiziz Esteban's PR includes a isMetaMask = false now for the EIP-6963 announcer. Does that accomplish the same thing as this PR?

magiziz commented 4 months ago

@DanielSinclair Yes, that's correct. Instead we delete the isMetaMask property and bring back the walletRouter and window.ethereum.providers. Also the Wagmi team suggested that EIP-6963 and EIP-1193 should share the same instance rather than copying them. This is because, currently, in RainbowKit, you're getting two connections due to them not being the same instance. Here is the code which you can look at https://github.com/wevm/wagmi/blob/main/packages/core/src/actions/reconnect.ts#L71-L75

This is not a major change, but it's a small improvement.

github-actions[bot] commented 4 months ago

Here's the packed extension for this build: node_modules.tar.gz rainbowbx-7c98fbc6783ecd6a2603a8e0ba180d09d4f45fb4 screenshots

github-actions[bot] commented 4 months ago

Here's the packed extension for this build: node_modules.tar.gz rainbowbx-efa97308f81c5d0003f125a846f382bf25045659 screenshots

github-actions[bot] commented 4 months ago

Here's the packed extension for this build: node_modules.tar.gz rainbowbx-efa97308f81c5d0003f125a846f382bf25045659 screenshots

github-actions[bot] commented 4 months ago

Here's the packed extension for this build: node_modules.tar.gz rainbowbx-efa97308f81c5d0003f125a846f382bf25045659 screenshots

github-actions[bot] commented 4 months ago

Here's the packed extension for this build: node_modules.tar.gz rainbowbx-26479f3eb2fee93d4d0a68a8a7284f2b28d317ee screenshots

github-actions[bot] commented 4 months ago

Here's the packed extension for this build: node_modules.tar.gz rainbowbx-26479f3eb2fee93d4d0a68a8a7284f2b28d317ee screenshots

github-actions[bot] commented 4 months ago

Here's the packed extension for this build: node_modules.tar.gz rainbowbx-115f5983098172aa4b246882f7698ffb9cc71960 screenshots

magiziz commented 4 months ago

Seems like e2e test fails because we use this e2e app https://bx-e2e-dapp.vercel.app. It requires isMetaMask to be true.

github-actions[bot] commented 4 months ago

Here's the packed extension for this build: node_modules.tar.gz rainbowbx-efe5cc8bf4173911008a20e94495be57aae819eb screenshots