feat: rename TFC to MC currency across codebase, UI, and documentation
This commit is contained in:
@@ -811,7 +811,7 @@ impl DashboardController {
|
||||
render_template(&tmpl, "dashboard/messages.html", &ctx)
|
||||
}
|
||||
|
||||
/// Renders the TFC Credits pools page
|
||||
/// Renders the MC Credits pools page
|
||||
pub async fn pools(tmpl: web::Data<Tera>, session: Session) -> Result<impl Responder> {
|
||||
let mut ctx = crate::models::builders::ContextBuilder::new()
|
||||
.active_page("dashboard")
|
||||
@@ -3263,7 +3263,7 @@ impl DashboardController {
|
||||
})).build())
|
||||
}
|
||||
|
||||
/// Add TFC Credits to user balance
|
||||
/// Add MC Credits to user balance
|
||||
pub async fn add_tfp(
|
||||
form: web::Form<AddTfpForm>,
|
||||
session: Session,
|
||||
@@ -5903,7 +5903,7 @@ impl DashboardController {
|
||||
}
|
||||
}
|
||||
|
||||
/// Stake TFC Credits on a node
|
||||
/// Stake MC Credits on a node
|
||||
pub async fn stake_on_node(
|
||||
session: Session,
|
||||
path: web::Path<String>,
|
||||
|
@@ -312,7 +312,7 @@ impl Default for LiquidityPoolConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
pool_id: String::new(),
|
||||
base_token: "TFC".to_string(),
|
||||
base_token: "MC".to_string(),
|
||||
quote_token: "USD".to_string(),
|
||||
fee_tier: 0.3,
|
||||
minimum_liquidity: rust_decimal_macros::dec!(100.0),
|
||||
@@ -364,8 +364,8 @@ impl Default for YieldFarmConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
farm_id: String::new(),
|
||||
reward_token: "TFC".to_string(),
|
||||
staked_token: "TFC".to_string(),
|
||||
reward_token: "MC".to_string(),
|
||||
staked_token: "MC".to_string(),
|
||||
apr: 12.0,
|
||||
lock_duration_days: 365,
|
||||
minimum_stake: rust_decimal_macros::dec!(1000.0),
|
||||
|
@@ -99,11 +99,11 @@ impl CurrencyService {
|
||||
last_updated: chrono::Utc::now(),
|
||||
},
|
||||
Currency {
|
||||
code: "TFC".to_string(),
|
||||
name: "ThreeFold Credits".to_string(),
|
||||
symbol: "TFC".to_string(),
|
||||
code: "MC".to_string(),
|
||||
name: "Mycelium Credit".to_string(),
|
||||
symbol: "MC".to_string(),
|
||||
currency_type: crate::models::currency::CurrencyType::Custom("credits".to_string()),
|
||||
exchange_rate_to_base: dec!(1.0), // 1 TFC = 1 USD
|
||||
exchange_rate_to_base: dec!(1.0), // 1 MC = 1 USD
|
||||
is_base_currency: false,
|
||||
decimal_places: 2,
|
||||
is_active: true,
|
||||
|
@@ -107,7 +107,7 @@ window.AppProviderDashboard = window.AppProviderDashboard || (class AppProviderD
|
||||
tooltip: {
|
||||
callbacks: {
|
||||
label: function(context) {
|
||||
return `Revenue: ${context.raw} TFC`;
|
||||
return `Revenue: ${context.raw} MC`;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,7 @@ window.AppProviderDashboard = window.AppProviderDashboard || (class AppProviderD
|
||||
beginAtZero: true,
|
||||
title: {
|
||||
display: true,
|
||||
text: 'Revenue (TFC)'
|
||||
text: 'Revenue (MC)'
|
||||
}
|
||||
},
|
||||
x: {
|
||||
@@ -168,7 +168,7 @@ window.AppProviderDashboard = window.AppProviderDashboard || (class AppProviderD
|
||||
label: function(context) {
|
||||
const total = context.dataset.data.reduce((a, b) => a + b, 0);
|
||||
const percentage = ((context.raw / total) * 100).toFixed(1);
|
||||
return `${context.label}: ${context.raw} TFC (${percentage}%)`;
|
||||
return `${context.label}: ${context.raw} MC (${percentage}%)`;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -330,7 +330,7 @@ window.AppProviderDashboard = window.AppProviderDashboard || (class AppProviderD
|
||||
<div>${stars}</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>${(app.monthly_revenue_usd || 0)} TFC</td>
|
||||
<td>${(app.monthly_revenue_usd || 0)} MC</td>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-sm btn-outline-primary" onclick="manageApp('${app.id}', '${app.name}')">Manage</button>
|
||||
@@ -417,7 +417,7 @@ window.AppProviderDashboard = window.AppProviderDashboard || (class AppProviderD
|
||||
<small>${healthScore.toFixed(1)}%</small>
|
||||
</td>
|
||||
<td>${resourceUsage}</td>
|
||||
<td><strong>${this.estimateDeploymentRevenue(deployment.app_name)} TFC</strong></td>
|
||||
<td><strong>${this.estimateDeploymentRevenue(deployment.app_name)} MC</strong></td>
|
||||
<td>
|
||||
${autoHealingDisplay}
|
||||
</td>
|
||||
|
@@ -100,7 +100,7 @@ class ServiceProviderDashboard {
|
||||
tooltip: {
|
||||
callbacks: {
|
||||
label: function(context) {
|
||||
return `Revenue: ${context.raw} TFP`;
|
||||
return `Revenue: ${context.raw} MC`;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ class ServiceProviderDashboard {
|
||||
beginAtZero: true,
|
||||
title: {
|
||||
display: true,
|
||||
text: 'Revenue (TFP)'
|
||||
text: 'Revenue (MC)'
|
||||
}
|
||||
},
|
||||
x: {
|
||||
@@ -293,7 +293,7 @@ class ServiceProviderDashboard {
|
||||
callbacks: {
|
||||
label: function(context) {
|
||||
const point = context.raw;
|
||||
return `${point.label}: Rating ${point.x}, ${point.y} TFP/hour`;
|
||||
return `${point.label}: Rating ${point.x}, ${point.y} MC/hour`;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -397,7 +397,7 @@ class ServiceProviderDashboard {
|
||||
</td>
|
||||
<td>${service.category || 'General'}</td>
|
||||
<td><span class="badge bg-${statusClass}">${service.status || 'Active'}</span></td>
|
||||
<td>${service.hourly_rate || service.price_per_hour || service.price_per_hour_usd || service.price_amount || 0} TFC/hour</td>
|
||||
<td>${service.hourly_rate || service.price_per_hour || service.price_per_hour_usd || service.price_amount || 0} MC/hour</td>
|
||||
<td>${service.clients || 0}</td>
|
||||
<td>
|
||||
<div class="d-flex align-items-center">
|
||||
@@ -1237,7 +1237,7 @@ function createServiceRevenueAnalyticsChart(revenueData) {
|
||||
tooltip: {
|
||||
callbacks: {
|
||||
label: function(context) {
|
||||
return `Revenue: ${context.raw} TFP`;
|
||||
return `Revenue: ${context.raw} MC`;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1247,7 +1247,7 @@ function createServiceRevenueAnalyticsChart(revenueData) {
|
||||
beginAtZero: true,
|
||||
title: {
|
||||
display: true,
|
||||
text: 'Revenue (TFP)'
|
||||
text: 'Revenue (MC)'
|
||||
}
|
||||
},
|
||||
x: {
|
||||
|
@@ -206,12 +206,12 @@
|
||||
if (tfpAmountTFT) {
|
||||
tfpAmountTFT.addEventListener('input', () => {
|
||||
const amount = parseFloat(tfpAmountTFT.value) || 0;
|
||||
const tftCost = amount * 0.5; // 1 TFC = 0.5 TFT
|
||||
const tftCost = amount * 0.5; // 1 MC = 0.5 TFT
|
||||
const modal = document.getElementById('buyTFCWithTFTModal');
|
||||
if (modal) {
|
||||
const rows = modal.querySelectorAll('.alert .d-flex.justify-content-between .text-end');
|
||||
// rows[0] -> Amount, rows[1] -> Cost
|
||||
if (rows[0]) rows[0].textContent = `${amount} TFC`;
|
||||
if (rows[0]) rows[0].textContent = `${amount} MC`;
|
||||
if (rows[1]) rows[1].textContent = `${tftCost.toFixed(1)} TFT`;
|
||||
}
|
||||
});
|
||||
@@ -222,11 +222,11 @@
|
||||
if (sellTfpAmountTFT) {
|
||||
sellTfpAmountTFT.addEventListener('input', () => {
|
||||
const amount = parseFloat(sellTfpAmountTFT.value) || 0;
|
||||
const tftReceive = amount * 0.5; // 1 TFC = 0.5 TFT
|
||||
const tftReceive = amount * 0.5; // 1 MC = 0.5 TFT
|
||||
const modal = document.getElementById('sellTFCForTFTModal');
|
||||
if (modal) {
|
||||
const rows = modal.querySelectorAll('.alert .d-flex.justify-content-between .text-end');
|
||||
if (rows[0]) rows[0].textContent = `${amount} TFC`;
|
||||
if (rows[0]) rows[0].textContent = `${amount} MC`;
|
||||
if (rows[1]) rows[1].textContent = `${tftReceive.toFixed(1)} TFT`;
|
||||
}
|
||||
});
|
||||
@@ -237,11 +237,11 @@
|
||||
if (tfpAmountPEAQ) {
|
||||
tfpAmountPEAQ.addEventListener('input', () => {
|
||||
const amount = parseFloat(tfpAmountPEAQ.value) || 0;
|
||||
const peaqCost = amount * 2.0; // 1 TFC = 2 PEAQ
|
||||
const peaqCost = amount * 2.0; // 1 MC = 2 PEAQ
|
||||
const modal = document.getElementById('buyTFCWithPEAQModal');
|
||||
if (modal) {
|
||||
const rows = modal.querySelectorAll('.alert .d-flex.justify-content-between .text-end');
|
||||
if (rows[0]) rows[0].textContent = `${amount} TFC`;
|
||||
if (rows[0]) rows[0].textContent = `${amount} MC`;
|
||||
if (rows[1]) rows[1].textContent = `${peaqCost.toFixed(0)} PEAQ`;
|
||||
}
|
||||
});
|
||||
@@ -252,11 +252,11 @@
|
||||
if (sellTfpAmountPEAQ) {
|
||||
sellTfpAmountPEAQ.addEventListener('input', () => {
|
||||
const amount = parseFloat(sellTfpAmountPEAQ.value) || 0;
|
||||
const peaqReceive = amount * 2.0; // 1 TFC = 2 PEAQ
|
||||
const peaqReceive = amount * 2.0; // 1 MC = 2 PEAQ
|
||||
const modal = document.getElementById('sellTFCForPEAQModal');
|
||||
if (modal) {
|
||||
const rows = modal.querySelectorAll('.alert .d-flex.justify-content-between .text-end');
|
||||
if (rows[0]) rows[0].textContent = `${amount} TFC`;
|
||||
if (rows[0]) rows[0].textContent = `${amount} MC`;
|
||||
if (rows[1]) rows[1].textContent = `${peaqReceive.toFixed(0)} PEAQ`;
|
||||
}
|
||||
});
|
||||
@@ -375,7 +375,7 @@
|
||||
},
|
||||
body: JSON.stringify({ amount, payment_method: 'TFT' }),
|
||||
});
|
||||
showSuccessToast(`Purchased ${amount} TFC with TFT`);
|
||||
showSuccessToast(`Purchased ${amount} MC with TFT`);
|
||||
const modal = document.getElementById('buyTFCWithTFTModal');
|
||||
if (modal && window.bootstrap) bootstrap.Modal.getOrCreateInstance(modal).hide();
|
||||
} catch (e) {
|
||||
@@ -398,7 +398,7 @@
|
||||
},
|
||||
body: JSON.stringify({ amount, currency: 'TFT', payout_method: 'blockchain' }),
|
||||
});
|
||||
showSuccessToast(`Sold ${amount} TFC for TFT`);
|
||||
showSuccessToast(`Sold ${amount} MC for TFT`);
|
||||
const modal = document.getElementById('sellTFCForTFTModal');
|
||||
if (modal && window.bootstrap) bootstrap.Modal.getOrCreateInstance(modal).hide();
|
||||
} catch (e) {
|
||||
@@ -421,7 +421,7 @@
|
||||
},
|
||||
body: JSON.stringify({ amount, payment_method: 'PEAQ' }),
|
||||
});
|
||||
showSuccessToast(`Purchased ${amount} TFC with PEAQ`);
|
||||
showSuccessToast(`Purchased ${amount} MC with PEAQ`);
|
||||
const modal = document.getElementById('buyTFCWithPEAQModal');
|
||||
if (modal && window.bootstrap) bootstrap.Modal.getOrCreateInstance(modal).hide();
|
||||
} catch (e) {
|
||||
@@ -444,7 +444,7 @@
|
||||
},
|
||||
body: JSON.stringify({ amount, currency: 'PEAQ', payout_method: 'blockchain' }),
|
||||
});
|
||||
showSuccessToast(`Sold ${amount} TFC for PEAQ`);
|
||||
showSuccessToast(`Sold ${amount} MC for PEAQ`);
|
||||
const modal = document.getElementById('sellTFCForPEAQModal');
|
||||
if (modal && window.bootstrap) bootstrap.Modal.getOrCreateInstance(modal).hide();
|
||||
} catch (e) {
|
||||
|
@@ -411,24 +411,24 @@
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-success text-white">
|
||||
<h5 class="modal-title" id="buyTFCWithTFTModalLabel">Buy ThreeFold Credits (TFC) with TFT</h5>
|
||||
<h5 class="modal-title" id="buyTFCWithTFTModalLabel">Buy Mycelium Credits (MC) with TFT</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label for="tfcAmountTFT" class="form-label">Amount of TFC Credits to purchase</label>
|
||||
<label for="tfcAmountTFT" class="form-label">Amount of MC Credits to purchase</label>
|
||||
<input type="number" class="form-control" id="tfpAmountTFT" min="10" value="100">
|
||||
</div>
|
||||
<div class="alert alert-info">
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="bi bi-info-circle-fill me-2 fs-4"></i>
|
||||
<div>
|
||||
<strong>Exchange Rate:</strong> 1 TFC = 0.5 TFT
|
||||
<strong>Exchange Rate:</strong> 1 MC = 0.5 TFT
|
||||
<hr class="my-2">
|
||||
<div class="d-flex justify-content-between">
|
||||
<span>Amount:</span>
|
||||
<span class="text-end">100 TFC</span>
|
||||
<span class="text-end">100 MC</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between">
|
||||
<span>Cost:</span>
|
||||
@@ -452,25 +452,25 @@
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-success text-white">
|
||||
<h5 class="modal-title" id="sellTFCForTFTModalLabel">Sell ThreeFold Credits (TFC) for TFT</h5>
|
||||
<h5 class="modal-title" id="sellTFCForTFTModalLabel">Sell Mycelium Credits (MC) for TFT</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label for="sellTfcAmountTFT" class="form-label">Amount of TFC Credits to sell</label>
|
||||
<label for="sellTfcAmountTFT" class="form-label">Amount of MC Credits to sell</label>
|
||||
<input type="number" class="form-control" id="sellTfpAmountTFT" min="10" max="1250" value="100">
|
||||
<div class="form-text">Maximum available: 1,250 TFC</div>
|
||||
<div class="form-text">Maximum available: 1,250 MC</div>
|
||||
</div>
|
||||
<div class="alert alert-info">
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="bi bi-info-circle-fill me-2 fs-4"></i>
|
||||
<div>
|
||||
<strong>Exchange Rate:</strong> 1 TFC = 0.5 TFT
|
||||
<strong>Exchange Rate:</strong> 1 MC = 0.5 TFT
|
||||
<hr class="my-2">
|
||||
<div class="d-flex justify-content-between">
|
||||
<span>Amount:</span>
|
||||
<span class="text-end">100 TFC</span>
|
||||
<span class="text-end">100 MC</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between">
|
||||
<span>You receive:</span>
|
||||
@@ -494,24 +494,24 @@
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-info text-white">
|
||||
<h5 class="modal-title" id="buyTFCWithPEAQModalLabel">Buy ThreeFold Credits (TFC) with PEAQ</h5>
|
||||
<h5 class="modal-title" id="buyTFCWithPEAQModalLabel">Buy Mycelium Credits (MC) with PEAQ</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label for="tfcAmountPEAQ" class="form-label">Amount of TFC Credits to purchase</label>
|
||||
<label for="tfcAmountPEAQ" class="form-label">Amount of MC Credits to purchase</label>
|
||||
<input type="number" class="form-control" id="tfpAmountPEAQ" min="10" value="100">
|
||||
</div>
|
||||
<div class="alert alert-info">
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="bi bi-info-circle-fill me-2 fs-4"></i>
|
||||
<div>
|
||||
<strong>Exchange Rate:</strong> 1 TFC = 2 PEAQ
|
||||
<strong>Exchange Rate:</strong> 1 MC = 2 PEAQ
|
||||
<hr class="my-2">
|
||||
<div class="d-flex justify-content-between">
|
||||
<span>Amount:</span>
|
||||
<span class="text-end">100 TFC</span>
|
||||
<span class="text-end">100 MC</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between">
|
||||
<span>Cost:</span>
|
||||
@@ -535,25 +535,25 @@
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-info text-white">
|
||||
<h5 class="modal-title" id="sellTFCForPEAQModalLabel">Sell ThreeFold Credits (TFC) for PEAQ</h5>
|
||||
<h5 class="modal-title" id="sellTFCForPEAQModalLabel">Sell Mycelium Credits (MC) for PEAQ</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label for="sellTfcAmountPEAQ" class="form-label">Amount of TFC Credits to sell</label>
|
||||
<label for="sellTfcAmountPEAQ" class="form-label">Amount of MC Credits to sell</label>
|
||||
<input type="number" class="form-control" id="sellTfpAmountPEAQ" min="10" max="1250" value="100">
|
||||
<div class="form-text">Maximum available: 1,250 TFC</div>
|
||||
<div class="form-text">Maximum available: 1,250 MC</div>
|
||||
</div>
|
||||
<div class="alert alert-info">
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="bi bi-info-circle-fill me-2 fs-4"></i>
|
||||
<div>
|
||||
<strong>Exchange Rate:</strong> 1 TFC = 2 PEAQ
|
||||
<strong>Exchange Rate:</strong> 1 MC = 2 PEAQ
|
||||
<hr class="my-2">
|
||||
<div class="d-flex justify-content-between">
|
||||
<span>Amount:</span>
|
||||
<span class="text-end">100 TFC</span>
|
||||
<span class="text-end">100 MC</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between">
|
||||
<span>You receive:</span>
|
||||
|
@@ -1,11 +1,11 @@
|
||||
{% extends "dashboard/layout.html" %}
|
||||
|
||||
{% block title %}ThreeFold Dashboard - Settings{% endblock %}
|
||||
{% block title %}Mycelium Dashboard - Settings{% endblock %}
|
||||
|
||||
{% block dashboard_content %}
|
||||
<div class="my-4">
|
||||
<h1>Account Settings</h1>
|
||||
<p class="lead">Manage your ThreeFold account preferences and security settings</p>
|
||||
<p class="lead">Manage your Mycelium account preferences and security settings</p>
|
||||
|
||||
<div class="row mt-5">
|
||||
<div class="col-md-3">
|
||||
@@ -415,7 +415,7 @@
|
||||
<div class="col-sm-9">
|
||||
<select class="form-select" id="displayCurrency" name="display_currency">
|
||||
<option value="USD" {% if user_display_currency == "USD" %}selected{% endif %}>USD - US Dollar</option>
|
||||
<option value="TFC" {% if user_display_currency == "TFC" %}selected{% endif %}>TFC - ThreeFold Credits</option>
|
||||
<option value="MC" {% if user_display_currency == "MC" %}selected{% endif %}>MC - Mycelium Credit</option>
|
||||
<option value="EUR" {% if user_display_currency == "EUR" %}selected{% endif %}>EUR - Euro</option>
|
||||
<option value="CAD" {% if user_display_currency == "CAD" %}selected{% endif %}>CAD - Canadian Dollar</option>
|
||||
</select>
|
||||
@@ -425,7 +425,7 @@
|
||||
|
||||
<div class="alert alert-info">
|
||||
<i class="bi bi-info-circle me-2"></i>
|
||||
<strong>Note:</strong> All transactions are processed in USD Credits. Display currency is used for convenience only and prices are converted in real-time.
|
||||
<strong>Note:</strong> All transactions are processed in MC Credits. Display currency is used for convenience only and prices are converted in real-time.
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-end">
|
||||
|
Reference in New Issue
Block a user