-
-
Notifications
You must be signed in to change notification settings - Fork 253
add refresh events to account tracker controller #6903
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
add refresh events to account tracker controller #6903
Conversation
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
) as ChecksumAddress, | ||
queryAllAccounts, | ||
selectedAccount, | ||
allAccounts, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to make any further changes here in case we have to end up cherrypicking this as a patch, but we should not defer this logic to the fetchers.
The fetchers should receive just an array of chainIds and an array of addresses (which could be one address). The only thing both of them do internally is use allAccounts
(only the address) or selectedAccount
depending on whether queryAllAccounts
is true or false.
Explanation
Adds single address balance refresh based on transaction events to make up for removing them on extension client side during migration.
Previews:
MetaMask/metamask-extension#36808
MetaMask/metamask-mobile#21465
References
Checklist
Note
AccountTrackerController now subscribes to transaction events to trigger targeted (single-address) balance refreshes, with internal refresh refactor and accompanying tests; changelog updated (breaking note).
TransactionController:unapprovedTransactionAdded
andTransactionController:transactionConfirmed
to refresh balances.#refreshAddress
and refactorrefresh
into#refreshAccounts
for single-address updates; passqueryAllAccounts
, checksumselectedAccount
, andallAccounts
to fetchers.AllowedEvents
to include transaction events; wire subscriptions in constructor.packages/assets-controllers/src/AccountTrackerController.test.ts
):messenger
and allow new events.[Unreleased]
.Written by Cursor Bugbot for commit 8ccaf66. This will update automatically on new commits. Configure here.