Skip to main content
@tevm/voltaire
@tevm/voltaire / primitives/BlockHeader

primitives/BlockHeader

Type Aliases

BlockHeaderType

BlockHeaderType = object
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:17 BlockHeader type - represents Ethereum block header Contains all metadata and Merkle roots for a block. Used for block validation and light client proofs.

See

Since

0.0.0

Properties

baseFeePerGas?
readonly optional baseFeePerGas: Type
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:49 EIP-1559: Base fee per gas (post-London)
beneficiary
readonly beneficiary: AddressType
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:23 Address receiving block reward (miner/validator)
blobGasUsed?
readonly optional blobGasUsed: Type
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:53 EIP-4844: Total blob gas used (post-Cancun)
difficulty
readonly difficulty: Type
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:33 Proof-of-work difficulty (0 post-merge)
excessBlobGas?
readonly optional excessBlobGas: Type
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:55 EIP-4844: Excess blob gas (post-Cancun)
extraData
readonly extraData: Uint8Array
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:43 Arbitrary data (max 32 bytes)
gasLimit
readonly gasLimit: Type
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:37 Maximum gas allowed in block
gasUsed
readonly gasUsed: Type
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:39 Total gas used by transactions
logsBloom
readonly logsBloom: Uint8Array
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:31 Bloom filter for logs (256 bytes)
mixHash
readonly mixHash: HashType
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:45 PoW mix hash (0 post-merge)
nonce
readonly nonce: Uint8Array
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:47 PoW nonce (8 bytes, 0 post-merge)
number
readonly number: BlockNumberType
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:35 Block number
ommersHash
readonly ommersHash: HashType
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:21 Keccak256 hash of ommers/uncles list RLP
parentBeaconBlockRoot?
readonly optional parentBeaconBlockRoot: HashType
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:57 EIP-4788: Parent beacon block root (post-Cancun)
parentHash
readonly parentHash: BlockHashType
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:19 Hash of parent block
receiptsRoot
readonly receiptsRoot: HashType
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:29 Receipts trie root
stateRoot
readonly stateRoot: HashType
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:25 State trie root after block execution
timestamp
readonly timestamp: Type
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:41 Unix timestamp (seconds)
transactionsRoot
readonly transactionsRoot: HashType
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:27 Transactions trie root
withdrawalsRoot?
readonly optional withdrawalsRoot: HashType
Defined in: src/primitives/BlockHeader/BlockHeaderType.ts:51 Post-merge: Withdrawals trie root (post-Shanghai)

Variables

BlockHeader

const BlockHeader: object
Defined in: src/primitives/BlockHeader/index.ts:37

Type Declaration

from()
from: (params) => BlockHeaderType
Parameters
params
baseFeePerGas?
string | number | bigint
beneficiary
string | AddressType
blobGasUsed?
string | number | bigint
difficulty
string | number | bigint
excessBlobGas?
string | number | bigint
extraData
Uint8Array
gasLimit
string | number | bigint
gasUsed
string | number | bigint
logsBloom
Uint8Array
mixHash
string | HashType
nonce
Uint8Array
number
number | bigint
ommersHash
string | HashType
parentBeaconBlockRoot?
string | HashType
parentHash
string | BlockHashType
receiptsRoot
string | HashType
stateRoot
string | HashType
timestamp
string | number | bigint
transactionsRoot
string | HashType
withdrawalsRoot?
string | HashType
Returns
BlockHeaderType

Functions

_from()

_from(params): BlockHeaderType
Defined in: src/primitives/BlockHeader/from.js:63 Create BlockHeader from components

Parameters

params
BlockHeaderParams BlockHeader parameters

Returns

BlockHeaderType BlockHeader

Example

const header = BlockHeader.from({
  parentHash: "0x1234...",
  ommersHash: "0x5678...",
  beneficiary: "0xabcd...",
  stateRoot: "0xef01...",
  transactionsRoot: "0x2345...",
  receiptsRoot: "0x6789...",
  logsBloom: new Uint8Array(256),
  difficulty: 0n,
  number: 12345n,
  gasLimit: 30000000n,
  gasUsed: 21000n,
  timestamp: 1234567890n,
  extraData: new Uint8Array(0),
  mixHash: "0xabcd...",
  nonce: new Uint8Array(8),
  baseFeePerGas: 1000000000n, // EIP-1559
  withdrawalsRoot: "0xdef0...", // Post-Shanghai
  blobGasUsed: 262144n, // EIP-4844
  excessBlobGas: 0n, // EIP-4844
  parentBeaconBlockRoot: "0x0123..." // EIP-4788
});

from()

from(params): BlockHeaderType
Defined in: src/primitives/BlockHeader/index.ts:11

Parameters

params
baseFeePerGas?
string | number | bigint
beneficiary
string | AddressType
blobGasUsed?
string | number | bigint
difficulty
string | number | bigint
excessBlobGas?
string | number | bigint
extraData
Uint8Array
gasLimit
string | number | bigint
gasUsed
string | number | bigint
logsBloom
Uint8Array
mixHash
string | HashType
nonce
Uint8Array
number
number | bigint
ommersHash
string | HashType
parentBeaconBlockRoot?
string | HashType
parentHash
string | BlockHashType
receiptsRoot
string | HashType
stateRoot
string | HashType
timestamp
string | number | bigint
transactionsRoot
string | HashType
withdrawalsRoot?
string | HashType

Returns

BlockHeaderType