import React from "react"; import { ethers } from "ethers"; import BlockLink from "../../components/BlockLink"; import TimestampAge from "../../components/TimestampAge"; import { ExtendedBlock } from "../../useErigonHooks"; import Blip from "./Blip"; const ELASTICITY_MULTIPLIER = 2; type BlockRowProps = { now: number; block: ExtendedBlock; baseFeeDelta: number; }; const BlockRow: React.FC = ({ now, block, baseFeeDelta }) => { const gasTarget = block.gasLimit.div(ELASTICITY_MULTIPLIER); const burntFees = block?.baseFeePerGas && block.baseFeePerGas.mul(block.gasUsed); const netFeeReward = block && block.feeReward.sub(burntFees ?? 0); const totalReward = block.blockReward.add(netFeeReward ?? 0); return (
{ethers.utils.commify(block.gasUsed.toString())}
{ethers.utils.commify(gasTarget.toString())}
{block.baseFeePerGas?.div(1e9).toString()} Gwei
{ethers.utils.commify(ethers.utils.formatEther(totalReward))} Ether
{ethers.utils.commify( ethers.utils.formatEther(block.gasUsed.mul(block.baseFeePerGas!)) )}{" "} ETH
); }; export default React.memo(BlockRow);