Skip to content

Conversation

ccharly
Copy link
Contributor

@ccharly ccharly commented Aug 6, 2025

Explanation

Bumping all accounts-related dependencies.

References

N/A

Changelog

N/A

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, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@ccharly ccharly self-assigned this Aug 6, 2025
Copy link

socket-security bot commented Aug 6, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​metamask/​keyring-internal-api@​8.0.0991007195100
Updated@​metamask/​account-api@​0.7.0 ⏵ 0.9.097 +110073 +397 +1100
Added@​metamask/​keyring-api@​20.0.01001001009850
Added@​metamask/​eth-snap-keyring@​16.0.099100929850

View full report

@ccharly ccharly marked this pull request as ready for review August 6, 2025 13:47
@ccharly ccharly requested review from a team as code owners August 6, 2025 13:47
Comment on lines 188 to +189
select(selector: AccountSelector<Account>): Account[] {
return this.getAccounts().filter((account) => {
let selected = true;

if (selector.id) {
selected &&= account.id === selector.id;
}
if (selector.address) {
selected &&= account.address === selector.address;
}
if (selector.type) {
selected &&= account.type === selector.type;
}
if (selector.methods !== undefined) {
selected &&= selector.methods.some((method) =>
account.methods.includes(method),
);
}
if (selector.scopes !== undefined) {
selected &&= selector.scopes.some((scope) => {
return (
// This will cover specific EVM EOA scopes as well.
isScopeEqualToAny(scope, account.scopes)
);
});
}

return selected;
});
return select(this.getAccounts(), selector);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and clean replacement! 👏

Although that name clash select function calls select selector from account-api really makes my Go dev's eyes bleed 😂 ahaha

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes... I wanted to avoid having getWhatever in the name for this, and IDK if that was a good idea or not, but it felt "clean and concise" that way 😄

import type { Bip44Account } from '@metamask/account-api';
import { isBip44Account } from '@metamask/account-api';
import type { InternalAccount } from '@metamask/keyring-internal-api';
import type { KeyringAccount } from '@metamask/keyring-api';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remind me (just for me): KeyringAccount is a specialized InternalAccount or... viceversa? 😳

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KeyringAccount is the most "basic" account representation we have (apart from "raw addresses" ofc 🙃)

But the the keyring API is using this type to represent account (which is only used account management Snaps for the moment). It will be used more widely once we introduce the unified keyring API for all keyrings (see this ADR).

InternalAcccount are basically KeyringAccount & { metadata: { ... } } which can includes various timestamps, account names, keyring info, etc...

With the new shift to the new account model, the AccountTreeController introduced new kind of metadata on wallets and groups, which will probably (in the long run) allow us to get rid of InternalAccount entirely 🤞.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I remember! It's one of the first topics we discussed, ever. I'm connecting all the dots now, thank you for the refresher!

fabiobozzo
fabiobozzo previously approved these changes Aug 6, 2025
infiniteflower
infiniteflower previously approved these changes Aug 6, 2025
Copy link
Contributor

@Prithpal-Sooriya Prithpal-Sooriya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for Asset related changes.

@ccharly ccharly enabled auto-merge (squash) August 6, 2025 16:08
@ccharly ccharly merged commit 280ad45 into main Aug 6, 2025
223 checks passed
@ccharly ccharly deleted the chore/bump-accounts-deps branch August 6, 2025 16:31
amitabh94 added a commit that referenced this pull request Aug 7, 2025
…and dependency bump

### Added
- Comprehensive balance selectors for multichain account groups and wallets ([#6235](#6235))

### Changed
- Bump `@metamask/keyring-api` from `^19.0.0` to `^20.0.0` ([#6248](#6248))
@amitabh94 amitabh94 mentioned this pull request Aug 7, 2025
4 tasks
amitabh94 added a commit that referenced this pull request Aug 8, 2025
## Explanation

Bumps @metamask/assets-controllers to 73.1.0 to add comprehensive
balance selectors for multichain account groups and wallets, along with
dependency updates and bug fixes.

## References

- [#6235](#6235) - Comprehensive
balance selectors for multichain account groups and wallets
- [#6248](#6248) - Bump keyring-api
dependency
- [#6242](#6242) - Fix
DeFiPositionsController polling rate
- [#6250](#6250) - Fix
AccountTrackerController cache invalidation

## 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, highlighting breaking changes as necessary
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants