This guide will show you how you can use the Fuel Wallet Icon Link SDK and its React Hooks Icon Link to build a simple React application that lets users connect their wallet to your application and see their balance.
In order to make use of the React hooks provided by the Fuel Wallet SDK, we need to wrap our application in a FuelProvider component. This component will provide the hooks with the necessary context to interact with the Fuel Wallet SDK. Add the following to your pages/_app.tsx file:
The useConnectors hook returns a list of available wallet connectors.
Once a connector has been selected by the user, the useConnect hook will return a connect function that can be used to connect the user's wallet to your application.
The useAccount hook returns information about the user's account, if they are connected.
The useBalance hook returns the user's ETH balance on the beta-5 network Icon Link, if they are connected.