Establishing a connection is the first step in interaction with any wallet. Without it, apps won't be able to get information about users' accounts, request transactions or sign messages.

In order to connect to Fuelet Wallet, you first need to check that the wallet is installed and then select the appropriate connector. See integration guide.

Then, the only thing you need to do is to call the connect method:

const isConnected = await fuel.connect();
console.log("Connection response", isConnected);

This method results in opening the wallet extension and prompts the user to connect to the website.

It returns Promise<boolean> : it will be true if the user accepts the connection and false otherwise.

Checking the connection status

To check if the user is already connected to the website, you can call the isConnected() method which also returns a Promise<boolean>:

const isConnected = await fuel.isConnected();
console.log("Is connected response", isConnected);

Last updated