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

Request perm multichain exploration #118

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
116 changes: 115 additions & 1 deletion openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,31 @@
"version": "1.0.0"
},
"methods": [
{
"name": "metamask_multiChain",
"tags": [
{
"$ref": "#/components/tags/Metamask"
}
],
"summary": "Call a method on a chain",
"description": "Call a method on a chain. This method is used to call methods on chains that are not the currently active chain. This method is only available if the user has added the chain to their wallet. Introduced by [EIP-3085](https://eips.ethereum.org/EIPS/eip-3085).",
"params": [
{
"name": "MultiChainParameter",
"description": "The MultiChainParameter",
"schema": {
"$ref": "#/components/schemas/MultiChainParameter"
}
}
],
"result": {
"name": "MultiChainResult",
"schema": {
"$ref": "#/components/schemas/MultiChainResult"
}
}
},
{
"name": "wallet_addEthereumChain",
"tags": [
Expand Down Expand Up @@ -84,7 +109,7 @@
],
"result": {
"name": "wallet_addEthereumChainExampleResult",
"value": "null"
"value": null
}
}
]
Expand Down Expand Up @@ -163,6 +188,24 @@
"schema": {
"title": "requestPermissionObject",
"type": "object",
"patternProperties": {
"[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}": {
"type": "object",
"properties": {
"openrpcDocument": {
"$ref": "https://raw.githubusercontent.com/open-rpc/meta-schema/master/schema.json"
},
"permissions": {
"type": "object",
"patternProperties": {
"": {
"type": "object"
}
}
}
}
}
},
"properties": {
"eth_accounts": {
"type": "object"
Expand Down Expand Up @@ -193,6 +236,49 @@
"name": "permissionList",
"value": {}
}
},
{
"name": "requestPermissionObjectExampleMultiChain",
"description": "example for a permission request for multi-chain",
"params": [
{
"name": "requestPermissionObject",
"value": {
"eip155:2": {
"openrpcDocument": {
"info": {
"title": "EIP-155 Chain 2",
"version": "1.0.0"
},
"methods": [
{
"name": "eth_accounts",
"summary": "List accounts",
"description": "Returns a list of addresses owned by the user.",
"params": [],
"result": {
"name": "accounts",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
]
},
"permissions": {
"eth_accounts": {}
}
}
}
}
],
"result": {
"name": "permissionList",
"value": {}
}
}
]
},
Expand Down Expand Up @@ -425,6 +511,34 @@
],
"components": {
"schemas": {
"MultiChainParameter": {
"title": "MultiChainParameter",
"type": "object",
"required": [
"chainId"
],
"properties": {
"chainId": {
"description": "MUST specify the integer ID of the chain as a hexadecimal string, per the eth_chainId Ethereum RPC method. The wallet SHOULD compare the specified chainId value with the eth_chainId return value from the endpoint. If these values are not identical, the wallet MUST reject the request.",
"type": "string"
},
"request": {
"description": "The request object to send to the specific chainId.",
"type": "object",
"properties": {
"method": {
"description": "The RPC method to send to the specific chainId.",
"type": "string"
},
"params": {
"description": "The RPC params to send to the specific chainId.",
"type": "array"
}
}
}
}
},
"MultiChainResult": true,
"AddEthereumChainParameter": {
"title": "AddEthereumChainParameter",
"type": "object",
Expand Down