Commit 0c7eb2e
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 <[email protected]>
1 parent ce86a74 commit 0c7eb2e
File tree
31 files changed
+1568
-22
lines changed- packages
- examples/packages
- browserify-plugin
- browserify
- snaps-controllers
- src
- multichain
- snaps
- test-utils
- snaps-execution-environments
- src/common
- snaps-rpc-methods
- src
- endowments
- snaps-sdk/src/types/handlers
- snaps-simulation/src/methods
- snaps-utils
- src
- manifest
31 files changed
+1568
-22
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
6 | 6 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
0 commit comments