-
Notifications
You must be signed in to change notification settings - Fork 570
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
feat: Implement MultichainRouter
and onProtocolRequest
(SIP-26)
#2875
base: main
Are you sure you want to change the base?
Conversation
5321c38
to
cc4715d
Compare
MultichainRoutingController
and onProtocolRequest
(SIP-26)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2875 +/- ##
==========================================
+ Coverage 94.80% 94.87% +0.06%
==========================================
Files 503 506 +3
Lines 10996 11116 +120
Branches 1685 1702 +17
==========================================
+ Hits 10425 10546 +121
+ Misses 571 570 -1 ☔ View full report in Codecov by Sentry. |
9817cfc
to
8b6e698
Compare
MultichainRoutingController
and onProtocolRequest
(SIP-26)MultichainRouter
and onProtocolRequest
(SIP-26)
047e488
to
ba2412d
Compare
0c62acf
to
5e42ee7
Compare
5e42ee7
to
50efb61
Compare
d920440
to
f5690ac
Compare
2800825
to
9c252ea
Compare
); | ||
|
||
if (!selectedAccount) { | ||
throw rpcErrors.invalidParams(); |
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.
Maybe add a more descriptive error message?
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.
Any proposals? 😄
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.
"Unable to get selected account" or something?
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.
Done!
Co-authored-by: Maarten Zuidhoorn <[email protected]>
This PR adds a
MultichainRouter
that can handle routing of non-EVM requests received via the multichain API. The multichain API should integrate this by callingMultichainRouter.handleRequest
for any requests that are not understood by our existing JSON-RPC stack.Additionally this PR implements
onProtocolRequest
, a new handler that Snaps can choose to register if they want to service protocol (non signing) requests for a given set of methods for one or more chains. The endowment is registered as follows:This implementation follows https://metamask.github.io/SIPs/SIPS/sip-26
Closes #2898