Class SignedTransactionBuilder


  • public final class SignedTransactionBuilder
    extends Object
    A convenience class for building an Aion transaction and signing it locally (offline) using a private key.

    In general, if a specific method is invoked multiple times before building the transaction, then the last invocation takes precedence.

    The builder can be used to construct additional transactions after each build, and the previous build settings will apply.

    The builder provides a reset method that will clear the build back to its initial state.

    The sender of the transaction will be the Aion account that corresponds to the provided private key.

    • Constructor Detail

      • SignedTransactionBuilder

        public SignedTransactionBuilder()
    • Method Detail

      • privateKey

        public SignedTransactionBuilder privateKey​(String privateKey)
        The private key used to sign the transaction with. This field must be set.
        Parameters:
        privateKey - The private key.
        Returns:
        this builder.
      • destination

        public SignedTransactionBuilder destination​(String destination)
        The destination address of the transaction. This field must be set.
        Parameters:
        destination - The destination.
        Returns:
        this builder.
      • value

        public SignedTransactionBuilder value​(BigInteger value)
        The amount of value to transfer from the sender to the destination.
        Parameters:
        value - The amount of value to transfer.
        Returns:
        this builder.
      • senderNonce

        public SignedTransactionBuilder senderNonce​(BigInteger nonce)
        The nonce of the sender. This field must be set.
        Parameters:
        nonce - The sender nonce.
        Returns:
        this builder.
      • energyLimit

        public SignedTransactionBuilder energyLimit​(long limit)
        The energy limit of the transaction. This field must be set.
        Parameters:
        limit - The energy limit.
        Returns:
        this builder.
      • energyPrice

        public SignedTransactionBuilder energyPrice​(long price)
        The energy price of the transaction.
        Parameters:
        price - The energy price.
        Returns:
        this builder.
      • useAvmTransactionType

        public SignedTransactionBuilder useAvmTransactionType()
        Sets the transaction type to be the type used by the AVM.
        Returns:
        this builder.
      • reset

        public void reset()
        Resets the builder so that it is in its initial state.

        The state of the builder after a call to this method is the same as the state of a newly constructed builder.