The destination event is emitted when the destination picker dialog has been openend, and is now closed. If a destinationw as selected, the data is returned.
// <script src="https://xumm.app/assets/cdn/xumm.min.js"></script>
var xumm = new Xumm('your-api-key')
xumm.xapp.on('destination', data => {
console.log('Destination account picked (?)', data)
})
The user switched the selected network in Xumm while present in the xApp, while your xApp settings (Xumm Developer Console) indicate the xApp shouldn't reload but receive an event.
The event will contain a property network with a key referring to a network from the rails endpoint, through getRails()or https://xumm.app/api/v1/jwt/rails
// <script src="https://xumm.app/assets/cdn/xumm.min.js"></script>
var xumm = new Xumm('your-api-key')
xumm.xapp.on("networkswitch", ({ network }) => {
xumm.helpers.getRails().then(rails => {
alert(JSON.stringify(rails?.[network]))
})
})