feat: add helper functions to convert MWEB change in LTC wallet

This commit is contained in:
tecnovert
2026-05-04 13:51:21 +02:00
parent c4e7de2873
commit 6ebbd98aec
8 changed files with 201 additions and 7 deletions
+17 -2
View File
@@ -40,6 +40,10 @@
});
},
confirmMWEBChangeConvert: function() {
return confirm('Confirm MWEB change conversion: This will create a tx sending all spendable MWEB outputs in the plain LTC wallet to LTC.');
},
confirmReseed: function() {
return confirm('Are you sure you want to reseed the wallet? This will generate new addresses.');
},
@@ -60,7 +64,7 @@
},
fillDonationAddress: function(address, coinType) {
let addressInput = null;
addressInput = window.DOMCache
@@ -188,7 +192,7 @@
},
lookup_rates: function() {
if (window.lookup_rates && typeof window.lookup_rates === 'function') {
window.lookup_rates();
} else {
@@ -282,6 +286,16 @@
}
});
document.addEventListener('click', (e) => {
const target = e.target.closest('[data-confirm-mweb-change-convert]');
if (target) {
if (!this.confirmMWEBChangeConvert()) {
e.preventDefault();
return false;
}
}
});
document.addEventListener('click', (e) => {
const target = e.target.closest('[data-confirm-utxo]');
if (target) {
@@ -398,6 +412,7 @@
window.EventHandlers = EventHandlers;
window.confirmReseed = EventHandlers.confirmReseed.bind(EventHandlers);
window.confirmMWEBChangeConvert = EventHandlers.confirmMWEBChangeConvert.bind(EventHandlers);
window.confirmWithdrawal = EventHandlers.confirmWithdrawal.bind(EventHandlers);
window.confirmUTXOResize = EventHandlers.confirmUTXOResize.bind(EventHandlers);
window.confirmRemoveExpired = EventHandlers.confirmRemoveExpired.bind(EventHandlers);