Hook for getting the
Chain object of the network that the user is connected - but only if
it's a supported network (added in the
supportedChains or one of default chains
undefined if the network is not supported or the user is not connected to a wallet. You can use the
useConnectionStatus hook to check if the user is connected to a wallet or not to differentiate between the two cases.
If you only want to get the chain id of the network the user is connected to regardless of whether it's supported or not, use
An object of type
@thirdweb-dev/chains package containing various information about the network, or
undefined if the network is not supported or user is not connected to a wallet.