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

feat: add wallet_switchEthereumChain #66

Merged
merged 6 commits into from
Jun 18, 2021
Merged
Changes from 4 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
58 changes: 58 additions & 0 deletions methods/wallet_switchEthereumChain.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"tags": [
{
"$ref": "../tags/Metamask.json"
}
],
"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).",
"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.",
"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"
}
}
]
}