Alby Developer Guide
User GuideDeveloper Portal
Alby Browser Extension APIs
Alby Browser Extension APIs
  • 📚Overview
  • window.webln
    • 👀See Webln.guide
  • window.liquid
    • enable
    • 🆕isEnabled
    • getAddress
    • signPset
    • 🆕on
    • 🆕off
  • window.nostr
    • getPublicKey
    • signEvent
    • nip04.encrypt
    • nip04.decrypt
    • signSchnorr
    • 🆕on
    • 🆕off
  • window.webbtc
    • enable
    • 🆕isEnabled
    • getAddress
    • signPsbt
    • 🆕on
    • 🆕off
  • window.alby
    • enable
    • 🆕isEnabled
    • ➕Adding accounts
Powered by GitBook
LogoLogo

Our content

  • Website
  • Blog
  • GitHub

Follow us

  • Nostr
  • Twitter / X
  • Youtube

Contact us

  • E-mail
  • Community Chat
  • Open Hours

Your bitcoin & nostr companion / from 🐝 with 🧡

On this page

Was this helpful?

  1. window.webbtc

off

This particular method enables you to cancel your subscription to an event that was initially set up using the webbtc.on() function. This allows you to stop receiving notifications or triggers when a specific event occurs.

Method

function off(eventName: "accountChanged", listener: () => void): void;

Code Example

if (!webbtc.on) { alert('not supported'); }

await webbtc.enable();
// subscribe to the accountChanged event
webbtc.on("accountChanged", accountChangedHandler); // callback is executed once account is changed in provided with multiple accounts

// use .off() to unsubscribe from the event. 
webbtc.off("accountChanged", accountChangedHandler);

function accountChangedHandler() {
    console.log("Account Changed!");
}

Last updated 1 year ago

Was this helpful?

🆕