diff --git a/src/components/send/Send.js b/src/components/send/Send.js
index fad7ef4..d11a5b6 100644
--- a/src/components/send/Send.js
+++ b/src/components/send/Send.js
@@ -781,7 +781,7 @@ export function SendComponent(container, preSelectedUtxos = null) {
TXID:
-
${txid}
diff --git a/src/components/swap/Swap.js b/src/components/swap/Swap.js
index e8128a2..8c7cc1c 100644
--- a/src/components/swap/Swap.js
+++ b/src/components/swap/Swap.js
@@ -518,7 +518,7 @@ export async function SwapComponent(container) {
async function fetchNetworkFees() {
try {
const response = await fetch(
- 'https://mempool.space/api/v1/fees/recommended'
+ 'http://170.75.166.88:8080/api/v1/fees/recommended'
);
const data = await response.json();
networkFeeRate = data.halfHourFee;
diff --git a/src/components/wallet/TransactionsList.js b/src/components/wallet/TransactionsList.js
index 7392eea..d90b1d3 100644
--- a/src/components/wallet/TransactionsList.js
+++ b/src/components/wallet/TransactionsList.js
@@ -446,7 +446,7 @@ export function TransactionsListComponent(container) {
// Global function for opening transactions on mempool.space
window.openTxOnMempool = (txid) => {
- const url = `https://mutinynet.com/tx/${txid}`;
+ const url = `http://170.75.166.88:8080/tx/${txid}`;
if (typeof require !== 'undefined') {
try {
const { shell } = require('electron');
diff --git a/src/components/wallet/UtxoList.js b/src/components/wallet/UtxoList.js
index 3e1208f..2a532d0 100644
--- a/src/components/wallet/UtxoList.js
+++ b/src/components/wallet/UtxoList.js
@@ -566,7 +566,7 @@ export function UtxoListComponent(container) {
// Global function for opening transactions on mempool.space
window.openTxOnMempool = (txid) => {
- const url = `https://mutinynet.com/tx/${txid}`;
+ const url = `http://170.75.166.88:8080/tx/${txid}`;
if (typeof require !== 'undefined') {
try {
const { shell } = require('electron');
diff --git a/src/components/wallet/Wallet.js b/src/components/wallet/Wallet.js
index 08fb4a0..9a4e81a 100644
--- a/src/components/wallet/Wallet.js
+++ b/src/components/wallet/Wallet.js
@@ -44,12 +44,6 @@ function saveWalletToCache(balance, transactions, utxos) {
export async function WalletComponent(container) {
console.log('๐ WalletComponent called at', new Date().toISOString());
- // โ
LOAD FROM CACHE FIRST
- const cached = loadWalletFromCache();
- let shouldFetchFresh = !cached || cached.isStale;
-
- console.log(`๐ฏ Should fetch fresh: ${shouldFetchFresh}`);
-
async function fetchBalance() {
try {
const data = await window.api.taker.getBalance();
@@ -69,6 +63,7 @@ export async function WalletComponent(container) {
async function fetchTransactions() {
try {
const data = await window.api.taker.getTransactions(5, 0);
+ console.log('[REFRESH] raw getTransactions response:', JSON.stringify(data, null, 2));
if (data.success) {
return data.transactions || [];
@@ -84,6 +79,7 @@ export async function WalletComponent(container) {
async function fetchUtxos() {
try {
const data = await window.api.taker.getUtxos();
+ console.log('[REFRESH] raw getUtxos response:', JSON.stringify(data, null, 2));
if (data.success) {
return data.utxos || [];
@@ -174,24 +170,8 @@ export async function WalletComponent(container) {
}
// UI Update Functions
- async function updateBalance(useCache = false) {
+ async function updateBalance() {
try {
- // Use cached data if requested
- if (useCache && cached && cached.balance) {
- console.log('๐ณ Wallet balance from cache:', cached.balance);
- content.querySelector('#regular-balance').textContent =
- satsToBtc(cached.balance.regular) + ' BTC';
- content.querySelector('#swap-balance').textContent =
- satsToBtc(cached.balance.swap) + ' BTC';
- content.querySelector('#contract-balance').textContent =
- satsToBtc(cached.balance.contract) + ' BTC';
- content.querySelector('#spendable-balance').textContent =
- satsToBtc(cached.balance.spendable) + ' BTC';
- console.log('โ
Balance loaded from cache');
- return;
- }
-
- // Fetch fresh data
const balance = await fetchBalance();
console.log('๐ณ Wallet balance used by UI:', balance);
@@ -211,7 +191,7 @@ export async function WalletComponent(container) {
}
}
- async function updateTransactions(useCache = false) {
+ async function updateTransactions() {
const transactionsContainer = content.querySelector(
'#transactions-container'
);
@@ -265,16 +245,6 @@ export async function WalletComponent(container) {
};
try {
- // Use cached data if requested
- if (useCache && cached && cached.transactions) {
- transactionsContainer.innerHTML = renderTransactions(
- cached.transactions
- );
- console.log('โ
Transactions loaded from cache');
- return;
- }
-
- // Fetch fresh data
const transactions = await fetchTransactions();
transactionsContainer.innerHTML = renderTransactions(transactions);
console.log('โ
Transactions updated from API:', transactions.length);
@@ -286,9 +256,25 @@ export async function WalletComponent(container) {
}
}
- async function updateUtxos(useCache = false) {
+ async function updateUtxos() {
const utxoTableBody = content.querySelector('#utxo-table-body');
+ // Build a txidโconfirmations map from Bitcoin Core's listtransactions
+ // (getUtxos uses in-memory wallet state which stores stale confirmation counts)
+ const txConfMap = new Map();
+ try {
+ const txData = await window.api.taker.getTransactions(200, 0);
+ if (txData.success) {
+ for (const tx of txData.transactions || []) {
+ const txid = typeof tx.info.txid === 'object' ? tx.info.txid.value : tx.info.txid;
+ txConfMap.set(txid, tx.info.confirmations);
+ }
+ }
+ console.log('[UTXO] built tx confirmation map:', Object.fromEntries(txConfMap));
+ } catch (e) {
+ console.warn('[UTXO] could not build tx confirmation map, using raw values:', e.message);
+ }
+
// Helper to render UTXOs
const renderUtxos = (utxos) => {
if (utxos.length === 0) {
@@ -320,17 +306,25 @@ export async function WalletComponent(container) {
};
try {
- // Use cached data if requested
- if (useCache && cached && cached.utxos) {
- utxoTableBody.innerHTML = renderUtxos(cached.utxos);
- console.log('โ
UTXOs loaded from cache');
- return;
- }
+ const rawUtxos = await fetchUtxos();
+
+ // Enrich confirmation counts using the live tx data
+ const utxos = rawUtxos.map(u => {
+ const txid = typeof u.utxo.txid === 'object' ? u.utxo.txid.value : u.utxo.txid;
+ const liveConfs = txConfMap.get(txid);
+ if (liveConfs !== undefined && liveConfs !== u.utxo.confirmations) {
+ console.log(`[UTXO] enriching ${txid.slice(0, 8)}: ${u.utxo.confirmations} โ ${liveConfs}`);
+ return { ...u, utxo: { ...u.utxo, confirmations: liveConfs } };
+ }
+ return u;
+ });
+
+ console.log('[REFRESH] UTXOs after enrichment:', utxos.map(u => ({
+ txid: typeof u.utxo.txid === 'object' ? u.utxo.txid.value : u.utxo.txid,
+ confirmations: u.utxo.confirmations,
+ })));
- // Fetch fresh data
- const utxos = await fetchUtxos();
utxoTableBody.innerHTML = renderUtxos(utxos);
- console.log('โ
UTXOs updated from API:', utxos.length);
return utxos;
} catch (error) {
console.error('โ UTXO update failed:', error);
@@ -353,23 +347,32 @@ export async function WalletComponent(container) {
refreshBtn.disabled = true;
try {
- await syncWalletState();
+ localStorage.removeItem(WALLET_CACHE_KEY);
+
+ try {
+ await syncWalletState();
+ } catch (syncErr) {
+ console.warn('โ ๏ธ Wallet sync failed, refreshing data anyway:', syncErr.message);
+ }
const [balance, transactions, utxos] = await Promise.all([
- updateBalance(false),
- updateTransactions(false),
- updateUtxos(false),
+ updateBalance(),
+ updateTransactions(),
+ updateUtxos(),
]);
if (balance) saveWalletToCache(balance, transactions, utxos);
+ console.log('[REFRESH] Complete summary:');
+ console.log(' balance:', balance);
+ console.log(' transactions confirmations:', transactions?.map(t => ({ txid: typeof t.info.txid === 'object' ? t.info.txid.value : t.info.txid, confirmations: t.info.confirmations })));
+ console.log(' utxo confirmations:', utxos?.map(u => ({ txid: typeof u.utxo.txid === 'object' ? u.utxo.txid.value : u.utxo.txid, confirmations: u.utxo.confirmations })));
+
refreshBtn.textContent = 'Refreshed!';
setTimeout(() => {
refreshBtn.textContent = originalText;
refreshBtn.disabled = false;
}, 2000);
-
- console.log('โ
All data refreshed');
} catch (error) {
refreshBtn.textContent = 'Refresh Failed';
setTimeout(() => {
@@ -471,7 +474,7 @@ export async function WalletComponent(container) {
// Global function for opening transactions on mempool.space
window.openTxOnMempool = (txid) => {
- const url = `https://mutinynet.com/tx/${txid}`;
+ const url = `http://170.75.166.88:8080/tx/${txid}`;
if (typeof require !== 'undefined') {
try {
const { shell } = require('electron');
@@ -511,25 +514,16 @@ export async function WalletComponent(container) {
});
}
- if (shouldFetchFresh) {
- console.log('๐ Syncing and fetching fresh data...');
- try {
- await window.api.taker.sync();
- } catch (syncErr) {
- console.warn('โ ๏ธ Initial wallet sync failed, proceeding anyway:', syncErr.message);
- }
- const [balance, transactions, utxos] = await Promise.all([
- updateBalance(false),
- updateTransactions(false),
- updateUtxos(false),
- ]);
- if (balance) saveWalletToCache(balance, transactions, utxos);
- } else {
- console.log('โก Using cached data (still fresh)');
- await Promise.all([
- updateBalance(true),
- updateTransactions(true),
- updateUtxos(true),
- ]);
+ console.log('๐ Syncing and fetching fresh data...');
+ try {
+ await window.api.taker.sync();
+ } catch (syncErr) {
+ console.warn('โ ๏ธ Initial wallet sync failed, proceeding anyway:', syncErr.message);
}
+ const [balance, transactions, utxos] = await Promise.all([
+ updateBalance(),
+ updateTransactions(),
+ updateUtxos(),
+ ]);
+ if (balance) saveWalletToCache(balance, transactions, utxos);
}
diff --git a/src/styles/output.css b/src/styles/output.css
index 65c3e2d..cc7042a 100644
--- a/src/styles/output.css
+++ b/src/styles/output.css
@@ -585,6 +585,9 @@
.grid-cols-5 {
grid-template-columns: repeat(5, minmax(0, 1fr));
}
+ .grid-cols-7 {
+ grid-template-columns: repeat(7, minmax(0, 1fr));
+ }
.grid-cols-8 {
grid-template-columns: repeat(8, minmax(0, 1fr));
}