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

chore: remove @metamask/ethjs package #29620

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

cryptodev-2s
Copy link
Contributor

@cryptodev-2s cryptodev-2s commented Jan 9, 2025

Description

This PR introduces the following changes:
• Removes the @metamask/ethjs package.
• Replaces the global variable global.eth with the existing global.ethereumProvider (an instance of StreamProvider from web3-stream-provider package).
• Updates all instances of getCode to use a manual sendAsync call for the eth_getCode method, as StreamProvider does not include getCode, unlike ethjs.
• Substitutes the use of ethjs contracts with Contract instances from the @ethersproject/contracts library.

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@cryptodev-2s cryptodev-2s self-assigned this Jan 9, 2025
@cryptodev-2s cryptodev-2s requested a review from a team as a code owner January 9, 2025 21:38
@cryptodev-2s cryptodev-2s marked this pull request as draft January 9, 2025 21:38
Copy link
Contributor

github-actions bot commented Jan 9, 2025

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@cryptodev-2s
Copy link
Contributor Author

@metamaskbot update-policies

Copy link

socket-security bot commented Jan 9, 2025

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

🚮 Removed packages: npm/@metamask/[email protected], npm/@metamask/[email protected], npm/[email protected]

View full report↗︎

@cryptodev-2s cryptodev-2s changed the title chore: remove ethjs chore: remove @metamask/ethjs package Jan 9, 2025
@metamaskbot
Copy link
Collaborator

Policy update failed. You can review the logs or retry the policy update here

@cryptodev-2s
Copy link
Contributor Author

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated.
👀 Please review the diff for suspicious new powers.

🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff

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