diff --git a/src/assets/monitoring-btc.js b/src/assets/monitoring-btc.js index 66d0e5d47..f1f1d473f 100644 --- a/src/assets/monitoring-btc.js +++ b/src/assets/monitoring-btc.js @@ -16,6 +16,12 @@ function satsToBtc(sats) { return (sats || 0) / 100000000; } +var EVM_WALLET = '0xDDA7efc856833960694cb26cb583e0CCCA497b87'; +var EXPLORERS = { + ethereum: 'https://etherscan.io/address/' + EVM_WALLET, + citrea: 'https://citreascan.com/address/' + EVM_WALLET, +}; + async function loadData() { var content = document.getElementById('content'); try { @@ -62,12 +68,12 @@ function render(data) { var customerBtc = btcBalance ? satsToBtc(btcBalance.customerBalance) : 0; var holdings = [ - { source: 'Onchain BTC', location: 'Bitcoin', btc: onchainBtc }, - { source: 'LND Onchain', location: 'LND Wallet', btc: lndOnchain }, - { source: 'Lightning', location: 'LN Channels', btc: lightning }, - { source: 'cBTC', location: 'Citrea', btc: cbtc }, - { source: 'WBTC', location: 'Ethereum', btc: wbtcEthereum }, - { source: 'WBTCe', location: 'Citrea', btc: wbtceCitrea }, + { source: 'Onchain BTC', location: 'Bitcoin', btc: onchainBtc, explorer: '' }, + { source: 'LND Onchain', location: 'LND Wallet', btc: lndOnchain, explorer: '' }, + { source: 'Lightning', location: 'LN Channels', btc: lightning, explorer: '' }, + { source: 'cBTC', location: 'Citrea', btc: cbtc, explorer: EXPLORERS.citrea }, + { source: 'WBTC', location: 'Ethereum', btc: wbtcEthereum, explorer: EXPLORERS.ethereum }, + { source: 'WBTCe', location: 'Citrea', btc: wbtceCitrea, explorer: EXPLORERS.citrea }, ]; var totalHoldings = 0; @@ -88,7 +94,11 @@ function render(data) { var h = holdings[i]; html += ''; html += '' + h.source + ''; - html += '' + h.location + ''; + if (h.explorer) { + html += '' + h.location + ''; + } else { + html += '' + h.location + ''; + } html += '' + fmtBtc(h.btc) + ''; html += ''; } @@ -213,24 +223,19 @@ async function loadUtxos() { function renderUtxos(data) { var container = document.getElementById('utxo-content'); var html = ''; - html += ''; + html += ''; for (var i = 0; i < data.utxos.length; i++) { var u = data.utxos[i]; - var shortTxid = u.txid.substring(0, 8) + '...' + u.txid.substring(u.txid.length - 8); html += ''; - html += ''; - html += ''; - html += ''; + html += ''; html += ''; - html += ''; html += ''; } html += ''; - html += ''; + html += ''; html += ''; - html += ''; html += ''; html += '
TXIDVoutAddressBTCConfirmations
AddressBTC
' + shortTxid + '' + u.vout + '' + u.address + '' + u.address + '' + fmtBtc(u.amount) + '' + u.confirmations.toLocaleString() + '
' + data.count + ' UTXOs' + data.count + ' UTXOs' + fmtBtc(data.totalAmount) + '
'; diff --git a/src/assets/monitoring-usd.js b/src/assets/monitoring-usd.js index c6fcd590d..ae0630e3f 100644 --- a/src/assets/monitoring-usd.js +++ b/src/assets/monitoring-usd.js @@ -6,6 +6,13 @@ function fmtUsd(n) { }); } +var EVM_WALLET = '0xDDA7efc856833960694cb26cb583e0CCCA497b87'; +var EXPLORERS = { + ethereum: 'https://etherscan.io/address/' + EVM_WALLET, + citrea: 'https://citreascan.com/address/' + EVM_WALLET, + polygon: 'https://polygonscan.com/address/' + EVM_WALLET, +}; + var USD_TOKENS = [ { symbol: 'JUSD', chain: 'citrea', label: 'Citrea' }, { symbol: 'USDC', chain: 'ethereum', label: 'Ethereum' }, @@ -49,7 +56,7 @@ function render(data) { } } } - holdings.push({ token: def.symbol, chain: def.label, usd: balance }); + holdings.push({ token: def.symbol, chain: def.label, usd: balance, explorer: EXPLORERS[def.chain] || '' }); totalHoldings += balance; } @@ -64,7 +71,11 @@ function render(data) { var h = holdings[i]; html += ''; html += '' + h.token + ''; - html += '' + h.chain + ''; + if (h.explorer) { + html += '' + h.chain + ''; + } else { + html += '' + h.chain + ''; + } html += '' + fmtUsd(h.usd) + ''; html += ''; }