diff --git a/frontend/public/explorer-spa.js b/frontend/public/explorer-spa.js
index 8cbad5b..9625736 100644
--- a/frontend/public/explorer-spa.js
+++ b/frontend/public/explorer-spa.js
@@ -458,6 +458,39 @@
{ symbol: 'cXAUC', address: '0x290E52a8819A4fbD0714E517225429aA2B70EC6b' },
{ symbol: 'cXAUT', address: '0x94e408E26c6FD8F4ee00b54dF19082FDA07dC96E' }
];
+ function buildRouteSweepQueries(ctx) {
+ var officialUsdt = (ctx && ctx.officialUSDT) || '';
+ var officialUsdc = (ctx && ctx.officialUSDC) || '';
+ var queries = [];
+ CHAIN_138_ROUTE_SWEEP_TOKENS.forEach(function(token) {
+ var anchors = [];
+ if (token.symbol === 'cUSDT') {
+ anchors.push({ symbol: 'cUSDC', address: CHAIN_138_CUSDC_ADDRESS });
+ if (safeAddress(officialUsdt)) anchors.push({ symbol: 'USDT', address: officialUsdt });
+ } else if (token.symbol === 'cUSDC') {
+ anchors.push({ symbol: 'cUSDT', address: CHAIN_138_CUSDT_ADDRESS });
+ if (safeAddress(officialUsdc)) anchors.push({ symbol: 'USDC', address: officialUsdc });
+ } else {
+ anchors.push({ symbol: 'cUSDT', address: CHAIN_138_CUSDT_ADDRESS });
+ anchors.push({ symbol: 'cUSDC', address: CHAIN_138_CUSDC_ADDRESS });
+ }
+ anchors.forEach(function(anchor) {
+ if (!safeAddress(anchor.address)) return;
+ if (String(anchor.address).toLowerCase() === String(token.address).toLowerCase()) return;
+ queries.push({
+ key: token.symbol.toLowerCase() + '-' + anchor.symbol.toLowerCase(),
+ title: token.symbol + ' / ' + anchor.symbol + ' coverage probe',
+ symbol: token.symbol,
+ pairLabel: token.symbol + ' / ' + anchor.symbol,
+ tokenIn: token.address,
+ tokenOut: anchor.address,
+ destinationChainId: 138,
+ amountIn: '1000000'
+ });
+ });
+ });
+ return queries;
+ }
function stripHexPrefix(value) {
return String(value || '').replace(/^0x/i, '');
}
@@ -3268,14 +3301,14 @@
}
function renderRouteSweepSummary(results) {
- var html = '
| Token | Direct Pools | Missing Quote Pools | Decision | Freshest Status |
';
+ var html = '| Probe | Direct Pools | Missing Quote Pools | Decision | Freshest Status |
';
results.forEach(function(entry) {
var response = entry.response || {};
var pools = Array.isArray(response.pools) ? response.pools : [];
var missing = Array.isArray(response.missingQuoteTokenPools) ? response.missingQuoteTokenPools : [];
var freshest = pools.length ? pools[0].depth && pools[0].depth.status ? pools[0].depth.status : 'unknown' : 'none';
html += '';
- html += '| ' + escapeHtml(entry.query.symbol + ' ' + shortenHash(entry.query.tokenIn)) + ' | ';
+ html += '' + escapeHtml((entry.query.pairLabel || entry.query.title || entry.query.symbol || 'probe') + ' ' + shortenHash(entry.query.tokenIn)) + ' | ';
html += '' + escapeHtml(String(pools.length)) + ' | ';
html += '' + escapeHtml(String(missing.length)) + ' | ';
html += '' + escapeHtml(response.decision || 'unresolved') + ' | ';
@@ -3349,16 +3382,9 @@
try {
var ctx = await fetchCurrentPmmContext();
var priorityQueries = buildRoutePriorityQueries(ctx);
+ var sweepQueries = buildRouteSweepQueries(ctx);
var priorityResults = await Promise.allSettled(priorityQueries.map(fetchRouteTree));
- var sweepResults = await Promise.allSettled(CHAIN_138_ROUTE_SWEEP_TOKENS.map(function(token) {
- return fetchRouteTree({
- key: token.symbol.toLowerCase(),
- title: token.symbol + ' coverage sweep',
- symbol: token.symbol,
- tokenIn: token.address,
- amountIn: '1000000'
- });
- }));
+ var sweepResults = await Promise.allSettled(sweepQueries.map(fetchRouteTree));
var priorityOkResults = priorityResults.filter(function(result) { return result.status === 'fulfilled'; }).map(function(result) { return result.value; });
var priorityErrors = priorityResults.filter(function(result) { return result.status === 'rejected'; });
var sweepOkResults = sweepResults.filter(function(result) { return result.status === 'fulfilled'; }).map(function(result) { return result.value; });
@@ -3372,10 +3398,10 @@
html += '';
html += '';
html += '
Priority routes
' + escapeHtml(String(priorityOkResults.length)) + ' ok' + (priorityErrors.length ? ' / ' + String(priorityErrors.length) + ' failed' : '') + '
';
- html += '
Sweep tokens
' + escapeHtml(String(sweepOkResults.length)) + ' ok
';
+ html += '
Sweep probes
' + escapeHtml(String(sweepOkResults.length)) + ' ok
';
html += '
Missing quote routes
' + escapeHtml(String(allSweepMissing.length)) + '
';
html += '
';
- html += 'This sweep queries every known Chain 138 compliant token so we can catch direct pool depth, bridge-leg paths to Mainnet or other destinations, and any pools whose quote-token metadata is still missing in the index.
';
+ html += 'This sweep probes explicit local token pairs against compliant and official anchor assets on Chain 138. The priority route cards above remain the bridge-path checks; this table focuses on direct-pair coverage and quote-token metadata gaps.
';
html += renderRouteSweepSummary(sweepOkResults);
if (priorityErrors.length) {
html += 'Some priority route requests failed, but the pools table is still available.
';