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

Replace litConnectModal with Wagmi #751

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

Conversation

anshss
Copy link
Member

@anshss anshss commented Dec 28, 2024

Description

As per this ticket, litConnectModal is now replaced with a more maintained wallet provider wagmi

Wagmi is chosen amongst other providers as most providers are built over wagmi and wagmi provides much more low-level control. It doesn't enforce any UI opinion and it have more granular error-handling capability


Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Tested in a browser app by testing with wallet other than metamask (disabled other wallets except trust wallet)
Screenshot 2024-12-28 at 7 32 07 PM Screenshot 2024-12-28 at 7 33 28 PM # Checklist:
  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@anshss anshss requested a review from Ansonhkg as a code owner December 28, 2024 12:35
Copy link
Collaborator

@Ansonhkg Ansonhkg left a comment

Choose a reason for hiding this comment

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

  1. Removing part of the existing code makes it a breaking change. Could you please revert the changes, set them as default, add a deprecation message, and allow users to opt for WAGMI if they choose to? This way, we can release this as a minor update.
  2. Could we also figure out why it’s failing on the CI?

@FedericoAmura
Copy link
Contributor

  1. Removing part of the existing code makes it a breaking change. Could you please revert the changes, set them as default, add a deprecation message, and allow users to opt for WAGMI if they choose to? This way, we can release this as a minor update.
  2. Could we also figure out why it’s failing on the CI?

CI is failing because the PR is from a fork. CI runs in @anshss environment instead of Lit and it cannot setup shiva (gh security)
We can fix this setting the config too in @anshss fork or by moving changes to this repo

) => {
const chain = Object.values(LIT_CHAINS).find((c) => c.chainId === chainId);
if (!chain) {
throw new Error(`Chain ID ${chainId} not supported`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we throw a ParamsMissingError or another LitError? 🙏🏻
Same on all other throw Error lines

*
* @return { Promise<ConnectWeb3Result> } web3, account
*/
export const connectWeb3 = async ({
export const connectWeb3WithLitConnectModal = async ({
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's re-export this function as connectWeb3 too and mark both (this and the one with the original name) as deprecated to retain backwards compatibility

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

Successfully merging this pull request may close these issues.

3 participants