web icon indicating copy to clipboard operation
web copied to clipboard

feat: pass full AddEthereumChainParameter params to ethSwitchChain()…

Open gomesalexandre opened this issue 2 years ago • 0 comments

… calls

Description

⚠️ Blocked by https://github.com/shapeshift/hdwallet/pull/552

This PR:

  • passes the full AddEthereumChainParameter params to ethSwitchChain() following the removal of the hardcoded struct in https://github.com/shapeshift/hdwallet/pull/552#diff-f9e068313c89ab1b915d52a8d9a89f80fff9a86172cc34d11ee765e2d178c5b3L10-L20
  • adds error-handling to handleChainClick
  • does some housekeeping replacing the EvmChainId terminology to EthNetwork

This will allow us to support switching to any arbitrary EVM chain in the future.

Notice

  • [x] Have you followed the guidelines in our Contributing guide?
  • [x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Pull Request Type

  • [ ] :bug: Bug fix (Non-breaking Change: Fixes an issue)
  • [ ] :hammer_and_wrench: Chore (Non-breaking Change: Doc updates, pkg upgrades, typos, etc..)
  • [x] :nail_care: New Feature (Breaking/Non-breaking Change)

Issue (if applicable)

N/A

Risk

None, this gets the data from chain-adapters/assets slice, if there is any issue here, we have bigger problems.

Testing

  • Delete Avalanche from your wallet networks on MetaMask
  • Switching chain still works and adds the Avalanche C-Chain if switching to it
  • Txs Metamask Tx history route to the block explorer when clicked
  • Broadcasting Avalanche Txs still works

Screenshots (if applicable)

gomesalexandre avatar Aug 05 '22 13:08 gomesalexandre