📄️ Setup the provider
Setting up the Provider is an important part during the initialization. Since the application uses Redux for state management, you have to wrap the application with the Redux Provider. Thankfully, we created the EthyleneProvider to simplify the setup process.
📄️ useConnection
Connect your wallet
📄️ useAccount
This hook helps you to obtain your WEB3 connection details in components. The available states are
📄️ useRightNetwork
This hook is used to check whether you are connected to the right network. Also, you can use the switchTo function that is returned from the hook to change the network to correct one.
📄️ useOnNetworkChange
useOnNetworkChange is used to register events for network change actions. If you want to refresh the page, or update any state on network change, you can use this hook.
📄️ useOnAccountsChange
useOnAccountsChange is used to register events for account change actions in defined time interval. The default value of this interval is 1000 (milliseconds). It means that, in every 1 second, the app checks the account change and executes the callback. interval is given as second parameter to the hook inside an object in addition to deps. It is used to reassign the event on any value change.