From 6fd07361c380a6205a5338edd09f2a3cdf7fe301 Mon Sep 17 00:00:00 2001 From: shanejonas Date: Mon, 10 May 2021 15:15:04 -0700 Subject: [PATCH 1/6] feat: add wallet_switchEthereumChain --- methods/wallet_switchEthereumChain.json | 58 +++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 methods/wallet_switchEthereumChain.json diff --git a/methods/wallet_switchEthereumChain.json b/methods/wallet_switchEthereumChain.json new file mode 100644 index 0000000..a6e6b7a --- /dev/null +++ b/methods/wallet_switchEthereumChain.json @@ -0,0 +1,58 @@ +{ + "tags": [ + { + "$ref": "../tags/Metamask.json" + } + ], + "name": "wallet_switchEthereumChain", + "summary": "An RPC method for switching the wallet's active Ethereum chain. ", + "description": "Allows Ethereum applications ('dapps') to request that the wallet switches its active Ethereum chain.\n Introduced by [EIP 3326](https://eips.ethereum.org/EIPS/eip-3326).", + "params": [ + { + "name": "SwitchEthereumChainParameter", + "description": "The SwitchEthereumChainParameter", + "schema": { + "title": "SwitchEthereumChainParameter", + "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" + } + } + } + } + ], + "result": { + "name": "SwitchEthereumChainResult", + "schema": { + "type": "null" + } + }, + "errors": [ + { + "code": 4902, + "message": "Unrecognized chain ID. Try adding the chain using `wallet_addEthereumChain` first." + } + ], + "examples": [ + { + "name": "wallet_switchEthereumChainExample", + "params": [ + { + "name": "SwitchEthereumChainParameter", + "value": { + "chainId": "0x64" + } + } + ], + "result": { + "name": "wallet_switchEthereumChainExampleResult", + "value": "null" + } + } + ] +} From 89c115c8d240e53b11a9dca704b7da33aab07fe5 Mon Sep 17 00:00:00 2001 From: Shane Date: Mon, 10 May 2021 15:24:02 -0700 Subject: [PATCH 2/6] Update wallet_switchEthereumChain.json --- methods/wallet_switchEthereumChain.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/methods/wallet_switchEthereumChain.json b/methods/wallet_switchEthereumChain.json index a6e6b7a..c1a8315 100644 --- a/methods/wallet_switchEthereumChain.json +++ b/methods/wallet_switchEthereumChain.json @@ -5,7 +5,7 @@ } ], "name": "wallet_switchEthereumChain", - "summary": "An RPC method for switching the wallet's active Ethereum chain. ", + "summary": "An RPC method for switching the wallet's active Ethereum chain.", "description": "Allows Ethereum applications ('dapps') to request that the wallet switches its active Ethereum chain.\n Introduced by [EIP 3326](https://eips.ethereum.org/EIPS/eip-3326).", "params": [ { From a21371782f528c40d096e5a04beecfe12199bf01 Mon Sep 17 00:00:00 2001 From: Shane Date: Mon, 10 May 2021 15:25:01 -0700 Subject: [PATCH 3/6] Update wallet_switchEthereumChain.json --- methods/wallet_switchEthereumChain.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/methods/wallet_switchEthereumChain.json b/methods/wallet_switchEthereumChain.json index c1a8315..dfbbc85 100644 --- a/methods/wallet_switchEthereumChain.json +++ b/methods/wallet_switchEthereumChain.json @@ -19,7 +19,7 @@ ], "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.", + "description": "MUST specify the integer ID of the chain as a hexadecimal string, per the eth_chainId Ethereum RPC method.", "type": "string" } } From 259b6ec1b3b65c61667398e4ccdbc0d41e16a7dd Mon Sep 17 00:00:00 2001 From: Shane Date: Mon, 10 May 2021 15:31:48 -0700 Subject: [PATCH 4/6] Update wallet_switchEthereumChain.json --- methods/wallet_switchEthereumChain.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/methods/wallet_switchEthereumChain.json b/methods/wallet_switchEthereumChain.json index dfbbc85..1c0d7e2 100644 --- a/methods/wallet_switchEthereumChain.json +++ b/methods/wallet_switchEthereumChain.json @@ -5,7 +5,7 @@ } ], "name": "wallet_switchEthereumChain", - "summary": "An RPC method for switching the wallet's active Ethereum chain.", + "summary": "An RPC method for switching the wallets active Ethereum chain.", "description": "Allows Ethereum applications ('dapps') to request that the wallet switches its active Ethereum chain.\n Introduced by [EIP 3326](https://eips.ethereum.org/EIPS/eip-3326).", "params": [ { From 3b682fd4b1c72dd412c9c1cf5e7f92822706c198 Mon Sep 17 00:00:00 2001 From: Shane Date: Wed, 12 May 2021 15:30:49 -0700 Subject: [PATCH 5/6] Update methods/wallet_switchEthereumChain.json --- methods/wallet_switchEthereumChain.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/methods/wallet_switchEthereumChain.json b/methods/wallet_switchEthereumChain.json index 1c0d7e2..bc88b45 100644 --- a/methods/wallet_switchEthereumChain.json +++ b/methods/wallet_switchEthereumChain.json @@ -19,7 +19,7 @@ ], "properties": { "chainId": { - "description": "MUST specify the integer ID of the chain as a hexadecimal string, per the eth_chainId Ethereum RPC method.", + "description": "MUST specify the integer ID of the chain as a hexadecimal string, per the `eth_chainId` Ethereum RPC method.", "type": "string" } } From 36bc3616806d3b9f581a8ca6cc0835b0dd399773 Mon Sep 17 00:00:00 2001 From: Shane Date: Wed, 12 May 2021 15:30:54 -0700 Subject: [PATCH 6/6] Update methods/wallet_switchEthereumChain.json --- methods/wallet_switchEthereumChain.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/methods/wallet_switchEthereumChain.json b/methods/wallet_switchEthereumChain.json index bc88b45..c8185f8 100644 --- a/methods/wallet_switchEthereumChain.json +++ b/methods/wallet_switchEthereumChain.json @@ -6,7 +6,7 @@ ], "name": "wallet_switchEthereumChain", "summary": "An RPC method for switching the wallets active Ethereum chain.", - "description": "Allows Ethereum applications ('dapps') to request that the wallet switches its active Ethereum chain.\n Introduced by [EIP 3326](https://eips.ethereum.org/EIPS/eip-3326).", + "description": "Allows Ethereum applications ('dapps') to request that the wallet switches its active Ethereum chain.\n Introduced by [EIP 3326](https://ethereum-magicians.org/t/eip-3326-wallet-switchethereumchain).", "params": [ { "name": "SwitchEthereumChainParameter",