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.
Property | Modifier | Type | Description | Inherited from |
---|---|---|---|---|
provider | readonly | Provider | The provider connected to the block used to fetch additional details if necessary. | Block .provider |
The Date this block was included at.
null
| Date
The date this block was included at, or null if the timestamp is not available.
The number of transactions in this block.
number
The number of transactions.
Returns the list of extended transaction hashes, in the order they were executed within the block.
readonly string
[]
The list of extended transaction hashes.
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.
If the transactions were not prefetched.
ExternalTransactionResponse
[]
The list of prefetched extended transactions.
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.
If the transactions were not prefetched.
The list of prefetched transactions.
Returns the list of transaction hashes, in the order they were executed within the block.
readonly string
[]
The list of transaction hashes.
Get the extended transaction at index
within this block.
Parameter | Type | Description |
---|---|---|
indexOrHash | string | number | The index or hash of the extended transaction. |
Promise
<ExternalTransactionResponse
>
A promise resolving to the extended transaction.
If the extended transaction is not found.
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.
Parameter | Type | Description |
---|---|---|
indexOrHash | string | number | The index or hash of the transaction. |
The transaction.
Block
.getPrefetchedTransaction
If the transaction is not found.
Get the transaction at index
within this block.
Parameter | Type | Description |
---|---|---|
indexOrHash | string | number | The index or hash of the transaction. |
Promise
<TransactionResponse
| ExternalTransactionResponse
>
A promise resolving to the transaction.
If the transaction is not found.
Returns true if this block been mined. This provides a type guard for all properties on a MinedBlock.
this is MinedBlock
True if the block has been mined.
Returns a JSON-friendly value.
The JSON-friendly value.
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.
Property | Modifier | Type | Description | Inherited from |
---|---|---|---|---|
provider | readonly | Provider | The provider connected to the block used to fetch additional details if necessary. | Block .provider |
The Date this block was included at.
null
| Date
The date this block was included at, or null if the timestamp is not available.
The number of transactions in this block.
number
The number of transactions.
Returns the list of extended transaction hashes, in the order they were executed within the block.
readonly string
[]
The list of extended transaction hashes.
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.
If the transactions were not prefetched.
ExternalTransactionResponse
[]
The list of prefetched extended transactions.
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.
If the transactions were not prefetched.
The list of prefetched transactions.
Returns the list of transaction hashes, in the order they were executed within the block.
readonly string
[]
The list of transaction hashes.
Get the extended transaction at index
within this block.
Parameter | Type | Description |
---|---|---|
indexOrHash | string | number | The index or hash of the extended transaction. |
Promise
<ExternalTransactionResponse
>
A promise resolving to the extended transaction.
If the extended transaction is not found.
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.
Parameter | Type | Description |
---|---|---|
indexOrHash | string | number | The index or hash of the transaction. |
The transaction.
Block
.getPrefetchedTransaction
If the transaction is not found.
Get the transaction at index
within this block.
Parameter | Type | Description |
---|---|---|
indexOrHash | string | number | The index or hash of the transaction. |
Promise
<TransactionResponse
| ExternalTransactionResponse
>
A promise resolving to the transaction.
If the transaction is not found.
Returns true if this block been mined. This provides a type guard for all properties on a MinedBlock.
this is MinedBlock
True if the block has been mined.
Returns a JSON-friendly value.
The JSON-friendly value.