Fuelet | Wallet on Fuel
  • Introduction
  • Intergration guide
    • Intro
    • Detecting wallet presence
    • Selecting Fuelet as a connector
    • Best practice
    • Audit and Security Assurance
  • Wallet API
    • Intro
    • Connecting
    • Getting current account
    • Getting current network
    • Signing messages
    • Sending transactions
    • Events
  • Resources
    • Media Kit
Powered by GitBook
On this page
  1. Wallet API

Connecting

Last updated 1 year ago

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);