feat: rename TFP to MC currency in dashboard UI and pools functionality
This commit is contained in:
@@ -207,7 +207,7 @@
|
||||
tfpAmountTFT.addEventListener('input', () => {
|
||||
const amount = parseFloat(tfpAmountTFT.value) || 0;
|
||||
const tftCost = amount * 0.5; // 1 MC = 0.5 TFT
|
||||
const modal = document.getElementById('buyTFCWithTFTModal');
|
||||
const modal = document.getElementById('buyMCWithTFTModal');
|
||||
if (modal) {
|
||||
const rows = modal.querySelectorAll('.alert .d-flex.justify-content-between .text-end');
|
||||
// rows[0] -> Amount, rows[1] -> Cost
|
||||
@@ -223,7 +223,7 @@
|
||||
sellTfpAmountTFT.addEventListener('input', () => {
|
||||
const amount = parseFloat(sellTfpAmountTFT.value) || 0;
|
||||
const tftReceive = amount * 0.5; // 1 MC = 0.5 TFT
|
||||
const modal = document.getElementById('sellTFCForTFTModal');
|
||||
const modal = document.getElementById('sellMCForTFTModal');
|
||||
if (modal) {
|
||||
const rows = modal.querySelectorAll('.alert .d-flex.justify-content-between .text-end');
|
||||
if (rows[0]) rows[0].textContent = `${amount} MC`;
|
||||
@@ -238,7 +238,7 @@
|
||||
tfpAmountPEAQ.addEventListener('input', () => {
|
||||
const amount = parseFloat(tfpAmountPEAQ.value) || 0;
|
||||
const peaqCost = amount * 2.0; // 1 MC = 2 PEAQ
|
||||
const modal = document.getElementById('buyTFCWithPEAQModal');
|
||||
const modal = document.getElementById('buyMCWithPEAQModal');
|
||||
if (modal) {
|
||||
const rows = modal.querySelectorAll('.alert .d-flex.justify-content-between .text-end');
|
||||
if (rows[0]) rows[0].textContent = `${amount} MC`;
|
||||
@@ -253,7 +253,7 @@
|
||||
sellTfpAmountPEAQ.addEventListener('input', () => {
|
||||
const amount = parseFloat(sellTfpAmountPEAQ.value) || 0;
|
||||
const peaqReceive = amount * 2.0; // 1 MC = 2 PEAQ
|
||||
const modal = document.getElementById('sellTFCForPEAQModal');
|
||||
const modal = document.getElementById('sellMCForPEAQModal');
|
||||
if (modal) {
|
||||
const rows = modal.querySelectorAll('.alert .d-flex.justify-content-between .text-end');
|
||||
if (rows[0]) rows[0].textContent = `${amount} MC`;
|
||||
@@ -376,7 +376,7 @@
|
||||
body: JSON.stringify({ amount, payment_method: 'TFT' }),
|
||||
});
|
||||
showSuccessToast(`Purchased ${amount} MC with TFT`);
|
||||
const modal = document.getElementById('buyTFCWithTFTModal');
|
||||
const modal = document.getElementById('buyMCWithTFTModal');
|
||||
if (modal && window.bootstrap) bootstrap.Modal.getOrCreateInstance(modal).hide();
|
||||
} catch (e) {
|
||||
if (e && e.status === 402) {
|
||||
@@ -399,7 +399,7 @@
|
||||
body: JSON.stringify({ amount, currency: 'TFT', payout_method: 'blockchain' }),
|
||||
});
|
||||
showSuccessToast(`Sold ${amount} MC for TFT`);
|
||||
const modal = document.getElementById('sellTFCForTFTModal');
|
||||
const modal = document.getElementById('sellMCForTFTModal');
|
||||
if (modal && window.bootstrap) bootstrap.Modal.getOrCreateInstance(modal).hide();
|
||||
} catch (e) {
|
||||
if (e && e.status === 402) {
|
||||
@@ -422,7 +422,7 @@
|
||||
body: JSON.stringify({ amount, payment_method: 'PEAQ' }),
|
||||
});
|
||||
showSuccessToast(`Purchased ${amount} MC with PEAQ`);
|
||||
const modal = document.getElementById('buyTFCWithPEAQModal');
|
||||
const modal = document.getElementById('buyMCWithPEAQModal');
|
||||
if (modal && window.bootstrap) bootstrap.Modal.getOrCreateInstance(modal).hide();
|
||||
} catch (e) {
|
||||
if (e && e.status === 402) {
|
||||
@@ -445,7 +445,7 @@
|
||||
body: JSON.stringify({ amount, currency: 'PEAQ', payout_method: 'blockchain' }),
|
||||
});
|
||||
showSuccessToast(`Sold ${amount} MC for PEAQ`);
|
||||
const modal = document.getElementById('sellTFCForPEAQModal');
|
||||
const modal = document.getElementById('sellMCForPEAQModal');
|
||||
if (modal && window.bootstrap) bootstrap.Modal.getOrCreateInstance(modal).hide();
|
||||
} catch (e) {
|
||||
if (e && e.status === 402) {
|
||||
|
Reference in New Issue
Block a user