Skip to content
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

feat!: add scopes field to KeyringAccount #5066

Merged
merged 7 commits into from
Jan 9, 2025
Merged

Conversation

ccharly
Copy link
Contributor

@ccharly ccharly commented Dec 13, 2024

Explanation

Testing the new scopes field for KeyringAccount

References

Changelog

@metamask/accounts-controller

  • CHANGED: Bump keyring-api to ^13.0.0
  • CHANGED: Bump keyring-internal-api to ^1.1.0
  • CHANGED: Add new scopes field to InternalAccount
    • This new field will automatically defaults to eip155 (CAIP-2 chain ID namespace for EVM) for newly created EOA accounts (both Snap and "normal" accounts).

@metamask/assets-controllers

  • CHANGED: Bump keyring-internal-api to ^1.1.0

@metamask/chain-controller

  • CHANGED: Bump keyring-internal-api to ^1.1.0

@metamask/keyring-controller

  • CHANGED: Bump keyring-api to ^13.0.0
  • CHANGED: Bump keyring-internal-api to ^1.1.0
  • CHANGED: Await for generateRandomMnemonic keyring calls
    • Not all keyrings uses an async implementation for this method, but awaiting should cover both (synchronous and asynchronous) cases.
    • This change is required since the bump of @metamask/utils@^11.0.1 that changed the generateRandomMnemonic function signature for the EthKeyring interface (coming from @metamask/keyring-internal-api.

@metamask/profile-sync-controller

  • CHANGED: Bump keyring-api to ^13.0.0
  • CHANGED: Bump keyring-internal-api to ^1.1.0

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 highlighted breaking changes using the "BREAKING" category above as appropriate
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@ccharly
Copy link
Contributor Author

ccharly commented Dec 13, 2024

@metamaskbot publish-preview

@ccharly ccharly changed the title chore: wip feat(keyring-api)!: add scopes field to KeyringAccount Dec 13, 2024
@ccharly ccharly force-pushed the feat/keyring-account-scopes branch from 0a46981 to 28a9753 Compare December 13, 2024 10:53
@ccharly
Copy link
Contributor Author

ccharly commented Dec 13, 2024

@metamaskbot publish-preview

Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/accounts-controller": "20.0.2-preview-28a9753",
  "@metamask-previews/address-book-controller": "6.0.2-preview-28a9753",
  "@metamask-previews/announcement-controller": "7.0.2-preview-28a9753",
  "@metamask-previews/approval-controller": "7.1.1-preview-28a9753",
  "@metamask-previews/assets-controllers": "45.1.2-preview-28a9753",
  "@metamask-previews/base-controller": "7.0.2-preview-28a9753",
  "@metamask-previews/build-utils": "3.0.2-preview-28a9753",
  "@metamask-previews/chain-controller": "0.2.2-preview-28a9753",
  "@metamask-previews/composable-controller": "10.0.0-preview-28a9753",
  "@metamask-previews/controller-utils": "11.4.4-preview-28a9753",
  "@metamask-previews/ens-controller": "15.0.1-preview-28a9753",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-28a9753",
  "@metamask-previews/gas-fee-controller": "22.0.2-preview-28a9753",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-28a9753",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-28a9753",
  "@metamask-previews/keyring-controller": "19.0.2-preview-28a9753",
  "@metamask-previews/logging-controller": "6.0.3-preview-28a9753",
  "@metamask-previews/message-manager": "11.0.3-preview-28a9753",
  "@metamask-previews/multichain": "1.1.2-preview-28a9753",
  "@metamask-previews/name-controller": "8.0.2-preview-28a9753",
  "@metamask-previews/network-controller": "22.1.1-preview-28a9753",
  "@metamask-previews/notification-services-controller": "0.15.0-preview-28a9753",
  "@metamask-previews/permission-controller": "11.0.4-preview-28a9753",
  "@metamask-previews/permission-log-controller": "3.0.2-preview-28a9753",
  "@metamask-previews/phishing-controller": "12.3.1-preview-28a9753",
  "@metamask-previews/polling-controller": "12.0.2-preview-28a9753",
  "@metamask-previews/preferences-controller": "15.0.1-preview-28a9753",
  "@metamask-previews/profile-sync-controller": "3.1.1-preview-28a9753",
  "@metamask-previews/queued-request-controller": "8.0.2-preview-28a9753",
  "@metamask-previews/rate-limit-controller": "6.0.2-preview-28a9753",
  "@metamask-previews/remote-feature-flag-controller": "1.2.0-preview-28a9753",
  "@metamask-previews/selected-network-controller": "20.0.2-preview-28a9753",
  "@metamask-previews/signature-controller": "23.1.0-preview-28a9753",
  "@metamask-previews/transaction-controller": "42.0.0-preview-28a9753",
  "@metamask-previews/user-operation-controller": "21.0.0-preview-28a9753"
}

@ccharly ccharly force-pushed the feat/keyring-account-scopes branch 2 times, most recently from 2a41698 to 808b388 Compare December 13, 2024 11:08
@ccharly ccharly force-pushed the feat/keyring-account-scopes branch 5 times, most recently from 3fcac04 to 21d7074 Compare January 6, 2025 15:18
@ccharly ccharly force-pushed the feat/keyring-account-scopes branch from 21d7074 to fd50073 Compare January 6, 2025 15:44
@ccharly ccharly force-pushed the feat/keyring-account-scopes branch from fd50073 to 865cff8 Compare January 6, 2025 15:59
@ccharly ccharly self-assigned this Jan 6, 2025
@ccharly ccharly marked this pull request as ready for review January 6, 2025 17:11
@ccharly ccharly requested review from a team as code owners January 6, 2025 17:11
@ccharly
Copy link
Contributor Author

ccharly commented Jan 6, 2025

@metamaskbot publish-preview

Copy link
Contributor

github-actions bot commented Jan 6, 2025

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/accounts-controller": "20.0.2-preview-04aeed55",
  "@metamask-previews/address-book-controller": "6.0.2-preview-04aeed55",
  "@metamask-previews/announcement-controller": "7.0.2-preview-04aeed55",
  "@metamask-previews/approval-controller": "7.1.1-preview-04aeed55",
  "@metamask-previews/assets-controllers": "45.1.2-preview-04aeed55",
  "@metamask-previews/base-controller": "7.1.0-preview-04aeed55",
  "@metamask-previews/build-utils": "3.0.2-preview-04aeed55",
  "@metamask-previews/chain-controller": "0.2.2-preview-04aeed55",
  "@metamask-previews/composable-controller": "10.0.0-preview-04aeed55",
  "@metamask-previews/controller-utils": "11.4.4-preview-04aeed55",
  "@metamask-previews/ens-controller": "15.0.1-preview-04aeed55",
  "@metamask-previews/eth-json-rpc-provider": "4.1.7-preview-04aeed55",
  "@metamask-previews/gas-fee-controller": "22.0.2-preview-04aeed55",
  "@metamask-previews/json-rpc-engine": "10.0.2-preview-04aeed55",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.6-preview-04aeed55",
  "@metamask-previews/keyring-controller": "19.0.2-preview-04aeed55",
  "@metamask-previews/logging-controller": "6.0.3-preview-04aeed55",
  "@metamask-previews/message-manager": "11.0.3-preview-04aeed55",
  "@metamask-previews/multichain": "2.0.0-preview-04aeed55",
  "@metamask-previews/name-controller": "8.0.2-preview-04aeed55",
  "@metamask-previews/network-controller": "22.1.1-preview-04aeed55",
  "@metamask-previews/notification-services-controller": "0.15.0-preview-04aeed55",
  "@metamask-previews/permission-controller": "11.0.4-preview-04aeed55",
  "@metamask-previews/permission-log-controller": "3.0.2-preview-04aeed55",
  "@metamask-previews/phishing-controller": "12.3.1-preview-04aeed55",
  "@metamask-previews/polling-controller": "12.0.2-preview-04aeed55",
  "@metamask-previews/preferences-controller": "15.0.1-preview-04aeed55",
  "@metamask-previews/profile-sync-controller": "3.1.1-preview-04aeed55",
  "@metamask-previews/queued-request-controller": "8.0.2-preview-04aeed55",
  "@metamask-previews/rate-limit-controller": "6.0.2-preview-04aeed55",
  "@metamask-previews/remote-feature-flag-controller": "1.2.0-preview-04aeed55",
  "@metamask-previews/selected-network-controller": "20.0.2-preview-04aeed55",
  "@metamask-previews/signature-controller": "23.1.0-preview-04aeed55",
  "@metamask-previews/transaction-controller": "42.1.0-preview-04aeed55",
  "@metamask-previews/user-operation-controller": "21.0.0-preview-04aeed55"
}

@ccharly ccharly changed the title feat(keyring-api)!: add scopes field to KeyringAccount feat!: add scopes field to KeyringAccount Jan 6, 2025
@ccharly ccharly force-pushed the feat/keyring-account-scopes branch 2 times, most recently from 4c331dd to 6c3ef88 Compare January 7, 2025 16:13
@ccharly
Copy link
Contributor Author

ccharly commented Jan 9, 2025

@metamaskbot publish-preview

Copy link
Contributor

github-actions bot commented Jan 9, 2025

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/accounts-controller": "20.0.2-preview-2ebcbae7",
  "@metamask-previews/address-book-controller": "6.0.2-preview-2ebcbae7",
  "@metamask-previews/announcement-controller": "7.0.2-preview-2ebcbae7",
  "@metamask-previews/approval-controller": "7.1.1-preview-2ebcbae7",
  "@metamask-previews/assets-controllers": "45.1.2-preview-2ebcbae7",
  "@metamask-previews/base-controller": "7.1.0-preview-2ebcbae7",
  "@metamask-previews/build-utils": "3.0.2-preview-2ebcbae7",
  "@metamask-previews/chain-controller": "0.2.2-preview-2ebcbae7",
  "@metamask-previews/composable-controller": "10.0.0-preview-2ebcbae7",
  "@metamask-previews/controller-utils": "11.4.4-preview-2ebcbae7",
  "@metamask-previews/ens-controller": "15.0.1-preview-2ebcbae7",
  "@metamask-previews/eth-json-rpc-provider": "4.1.7-preview-2ebcbae7",
  "@metamask-previews/gas-fee-controller": "22.0.2-preview-2ebcbae7",
  "@metamask-previews/json-rpc-engine": "10.0.2-preview-2ebcbae7",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.6-preview-2ebcbae7",
  "@metamask-previews/keyring-controller": "19.0.2-preview-2ebcbae7",
  "@metamask-previews/logging-controller": "6.0.3-preview-2ebcbae7",
  "@metamask-previews/message-manager": "11.0.3-preview-2ebcbae7",
  "@metamask-previews/multichain": "2.0.0-preview-2ebcbae7",
  "@metamask-previews/name-controller": "8.0.2-preview-2ebcbae7",
  "@metamask-previews/network-controller": "22.1.1-preview-2ebcbae7",
  "@metamask-previews/notification-services-controller": "0.15.0-preview-2ebcbae7",
  "@metamask-previews/permission-controller": "11.0.4-preview-2ebcbae7",
  "@metamask-previews/permission-log-controller": "3.0.2-preview-2ebcbae7",
  "@metamask-previews/phishing-controller": "12.3.1-preview-2ebcbae7",
  "@metamask-previews/polling-controller": "12.0.2-preview-2ebcbae7",
  "@metamask-previews/preferences-controller": "15.0.1-preview-2ebcbae7",
  "@metamask-previews/profile-sync-controller": "3.1.1-preview-2ebcbae7",
  "@metamask-previews/queued-request-controller": "8.0.2-preview-2ebcbae7",
  "@metamask-previews/rate-limit-controller": "6.0.2-preview-2ebcbae7",
  "@metamask-previews/remote-feature-flag-controller": "1.2.0-preview-2ebcbae7",
  "@metamask-previews/selected-network-controller": "20.0.2-preview-2ebcbae7",
  "@metamask-previews/signature-controller": "23.2.0-preview-2ebcbae7",
  "@metamask-previews/transaction-controller": "42.1.0-preview-2ebcbae7",
  "@metamask-previews/user-operation-controller": "21.0.0-preview-2ebcbae7"
}

@ccharly ccharly enabled auto-merge (squash) January 9, 2025 14:29
@ccharly ccharly merged commit 70ecb88 into main Jan 9, 2025
232 checks passed
@ccharly ccharly deleted the feat/keyring-account-scopes branch January 9, 2025 14:34
@Prithpal-Sooriya Prithpal-Sooriya mentioned this pull request Jan 10, 2025
4 tasks
PatrykLucka pushed a commit that referenced this pull request Jan 13, 2025
## Explanation

Testing the new `scopes` field for `KeyringAccount`

## References

- MetaMask/accounts#101
- MetaMask/metamask-extension#29195

## Changelog

### `@metamask/accounts-controller`

- **CHANGED**: Bump `keyring-api` to `^13.0.0`
- **CHANGED**: Bump `keyring-internal-api` to `^1.1.0`
- **CHANGED**: **BREAKING:** Add new `scopes` field to `InternalAccount`
- This new field wil automatically defaults to `eip155` (CAIP-2 chain ID
namespace for EVM) for newly created EOA accounts (both Snap and
"normal" accounts).

### `@metamask/assets-controllers`

- **CHANGED**: Bump `keyring-internal-api` to `^1.1.0`

### `@metamask/chain-controller`

- **CHANGED**: Bump `keyring-internal-api` to `^1.1.0`

### `@metamask/keyring-controller`

- **CHANGED**: Bump `keyring-api` to `^13.0.0`
- **CHANGED**: Bump `keyring-internal-api` to `^1.1.0`
- **CHANGED**: Await for `generateRandomMnemonic` keyring calls
- Not all keyrings uses an `async` implementation for this method, but
`await`ing should cover both (synchronous and asynchronous) cases.
- This change is required since the bump of `@metamask/utils@^11.0.1`
that changed the `generateRandomMnemonic` function signature for the
`EthKeyring` interface (coming from `@metamask/keyring-internal-api`.

### `@metamask/profile-sync-controller`

- **CHANGED**: Bump `keyring-api` to `^13.0.0`
- **CHANGED**: Bump `keyring-internal-api` to `^1.1.0`

## 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 highlighted breaking changes using the "BREAKING" category
above as appropriate
- [ ] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
ccharly added a commit that referenced this pull request Jan 13, 2025
…eature (#5136)

## Explanation

Some accounts packages were not properly versioned when introducing the
new `scopes` feature. This has now been fixed and this PR bumps each
accounts packages accordingly.

## References

- #5066
- MetaMask/accounts#137
- MetaMask/accounts#133

## Changelog

### `@metamask/accounts-controller`

- **CHANGED**: **BREAKING:** Bump `keyring-internal-api` to `^2.0.0`
- **CHANGED**: **BREAKING:** Bump `eth-snap-keyring` to `^8.0.0`

### `@metamask/chain-controller`

- **CHANGED**: **BREAKING:** Bump `keyring-internal-api` to `^2.0.0`

### `@metamask/keyring-controller`

- **CHANGED**: **BREAKING:** Bump `keyring-internal-api` to `^2.0.0`

## 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 highlighted breaking changes using the "BREAKING" category
above as appropriate
- [ ] 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants