feat: make SafeEventEmitterProvider compatible with eth req libraries
Explanation
- Aligning SafeEventEmitterProvider to EIP-1193 by adding a
requestmethod and deprecatingsendAsync(which aren't part of the spec) - Ensuring that
requestdoes not requireidandjsonrpcto be set, filling them in if they are missing
References
Fixes #4095
Changelog
@metamask/eth-json-rpc-provider
- ADDED: request method type compatible with ethereum request libraries.
-
CHANGED: markes sendAsync as
deprecatedfor usage in favor ofrequest.
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
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎
To accept the risk, merge this PR and you will not be notified again.
| Alert | Package | Note | Source | CI |
|---|---|---|---|---|
| Deprecated | npm/[email protected] |
| 🚫 | |
| Install scripts | npm/[email protected] |
| 🚫 |
Next steps
What is a deprecated package?
The maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Research the state of the package and determine if there are non-deprecated versions that can be used, or if it should be replaced with a new, supported solution.
What is an install script?
Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.
Take a deeper look at the dependency
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 [AT] socket [DOT] dev.
Remove the package
If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.
Mark a package as acceptable risk
To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all
@SocketSecurity ignore npm/[email protected]
@cryptodev-2s Hey! I still think we ought to add smoke tests so that we can be confident that these changes fix the compatibility issues we have with the various Ethereum libraries. I outlined ideas for this in the comment above. What are your thoughts?
@cryptodev-2s Hey! I still think we ought to add smoke tests so that we can be confident that these changes fix the compatibility issues we have with the various Ethereum libraries. I outlined ideas for this in the comment above. What are your thoughts? @mcmire yes make sense I will add smoke tests as outlined in your comment
One more comment from me above and then I think we may be good to go on this.
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
| Package | New capabilities | Transitives | Size | Publisher |
|---|---|---|---|---|
| npm/@metamask/[email protected] | None | +6 |
1.46 MB | lgbot |
| npm/@metamask/[email protected] | Transitive: environment, eval, filesystem | +6 |
2.94 MB | lgbot |
| npm/@metamask/[email protected] | None | +3 |
92.5 kB | metamaskbot |
| npm/[email protected] | network | +5 |
19 MB | ricmoo |
🚮 Removed packages: npm/[email protected]