Skip to content

MinedBlock

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:269

An Interface to indicate a [[Block]] has been included in the blockchain. This asserts a Type Guard that necessary properties are non-null.

Before a block is included, it is a //pending// block.

readonly baseFeePerGas: null | bigint;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:394

The base fee per gas that all transactions in this block were charged.

This adjusts after each block, depending on how congested the network is.

MinedBlock.baseFeePerGas


readonly blobGasUsed: null | bigint;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:367

The total amount of blob gas consumed by the transactions within the block. See [[link-eip-4844]].

MinedBlock.blobGasUsed


readonly date: Date;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:285

The block date, created from the [[timestamp]].

Block.date


readonly difficulty: bigint;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:345

The difficulty target.

On legacy networks, this is the proof-of-work target required for a block to meet the protocol rules to be included.

On modern networks, this is a random number arrived at using randao. @TODO: Find links?

Block.difficulty


readonly excessBlobGas: null | bigint;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:372

The running total of blob gas consumed in excess of the target, prior to the block. See [[link-eip-4844]].

MinedBlock.excessBlobGas


readonly extraData: string;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:386

Any extra data the validator wished to include.

Block.extraData


readonly gasLimit: bigint;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:349

The total gas limit for this block.

Block.gasLimit


readonly gasUsed: bigint;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:353

The total gas used in this block.

Block.gasUsed


readonly hash: string;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:277

The block hash.

Block.hash


readonly miner: string;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:290

The miner of the block, also known as the author or block producer.

Block.miner


readonly nonce: string;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:335

The nonce.

On legacy networks, this is the random number inserted which permitted the difficulty target to be reached.

Block.nonce


readonly number: number;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:273

The block number also known as the block height.

Block.number


parentBeaconBlockRoot: null | string;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:328

The hash tree root of the parent beacon block for the given execution block. See [[link-eip-4788]].

MinedBlock.parentBeaconBlockRoot


readonly parentHash: string;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:323

The block hash of the parent block.

Block.parentHash


readonly prevRandao: null | string;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:382

The latest RANDAO mix of the post beacon state of the previous block.

MinedBlock.prevRandao


readonly provider: Provider;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:302

The provider connected to the block used to fetch additional details if necessary.

Block.provider


readonly receiptsRoot: null | string;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:362

The hash of the transaction receipts trie.

MinedBlock.receiptsRoot


readonly stateRoot: null | string;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:358

The root hash for the global state after applying changes in this block.

MinedBlock.stateRoot


readonly timestamp: number;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:281

The block timestamp, in seconds from epoch.

Block.timestamp

get length(): number;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:424

The number of transactions in this block.

number

Block.length


get prefetchedTransactions(): TransactionResponse[];

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:415

Returns the complete transactions, in the order they were executed within the block.

This is only available for blocks which prefetched transactions, by passing true to %%prefetchTxs%% into [[Provider-getBlock]].

TransactionResponse[]

Block.prefetchedTransactions


get transactions(): readonly string[];

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:406

Returns the list of transaction hashes, in the order they were executed within the block.

readonly string[]

The list of transactions in the block.

Block.transactions

iterator: Iterator<string>;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:420

Iterator<string>

Block.[iterator]


getPrefetchedTransaction(indexOrHash): TransactionResponse;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:439

If a Block was fetched with a request to include the transactions this will allow synchronous access to those transactions.

If the transactions were not prefetched, this will throw.

ParameterType
indexOrHashstring | number

TransactionResponse

Block.getPrefetchedTransaction


getTransaction(indexOrHash): Promise<TransactionResponse>;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:432

Get the transaction at %%indexe%% within this block.

ParameterType
indexOrHashstring | number

Promise<TransactionResponse>

Block.getTransaction


isLondon(): this is Block & { baseFeePerGas: bigint };

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:448

Returns true if this block is an [[link-eip-2930]] block.

this is Block & { baseFeePerGas: bigint }

Block.isLondon


isMined(): this is MinedBlock;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:444

Returns true if this block been mined. This provides a type guard for all properties on a [[MinedBlock]].

this is MinedBlock

Block.isMined


orphanedEvent(): OrphanFilter;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:454

@_ignore:

OrphanFilter

Block.orphanedEvent


toJSON(): any;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/provider.d.ts:419

Returns a JSON-friendly value.

any

Block.toJSON