Skip to main content
A Block represents the data associated with a full block on Ethereum.

Extended by

Implements

Constructors

new Block()

Create a new Block object. This should generally not be necessary as the unless implementing a low-level library.

Parameters

Returns

Block

Source

providers/provider.ts:627

Properties

Accessors

date

The Date this block was included at.

Returns

null | Date The date this block was included at, or null if the timestamp is not available.

Source

providers/provider.ts:826

length

The number of transactions in this block.

Returns

number The number of transactions.

Source

providers/provider.ts:816

outboundEtxs

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

Returns

readonly string[] The list of extended transaction hashes.

Source

providers/provider.ts:689

prefetchedExtTransactions

Returns the complete extended 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 getBlock.

Throws

If the transactions were not prefetched.

Returns

ExternalTransactionResponse[] The list of prefetched extended transactions.

Source

providers/provider.ts:737

prefetchedTransactions

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 getBlock.

Throws

If the transactions were not prefetched.

Returns

TransactionResponse[] The list of prefetched transactions.

Source

providers/provider.ts:707

transactions

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

Returns

readonly string[] The list of transaction hashes.

Source

providers/provider.ts:675

Methods

getExtTransaction()

Get the extended transaction at index within this block.

Parameters

Returns

Promise<ExternalTransactionResponse> A promise resolving to the extended transaction.

Throws

If the extended transaction is not found.

Source

providers/provider.ts:883

getPrefetchedTransaction()

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.

Parameters

Returns

TransactionResponse The transaction.

Throws

If the transaction is not found.

Source

providers/provider.ts:927

getTransaction()

Get the transaction at index within this block.

Parameters

Returns

Promise<TransactionResponse | ExternalTransactionResponse> A promise resolving to the transaction.

Throws

If the transaction is not found.

Source

providers/provider.ts:842

isMined()

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

Returns

this is MinedBlock True if the block has been mined.

Source

providers/provider.ts:949

toJSON()

Returns a JSON-friendly value.

Returns

BlockParams The JSON-friendly value.

Source

providers/provider.ts:763