Skip to content

Commit

Permalink
Add docs for endowment:webassembly (MetaMask#691)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikBolding authored Apr 12, 2023
1 parent 090df38 commit 8fe48d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/guide/snaps-development-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ In addition, the following globals are available:
- `setTimeout` / `clearTimeout`
- `setInterval` / `clearInterval`
- `SubtleCrypto`
- `WebAssembly`
- `WebAssembly` (with the `endowment:webassembly` permission)
- `TextEncoder` / `TextDecoder`
- `atob` / `btoa`
- `URL`
Expand Down
4 changes: 4 additions & 0 deletions docs/guide/snaps-permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ Cronjobs are specified as follows:

For snaps that wish to communicate with a node via MetaMask, the snap can request the `endowment:ethereum-provider` permission. This permission will expose the global API `ethereum` to the snap execution environment. Without this permission, this global will not be available. This global is a EIP-1193 provider.

### `endowment:webassembly`

For snaps that wish to leverage `WebAssembly`, the snap can request the `endowment:webassembly` permission. This permission will expose the global `WebAssembly` API to the snap execution environment.

## RPC Permissions

To use any restricted RPC method, a snap will need to request permissions to access that method. For a list of available RPC methods and thus valid RPC permissions see [JSON-RPC API](./snaps-rpc-api.html#restricted-methods).

0 comments on commit 8fe48d3

Please sign in to comment.