Class CryptoJDK.Transaction.Ethereum

java.lang.Object
com.barbantfintech.tools.common.cryptojdk.CryptoJDK.Transaction.Ethereum
Enclosing class:
CryptoJDK.Transaction

public static class CryptoJDK.Transaction.Ethereum extends Object
Utility class for creating signed transactions for the Ethereum blockchain. Provides methods to prepare Ethereum transactions by specifying details such as from and to addresses, amount, nonce, and gas price.
  • Constructor Details

    • Ethereum

      public Ethereum()
  • Method Details

    • generate

      public static String generate(@NonNull @NonNull Network network, @NonNull @NonNull String fromPrivateKey, @NonNull @NonNull String toAddress, @NonNull @NonNull BigDecimal amount, @NonNull Coin coin, @NonNull @NonNull BigInteger nonce, @NonNull @NonNull BigInteger gasPriceInETHWei, @NonNull @NonNull BigInteger gasLimitInUnits) throws CryptoJDKException
      Prepares a signed transaction ready for broadcasting on the Ethereum network.
      Parameters:
      network - The Ethereum network where the transaction is to be broadcast (e.g., Mainnet, Ropsten).
      fromPrivateKey - The private key of the sender's address.
      toAddress - The address to which the funds will be sent.
      amount - The amount to be sent, in full units (e.g., 1.123456789012345678 ETH).
      coin - The coin type being sent (e.g., ETH).
      nonce - The transaction nonce.
      gasPriceInETHWei - The gas price in wei (e.g., 150 wei, equivalent to 0.000000000000000150 ETH).
      gasLimitInUnits - The gas limit for the transaction (e.g., 21000 units for a standard ETH transaction).
      Returns:
      A string representing the signed transaction ready to be broadcast.
      Throws:
      CryptoJDKException - if an error occurs during the signing process.