Alby Developer Guide
Alby Browser Extension APIs
Ask or search…
K
Links
🆕

on

This method specifically allows you to listen for a particular event such as "accountChanged" and execute a callback function when this event occurs.

Method

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

Code Example

if (!liquid.on) { alert('not supported'); }
await liquid.enable();
liquid.on("accountChanged", accountChangedHandler); // callback is executed once account is changed in provided with multiple accounts
function accountChangedHandler() {
console.log("Account Changed!");
}

Demo

Last modified 4mo ago