Class TransactionUtils

java.lang.Object
org.web3j.crypto.TransactionUtils

public class TransactionUtils extends Object
Transaction utility functions.
  • Constructor Details

    • TransactionUtils

      public TransactionUtils()
  • Method Details

    • generateTransactionHash

      public static byte[] generateTransactionHash(RawTransaction rawTransaction, Credentials credentials)
      Utility method to provide the transaction hash for a given transaction.
      Parameters:
      rawTransaction - we wish to send
      credentials - of the sender
      Returns:
      encoded transaction hash
    • generateTransactionHash

      public static byte[] generateTransactionHash(RawTransaction rawTransaction, byte chainId, Credentials credentials)
      Utility method to provide the transaction hash for a given transaction.
      Parameters:
      rawTransaction - we wish to send
      chainId - of the intended chain
      credentials - of the sender
      Returns:
      encoded transaction hash
    • generateTransactionHashHexEncoded

      public static String generateTransactionHashHexEncoded(RawTransaction rawTransaction, Credentials credentials)
      Utility method to provide the transaction hash for a given transaction.
      Parameters:
      rawTransaction - we wish to send
      credentials - of the sender
      Returns:
      transaction hash as a hex encoded string
    • generateTransactionHashHexEncoded

      public static String generateTransactionHashHexEncoded(RawTransaction rawTransaction, byte chainId, Credentials credentials)
      Utility method to provide the transaction hash for a given transaction.
      Parameters:
      rawTransaction - we wish to send
      chainId - of the intended chain
      credentials - of the sender
      Returns:
      transaction hash as a hex encoded string
    • deriveChainId

      public static long deriveChainId(long v)
      Utility method to derive chain id from v parameter
      Parameters:
      v - recovery identifier
      Returns:
      Chain id