⌘K

Icon SunFilledIcon MoonStars
Wallet Connectors

Icon LinkWallet Connectors

A Wallet Connector is an interface to integrate with third-party wallets on the Fuel Ecosystem. It exposes all currently installed wallets in a unified manner via window.fuel.

Icon LinkCheck it working

Icon LinkMethods

Icon LinkListing connectors

To list all available connectors you can use the listConnectors() method.

const connectors = fuel.listConnectors();

Icon LinkSelecting connector

To select a different Wallet Connector use the selectConnector(connectorName: string) method.

async (connectorName: string) => {
  console.log(`Select connector "${connectorName}"!`);
  await fuel.selectConnector(connectorName);
  console.log(`Connector "${connectorName}" connected`);
};

Icon LinkEvents

Icon LinkCurrentConnector

This event is triggered when the Current Connector is updated. The callback function receives the FuelWalletConnector object.

fuel.on(fuel.events.currentConnector, onCurrentConnector);
return () => {
  fuel.off(fuel.events.currentConnector, onCurrentConnector);
};

Icon LinkConnectors

This event is triggered when the Connectors list is updated. The callback function receives the list of connectors, Array<FuelWalletConnector>.

fuel.on(fuel.events.connectors, onConnectors);
return () => {
  fuel.off(fuel.events.connectors, onConnectors);
};

Icon LinkFor Wallet Developers

Third-party wallets developed by the community can use the Wallet Connector to integrate with the current fuel instance on the window, enabling a better experience for developers and users.

Icon LinkCreating a Wallet Connector

Inside pageScript.ts you can call the method createConnector instead of creating a new object on the window. This method will add your Connector to the current, window.fuel element.

import { createConnector } from '@fuel-wallet/sdk';
 
createConnector({ name: 'Wallet Name' });

If you are using our Communication SDK Content Page Script Icon Link import ContentProxyConnection and pass the name of Wallet Extension.

Otherwise, remember to filter events by the ones that have your Wallet Connector Name as the target.

import { ContentProxyConnection } from '@fuel-wallet/sdk';
 
// Start the content page script with the current Wallet Name
ContentProxyConnection.start('Wallet Name');
 
// ...pageScript.ts logic for page script injection