feat: add bllockTimestamp under RPCTransaction suite

This commit is contained in:
jeevan-sid 2026-01-29 12:37:23 +05:30
parent 424bc22ab8
commit bdbd62b3da

View file

@ -974,6 +974,7 @@ func RPCMarshalBlock(block *types.Block, inclTx bool, fullTx bool, config *param
type RPCTransaction struct {
BlockHash *common.Hash `json:"blockHash"`
BlockNumber *hexutil.Big `json:"blockNumber"`
BlockTimestamp *hexutil.Uint64 `json:"blockTimestamp"`
From common.Address `json:"from"`
Gas hexutil.Uint64 `json:"gas"`
GasPrice *hexutil.Big `json:"gasPrice"`
@ -1020,6 +1021,7 @@ func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber
if blockHash != (common.Hash{}) {
result.BlockHash = &blockHash
result.BlockNumber = (*hexutil.Big)(new(big.Int).SetUint64(blockNumber))
result.BlockTimestamp = (*hexutil.Uint64)(&blockTime)
result.TransactionIndex = (*hexutil.Uint64)(&index)
}