code: func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber uint64, index uint64) *RPCTransaction {
  	var signer types.Signer = types.FrontierSigner{}
  	if tx.Protected() {
  		signer = types.NewEIP155Signer(tx.ChainId())
  	}
  	from, _ := types.Sender(signer, tx)
  	v, r, s := tx.RawSignatureValues()
  
  	result := &RPCTransaction{
  		From:     from,
  		Gas:      hexutil.Uint64(tx.Gas()),
  		GasPrice: (*hexutil.Big)(tx.GasPrice()),
  		Hash:     tx.Hash(),
  		Input:    hexutil.Bytes(tx.Data()),
  		Nonce:    hexutil.Uint64(tx.Nonce()),
  		To:       tx.To(),
  		Value:    (*hexutil.Big)(tx.Value()),
  		V:        (*hexutil.Big)(v),
  		R:        (*hexutil.Big)(r),
  		S:        (*hexutil.Big)(s),
  	}
  	if blockHash != (common.Hash{}) {
  		result.BlockHash = blockHash
  		result.BlockNumber = (*hexutil.Big)(new(big.Int).SetUint64(blockNumber))
  		result.TransactionIndex = hexutil.Uint(index)
  	}
  	return result
  }
docs: // newRPCTransaction returns a transaction that will serialize to the RPC
  // representation, with the given location metadata set (if available).