Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wallet revoke permissions #145

Merged
merged 12 commits into from
Nov 20, 2023
Merged
129 changes: 95 additions & 34 deletions openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,18 +264,7 @@
"name": "requestPermissionsObject",
"required": true,
"schema": {
"title": "requestPermissionObject",
"type": "object",
"additionalProperties": {
"type": "object",
"additionalProperties": true
},
"properties": {
"eth_accounts": {
"type": "object",
"additionalProperties": true
}
}
"$ref": "#/components/schemas/PermissionObject"
}
}
],
Expand Down Expand Up @@ -308,6 +297,53 @@
}
]
},
{
"name": "wallet_revokePermissions",
"tags": [
{
"$ref": "#/components/tags/MetaMask"
},
{
"$ref": "#/components/tags/Experimental"
}
],
"summary": "Revoke the current dapp permissions.",
"description": "Revoke previously granted permissions for the current dapp identified by origin",
"params": [
{
"name": "revokePermissionObject",
"required": true,
"schema": {
"$ref": "#/components/schemas/PermissionObject"
}
}
],
"result": {
"name": "UpdatedPermissionsAfterRevoke",
"description": "The permissions list after the permission has been revoked",
"schema": {
"$ref": "#/components/schemas/PermissionsList"
}
},
"errors": [],
"examples": [
{
"name": "wallet_revokePermissions example of revoking the eth_accounts permission",
"params": [
{
"name": "revokePermissionObject",
"value": {
"eth_accounts": {}
}
}
],
"result": {
"name": "UpdatedPermissionsAfterRevoke",
"value": []
}
}
]
},
{
"tags": [
{
Expand Down Expand Up @@ -368,7 +404,9 @@
"schema": {
"title": "WatchAssetOptions",
"type": "object",
"required": ["address"],
"required": [
"address"
],
"properties": {
"address": {
"description": "The address of the token contract.",
Expand Down Expand Up @@ -1038,6 +1076,45 @@
}
}
},
"Caveats": {
"title": "Caveats",
"description": "Every capability document MAY add restrictions on the way the capability may be used by adding to the caveat property. Capabilities inherit the restrictions from all caveat properties of their parents, and MAY add new caveats in addition to those of their parents.",
"type": "array",
"items": {
"title": "Caveat",
"type": "object",
"properties": {
"type": {
"title": "Type",
"type": "string",
"description": "Type of caveat."
},
"value": {
"title": "CaveatValue",
"description": "Value of the caveat."
Copy link
Contributor

Choose a reason for hiding this comment

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

this is technically any. any thoughts on other ways to represent this @BelfordZ

},
"name": {
"title": "Name",
"type": "string",
"description": "Name of the caveat."
}
}
}
},
"PermissionObject": {
"type": "object",
"title": "PermissionObject",
"additionalProperties": {
"type": "object",
"additionalProperties": true
},
"properties": {
"eth_accounts": {
"type": "object",
"additionalProperties": true
}
}
},
"Permission": {
"title": "Permission",
"type": "object",
Expand All @@ -1058,27 +1135,7 @@
"type": "string"
},
"caveats": {
"description": "The specific restrictions applied to the permitted method.",
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"title": "Type",
"type": "string",
"description": "Type of caveat."
},
"value": {
"title": "CaveatValue",
"description": "Value of the caveat."
},
"name": {
"title": "Name",
"type": "string",
"description": "Name of the caveat."
}
}
}
"$ref": "#/components/schemas/Caveats"
}
}
},
Expand All @@ -1101,6 +1158,10 @@
"Mobile": {
"name": "Mobile",
"description": "Mobile-specific methods."
},
"Experimental": {
"name": "Experimental",
"description": "Experimental methods."
}
},
"errors": {
Expand Down
Loading