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

fix: switchNetwork - invalid chain ID error parsing #3847

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tomiir
Copy link
Collaborator

@tomiir tomiir commented Feb 12, 2025

Description

  • Metamsk Mobile is responding with an Unsupported Chain error code that was not properly handled when switchintg network. This caused wallet_addEthereumNetwork to not be fired when wallet considers some chain id sent as invalid, which can happen when the network is not configured wallet side (valid add ethereum chain case).
  • Adds some missing methods on universal adapter OPTIONAL_METHODS
  • Removes duplicated constants in code

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

Closes APKT-2261

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
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

Copy link

linear bot commented Feb 12, 2025

Copy link

changeset-bot bot commented Feb 12, 2025

🦋 Changeset detected

Latest commit: 034a504

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-utils Patch
@reown/appkit Patch
@reown/appkit-adapter-bitcoin Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit-cdn Patch
@reown/appkit-cli Patch
@reown/appkit-common Patch
@reown/appkit-core Patch
@reown/appkit-experimental Patch
@reown/appkit-polyfills Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-ui Patch
@reown/appkit-wallet Patch
@reown/appkit-wallet-button Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Feb 12, 2025

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

Name Status Preview Comments Updated (UTC)
appkit-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 12, 2025 10:52am
appkit-ethers5-bera ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 12, 2025 10:52am
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 12, 2025 10:52am
next-wagmi-solana-bitcoin-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 12, 2025 10:52am
9 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-basic-ep ⬜️ Ignored (Inspect) Feb 12, 2025 10:52am
appkit-basic-ep-example ⬜️ Ignored (Inspect) Feb 12, 2025 10:52am
appkit-basic-example ⬜️ Ignored (Inspect) Feb 12, 2025 10:52am
appkit-basic-sign-client-example ⬜️ Ignored (Inspect) Feb 12, 2025 10:52am
appkit-basic-up-example ⬜️ Ignored (Inspect) Feb 12, 2025 10:52am
appkit-vue-solana ⬜️ Ignored (Inspect) Feb 12, 2025 10:52am
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) Feb 12, 2025 10:52am
ethereum-provider-wagmi-example ⬜️ Ignored (Inspect) Visit Preview Feb 12, 2025 10:52am
vue-wagmi-example ⬜️ Ignored (Inspect) Feb 12, 2025 10:52am

Copy link
Contributor

github-actions bot commented Feb 12, 2025

Warnings
⚠️ File packages/adapters/ethers/src/client.ts contains a KEY or SECRET
⚠️ File packages/adapters/ethers5/src/client.ts contains a KEY or SECRET
⚠️ File packages/appkit-utils/src/solana/SolanaConstantsUtil.ts contains a KEY or SECRET
⚠️ File packages/appkit/src/universal-adapter/client.ts contains a KEY or SECRET

Generated by 🚫 dangerJS against 034a504

Copy link
Contributor

github-actions bot commented Feb 12, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 68.93% 20172 / 29261
🔵 Statements 68.93% 20172 / 29261
🔵 Functions 60.89% 1783 / 2928
🔵 Branches 80.79% 3756 / 4649
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/adapters/ethers/src/client.ts 48.49% 60.31% 63.63% 48.49% 42-105, 121-122, 153-154, 167-190, 193-203, 216-253, 259-260, 267-284, 289-296, 299-321, 324-329, 340-341, 348-353, 367-368, 377-378, 394-404, 407-434, 438-439, 452-453, 455, 477-478, 482, 496, 513-515, 522-526, 572-577, 586-604, 610-611, 615-620, 629-630, 641-642
packages/adapters/ethers5/src/client.ts 47.01% 56.14% 63.63% 47.01% 43-106, 122-123, 154-155, 168-191, 194-204, 217-253, 259-260, 267-284, 289-296, 299-321, 324-329, 339-340, 347-352, 366-367, 376-377, 393-420, 423-433, 437-438, 451-452, 454, 479-480, 484, 498, 515-517, 524-528, 566-580, 588-606, 612-613, 617-622, 631-632, 643-644
packages/appkit-utils/exports/ethers.ts 100% 100% 100% 100%
packages/appkit-utils/src/solana/SolanaConstantsUtil.ts 100% 100% 100% 100%
packages/appkit/src/universal-adapter/client.ts 42.65% 71.42% 25% 42.65% 29-38, 75-108, 111-144, 153-156, 159-163, 166-169, 172-175, 178-181, 184-185, 188-189, 192-193, 196-197, 200-201, 204-211, 224, 228-231, 247-248, 256-30, 76-127
packages/appkit/src/utils/ConstantsUtil.ts 100% 100% 100% 100%
packages/appkit/src/utils/HelpersUtil.ts 93.8% 100% 77.77% 93.8% 40, 45, 48, 101-104, 133
Generated in workflow #9519 for commit 034a504 by the Vitest Coverage Report Action

Copy link

@Dargon789 Dargon789 left a comment

Choose a reason for hiding this comment

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

fix: switchNetwork - invalid chain ID error parsing #3847
changeset:pre #3847

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.

3 participants