Skip to content

feat: Add wallet library#8417

Draft
FrederikBolding wants to merge 7 commits intomainfrom
feat/wallet-library
Draft

feat: Add wallet library#8417
FrederikBolding wants to merge 7 commits intomainfrom
feat/wallet-library

Conversation

@FrederikBolding
Copy link
Copy Markdown
Member

Explanation

Feature branch. WIP.

References

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
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@socket-security
Copy link
Copy Markdown

socket-security bot commented Apr 9, 2026

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

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addeddotenv@​16.6.19910010096100

View full report

Builds and tests pass. All lint issues are fixed except a handful that
are deferred pending future changes.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Moderate risk due to new controller dependencies and changes to
initialization wiring/typing that could affect runtime messaging and
controller lifecycle. Test behavior now depends on external
`INFURA_PROJECT_KEY` and mocked timers, which may introduce
CI/environment sensitivity.
> 
> **Overview**
> **Stabilizes wallet builds/tests by wiring in missing controllers and
config.** The wallet package now depends on additional controllers
(accounts/approval/connectivity/network/remote feature
flags/transaction) and updates TS project references accordingly.
> 
> **Improves runtime/test ergonomics.** Jest loads a local `.env` (with
`.env.example` added and `.env` gitignored), `Wallet` exposes stronger
typed `messenger`/`state` and adds `destroy()` to clean up controller
instances; tests are updated to require `INFURA_PROJECT_KEY`, use fake
timers, and properly teardown the wallet.
> 
> **Tightens initialization typing and controller wiring.** Adds
`initialization/defaults.ts` for inferred
`DefaultInstances`/`DefaultActions`/`DefaultEvents`, introduces
`bindMessengerAction` to preserve action typings, and updates controller
initializers (notably `TransactionController` and
`RemoteFeatureFlagController`) to pass required options and bind
messenger actions safely.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
a652933. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
@socket-security
Copy link
Copy Markdown

Caution

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Action Severity Alert  (click "▶" to expand/collapse)
Block Medium
Network access: npm @metamask/transaction-controller in module globalThis["fetch"]

Module: globalThis["fetch"]

Location: Package overview

From: ?npm/@metamask/transaction-controller@64.1.0

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@metamask/transaction-controller@64.1.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Potential code anomaly (AI signal): npm @metamask/transaction-controller is 75.0% likely to have a medium risk anomaly

Notes: The code performs straightforward signature verification using ethers.js, returning true when the recovered signer matches the provided publicKey. While generally safe, the silent catch and potential mismatch between data formatting and signing process should be addressed to avoid silent failures. Overall, a benign utility with moderate input-format sensitivity.

Confidence: 0.75

Severity: 0.50

From: ?npm/@metamask/transaction-controller@64.1.0

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@metamask/transaction-controller@64.1.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

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.

2 participants