Try it Live
Run FeeMarket examples in the interactive playground
FeeMarket Types
TypeScript types for fee market state and calculations.State
gasUsed- Gas used in block (0 to gasLimit)gasLimit- Maximum gas per blockbaseFee- Base fee per gas (wei), minimum 7excessBlobGas- Accumulated excess blob gasblobGasUsed- Blob gas used in block (0 to 786432)
Eip1559State
Eip4844State
TxFeeParams
maxFeePerGas- Maximum total fee per gas (wei)maxPriorityFeePerGas- Maximum priority fee/tip (wei)baseFee- Current block base fee (wei)
maxFeePerGas >= baseFee(or tx cannot be included)maxPriorityFeePerGas <= maxFeePerGas
BlobTxFeeParams
TxFeeParams.
Additional Properties:
maxFeePerBlobGas- Maximum fee per blob gas (wei)blobBaseFee- Current blob base fee (wei)blobCount- Number of blobs (1-6)
maxFeePerBlobGas >= blobBaseFee(or tx cannot be included)1 <= blobCount <= 6
TxFee
effectiveGasPrice- Actual price per gas paid (wei)priorityFee- Priority fee per gas paid (wei)baseFee- Base fee per gas (wei)
effectiveGasPrice = min(maxFeePerGas, baseFee + maxPriorityFeePerGas)priorityFee = effectiveGasPrice - baseFee
BlobTxFee
TxFee.
Additional Properties:
blobGasPrice- Actual blob gas price paid (wei per blob gas)totalBlobFee- Total fee for all blobs (wei)
blobGasPrice = min(maxFeePerBlobGas, blobBaseFee)totalBlobFee = blobGasPrice * BLOB_GAS_PER_BLOB * blobCount
Type Guards
All types are plain TypeScript interfaces. No runtime type guards provided.Type Relationships
Branded Types
Types inBrandedState.ts are identical to main types. No phantom branding used.

