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

@@ -8,6 +8,7 @@ const {
} = require("../shared/constants");
const { state, loadState, saveState } = require("../shared/state");
const { refreshBalances } = require("../shared/balances");
const { debugFetch } = require("../shared/log");
const storageApi =
typeof browser !== "undefined"
@@ -67,7 +68,7 @@ function extractHostname(origin) {
// Proxy an RPC call to the Ethereum node
async function proxyRpc(method, params) {
const rpcUrl = await getRpcUrl();
const resp = await fetch(rpcUrl, {
const resp = await debugFetch(rpcUrl, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({