-
-
Notifications
You must be signed in to change notification settings - Fork 187
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 Nft Controllers to use selectedAccountId instead of selectedAddress #4221
refactor: update Nft Controllers to use selectedAccountId instead of selectedAddress #4221
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.
|
61ace68
to
dd6e3e8
Compare
dd6e3e8
to
42bbf96
Compare
@@ -314,7 +323,7 @@ export class NftController extends BaseController< | |||
*/ | |||
constructor({ | |||
chainId: initialChainId, | |||
selectedAddress = '', | |||
selectedAccountId = '', |
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.
Similar comment as here — what are your thoughts on using the messenger to get this value from the AccountsController a bit later on in this constructor instead of having the constructor take this argument?
…controllers-to-use-internal-account
…selectedAddress (#4221) This PR updates removes `selectedAddress` and uses the controller messenger to get InternalAccounts in the Nft Controllers Fixes https://github.com/MetaMask/accounts-planning/issues/381 - **BREAKING**: `NftController` constructor argument `selectedAddress` has been removed. - **BREAKING**: `NftController` now requires `AccountsControlelr:get{Account,SelectedAccount}` messenger actions. - **BREAKING**: `NftController` now requires `AccountsController:selectedEvmAccountChange` event. - **BREAKING**: `NftDetectionController` now requires `AccountsControlelr:getSelectedAccount` messenger actions. - [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 highlighted breaking changes using the "BREAKING" category above as appropriate
Explanation
This PR updates removes
selectedAddress
and uses the controller messenger to get InternalAccounts in the Nft ControllersReferences
Fixes https://github.com/MetaMask/accounts-planning/issues/381
Changelog
@metamask/assets-controllers
NftController
constructor argumentselectedAddress
has been removed.NftController
now requiresAccountsControlelr:get{Account,SelectedAccount}
messenger actions.NftController
now requiresAccountsController:selectedEvmAccountChange
event.NftDetectionController
now requiresAccountsControlelr:getSelectedAccount
messenger actions.Checklist