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

refactor: use chain id for the transports array mapping #2617

Merged
merged 3 commits into from
Jul 30, 2024

Conversation

enesozturk
Copy link
Contributor

@enesozturk enesozturk commented Jul 30, 2024

Description

We previously refactored our logic to create transports array for wagmi, to use chain object directly instead of chain.id in the defaultWagmiReactConfig.ts. But we still use chain.id in the defaultWagmiCoreConfig.ts. Wagmi is looking for chainID while mapping the transport objects, as could be seen in any dApp that uses our package >=5.0.6:

TypeError: rest.transports[chainId] is not a function
    at Object.transport (createConfig.js:121:66)
    at createClient (createClient.js:15:51)
    at Object.getClient (createConfig.js:115:72)

This PR introduces changes to revert this back.

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • 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)

Associated Issues

For Linear issues: Closes APKT-xxx
For GH issues: closes #...

Showcase (Optional)

If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections

Copy link

vercel bot commented Jul 30, 2024

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

Name Status Preview Updated (UTC)
web3modal-gallery ✅ Ready (Inspect) Visit Preview Jul 30, 2024 2:25pm
web3modal-laboratory ✅ Ready (Inspect) Visit Preview Jul 30, 2024 2:25pm

Copy link
Member

@chris13524 chris13524 left a comment

Choose a reason for hiding this comment

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

Sounds like a bug fix, looks good to me!

@enesozturk enesozturk merged commit 3ab60bc into main Jul 30, 2024
12 checks passed
@enesozturk enesozturk deleted the refactor/transports-array-chain-id branch July 30, 2024 14:41
This was referenced Jul 30, 2024
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