Skip to content

Commit

Permalink
feat: update l2 fees
Browse files Browse the repository at this point in the history
  • Loading branch information
ponyjackal committed Feb 14, 2024
1 parent 6a1ff63 commit 9b69cd0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/transformers/ethereum/fees.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { RawBlock } from '../../types';
import { parseUnits } from 'viem';

export function transform(block: RawBlock): RawBlock {
block.transactions = block.transactions.map((tx) => {
Expand All @@ -18,7 +19,7 @@ export function transform(block: RawBlock): RawBlock {
const l1GasWithoutScalarAsNumber = Number(l1GasWithoutScalar);
const l1GasWithScalar = l1GasWithoutScalarAsNumber * scalar;

totalL2FeeWei = BigInt(l1GasWithScalar) + l2Gas;
totalL2FeeWei = parseUnits(l1GasWithScalar.toString(), 18) + l2Gas;
}

tx.baseFeePerGas = block.baseFeePerGas;
Expand Down

0 comments on commit 9b69cd0

Please sign in to comment.