From 2ed832f4f4cabf01198f88c32b59ea4e4c462365 Mon Sep 17 00:00:00 2001 From: Vignesh Date: Tue, 9 Apr 2024 21:56:37 +0530 Subject: [PATCH] log responses from etherscan --- backend/src/utils/common.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/src/utils/common.ts b/backend/src/utils/common.ts index 2c82292..86ad8b2 100644 --- a/backend/src/utils/common.ts +++ b/backend/src/utils/common.ts @@ -40,11 +40,14 @@ export async function getEtherscanFee(chainId: number, log?: FastifyBaseLogger): if (etherscanUrlsBase64) { const buffer = Buffer.from(etherscanUrlsBase64, 'base64'); const etherscanUrls = JSON.parse(buffer.toString()); + console.log('etherscanUrl: ', etherscanUrls[chainId]); if (etherscanUrls[chainId]) { const data = await fetch(etherscanUrls[chainId]); const response: EtherscanResponse = await data.json(); + console.log('Etherscan Response: ', response); if (response.result && typeof response.result === "object" && response.status === "1") { + console.log('setting maxFeePerGas and maxPriorityFeePerGas as received') const maxFeePerGas = ethers.utils.parseUnits(response.result.suggestBaseFee, 'gwei') const fastGasPrice = ethers.utils.parseUnits(response.result.FastGasPrice, 'gwei') return { @@ -55,6 +58,7 @@ export async function getEtherscanFee(chainId: number, log?: FastifyBaseLogger): } if (response.result && typeof response.result === "string" && response.jsonrpc) { const gasPrice = BigNumber.from(response.result) + console.log('setting gas price as received') return { maxFeePerGas: gasPrice, maxPriorityFeePerGas: gasPrice,