diff --git a/src/components/PercentageGauge.tsx b/src/components/PercentageGauge.tsx index 23af8f7..bba06a1 100644 --- a/src/components/PercentageGauge.tsx +++ b/src/components/PercentageGauge.tsx @@ -2,29 +2,29 @@ import React from "react"; type PercentageGaugeProps = { perc: number; - bgFull: string; - bgPerc: string; - textPerc: string; + bgColor: string; + bgColorPerc: string; + textColor: string; }; const PercentageGauge: React.FC = ({ perc, - bgFull, - bgPerc, - textPerc, + bgColor, + bgColorPerc, + textColor, }) => (
-
+
{perc}%
diff --git a/src/transaction/RewardSplit.tsx b/src/transaction/RewardSplit.tsx index 9005d12..23c527d 100644 --- a/src/transaction/RewardSplit.tsx +++ b/src/transaction/RewardSplit.tsx @@ -10,20 +10,22 @@ type RewardSplitProps = { }; const RewardSplit: React.FC = ({ txData }) => { + const paidFees = txData.gasPrice.mul(txData.gasUsed); const burntFees = txData.blockBaseFeePerGas!.mul(txData.gasUsed); - const minerReward = txData.gasPrice.mul(txData.gasUsed).sub(burntFees); + + const minerReward = paidFees.sub(burntFees); const burntPerc = - burntFees.mul(10000).div(txData.gasPrice.mul(txData.gasUsed)).toNumber() / - 100; + Math.round(burntFees.mul(10000).div(paidFees).toNumber()) / 100; + const minerPerc = Math.round((100 - burntPerc) * 100) / 100; return (
@@ -39,10 +41,10 @@ const RewardSplit: React.FC = ({ txData }) => {