Package org.web3j.crypto
Class TransactionUtils
java.lang.Object
org.web3j.crypto.TransactionUtils
Transaction utility functions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longderiveChainId(long v) Utility method to derive chain id from v parameterstatic byte[]generateTransactionHash(RawTransaction rawTransaction, byte chainId, Credentials credentials) Utility method to provide the transaction hash for a given transaction.static byte[]generateTransactionHash(RawTransaction rawTransaction, Credentials credentials) Utility method to provide the transaction hash for a given transaction.static StringgenerateTransactionHashHexEncoded(RawTransaction rawTransaction, byte chainId, Credentials credentials) Utility method to provide the transaction hash for a given transaction.static StringgenerateTransactionHashHexEncoded(RawTransaction rawTransaction, Credentials credentials) Utility method to provide the transaction hash for a given transaction.
-
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 sendcredentials- 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 sendchainId- of the intended chaincredentials- 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 sendcredentials- 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 sendchainId- of the intended chaincredentials- 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
-