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

Implement routing logic and endowment for SIP-26 #2898

Closed
FrederikBolding opened this issue Nov 20, 2024 · 0 comments · Fixed by #2875
Closed

Implement routing logic and endowment for SIP-26 #2898

FrederikBolding opened this issue Nov 20, 2024 · 0 comments · Fixed by #2875
Assignees

Comments

@FrederikBolding
Copy link
Member

FrederikBolding commented Nov 20, 2024

Following the merge of SIP-26, we should implement an RPC router and the onProtocolRequest endowment/export as per the agreed specification: https://metamask.github.io/SIPs/SIPS/sip-26

@FrederikBolding FrederikBolding self-assigned this Nov 20, 2024
FrederikBolding added a commit that referenced this issue Jan 31, 2025
…2875)

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 calling `MultichainRouter.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:
```json5
"initialPermissions": {
  "endowment:protocol": {
    "scopes": {
      "<caip2_chainId>": {
        "methods": [
          // List of supported methods
        ],
        "notifications": [
          // List of supported notifications
        ]
      }
    }
  }
}
```

This implementation follows https://metamask.github.io/SIPs/SIPS/sip-26

Closes #2898

---------

Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant