@nomicfoundation/ethereumjs-tx
Version:
Implementation of the various Ethereum Transaction Types
8 lines • 333 B
JavaScript
export function getUpfrontCost(tx, baseFee) {
const prio = tx.maxPriorityFeePerGas;
const maxBase = tx.maxFeePerGas - baseFee;
const inclusionFeePerGas = prio < maxBase ? prio : maxBase;
const gasPrice = inclusionFeePerGas + baseFee;
return tx.gasLimit * gasPrice + tx.value;
}
//# sourceMappingURL=eip1559.js.map