Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support custom connectors #2119

Open
wants to merge 6 commits into
base: V4
Choose a base branch
from
Open

feat: support custom connectors #2119

wants to merge 6 commits into from

Conversation

chris13524
Copy link
Member

@chris13524 chris13524 commented Apr 5, 2024

Breaking Changes

N/A

Changes

  • feat: support custom connectors
  • chore: make return types consistent
  • chore: missing and typo comments

Copy link

vercel bot commented Apr 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
web3modal-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 20, 2024 6:34pm
web3modal-gallery ✅ Ready (Inspect) Visit Preview May 20, 2024 6:34pm
web3modal-laboratory ✅ Ready (Inspect) Visit Preview May 20, 2024 6:34pm
web3modal-react-wagmi-ex ✅ Ready (Inspect) Visit Preview May 20, 2024 6:34pm
web3modal-vue-wagmi-ex ✅ Ready (Inspect) Visit Preview May 20, 2024 6:34pm

Copy link
Member

@glitch-txs glitch-txs left a comment

Choose a reason for hiding this comment

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

Mmm, the idea of defaultWagmiConfig is to save dev time, we intentionally prevent connectors to be overriden to make sure WalletConnectConnector was set correctly. For custom connector devs can always use the usual Wagmi configuration without using the default function.

Also this seem like it might add some connectors twice if the dev doesn't know what's internally

@chris13524
Copy link
Member Author

@glitch-txs There's a lot of stuff this function sets up which defaultWagmiConfig() drastically simplifies: WalletConnect, email wallet, RPC URLs, EIP-6963. Lot of lines of code for a dev to re-implement if they just want a new connector, and it wouldn't use our RPC out of the box.

To avoid duplicates we can detect if a connector ID already exists in the list. If it already exists, don't add. That should solve your concerns?

@glitch-txs
Copy link
Member

That'd be better I guess.

As a point aside, I think we should also abstract the Blockchain API implementation so it could be used without this function being required.

@tomiir
Copy link
Contributor

tomiir commented Apr 5, 2024

I'd filter out duplicates and leave it as-is. But this should be included in docs @glitch-txs @boidushya to prevent confusion

@chris13524
Copy link
Member Author

Slack conversation

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.

None yet

3 participants