Skip to content

feat: add ChainController#4227

Merged
ccharly merged 52 commits intomainfrom
feature/chain-controller
May 20, 2024
Merged

feat: add ChainController#4227
ccharly merged 52 commits intomainfrom
feature/chain-controller

Conversation

@ccharly
Copy link
Copy Markdown
Contributor

@ccharly ccharly commented Apr 29, 2024

Explanation

This new controller will be responsible of exposing Snaps that implement the newly defined Chain API.

This controller also implements the chain API itself.

Reference: https://github.com/MetaMask/chain-api/

Changelog

@metamask/chain-controller

  • Added: New ChainController: exposes/interacts with chain API providers

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

@socket-security
Copy link
Copy Markdown

socket-security bot commented Apr 29, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

@ccharly ccharly force-pushed the feature/chain-controller branch from 8fd62cf to 395a3c3 Compare May 2, 2024 17:16
@ccharly ccharly force-pushed the feature/chain-controller branch from ea51726 to 6165cd2 Compare May 2, 2024 20:14
@ccharly ccharly marked this pull request as ready for review May 2, 2024 21:06
@ccharly ccharly requested a review from a team May 2, 2024 21:06
Copy link
Copy Markdown
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Hello! I am not sure whether more work was planned for this PR, but I made some suggestions based on how we've written controllers and tests for controllers in other places. One question I have is whether ChainController needs to be a controller? I didn't notice any state being set, but perhaps that was just left out for now.

@ccharly
Copy link
Copy Markdown
Contributor Author

ccharly commented May 14, 2024

@mcmire I did update the README, but I had to hack the script locally because it was removing the accounts-controller from the README because of the .slice(1) here.

I didn't want to fix this in this PR, cause I'm not sure it's still required or not.

@ccharly
Copy link
Copy Markdown
Contributor Author

ccharly commented May 14, 2024

I've added the DO-NOT-MERGE label, cause I've added skipLibCheck=true for tsbuild temporarily, otherwise the CI complains (something the jsx-runtime, we faced that in another PR and that might be related to some Snaps dependencies, I'll wait for more info on this before removing it from the PR)

@socket-security
Copy link
Copy Markdown

socket-security bot commented May 15, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@metamask/chain-api@0.0.1 None +1 229 kB metamaskbot
npm/@metamask/chain-controller@0.0.0-use.local None 0 0 B

View full report↗︎

@ccharly
Copy link
Copy Markdown
Contributor Author

ccharly commented May 16, 2024

Removing the DO-NOT-MERGE label for now, to have a successful CI and allow preview builds

@ccharly
Copy link
Copy Markdown
Contributor Author

ccharly commented May 16, 2024

@metamaskbot publish-preview

@github-actions
Copy link
Copy Markdown
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": "14.0.0-preview-699063fc",
  "@metamask-previews/address-book-controller": "4.0.1-preview-699063fc",
  "@metamask-previews/announcement-controller": "6.1.0-preview-699063fc",
  "@metamask-previews/approval-controller": "6.0.2-preview-699063fc",
  "@metamask-previews/assets-controllers": "29.0.0-preview-699063fc",
  "@metamask-previews/base-controller": "5.0.2-preview-699063fc",
  "@metamask-previews/build-utils": "2.0.1-preview-699063fc",
  "@metamask-previews/chain-controller": "0.0.0-preview-699063fc",
  "@metamask-previews/composable-controller": "6.0.1-preview-699063fc",
  "@metamask-previews/controller-utils": "9.1.0-preview-699063fc",
  "@metamask-previews/ens-controller": "10.0.1-preview-699063fc",
  "@metamask-previews/eth-json-rpc-provider": "3.0.2-preview-699063fc",
  "@metamask-previews/gas-fee-controller": "15.1.2-preview-699063fc",
  "@metamask-previews/json-rpc-engine": "8.0.2-preview-699063fc",
  "@metamask-previews/json-rpc-middleware-stream": "7.0.1-preview-699063fc",
  "@metamask-previews/keyring-controller": "16.0.0-preview-699063fc",
  "@metamask-previews/logging-controller": "3.0.1-preview-699063fc",
  "@metamask-previews/message-manager": "8.0.2-preview-699063fc",
  "@metamask-previews/name-controller": "6.0.1-preview-699063fc",
  "@metamask-previews/network-controller": "18.1.0-preview-699063fc",
  "@metamask-previews/notification-controller": "5.0.1-preview-699063fc",
  "@metamask-previews/permission-controller": "9.0.2-preview-699063fc",
  "@metamask-previews/permission-log-controller": "2.0.1-preview-699063fc",
  "@metamask-previews/phishing-controller": "9.0.2-preview-699063fc",
  "@metamask-previews/polling-controller": "6.0.2-preview-699063fc",
  "@metamask-previews/preferences-controller": "11.0.0-preview-699063fc",
  "@metamask-previews/profile-sync-controller": "0.0.0-preview-699063fc",
  "@metamask-previews/queued-request-controller": "0.10.0-preview-699063fc",
  "@metamask-previews/rate-limit-controller": "5.0.1-preview-699063fc",
  "@metamask-previews/selected-network-controller": "13.0.0-preview-699063fc",
  "@metamask-previews/signature-controller": "16.0.0-preview-699063fc",
  "@metamask-previews/transaction-controller": "29.0.0-preview-699063fc",
  "@metamask-previews/user-operation-controller": "10.0.0-preview-699063fc"
}

@ccharly ccharly force-pushed the feature/chain-controller branch from 2958fdb to 0b1caeb Compare May 17, 2024 13:03
@ccharly ccharly force-pushed the feature/chain-controller branch from 0b1caeb to 61ff417 Compare May 17, 2024 13:14
@mcmire
Copy link
Copy Markdown
Contributor

mcmire commented May 17, 2024

@ccharly Thank you for the changes! I agree it looks a lot better. Nothing jumps out at me, so feel free to get approval from your team and continue on with this PR :)

gantunesr
gantunesr previously approved these changes May 17, 2024
Copy link
Copy Markdown
Member

@gantunesr gantunesr left a comment

Choose a reason for hiding this comment

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

LGTM. Just one minor comment

@ccharly ccharly merged commit 2752a88 into main May 20, 2024
@ccharly ccharly deleted the feature/chain-controller branch May 20, 2024 09:16
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.

5 participants