diff --git a/openrpc.json b/openrpc.json index 6de704d..4b8967d 100644 --- a/openrpc.json +++ b/openrpc.json @@ -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": [ @@ -84,7 +109,7 @@ ], "result": { "name": "wallet_addEthereumChainExampleResult", - "value": "null" + "value": null } } ] @@ -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" @@ -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": {} + } } ] }, @@ -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",