Cross-Chain Liquidity Tracker

Add New Liquidity Source

Tracked Liquidity Sources

  • No liquidity sources tracked yet.

Asset B / Details: ${escapeHtml(source.assetB)}

` : ''}

Liquidity Amount: ${escapeHtml(source.liquidity)}

Notes: ${escapeHtml(source.notes).replace(/\n/g, '
')}

Last Updated (Client): ${lastUpdated}

`; sourcesList.appendChild(listItem); }); } } if (addSourceButton) { addSourceButton.addEventListener('click', function() { const name = sourceNameInput.value.trim(); const chainA = chainASelect.value; const assetA = assetAInput.value.trim(); const chainB = chainBSelect.value; const assetB = assetBInput.value.trim(); const liquidity = liquidityAmountInput.value.trim(); const link = sourceLinkInput.value.trim(); const notes = notesInput.value.trim(); if (!name) { alert('Please enter a source name/label.'); return; } if (!chainA) { alert('Please select Chain A.'); return; } if (!assetA) { alert('Please enter Asset A details.'); return; } if (link && !/^https?:\/\/.+/.test(link)) { alert('Please enter a valid URL (starting with http:// or https://) for the dashboard/explorer link.'); return; } trackedSources.push({ name, chainA, assetA, chainB, assetB, liquidity, link, notes, lastUpdated: new Date().toISOString() }); saveSources(); renderSources(); // Clear form fields sourceNameInput.value = ''; chainASelect.value = 'Ethereum'; assetAInput.value = ''; chainBSelect.value = ''; assetBInput.value = ''; liquidityAmountInput.value = ''; sourceLinkInput.value = ''; notesInput.value = ''; }); } if (sourcesList) { sourcesList.addEventListener('click', function(event) { if (event.target.classList.contains('cclt-remove-button')) { const itemToRemove = event.target.closest('.cclt-source-item'); if (itemToRemove) { const index = parseInt(itemToRemove.getAttribute('data-index'), 10); trackedSources.splice(index, 1); saveSources(); renderSources(); } } }); } if (pdfButton) { pdfButton.addEventListener('click', function() { if (trackedSources.length === 0) { alert("No liquidity sources to export. Please add some sources first."); return; } window.print(); }); } // Initial load and render // Null check primary interactive elements before proceeding const criticalElements = [sourceNameInput, chainASelect, assetAInput, chainBSelect, assetBInput, liquidityAmountInput, sourceLinkInput, notesInput, addSourceButton, sourcesList, pdfButton, noSourcesMessage]; if (criticalElements.some(el => !el)) { console.error("CCLTracker: One or more critical HTML elements for the tracker are missing from the DOM."); const appDiv = document.getElementById('crossChainLiquidityTrackerApp'); if(appDiv) { appDiv.innerHTML = "

Error: Tool initialization failed. Required elements not found. Please check the HTML structure.

"; } return; // Stop further execution } loadSources(); renderSources(); });
Scroll to Top