Commit 1f4fc7a
authored
feat: Add WebSockets support (#3450)
Implements the rewritten SIP-20 to enable WebSocket support in Snaps.
WebSockets are supported via the `WebSocketService` which runs in the
client and handles open WebSocket connections for the Snap. The Snap is
notified of WebSocket events via `onWebSocketEvent` and is notified of
`open`, `close` and `message`. Messages can also be sent from the Snap
using `snap_sendWebSocketMessage`. Both string and binary payloads are
allowed.
All of the new RPC methods are gated on `endowment:network-access`,
which is also the permission required to expose `onWebSocketEvent`.1 parent fece6fe commit 1f4fc7a
File tree
39 files changed
+2171
-21
lines changed- packages
- snaps-controllers
- src
- snaps
- test-utils
- websocket
- snaps-execution-environments
- src/common
- snaps-rpc-methods
- src
- endowments
- permitted
- snaps-sdk/src/types
- handlers
- methods
- snaps-utils/src
- handlers
- manifest/validators
39 files changed
+2171
-21
lines changed| 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 | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6940 | 6940 | | |
6941 | 6941 | | |
6942 | 6942 | | |
6943 | | - | |
| 6943 | + | |
6944 | 6944 | | |
6945 | 6945 | | |
6946 | 6946 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
| |||
962 | 967 | | |
963 | 968 | | |
964 | 969 | | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
0 commit comments