Add Solana accountChanged event support#5491
Merged
Conversation
4d67a61 to
4001385
Compare
5def1a0 to
06e7371
Compare
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
accountChanged event support
jiexi
reviewed
Mar 20, 2025
packages/chain-agnostic-permission/src/adapters/caip-permission-adapter-session-scopes.test.ts
Show resolved
Hide resolved
jiexi
reviewed
Mar 20, 2025
packages/chain-agnostic-permission/src/adapters/caip-permission-adapter-session-scopes.test.ts
Show resolved
Hide resolved
jiexi
reviewed
Mar 20, 2025
packages/chain-agnostic-permission/src/adapters/caip-permission-adapter-session-scopes.ts
Outdated
Show resolved
Hide resolved
jiexi
reviewed
Mar 20, 2025
packages/chain-agnostic-permission/src/adapters/caip-permission-adapter-session-scopes.ts
Outdated
Show resolved
Hide resolved
jiexi
reviewed
Mar 20, 2025
jiexi
reviewed
Mar 20, 2025
jiexi
reviewed
Mar 20, 2025
jiexi
approved these changes
Mar 20, 2025
ffmcgee725
approved these changes
Mar 21, 2025
4 tasks
github-merge-queue bot
pushed a commit
that referenced
this pull request
Dec 4, 2025
## Explanation Add Tron accountChanged event support, following the previous work done for Solana. ## References Previous PR: #5491 ## Changelog ### @metamask/chain-agnostic-permission - ADDED: Added `TronAccountChangedNotifications` property to `KnownSessionProperties` enum ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Add Tron accountChanged session property and update related tests and changelog. > > - **@metamask/chain-agnostic-permission**: > - **Session Properties**: Add `TronAccountChangedNotifications` to `KnownSessionProperties` in `packages/chain-agnostic-permission/src/scope/constants.ts`. > - **Tests**: Update snapshot for `KnownSessionProperties` in `packages/chain-agnostic-permission/src/scope/constants.test.ts`. > - **Changelog**: Document addition in `packages/chain-agnostic-permission/CHANGELOG.md`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit a1bf7bf. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Explanation
Changes in support of the PR here on extension to add support for a
metamask_accountChangednotification via wallet_notify notification☝️ the PR linked includes preview builds of the changes in this PR.
More context from the extension PR description:
References
Ticket: https://github.com/MetaMask/MetaMask-planning/issues/4193
Next PR: MetaMask/metamask-extension#30949
Changelog
@metamask/chain-agnostic-permission
Caip25CaveatValuetype to makesessionPropertiesa required field instead of optionalKnownSessionPropertiesenum with initialSolanaAccountChangedNotificationspropertyisSupportedSessionPropertyfunction to validate session propertiesgetPermittedAccountsForScopeshelper function to get permitted accounts for specific scopes@metamask/multichain-api-middleware
MultichainApiNotificationsenum to standardize notification method namesChecklist