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

Add updateChain method to Client SDK #122

Open
pedrouid opened this issue May 13, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@pedrouid
Copy link
Member

commented May 13, 2019

Following ethereum/EIPs#2015, the client SDK will include a method named updateChain which will require the parameters from the JSON-RPC method wallet_updateChain described on EIP-2015 as follows:

Example 1

A JSON-RPC request from a Dapp to switch the Ethereum Goerli chain would be as follows:

{
  "id":1,
  "jsonrpc": "2.0",
  "method": "wallet_updateChain",
  "params": [
    {
      "chainId": 5,
      "networkId": 5,
      "rpcUrl": "https://goerli.infura.io/v3/406405f9c65348f99d0d5c27104b2213",
      "nativeCurrencyName": "gorETH"
    }
  ]
}

Example 2

A JSON-RPC request from a Dapp to switch the POA Network's xDAI chain would be as follows:

{
  "id":1,
  "jsonrpc": "2.0",
  "method": "wallet_updateChain",
  "params": [
    {
      "chainId": 100,
      "networkId": 100,
      "rpcUrl": "https://dai.poa.network",
      "nativeCurrencyName": "xDAI"
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.