참고: 이 페이지는 아직 한국어로 번역되지 않았습니다. 아래는 영어 원문입니다.A Block represents the data associated with a full block on Ethereum.
Extended by
Implements
BlockParams
Iterable
<string
>
Constructors
new Block()
Parameters
Parameter | Type | Description |
---|---|---|
block | BlockParams | The block parameters. |
provider | Provider | The provider. |
Returns
Block
Source
providers/provider.ts:627Properties
Property | Modifier | Type | Description |
---|---|---|---|
provider | readonly | Provider | The provider connected to the block used to fetch additional details if necessary. |
Accessors
date
Returns
null
| Date
The date this block was included at, or null if the timestamp is not available.
Source
providers/provider.ts:826length
Returns
number
The number of transactions.
Source
providers/provider.ts:816outboundEtxs
Returns
readonlystring
[]
The list of extended transaction hashes.
Source
providers/provider.ts:689prefetchedExtTransactions
true
to prefetchTxs
into
getBlock.
Throws
If the transactions were not prefetched.Returns
ExternalTransactionResponse
[]
The list of prefetched extended transactions.
Source
providers/provider.ts:737prefetchedTransactions
true
to prefetchTxs
into
getBlock.
Throws
If the transactions were not prefetched.Returns
TransactionResponse
[]
The list of prefetched transactions.
Source
providers/provider.ts:707transactions
Returns
readonlystring
[]
The list of transaction hashes.
Source
providers/provider.ts:675Methods
getExtTransaction()
index
within this block.
Parameters
Parameter | Type | Description |
---|---|---|
indexOrHash | string | number | The index or hash of the extended transaction. |
Returns
Promise
<ExternalTransactionResponse
>
A promise resolving to the extended transaction.
Throws
If the extended transaction is not found.Source
providers/provider.ts:883getPrefetchedTransaction()
Parameters
Parameter | Type | Description |
---|---|---|
indexOrHash | string | number | The index or hash of the transaction. |
Returns
TransactionResponse
The transaction.
Throws
If the transaction is not found.Source
providers/provider.ts:927getTransaction()
index
within this block.
Parameters
Parameter | Type | Description |
---|---|---|
indexOrHash | string | number | The index or hash of the transaction. |
Returns
Promise
<TransactionResponse
| ExternalTransactionResponse
>
A promise resolving to the transaction.
Throws
If the transaction is not found.Source
providers/provider.ts:842isMined()
Returns
this is MinedBlock
True if the block has been mined.
Source
providers/provider.ts:949toJSON()
Returns
BlockParams
The JSON-friendly value.