Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion CAIPs/caip-285.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
caip: 285
title: JSON-RPC Method for Revoking Session Authorizations
author: Alex Donesky (@adonesky1)
author: Alex Donesky (@adonesky1), João Carlos (@ffmcgee725)
discussions-to: https://github.com/ChainAgnostic/CAIPs/pull/285/files
status: Draft
type: Standard
Expand Down Expand Up @@ -33,6 +33,7 @@ otherwise, an appropriate error message is sent.
**Parameters:**

- `sessionId` (string, optional): The session identifier.
- `scopes` (string[], optional): Scopes to be revoked if a partial revoke is intended instead of a full permission revoke.

### Request

Expand Down Expand Up @@ -65,6 +66,26 @@ An example of a successful response follows:
}
```

### Extended Usage: partial revokes via `wallet_revokeSession`

When the optional `scopes` parameter is passed, the `wallet_revokeSession` method MUST partially revoke the active session.

```jsonc
{
"id": 1,
"jsonrpc": "2.0",
"method": "wallet_revokeSession",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pedrouid made a good point that this doesn't map well to CRUD -- reduceSession, maybe? separate CAIP so as not to add a MUST? non blocking, just ideas to discuss at next call without a full agenda

"params": {
"scopes": ["eip155:1", "eip155:10"]
}
}
```

The wallet SHOULD ignore any scopes that do not exist in the active session.
This parameter is optional, so if it is not present in the request, the wallet MUST allow the request to follow through as usual, fully revoking the active session.

If after a partial revoke, no scopes exist in the active session, the wallet SHOULD proceed with a full session revoke.

### Failure States

The response MUST NOT be a JSON-RPC success result in any of the following failure states.
Expand Down