diff --git a/.gitignore b/.gitignore index 1c91bc0..3c0be7b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules/ package-lock.json coinswap-ffi dist/ -squashfs-root/ \ No newline at end of file +squashfs-root/ +.DS_Store \ No newline at end of file diff --git a/src/components/market/Market.js b/src/components/market/Market.js index d624611..30e93ec 100644 --- a/src/components/market/Market.js +++ b/src/components/market/Market.js @@ -38,20 +38,20 @@ export function Market(container) { } } - function formatTorEndpoint(address, start = 14, end = 16) { + function formatTorEndpoint(address, start = 6, end = 0) { if (!address || typeof address !== 'string') return 'unknown'; const separatorIndex = address.lastIndexOf(':'); if (separatorIndex === -1) return address; - const host = address.slice(0, separatorIndex); + const host = address.slice(0, separatorIndex).replace(/\.onion$/i, ''); const port = address.slice(separatorIndex + 1); if (host.length <= start + end + 3) { return `${host}:${port}`; } - return `${host.slice(0, start)}...${host.slice(-end)}:${port}`; + return end > 0 ? `${host.slice(0, start)}..${host.slice(-end)}:${port}` : `${host.slice(0, start)}..:${port}`; } // Check sync state every second @@ -89,10 +89,16 @@ export function Market(container) { function transformMaker(item, index) { const offer = item.offer; - const addressObj = item.address || {}; - const onionAddr = addressObj.onion_addr || ''; - const port = addressObj.port || '6102'; - const fullAddress = `${onionAddr}:${port}`; + const addr = item.address; + let fullAddress; + if (typeof addr === 'string') { + fullAddress = addr.includes(':') ? addr : `${addr}:6102`; + } else { + const addressObj = addr || {}; + const onionAddr = addressObj.onion_addr || ''; + const port = addressObj.port || '6102'; + fullAddress = `${onionAddr}:${port}`; + } // Handle null offers (unresponsive makers) if (!offer) { @@ -584,7 +590,7 @@ export function Market(container) {

Bond Txid