I'm trying to calculate in ethers.js the cost of a transaction on BSC. I found on another thread the following snippet of code:
getTxCost = async (txHash) => {
let receipt = await provider.getTransactionReceipt(txHash);
return receipt.effectiveGasPrice.mul(receipt.gasUsed);
};
but the problem is that effectiveGasPrice seems to not exist on BSC. How can I get this value? Thanks