Xumm UI interaction
Using the Xumm SDK in xApps, you can trigger native Xumm interaction & receive events from Xumm in your xApp.
Example code
<html lang="en">
<body>
<div id="destinationname">...</div>
<input id="destinationaddress" value="" placeholder="Destination address" />
<button onclick="xumm.xapp.selectDestination()">Pick destination account</button>
<script src="https://xumm.app/assets/cdn/xumm.min.js"></script>
<script>
var xumm = new Xumm('your-api-key')
xumm.xapp.on('destination', data => {
if (data.destination.address) {
document.getElementById('destinationname').innerText = data.destination.name
document.getElementById('destinationaddress').value = data.destination.address
} else {
console.log('No destination selected', data.reason)
}
})
</script>
</body>
</html>Trigger actions
Receive events
Last updated
Was this helpful?