Uniswap / web3-react

A simple, maximally extensible, dependency minimized framework for building modern Ethereum dApps
https://web3-react-mu.vercel.app/
GNU General Public License v3.0
5.48k stars 1.51k forks source link

MetaMask connector to support MetaMask SDK #864

Open andreahaku opened 11 months ago

andreahaku commented 11 months ago

We are MetaMask SDK developers and we would like to help you add support for the MetaMask SDK to the MetaMask connector.

This would enable to add support to MetaMask Mobile app along with MetaMask Extension. The MetaMask SDK also solves some hijacking issues with the window.ethereum provider.

The MetaMask Mobile connection would be enabled on desktop browsers (via QRCode scanning) and mobile browsers (via Universal Links).

The update should add the '@metamask/sdk' dependency, the MetaMask SDK npm module, initialise the MetaMask SDK and use the MetaMask SDK provider as it's able to handle connection with both MetaMask Extension and MetaMask Mobile app.

The file that should be involved in the integration with the MetaMask SDK is: https://github.com/Uniswap/web3-react/blob/main/packages/metamask/src/index.ts

The repo to refer to is: https://github.com/MetaMask/metamask-sdk A few examples can be found here. Documentation is here.

JFrankfurt commented 11 months ago

concept ack

I'll gladly review this PR. You may want to look at the wallet connect connectors, as it sounds like part of the new functionality is similar.

Q: What hijacking issues are you describing? The namespace battle?

Mzprincess21 commented 11 months ago

/ /

andreahaku commented 11 months ago

concept ack

I'll gladly review this PR. You may want to look at the wallet connect connectors, as it sounds like part of the new functionality is similar.

Q: What hijacking issues are you describing? The namespace battle?

Thanks!

Yes, I'm referring to the namespace issues. The MM SDK solves the coexistence of the MM extension and Coinbase extension.

The way the MM SDK works is much easier, particularly if the MM Extension provider is already implemented. It's only a matter of switching to the MM SDK one (that is the same with some additional features to allow for remote connections with the MetaMask mobile app and others).

bumblefudge commented 11 months ago

The MM SDK solves the coexistence of the MM extension and Coinbase extension.

Is EIP-6963 on the roadmap for this SDK or are you referring to a different solution to the provider race condition?

andreahaku commented 11 months ago

The MM SDK solves the coexistence of the MM extension and Coinbase extension.

Is EIP-6963 on the roadmap for this SDK or are you referring to a different solution to the provider race condition?

As soon as MetaMask Extension will support EIP-6963, the MM SDK will implement the support for it.

vandan commented 8 months ago

Now that EIP-6963 support is live in the MetaMask Extension, getting the SDK in to the MetaMask Connector would help accelerate further EIP-6963 adoption and bring some nice UX improvements for people with multiple wallet extensions.

gregorobreza commented 1 month ago

Any news regarding EIP-6963 support for metamask connector? I can see some effort has been made adding MetaMaks SDK in this pull request https://github.com/Uniswap/web3-react/pull/880 . But last commit was in August.