Can I get the time stamp on when a transaction was added to the mempool and when it was successfully added to a block?
Is there an API to do this?
You cannot get a timestamp for the transaction when it was added to the mempool because transactions do not have a concept of time, only blockNumber
. While in the mempool, the transaction's blockNumber
parameter is None
.
Once a miner has included a transaction into a block, the transaction will update with the appropriate blockNumber
that it was included in. That block also has a timestamp associated with it, so you can now get a time that the transaction was included in the blockchain.