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:
@@ -9,7 +9,7 @@ const {
|
||||
formatUnits,
|
||||
} = require("ethers");
|
||||
const { ERC20_ABI } = require("./constants");
|
||||
const { log } = require("./log");
|
||||
const { log, debugFetch } = require("./log");
|
||||
const { deriveAddressFromXpub } = require("./wallet");
|
||||
|
||||
// Use a static network to skip auto-detection (which can fail and cause
|
||||
@@ -40,7 +40,7 @@ function formatTokenBalance(raw, decimals) {
|
||||
// Returns [{ address, symbol, decimals, balance }].
|
||||
async function fetchTokenBalances(address, blockscoutUrl) {
|
||||
try {
|
||||
const resp = await fetch(
|
||||
const resp = await debugFetch(
|
||||
blockscoutUrl + "/addresses/" + address + "/token-balances",
|
||||
);
|
||||
if (!resp.ok) {
|
||||
|
||||
Reference in New Issue
Block a user