for _, trans :=range block.Transactions() { fmt.Println(trans.Hash().Hex()) // get transaction hash fmt.Println(trans.Value().String()) // get transaction value chianID, err := client.ChainID(context.Background())if err !=nil{ fmt.Println(err) } msg, err := trans.AsMessage(types.NewEIP155Signer(chianID))if err !=nil{ fmt.Println(err) } else{ fmt.Println(msg.From().Hex()) // get from address } fmt.Println(trans.To().Hex()) // get to address}
Or get transaction details directly by transaction hash: