Moralis JS SDK v1.0 (migration to Ethers.js)

thanks, 'll give it a go… doesn’t matter if it takes a bit longer, I have a delay built in after the change to allow for some reconnection. I vaguely remember there being a isWeb3enabled call or something similar, but can’t seem to find it now. maybe something like that could be used to check the ready state of the provider?

Yep, you can use Moralis.isWeb3Enabled()

Or if you use hooks you can use isWeb3Enabled or any of the following properties to check if everytihing is allright:

const {
    isWeb3Enabled,
    isWeb3EnableLoading,
    web3EnableError,
    chainId,
    network,
    connectorType,
    account,
} = useMoralis()
1 Like

So I ran a bunch of tests, and indeed it appears that by suppressing the unexpected disconnect, everything works fine… thanks!

2 Likes

Could it update on react-moralis?

react-moralis only involved a types update.
That is now released on the latest version.

1 Like

@Erno when updating i get the following error:

error: Error: Unable to resolve module moralis/react-native

Can you please make a new topic with more details.