Skip to content

Conversation

hmalik88
Copy link
Contributor

@hmalik88 hmalik88 commented Aug 27, 2025

Explanation

EvmAccountProvider

  1. discoverAndCreateAccounts method added to perform discovery and return the created account. The method will add an account to the keyring and remove it (except for groupIndex 0) if it is found there is no transaction history.
  2. getEvmProvider method was added to grab the provider from the NetworkController.

SolAccountProvider

  1. discoverAndCreateAccounts method added to perform discovery and return the created account. This method does not create an account if discovery yields no accounts.
  2. Added a #getKeyringClientFromSnapId method that initializes the keyring client into a newly added #client property.

MultichainAccountWallet

  1. discoverAndCreateAccounts method added to act as an orchestrator for provider discovery. This method "fast-forwards" lagging providers to the highest groupIndex being processed by a provider. At the end of discovery, it will sync the wallet and then align all created groups. The method returns only the discovered accounts (for consumption of the clients' metrics).

References

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

fabiobozzo
fabiobozzo previously approved these changes Aug 29, 2025
Copy link
Contributor

@fabiobozzo fabiobozzo left a comment

Choose a reason for hiding this comment

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

LGTM

@hmalik88 hmalik88 changed the title feat: add account discovery to MultichainAccountWallet and providers and add createMultichainAccountWallet to the service feat: add account discovery to MultichainAccountWallet and providers Sep 5, 2025
@hmalik88 hmalik88 merged commit 7ce44d7 into main Sep 5, 2025
239 checks passed
@hmalik88 hmalik88 deleted the hm/mul-345 branch September 5, 2025 17:46
Kriys94 pushed a commit that referenced this pull request Sep 8, 2025
#6397)

## Explanation

### EvmAccountProvider
1. `discoverAndCreateAccounts` method added to perform discovery and
return the created account. The method will add an account to the
keyring and remove it (except for `groupIndex` 0) if it is found there
is no transaction history.
2. `getEvmProvider` method was added to grab the provider from the
`NetworkController`.

### SolAccountProvider
1. `discoverAndCreateAccounts` method added to perform discovery and
return the created account. This method does not create an account if
discovery yields no accounts.
2. Added a `#getKeyringClientFromSnapId` method that initializes the
keyring client into a newly added `#client` property.

### MultichainAccountWallet
1. `discoverAndCreateAccounts` method added to act as an orchestrator
for provider discovery. This method "fast-forwards" lagging providers to
the highest `groupIndex` being processed by a provider. At the end of
discovery, it will sync the wallet and then align all created groups.
The method returns only the discovered accounts (for consumption of the
clients' metrics).

## References

N/A

## 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

---------

Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants