-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Added multichain api notifications #25869
Conversation
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. |
app/scripts/lib/multichain-api/multichainSubscriptionManager.ts
Outdated
Show resolved
Hide resolved
app/scripts/lib/multichain-api/multichainSubscriptionManager.ts
Outdated
Show resolved
Hide resolved
app/scripts/lib/multichain-api/multicainSubscriptionManager.test.ts
Outdated
Show resolved
Hide resolved
app/scripts/lib/multichain-api/multicainSubscriptionManager.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Added multichain API notifications to enhance the handling of notifications across multiple blockchain networks.
- New Unit Tests: Added
app/scripts/lib/multichain-api/multicainSubscriptionManager.test.ts
forMultichainSubscriptionManager
andcreateMultichainMiddlewareManager
. - Subscription Manager: Introduced
app/scripts/lib/multichain-api/multichainSubscriptionManager.ts
for managing multichain subscriptions and middleware. - Provider Authorization: Updated
app/scripts/lib/multichain-api/provider-authorize.js
to handle multichain API notifications with new logging and scope management. - Request Handling: Modified
app/scripts/lib/multichain-api/provider-request.js
to include ascope
parameter for determining network client ID. - Notification Support: Added
eth_subscription
to supported notifications inapp/scripts/lib/multichain-api/scope/supported.ts
.
8 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
The recent changes focus on enhancing the multichain API notifications and managing subscriptions across different blockchain networks.
- Subscription Management: Introduced
MultichainSubscriptionManager
inapp/scripts/lib/multichain-api/multichainSubscriptionManager.ts
for handling subscriptions and notifications. - Debug Logging: Added console logs in
createMultichainMiddlewareManager
for debugging, which should be replaced with a proper logging mechanism before production. - Chain Change Notifications: Commented out
_notifyChainChange
inapp/scripts/metamask-controller.js
, potentially affecting chain change notifications. Thorough testing is recommended to ensure no regressions.
2 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings
app/scripts/lib/multichain-api/multichainSubscriptionManager.ts
Outdated
Show resolved
Hide resolved
app/scripts/lib/multichain-api/multichainSubscriptionManager.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
The recent changes introduce multichain API notifications, enhancing the MetaMask extension's ability to handle notifications across different blockchain networks.
- New Class and Tests: Added
app/scripts/lib/multichain-api/MultichainMiddlewareManager.ts
andMultichainMiddlewareManager.test.ts
to manage and test JSON-RPC middleware for different scopes and domains. - Subscription Management: Updated
app/scripts/lib/multichain-api/multichainSubscriptionManager.ts
to improve multichain API notifications, including a newSubscriptionManager
type and better subscription handling. - Refactored Tests: Renamed and refocused
app/scripts/lib/multichain-api/MultichainSubscriptionManager.test.ts
to exclusively testMultichainSubscriptionManager
. - Logging Enhancements: Added error logging in
app/scripts/lib/multichain-api/provider-authorize.js
for better debugging during the authorization process. - Controller Initialization: Simplified initialization in
app/scripts/metamask-controller.js
by directly instantiatingMultichainMiddlewareManager
and updating import paths.
6 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
app/scripts/lib/multichain-api/MultichainMiddlewareManager.test.ts
Outdated
Show resolved
Hide resolved
app/scripts/lib/multichain-api/MultichainMiddlewareManager.test.ts
Outdated
Show resolved
Hide resolved
app/scripts/lib/multichain-api/multichainSubscriptionManager.ts
Outdated
Show resolved
Hide resolved
app/scripts/lib/multichain-api/MultichainSubscriptionManager.test.ts
Outdated
Show resolved
Hide resolved
…name for spy in middleware tests
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is network access?This module accesses the network. Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use. Take a deeper look at the dependencyTake 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 packageIf 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 riskTo ignore an alert, reply with a comment starting with
|
@metamaskbot update-policies |
Policies updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Lets merge it
Description
Added multichain api notifications
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist