You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: changes to AccountTrackerController to enable migration in extension (#6938)
## Explanation
<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:
* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->
Adds optional callback to disable fetching balances in
AccountTrackerController.
Attempts to refresh balance when a network is added and when the keyring
is unlocked.
## References
<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?
For example:
* Fixes #12345
* Related to #67890
-->
* Related to https://consensyssoftware.atlassian.net/browse/ASSETS-1368
## Checklist
- [X] I've updated the test suite for new or updated code as appropriate
- [X] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [X] 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),
highlighting breaking changes as necessary
- [X] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds optional fetchingEnabled gate, refreshes on networkAdded/unlock,
and updates tx handlers to refresh both from/to addresses via new
refreshAddresses; updates tests and changelog with breaking notes.
>
> - **AccountTrackerController**:
> - Add optional `fetchingEnabled` constructor callback; `refresh`
short-circuits when disabled.
> - Subscribe to `NetworkController:networkAdded` and
`KeyringController:unlock` to trigger balance refreshes.
> - Update tx event handlers to refresh both `from` and `to` via new
`refreshAddresses`; remove single-address refresh path.
> - Adjust allowed actions/events and inline
`PreferencesController:getState` typing; remove legacy
`AccountsController:selectedAccountChange` reference.
> - **Tests**:
> - Add cases for `networkAdded`, `unlock`, and disabled fetching;
address checksum fixes.
> - **Changelog**:
> - Document breaking event/action changes and the new `fetchingEnabled`
option.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
878ed7e. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
-`TransactionController:unapprovedTransactionAdded'` refetches balances for the transaction from address and network
17
+
-`TransactionController:transactionConfirmed` refetches balances for the transaction from address and network
18
+
- Add optional `fetchingEnabled` callback to `AccountTrackerController` constructor to stop it from fetching balances ([#6938](https://github.com/MetaMask/core/pull/6938))
0 commit comments