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?
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(orwallet_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:
anyswap-crosschain/src/config/tools/methods.ts
Lines 9 to 12 in 2377e73
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
ethereumFNobject correctly. Is there a reason the provider is spread onto a new object like this?