Debug-log every API request and response
Some checks failed
check / check (push) Has been cancelled

Add debugFetch wrapper in log.js that logs method, URL, and body on
request, and status code on response. Replace all fetch() calls
across balances, transactions, tokens, background RPC proxy, and
settings validation with debugFetch.
This commit is contained in:
2026-02-26 15:40:09 +07:00
parent 47e690f466
commit d24c10ca9c
6 changed files with 24 additions and 11 deletions

View File

@@ -5,6 +5,8 @@
// Source: Etherscan, CoinGecko, CoinMarketCap as of 2026-02-25.
// Ordered by approximate market cap descending.
const { debugFetch } = require("./log");
const COINDESK_API = "https://data-api.coindesk.com/index/cc/v1/latest/tick";
const DEFAULT_TOKENS = [
@@ -818,7 +820,7 @@ async function getTopTokenPrices(n) {
"?market=cadli&instruments=" +
instruments +
"&apply_mapping=true";
const resp = await fetch(url);
const resp = await debugFetch(url);
const json = await resp.json();
const prices = {};
for (const [instrument, data] of Object.entries(json.Data || {})) {