You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.
In MM chainId is a hex, in WC a number. Need to handle. Convert to a numberified string.
Description
shouldSwitchNetwork references the provider of Onboard's wallet instance. However, it seems as there is no universal chainId value that we can reference across all providers.
The original version of shouldSwitchNetwork checked networkVersion, which is MetaMask-specific (although likely other providers as well. As part of the desktop pairing implementation (also affecting WC), it was extended to check chainId as well.
Subsequently, it has been noticed that there is no 'standard' across these two keys (maybe there are also other keys with other providers), e.g.
We need a way of consistently checking against a standard key that the current chainId matches that, perhaps comparing an integer, string and hex value of it.
Expected result
shouldSwitchNetwork returns a consistent boolean back across all chains when the chain needs to be switched.
Obtained result
It is not always consistent.
The text was updated successfully, but these errors were encountered:
tl;dr
In MM
chainId
is a hex, in WC a number. Need to handle. Convert to a numberified string.Description
shouldSwitchNetwork
references the provider of Onboard'swallet
instance. However, it seems as there is no universalchainId
value that we can reference across all providers.The original version of
shouldSwitchNetwork
checkednetworkVersion
, which is MetaMask-specific (although likely other providers as well. As part of the desktop pairing implementation (also affecting WC), it was extended to checkchainId
as well.Subsequently, it has been noticed that there is no 'standard' across these two keys (maybe there are also other keys with other providers), e.g.
WC
MM
We need a way of consistently checking against a standard key that the current
chainId
matches that, perhaps comparing an integer, string and hex value of it.Expected result
shouldSwitchNetwork
returns a consistentboolean
back across all chains when the chain needs to be switched.Obtained result
It is not always consistent.
The text was updated successfully, but these errors were encountered: