Fuelet wallet extension injects a fuelet
object to the DOM window and exposes the following API. The API mirrors the API exposed by Fuel Wallet and integrates with @fuel-wallet/sdk
. Object fuelet
implements the Fuel
interface from the SDK, so it can be integrated in the project in the following way:
const onFueletLoaded = () => {
setFuel(window.fuelet);
};
// If fuelet is already loaded, call the handler
if (window.fuelet) {
onFueletLoaded();
}
// Listen for the fueletLoaded event
document.addEventListener("FueletLoaded", onFueletLoaded);
If you have any comments or suggestions, please reach out to us: [email protected].
async connect(): Promise<boolean>
Connect a website to the wallet.
await fuelet.connect();
// true
await fuelet.isConnected();
// true
async disconnect(): Promise<boolean>
Disconnect a website from the wallet.
await fuelet.disconnect();
// true
await fuelet.isConnected();
// false
async isConnected(): Promise<boolean>
Check the connection status.
await fuelet.isConnected();
// true