Skip to content

Commit

Permalink
Removed Caveat examples
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejonas committed Nov 17, 2023
1 parent da0ee61 commit 6a41832
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions MIPs/mip-x.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ By implementing wallet_revokePermissions, we achieve feature parity with traditi


# Proposal
The `wallet_revokePermissions` method is proposed as a new JSON-RPC feature for MetaMask, aimed at giving users more granular control over permission management. With this method, users can can revoke permissions for the specified permissions and caveats provided.
The `wallet_revokePermissions` method is proposed as a new JSON-RPC feature for MetaMask, aimed at giving users more granular control over permission management. With this method, users can can revoke permissions for the specified permission(s).

The method signature will be as follows:

Expand All @@ -36,46 +36,30 @@ await window.ethereum.request({
"method": "wallet_revokePermissions",
"params": [
{
"baz": {
"caveats": [
{
"type": "foo",
"value": "bar"
}
]
}
"<permission>": {}
}
]
});
```

# Usage Example
```js
// Request to revoke permissions for a single address (disconnect a user's account)
// revoke eth_account permission for the dApp
await window.ethereum.request({
"method": "wallet_revokePermissions",
"params": [
{
"eth_accounts": {
"caveats": [
{
"type": "restrictReturnedAccounts",
"value": [
"0x36Cad5E14C0a845500E0aDA68C642d254BE8d538"
]
}
],
}
"eth_accounts": {}
}
]
});

// revoke eth_account permission for the dApp
// revoke snap_dialog permission for the dApp
await window.ethereum.request({
"method": "wallet_revokePermissions",
"params": [
{
"eth_accounts": {}
"snap_dialog": {}
}
]
});
Expand All @@ -84,7 +68,7 @@ await window.ethereum.request({
The proposed changes have been implemented in the following PR against the `MetaMask/api-specs` repo: https://github.com/MetaMask/api-specs/pull/145

## Caveats
The implementation of `wallet_revokePermissions` means more granular control over user permissions and, subsequently, more combinations of permissions that can be revoked. This increases the scope of testing to ensure that there are no edge cases that haven't been considered, or bugs.
Adding Caveats to the implementation of `wallet_revokePermissions` means more granular control over user permissions and, subsequently, more combinations of permissions that can be revoked. This increases the scope of implementation so it will not be supported in the initial implementation.

## Implementation
There is a [PR](https://github.com/MetaMask/core/pull/1889) open against the `MetaMask/core` repo that implements the proposed changes.
Expand Down

0 comments on commit 6a41832

Please sign in to comment.