Skip to content

Commit

Permalink
Document allowedOrigins caveat for endowment:rpc (MetaMask#1042)
Browse files Browse the repository at this point in the history
  • Loading branch information
Montoya authored Dec 6, 2023
1 parent 690b2d7 commit 95e4221
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions snaps/reference/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,29 @@ Specify this permission in the manifest file as follows:
}
```

Alternatively, you can specify the caveat `allowedOrigins` to restrict requests to specific domains or Snap IDs.
Calls from any other origins will be rejected.

Specify this caveat in the manifest file as follows:

```json
{
"initialPermissions": {
"endowment:rpc": {
"allowedOrigins": [
"metamask.io",
"consensys.io",
"npm:@metamask/example-snap"
]
}
}
}
```

:::note
If you specify `allowedOrigins`, you should not specify `dapps` or `snaps`.
:::

### endowment:transaction-insight

To provide transaction insights, a Snap must request the `endowment:transaction-insight` permission.
Expand Down

0 comments on commit 95e4221

Please sign in to comment.