Skip to content

Our injected Ethereum provider never gets the 'wallet_addEthereumChain' request #10

Description

@bkbooth

We're developing a multi-chain wallet which supports a number of EVM chains. When a user in your application switches which chain they're on, I'd expect to receive a wallet_addEthereumChain (or wallet_switchEthereumChain) request, but it doesn't happen for us. I've tested and confirmed that it works with MetaMask, our provider is mostly compatible with MetaMask's provider.

I noticed these lines:

const ethereumFN:any = {
request: '',
...ethereum
}

I suspect that's where it's falling down for us. Our provider is a JS class, so I think methods aren't being spread onto the new ethereumFN object correctly. Is there a reason the provider is spread onto a new object like this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions