Commit ca683e8
authored
fix: update tokens controllers to use selectedAccountId instead of selectedAddress (#4219)
## Explanation
This PR updates the `selectedAccount` to `selectedAccountId` in the
token controllers
## References
Fixes MetaMask/accounts-planning#381
## Changelog
### `@metamask/assets-controllers`
- **BREAKING**: `TokenBalancesController` update
`PreferencesConrtollerGetStateAction` to
`AccountsControllerGetSelectedAccountAction`
- **BREAKING**: `TokenDetectionController` change `selectedAddress` to
`selectedAccountId`
- **ADDED**: `TokenDetectionController` add `getAccountAction`
- **BREAKING**: `TokenRatesController` change `selectedAddress` to
`selectedAccountId`
- **BREAKING**: `onPreferencesStateChange` arg removed and
`getInternalAccount` and `onSelectedAccountChange` added in
`TokenRatesController`
- **ADDED**: `getAccountAction` added in`TokensController`
- **BREAKING**: Changed `selectedAddress` to `selectedAccountId` and
`PreferencesControllerStateChangeEvent` to
`AccountsControllerSelectedEvmAccountChangeEvent` in the
`TokensController`
- **ADDED**: `getAccountAction` added in`TokensController`
## 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 highlighted breaking changes using the "BREAKING" category
above as appropriate1 parent d51609f commit ca683e8
File tree
8 files changed
+1138
-633
lines changed- packages/assets-controllers/src
8 files changed
+1138
-633
lines changedLines changed: 172 additions & 137 deletions
Large diffs are not rendered by default.
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
205 | | - | |
206 | | - | |
| 204 | + | |
| 205 | + | |
207 | 206 | | |
208 | 207 | | |
209 | 208 | | |
210 | 209 | | |
211 | 210 | | |
212 | 211 | | |
213 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
214 | 216 | | |
215 | 217 | | |
216 | 218 | | |
| |||
0 commit comments