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

@@ -7,7 +7,7 @@
// a pure function that applies anti-poisoning heuristics.
const { formatEther, formatUnits } = require("ethers");
const { log } = require("./log");
const { log, debugFetch } = require("./log");
const { KNOWN_SYMBOLS } = require("./tokens");
function formatTxValue(val) {
@@ -67,8 +67,8 @@ async function fetchRecentTransactions(address, blockscoutUrl, count = 25) {
const addrLower = address.toLowerCase();
const [txResp, ttResp] = await Promise.all([
fetch(blockscoutUrl + "/addresses/" + address + "/transactions"),
fetch(
debugFetch(blockscoutUrl + "/addresses/" + address + "/transactions"),
debugFetch(
blockscoutUrl +
"/addresses/" +
address +