# Introduction

## About Fuelet Wallet

Fuelet is a non-custodial wallet dedicated to [Fuel Blockchain](https://www.fuel.network/). Non-custodial means that it doesn't have access to users' funds in any way. The only thing it does - it provides an interface to the blockchain.

It is currently available as a browser extension for Chrome-compatible browsers, and also as iOS and Android mobile apps.

Fuelet Wallet provides an API for dApps to communicate with it: get user accounts information, request transaction signing etc. Currently this API is supported in the browser extension only, but mobile support will come in future releases as well.

This documentation is intended for developers building applications on Fuel blockchain.

One of our top priorities is to make Fuelet Wallet easy to use for both users and developers. That’s why we’re sticking to the same wallet API as the official Fuel wallet provides - that way integrating both wallets in your applications is as easy as integrating any one of them.

If you have any feedback, please reach out to us either by email (`hi@fuelet.app`) or on [discord](https://discord.com/invite/8RF78b5X6a).


# Intro

{% hint style="info" %}
Fuelet (as well as Fuel blockchain) is under active development and the following API is a subject to change. The team would always try to keep all the changes to be backward compatible though.
{% endhint %}

There is an [open-source SDK](https://github.com/FuelLabs/fuels-wallet/tree/master/packages/sdk) ([docs](https://wallet.fuel.network/docs/dev/getting-started/)) developed by the Fuel team designed for making the wallet APIs of all wallets in Fuel ecosystem to be standard. That hugely simplifies the integration of new wallets for web app developers.


# Detecting wallet presence

To begin integrating with Fuelet Wallet, you first need to install the packages `@fuel-wallet/sdk` and `fuels`.

`npm install @fuel-wallet/sdk fuels`

With these dependencies installed you're able to create a `Fuel` object to interact with any supported wallet on Fuel:

{% tabs %}
{% tab title="TypeScript" %}

```javascript
import {
  Fuel,
  FuelWalletConnector,
  FueletWalletConnector,
} from "@fuel-wallet/sdk";

const fuel = new Fuel({
  connectors: [
    new FueletWalletConnector(),
    new FuelWalletConnector(),
  ],
});
```

{% endtab %}
{% endtabs %}

To detect that Fuelet wallet is installed you need to specify `FueletWalletConnector` when creating an instance of `Fuel` and then check the status of the needed connector:

{% tabs %}
{% tab title="TypeScript" %}

```javascript
const fuel = new Fuel({connectors: [new FueletWalletConnector()]});
const connectors = await window.fuel.connectors();
const fueletWalletInstalled = connectors.find((c) => {
  return c.name === 'Fuelet Wallet';
})?.installed ?? false;
```

{% endtab %}
{% endtabs %}

See more on [SDK documentation page](https://wallet.fuel.network/docs/dev/getting-started/).


# Selecting Fuelet as a connector

Fuel SDK operates with entities called [connectors](https://wallet.fuel.network/docs/dev/connectors/). Each connector is a wallet application which implements the SDK interfaces. All needed connectors should be registered in the `fuel` object.

So, in order to interact with a specific wallet, you need to select the corresponding connector first.

### Listing all available connectors

{% tabs %}
{% tab title="TypeScript" %}

```javascript
const connectors = await fuel.connectors();
console.log("available connectors", connectors);
```

{% endtab %}
{% endtabs %}

### Checking the currently selected connector

{% tabs %}
{% tab title="TypeScript" %}

```javascript
const currentConnector = fuel.currentConnector();
console.log("selected connector", currentConnector);
```

{% endtab %}
{% endtabs %}

### Changing the connector

{% tabs %}
{% tab title="TypeScript" %}

```javascript
const isSelected = await fuel.selectConnector("Fuelet Wallet");
console.log("isSelected", isSelected);
```

{% endtab %}
{% endtabs %}

After selecting the “Fuelet Wallet” connector, you can start communicating with Fuelet app.

The communication is identical to the official Fuel wallet. The only thing you need to do to switch wallets is to select an appropriate connector. See the Fuel wallet API documentation [here](https://wallet.fuel.network/docs/dev/getting-started/).


# Best practice

{% hint style="warning" %}

## Naming

Please use the following name when adding Fuelet wallet support on your side:

<mark style="background-color:green;">Fuelet Wallet</mark>.
{% endhint %}

{% hint style="warning" %}

## Download link

If you detect that a user doesn’t have Fuelet installed (see [Detecting wallet presence](/intergration-guide/detecting-wallet-presence)), please add the following link so the user could download the wallet:

[`https://fuelet.app/download/`](https://fuelet.app/download/).
{% endhint %}


# Audit and Security Assurance

At Fuelet, maintaining the highest standards of security is fundamental to our operations. We conduct rigorous audits to ensure the integrity, reliability, and safety of our platform. Below is an overview of our recent audits conducted by renowned security firms.

Audit Summaries

1. Halborn Security Audit

Halborn performed an extensive review of our core contracts and peripheral scripts. The audit covered critical aspects of security, reliability, and performance. The public audit report is completed, offering transparency into the findings and our subsequent actions. Soon it will be available for everyone.

```
•	Status: Completed, awaiting final report
•	Access Report: Available soon
```

2\. Zellic Security Audit

Our core contracts and peripheral scripts were also subjected to a detailed audit by Zellic. While the audit has been successfully completed, the final report is currently under review. We will make the report publicly accessible upon its release.

```
•	Status: Completed
•	Access Report: Available to download 
```

{% file src="/files/gk1wKY8eW4KVcTUKa2WN" %}

3\. Hashcloak Security Audit

The team at Hashcloak has contributed to the security assurance of our platform by conducting a thorough audit, aimed at identifying potential vulnerabilities and ensuring robust protection mechanisms.

```
•	Status: Completed
•	Access Report: Available to download
```

{% file src="/files/rZ5AUxRsiV3rr9OvknNf" %}

Commitment to Transparency and Open-Source Development

As an open-source platform, Fuelet is dedicated to transparency and collaboration. Our codebase is available for public review, allowing the community to contribute, scrutinize, and improve our solutions. We welcome external insights and encourage proactive engagement to maintain and elevate our security standards.

<pre><code>•	Access Codebase: <a data-footnote-ref href="#user-content-fn-1">Fuelet GitHub</a>
</code></pre>

Conclusion

Fuelet’s commitment to security is reflected in our proactive approach to auditing and transparency. By engaging with industry-leading auditors and opening our codebase to the community, we aim to build trust and foster a secure environment for our users. We will continue to update this page with the latest audit findings and publicly accessible reports.

[^1]: <https://github.com/fuelet>


# Intro

Fuelet Wallet is integrated with the Fuel TS SDK, so it has the same API as the SDK.&#x20;

This section contains the API description, but you should also consider the [Fuel SDK documentation](https://wallet.fuel.network/docs/dev/getting-started/) as a reference.


# Connecting

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](broken://pages/QVyuPEMN9fsbypCjMD8e).<br>

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

{% tabs %}
{% tab title="TypeScript" %}

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

{% endtab %}
{% endtabs %}

This method results in opening the wallet extension and prompts the user to connect to the website.&#x20;

<figure><img src="/files/7AoxE3AYCeF4M4EyJLES" alt="" width="182"><figcaption></figcaption></figure>

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>`:

{% tabs %}
{% tab title="TypeScript" %}

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

{% endtab %}
{% endtabs %}


# Getting current account

When the user is connected, the app can get the address of the connected account using the `currentAccount` method, which returns a `Promise<string>` - account address in [Bech32 format](https://fuellabs.github.io/fuels-ts/guide/types/bech32.html).

{% tabs %}
{% tab title="TypeScript" %}

```javascript
const currentAccount = await fuel.currentAccount();
console.log("Current Account ", currentAccount);
```

{% endtab %}
{% endtabs %}


# Getting current network

To request the network the user is connected to, use the `network` method

{% tabs %}
{% tab title="TypeScript" %}

```javascript
const networkInfo = await fuel.network();
console.log("Network ", networkInfo);
```

{% endtab %}
{% endtabs %}

It returns a promise with an object containing the `url` field, which has a GraphQL network endpoint, for example:

```javascript
{url: "https://beta-5.fuel.network/graphql"}
```


# Signing messages

You can request a user to sign a message with a private key of his connected account. This can be achieved in two ways.

You can call the `signMessage` on the `fuel` object providing the account address (in [Bech32 format](https://fuellabs.github.io/fuels-ts/guide/types/bech32.html)) you want to sign message with, and the message itself:

{% tabs %}
{% tab title="TypeScript" %}

```javascript
const signature = await fuel.signMessage('fuel1j0nym7r7twmy8cs6gx2yhd042n38znkeghyjw3dtp0g6tkju34zq2fwltf', 'Message to sign');
console.log("Sign message response", signature);
```

{% endtab %}
{% endtabs %}

Or you can get an instance of the wallet first and then call the `signMessage` method on it:

{% tabs %}
{% tab title="TypeScript" %}

```javascript
const wallet = await fuel.getWallet('fuel1j0nym7r7twmy8cs6gx2yhd042n38znkeghyjw3dtp0g6tkju34zq2fwltf');
const signature = await wallet.signMessage('Message to sign');
console.log("Sign message response", signature);
```

{% endtab %}
{% endtabs %}

After calling any of the methods, the app will prompt the user to authorize the request. The following screen will appear:

<figure><img src="/files/xtItWIjvPOlWOQ1L32Ub" alt="" width="183"><figcaption></figcaption></figure>

Once the user approves the request, the promise is finalized with a string - the signature. If anything goes wrong, e.g. the user cancels the request, the method call will result in an exception.


# Sending transactions

You can request a user to sign and send a transaction on behalf of the connected account.&#x20;

For that, you'll need to obtain an instance of the wallet object, construct the transaction you want to send and call the `sendTransaction` function on it.

{% tabs %}
{% tab title="TypeScript" %}

```javascript
const accounts = await fuel.accounts();
const account = accounts[0];

const transactionRequest = new ScriptTransactionRequest({
  gasLimit: 50_000,
  gasPrice: 1,
});

const toAddress = Address.fromString(toAccount);
const amount = bn.parseUnits("0.1");
transactionRequest.addCoinOutput(toAddress, amount);

const wallet = await fuel.getWallet(account);
const resources = await wallet.getResourcesToSpend([[amount, NativeAssetId]]);

transactionRequest.addResources(resources);
const response = await wallet.sendTransaction(transactionRequest);

// wait for transaction to be completed
await response.wait();
```

{% endtab %}
{% endtabs %}


# Events

Fuelet Wallet produces some events in response to some of the user actions.

## Usage

The `fuel` object has an `events` property which is an enum of all the events that can be listened to.\
The `on` method takes two arguments, the event name and a callback function. The callback function receives data associated with the event.

## Connection

The connection event is triggered when the connection status between the currently selected account and the website changes. The payload of the event is a boolean object - it's `true` if the connection is established and `false` if it's withdrawn.

{% tabs %}
{% tab title="TypeScript" %}

```javascript
fuel.on(fuel.events.connection, console.log)
```

{% endtab %}
{% endtabs %}

## Current account

This event is triggered when the user selects a different account in the app. The payload is a string - the newly selected account address in [Bech32 format](https://fuellabs.github.io/fuels-ts/guide/types/bech32.html).

{% tabs %}
{% tab title="TypeScript" %}

```javascript
fuel.on(fuel.events.currentAccount, console.log)
```

{% endtab %}
{% endtabs %}

## Current network

The event is triggered when the user changes a network within the app. The payload is a string - the GraphQL endpoint of the selected network.

{% tabs %}
{% tab title="TypeScript" %}

```javascript
fuel.on(fuel.events.network, console.log)
```

{% endtab %}
{% endtabs %}


# Media Kit

This media kit is crafted for developers, to help unify their messaging and presentation. It includes the core elements that define our brand and offers clear guidelines to maintain visual consistency across all regions and platforms. Together, let's shape and strengthen the Fuel brand.

## Overview

**Protocol Name:** `Fuelet Wallet`&#x20;

**Website:** <https://fuelet.app/>

## Media Assets <a href="#media-assets" id="media-assets"></a>

#### Logo:

| Name                    | SVG                                                                 |
| ----------------------- | ------------------------------------------------------------------- |
| Fuelet Logo Full white  | <img src="/files/mPOp0luzAElWt9lWPYoA" alt="" data-size="original"> |
| Fuelet Logo Full  black | <img src="/files/E4X0H68m2Nrm8Y4Uv6Zf" alt="" data-size="original"> |
| Fuelet Logo white       | <img src="/files/JiLFUVkGifH0PuUZh1tz" alt="" data-size="original"> |
| Fuelet Logo black       | <img src="/files/HEGYEEeCEKc9oAKrdjX0" alt="" data-size="original"> |

#### Download all files (svg and png):

{% file src="/files/EoAM77Vq8SNYmWj1wzS8" %}

**Primary Color Dark:** HEX: `BDFF00`<img src="/files/Dw3aJYJrbaUT7Vxlrzih" alt="" data-size="line">

**Primary Font:** Prompt from Google Fonts

## Social Media Links <a href="#social-media-links" id="social-media-links"></a>

* **X (formerly Twitter):** <https://x.com/FueletWallet>
* **Discord:** <https://discord.com/invite/8RF78b5X6a>
* **Blog:** <https://mirror.xyz/miraql.eth>

## Contact us <a href="#contact-us" id="contact-us"></a>

<hi@fuelet.app>


