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: update account info for non active chain when accountChanged triggered #3922

Open
wants to merge 3 commits into
base: enes/apkt-2335-add-lab-examples-and-e2e-tests-for-multi-chain-use-cases
Choose a base branch
from

Conversation

enesozturk
Copy link
Contributor

@enesozturk enesozturk commented Feb 26, 2025

Description

There is a case that users might switch account for the non-active chain on AppKit. For example; you've connected with MM to EVM, and Phantom to Bitcoin, then when Bitcoin is active on AppKit, and if user switch account on MetaMask, it's not updating the state on the EVM chain.

This PR introduces changes to accountChanged handler to handle case where the chainNamespace of the listener is not same with the ChainController.state.activeChain. And updates the caipAddress via setCaipAddress method

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
  • 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

changeset-bot bot commented Feb 26, 2025

⚠️ No Changeset found

Latest commit: 6a78302

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

vercel bot commented Feb 26, 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 26, 2025 8:29am
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 26, 2025 8:29am
12 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-basic-ep ⬜️ Ignored (Inspect) Feb 26, 2025 8:29am
appkit-basic-ep-example ⬜️ Ignored (Inspect) Feb 26, 2025 8:29am
appkit-basic-example ⬜️ Ignored (Inspect) Feb 26, 2025 8:29am
appkit-basic-sign-client-example ⬜️ Ignored (Inspect) Feb 26, 2025 8:29am
appkit-basic-up-example ⬜️ Ignored (Inspect) Feb 26, 2025 8:29am
appkit-ethers5-bera ⬜️ Ignored (Inspect) Feb 26, 2025 8:29am
appkit-nansen-demo ⬜️ Ignored (Inspect) Feb 26, 2025 8:29am
appkit-vue-solana ⬜️ Ignored (Inspect) Feb 26, 2025 8:29am
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) Feb 26, 2025 8:29am
ethereum-provider-wagmi-example ⬜️ Ignored (Inspect) Visit Preview Feb 26, 2025 8:29am
next-wagmi-solana-bitcoin-example ⬜️ Ignored (Inspect) Feb 26, 2025 8:29am
vue-wagmi-example ⬜️ Ignored (Inspect) Feb 26, 2025 8:29am

@enesozturk enesozturk changed the base branch from main to enes/apkt-2335-add-lab-examples-and-e2e-tests-for-multi-chain-use-cases February 26, 2025 07:51
Copy link
Contributor

Warnings
⚠️ File packages/appkit/src/client.ts contains a KEY or SECRET

Generated by 🚫 dangerJS against 55c4892

Copy link
Contributor

@tomiir
Copy link
Collaborator

tomiir commented Feb 26, 2025

Please do not merge until 1.6.9 is out

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.

2 participants