Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
This PR introduces a feature update to support wagmi v2 for our existing connectors. The upgrade aligns our connectors with the latest wagmi standards, ensuring compatibility and leveraging the new functionalities introduced in wagmi v2.
What is the current behavior? (You can also link to an open issue here)
Currently, our connectors are based on the previous version of wagmi, which may lead to compatibility issues with projects that have migrated to wagmi v2. The existing implementation might not fully support the new API and functionalities introduced in wagmi v2, potentially causing type errors and limitations in functionality.
What is the new behavior (if this is a feature change)?
With this PR, our connectors are now fully compatible with wagmi v2. This includes the following enhancements:
Adoption of wagmi v2's new connector configuration pattern.
Improved type definitions to eliminate type errors and better align with wagmi v2's expected connector properties and methods.
Support for new wagmi v2 features such as chain switching, enhanced event handling, and optimized connection management.
The upgrade ensures that our connectors can seamlessly integrate with wagmi v2, providing a robust and flexible connection mechanism for decentralized applications.
Other information:
In this upgrade, we followed the official wagmi guide for creating connectors. This involved modifying the createConnector method to include the required properties and methods, such as id, name, connect, disconnect, getAccounts, getChainId, getProvider, isAuthorized, setup, switchChain, onAccountsChanged, onChainChanged, onConnect, onDisconnect, and onMessage.
Additionally, we leveraged wagmi v2's config properties such as chains, emitter, and storage to enhance the functionality and flexibility of our connectors. This upgrade not only addresses the compatibility issues but also enriches our connectors with the advanced capabilities of wagmi v2.