-
According to the docs, a TransactionResponse object has a timestamp property that is non-null if the block has been mined. For me, the timestamp is null even if the block has been mined. Here is some code where I'm using Infura as a provider:
Shouldn't |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
But there can be some non-standard backends who do give timestamp, so in that case, it may helpful to include timestamp in |
Beta Was this translation helpful? Give feedback.
provider.getTransaction
useseth_getTransactionByHash
under the hood. And from the specs, a standard ethereum node doesn't give you a timestamp. Here if you need the timestamp you have to do another query to fetch the blockprovider.getBlock(blockNumber)
and get the timestamp from there.But there can be some non-standard backends who do give timestamp, so in that case, it may helpful to include timestamp in
TransactionResponse
and we need to update the docs about this.