Skip to content

Conversation

@ashthecoder05
Copy link
Collaborator

created a button to connect to any wallet add-ons

created a button to connect to any wallet add-ons
const connectBtn = document.getElementById('connect-wallet');

connectBtn.addEventListener('click', async () => {
const provider = new ethers.providers.Web3Provider(window.ethereum);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the injected window.ethereum will work for browser extensions.

To support web app wallets (Coinbase), hardware wallets (Ledger), and mobile wallets (Trust, Metamask mobile app), we can consider using an existing package like Web3Modal (Demo). This will support a larger number wallets and avoids us dealing with connectors for each wallet type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants