@ethereumjs/block / BlockHeader
Defined in: header/header.ts:44
An object that represents the block header.
new BlockHeader(
headerData,opts):BlockHeader
Defined in: header/header.ts:99
This constructor takes the values, validates them, assigns them and freezes the object.
BlockOptions = {}
BlockHeader
Use the public static factory methods to assist in creating a Header object from varying data types. For a default empty header, use createBlockHeader.
readonlyoptionalbaseFeePerGas:bigint
Defined in: header/header.ts:60
readonlyoptionalblobGasUsed:bigint
Defined in: header/header.ts:62
readonlyoptionalblockAccessListHash:Uint8Array<ArrayBufferLike>
Defined in: header/header.ts:67
EIP-7928 block access list hash. Experimental (Amsterdam); may change on patch releases.
readonlycoinbase:Address
Defined in: header/header.ts:47
readonlycommon:Common
Defined in: header/header.ts:71
readonlydifficulty:bigint
Defined in: header/header.ts:52
readonlyoptionalexcessBlobGas:bigint
Defined in: header/header.ts:63
readonlyextraData:Uint8Array
Defined in: header/header.ts:57
readonlygasLimit:bigint
Defined in: header/header.ts:54
readonlygasUsed:bigint
Defined in: header/header.ts:55
readonlylogsBloom:Uint8Array
Defined in: header/header.ts:51
readonlymixHash:Uint8Array
Defined in: header/header.ts:58
readonlynonce:Uint8Array
Defined in: header/header.ts:59
readonlynumber:bigint
Defined in: header/header.ts:53
readonlyoptionalparentBeaconBlockRoot:Uint8Array<ArrayBufferLike>
Defined in: header/header.ts:64
readonlyparentHash:Uint8Array
Defined in: header/header.ts:45
readonlyreceiptTrie:Uint8Array
Defined in: header/header.ts:50
readonlyoptionalrequestsHash:Uint8Array<ArrayBufferLike>
Defined in: header/header.ts:65
readonlyoptionalslotNumber:bigint
Defined in: header/header.ts:69
EIP-7843 slot number. Experimental (Amsterdam); may change on patch releases.
readonlystateRoot:Uint8Array
Defined in: header/header.ts:48
readonlytimestamp:bigint
Defined in: header/header.ts:56
readonlytransactionsTrie:Uint8Array
Defined in: header/header.ts:49
readonlyuncleHash:Uint8Array
Defined in: header/header.ts:46
readonlyoptionalwithdrawalsRoot:Uint8Array<ArrayBufferLike>
Defined in: header/header.ts:61
get prevRandao():
Uint8Array<ArrayBufferLike>
Defined in: header/header.ts:82
EIP-4399: After merge to PoS, mixHash supplanted as prevRandao
Uint8Array<ArrayBufferLike>
calcDataFee(
numBlobs):bigint
Defined in: header/header.ts:594
Returns the total fee for blob gas spent for including blobs in block.
number
number of blobs in the transaction/block
bigint
the total blob gas fee for numBlobs blobs
calcNextBaseFee():
bigint
Defined in: header/header.ts:543
Calculates the base fee for a potential next block
bigint
calcNextBlobGasPrice(
childCommon):bigint
Defined in: header/header.ts:638
Calculate the blob gas price of the block built on top of this one
Common
bigint
The blob gas price
calcNextExcessBlobGas(
childCommon):bigint
Defined in: header/header.ts:605
Calculates the excess blob gas for next (hopefully) post EIP 4844 block.
Common
bigint
errorStr():
string
Defined in: header/header.ts:865
Return a compact error string representation of the object
string
ethashCanonicalDifficulty(
parentBlockHeader):bigint
Defined in: header/header.ts:715
Returns the canonical difficulty for this block.
BlockHeader
the header from the parent Block of this header
bigint
getBlobGasPrice():
bigint
Defined in: header/header.ts:581
Returns the price per unit of blob gas for a blob transaction in the current/pending block
bigint
the price in gwei per unit of blob gas spent
hash():
Uint8Array
Defined in: header/header.ts:695
Returns the hash of the block header.
Uint8Array
isGenesis():
boolean
Defined in: header/header.ts:706
Checks if the block header is a genesis header.
boolean
raw():
BlockHeaderBytes
Defined in: header/header.ts:645
Returns a Uint8Array Array of the raw Bytes in this header, in order.
serialize():
Uint8Array
Defined in: header/header.ts:786
Returns the rlp encoding of the block header.
Uint8Array
toJSON():
JSONHeader
Defined in: header/header.ts:793
Returns the block header in JSON format.
validateGasLimit(
parentBlockHeader):void
Defined in: header/header.ts:497
Validates if the block gasLimit remains in the boundaries set by the protocol. Throws if out of bounds.
BlockHeader
the header from the parent Block of this header
void