🗣️Events
All javascript events triggered by the wallet
xidar.account.change
This event is triggered when the user changes the active address in the wallet.
CustomEvent {
...
detail: {
address: 'rdx...'
},
type: 'xidar.account.change'
}
const hasWallet = await window.xidar.v1.hasWallet();
if (hasWallet) {
const isConnected = await window.xidar.v1.isConnected();
if (isConnected) {
window.addEventListener(
'xidar.account.change',
data => {
console.log('New active address : ' + data.detail.address);
},
false
);
}
}