mining-pool/frontend/app/utils/strings.js
Claude 909bff2dd9
rebrand(lethean): update branding, ports, and config for Lethean blockchain
- Coin: Zano → Lethean, ticker: ZAN/ZANO → LTHN
- Ports: 11211 → 36941 (mainnet RPC), 46941 (testnet RPC)
- Wallet: 11212 → 36944/46944
- Address prefix: iTHN
- URLs: zano.org → lethean.io
- Explorer links: explorer.lthn.io

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 22:24:13 +01:00

42 lines
1.1 KiB
JavaScript

'use strict';
angular.module('utils.strings', [])
.filter('toLTHN', function() {
return function(amount) {
return amount / 1000000000000; // 12 decimal places for LTHN
};
})
// Keep toXMR as alias for backwards compatibility with templates
.filter('toXMR', function() {
return function(amount) {
return amount / 1000000000000;
};
})
.filter('toHashRate', function() {
return function(hashes) {
if (hashes > 1000000) {
return Math.floor(hashes / 1000000) + "." + (hashes % 1000000).toString().substring(0, 1) + " MH/s"
}
if (hashes > 1000) {
return Math.floor(hashes / 1000) + "." + (hashes % 1000).toString().substring(0, 1) + " KH/s"
}
return ( hashes || 0 ) + " H/s"
};
})
.filter('hashToLink', function($sce) {
return function(hash, type) {
var str = (hash == undefined) ? 'none' : "<a class=\"md-body-2\" target=\"_new\" href=\"https://explorer.lethean.io/"+type+"/" + hash + "\">" + hash + "</a>";
return $sce.trustAsHtml(str);
};
})
.filter('difficultyToHashRate', function() {
return function(hashrate) {
return Math.floor(hashrate / 120)
};
});