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

refactor: split keyring-api #24

Merged
merged 56 commits into from
Dec 6, 2024
Merged

refactor: split keyring-api #24

merged 56 commits into from
Dec 6, 2024

Conversation

ccharly
Copy link
Collaborator

@ccharly ccharly commented Sep 9, 2024

Description

Split of the keyring-api into smaller packages.

Fixes: https://github.com/MetaMask/accounts-planning/issues/729

@ccharly ccharly force-pushed the refactor/split-keyring-api branch 5 times, most recently from 4678982 to 55f15b4 Compare September 10, 2024 19:46
@ccharly
Copy link
Collaborator Author

ccharly commented Sep 10, 2024

@metamaskbot publish-preview

1 similar comment
@ccharly
Copy link
Collaborator Author

ccharly commented Sep 11, 2024

@metamaskbot publish-preview

Copy link

Preview builds have been published. See these instructions (from the core monorepo) for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/keyring-api": "8.1.0-67f3b77",
  "@metamask-previews/eth-hd-keyring": "7.0.1-67f3b77",
  "@metamask-previews/eth-ledger-bridge-keyring": "4.1.1-67f3b77",
  "@metamask-previews/eth-simple-keyring": "6.0.2-67f3b77",
  "@metamask-previews/eth-trezor-keyring": "3.1.0-67f3b77",
  "@metamask-previews/keyring-internal-api": "0.0.1-67f3b77",
  "@metamask-previews/eth-snap-keyring": "4.3.2-67f3b77",
  "@metamask-previews/keyring-snap-client": "0.0.1-67f3b77",
  "@metamask-previews/keyring-snap-sdk": "0.0.1-67f3b77",
  "@metamask-previews/keyring-utils": "0.0.1-67f3b77"
}

@ccharly ccharly force-pushed the refactor/split-keyring-api branch from 67f3b77 to 672cc7b Compare September 11, 2024 16:37
@ccharly
Copy link
Collaborator Author

ccharly commented Sep 11, 2024

@metamaskbot publish-preview

Copy link

Preview builds have been published. See these instructions (from the core monorepo) for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/keyring-api": "8.1.0-672cc7b",
  "@metamask-previews/eth-hd-keyring": "7.0.1-672cc7b",
  "@metamask-previews/eth-ledger-bridge-keyring": "4.1.1-672cc7b",
  "@metamask-previews/eth-simple-keyring": "6.0.2-672cc7b",
  "@metamask-previews/eth-trezor-keyring": "3.1.0-672cc7b",
  "@metamask-previews/keyring-internal-api": "0.0.1-672cc7b",
  "@metamask-previews/eth-snap-keyring": "4.3.2-672cc7b",
  "@metamask-previews/keyring-snap-client": "0.0.1-672cc7b",
  "@metamask-previews/keyring-snap-sdk": "0.0.1-672cc7b",
  "@metamask-previews/keyring-utils": "0.0.1-672cc7b"
}

@ccharly
Copy link
Collaborator Author

ccharly commented Sep 13, 2024

@metamaskbot publish-preview

Copy link

Preview builds have been published. See these instructions (from the core monorepo) for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/keyring-api": "8.1.0-b9b21be",
  "@metamask-previews/eth-hd-keyring": "7.0.1-b9b21be",
  "@metamask-previews/eth-ledger-bridge-keyring": "4.1.1-b9b21be",
  "@metamask-previews/eth-simple-keyring": "6.0.2-b9b21be",
  "@metamask-previews/eth-trezor-keyring": "3.1.0-b9b21be",
  "@metamask-previews/keyring-internal-api": "0.0.1-b9b21be",
  "@metamask-previews/eth-snap-keyring": "4.3.2-b9b21be",
  "@metamask-previews/keyring-snap-client": "0.0.1-b9b21be",
  "@metamask-previews/keyring-snap-sdk": "0.0.1-b9b21be",
  "@metamask-previews/keyring-utils": "0.0.1-b9b21be"
}

Copy link

This PR is marked as stale because it has been open for 60 days with no activity. Please remove the stale label or leave a comment, or it will be closed in 14 days.

@github-actions github-actions bot added the Stale label Nov 18, 2024
@danroc danroc removed the Stale label Nov 25, 2024
@ccharly
Copy link
Collaborator Author

ccharly commented Dec 5, 2024

@metamaskbot publish-preview

@ccharly
Copy link
Collaborator Author

ccharly commented Dec 5, 2024

@metamaskbot publish-preview

Copy link

github-actions bot commented Dec 5, 2024

Preview builds have been published. See these instructions (from the core monorepo) for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/keyring-api": "11.1.0-388ed88",
  "@metamask-previews/eth-hd-keyring": "9.0.0-388ed88",
  "@metamask-previews/eth-ledger-bridge-keyring": "7.0.0-388ed88",
  "@metamask-previews/eth-simple-keyring": "8.0.0-388ed88",
  "@metamask-previews/eth-trezor-keyring": "6.0.0-388ed88",
  "@metamask-previews/keyring-internal-api": "0.0.1-388ed88",
  "@metamask-previews/eth-snap-keyring": "6.0.0-388ed88",
  "@metamask-previews/keyring-snap-client": "0.0.1-388ed88",
  "@metamask-previews/keyring-snap-internal-client": "0.0.1-388ed88",
  "@metamask-previews/keyring-snap-sdk": "0.0.1-388ed88",
  "@metamask-previews/keyring-utils": "0.0.1-388ed88"
}

@ccharly
Copy link
Collaborator Author

ccharly commented Dec 5, 2024

@metamaskbot publish-preview

Copy link

github-actions bot commented Dec 5, 2024

Preview builds have been published. See these instructions (from the core monorepo) for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/keyring-api": "11.1.0-f78dac4",
  "@metamask-previews/eth-hd-keyring": "9.0.0-f78dac4",
  "@metamask-previews/eth-ledger-bridge-keyring": "7.0.0-f78dac4",
  "@metamask-previews/eth-simple-keyring": "8.0.0-f78dac4",
  "@metamask-previews/eth-trezor-keyring": "6.0.0-f78dac4",
  "@metamask-previews/keyring-internal-api": "0.0.1-f78dac4",
  "@metamask-previews/eth-snap-keyring": "6.0.0-f78dac4",
  "@metamask-previews/keyring-snap-client": "0.0.1-f78dac4",
  "@metamask-previews/keyring-snap-internal-client": "0.0.1-f78dac4",
  "@metamask-previews/keyring-snap-sdk": "0.0.1-f78dac4",
  "@metamask-previews/keyring-utils": "0.0.1-f78dac4"
}

@ccharly ccharly enabled auto-merge December 6, 2024 08:55
@ccharly ccharly added this pull request to the merge queue Dec 6, 2024
Merged via the queue into main with commit 0488168 Dec 6, 2024
29 checks passed
@ccharly ccharly deleted the refactor/split-keyring-api branch December 6, 2024 09:09
ccharly added a commit to MetaMask/core that referenced this pull request Dec 11, 2024
)

## Explanation

The `keyring-api` has been split out into multiple smaller packages,
this introduce some breaking changes since some exports have been moved
elsewhere.

This was done to reduce the number of required dependencies for the
`keyring-api`. The `InternalAccount` type (widely used internally by
some controllers) has been moved to a new package:
`@metamask/keyring-internal-api`.

## References

Relates to:
- MetaMask/accounts#24

Basic testing done through the CI + preview builds:
- MetaMask/metamask-extension#28861

## Changelog

### `@metamask/keyring-controller`

- **CHANGED**: Remove use of peer dependency `@metamask/providers`
- **CHANGED**: Bump `@metamask/keyring-api` to `^12.0.0`
- **CHANGED**: Use `@metamask/keyring-internal-api@^1.0.0`

> Even if we are bumping the major of the `keyring-api`, this is not
breaking since all
> types from the split are compatible. The only difference now here is
the `Keyring`
> interface which has a new optional method `listAccountTransactions`,
optional, thus
> non-breaking (and this type is not used there anyway)

### `@metamask/accounts-controller`

- **CHANGED**: Bump `@metamask/keyring-api` to `^12.0.0`
- **CHANGED**: Bump `@metamask/eth-snap-keyring` to `^7.0.0`
- **CHANGED**: Use `@metamask/keyring-internal-api@^1.0.0`

> `eth-snap-keyring` has been bumped to `7.0.0` but this was a mistake
since no breaking changes has been introduced there either.
> The version `6.0.0` also introduces `ts-bridge` builds, but this is
already compatible with this repo, so not breaking here either.

### `@metamask/assets-controllers`

- **CHANGED**: Remove use of `@metamask/keyring-api`
- **CHANGED**: Use `@metamask/keyring-internal-api@^1.0.0`

### `@metamask/chain-controller`

- **CHANGED**: Remove use of `@metamask/keyring-api`
- **CHANGED**: Use `@metamask/keyring-internal-api@^1.0.0`
- **CHANGED**: Use `@metamask/keyring-utils@^1.0.0`

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

- **CHANGED**: Remove use of `@metamask/keyring-api`
- **CHANGED**: Use `@metamask/keyring-internal-api@^1.0.0`

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

3 participants