Package org.web3j.tx

Class ManagedTransaction

  • Direct Known Subclasses:
    Contract, Transfer

    public abstract class ManagedTransaction
    extends java.lang.Object
    Generic transaction manager.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String call​(java.lang.String to, java.lang.String data, DefaultBlockParameter defaultBlockParameter)  
      long getSyncThreshold()
      This should only be used in case you need to get the EnsResolver.getSyncThreshold() parameter, which dictates the threshold in milliseconds since the last processed block timestamp should be to considered in sync the blockchain.
      java.math.BigInteger requestCurrentGasPrice()
      Return the current gas price from the ethereum node.
      protected TransactionReceipt send​(java.lang.String to, java.lang.String data, java.math.BigInteger value, java.math.BigInteger gasPrice, java.math.BigInteger gasLimit)  
      protected TransactionReceipt send​(java.lang.String to, java.lang.String data, java.math.BigInteger value, java.math.BigInteger gasPrice, java.math.BigInteger gasLimit, boolean constructor)  
      protected TransactionReceipt sendEIP1559​(java.lang.String to, java.lang.String data, java.math.BigInteger value, java.math.BigInteger gasLimit, java.math.BigInteger gasPremium, java.math.BigInteger feeCap)  
      void setSyncThreshold​(long syncThreshold)
      This should only be used in case you need to modify the EnsResolver.getSyncThreshold() parameter, which dictates the threshold in milliseconds since the last processed block timestamp should be to considered in sync the blockchain.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • GAS_PRICE

        public static final java.math.BigInteger GAS_PRICE
        Deprecated.
        use ContractGasProvider
        See Also:
        DefaultGasProvider
      • web3j

        protected Web3j web3j
    • Method Detail

      • getSyncThreshold

        public long getSyncThreshold()
        This should only be used in case you need to get the EnsResolver.getSyncThreshold() parameter, which dictates the threshold in milliseconds since the last processed block timestamp should be to considered in sync the blockchain.

        It is currently experimental and only used in ENS name resolution, but will probably be made available for read calls in the future.

        Returns:
        sync threshold value in milliseconds
      • setSyncThreshold

        public void setSyncThreshold​(long syncThreshold)
        This should only be used in case you need to modify the EnsResolver.getSyncThreshold() parameter, which dictates the threshold in milliseconds since the last processed block timestamp should be to considered in sync the blockchain.

        It is currently experimental and only used in ENS name resolution, but will probably be made available for read calls in the future.

        Parameters:
        syncThreshold - the sync threshold in milliseconds
      • requestCurrentGasPrice

        public java.math.BigInteger requestCurrentGasPrice()
                                                    throws java.io.IOException
        Return the current gas price from the ethereum node.

        Note: this method was previously called getGasPrice but was renamed to distinguish it when a bean accessor method on Contract was added with that name. If you have a Contract subclass that is calling this method (unlikely since those classes are usually generated and until very recently those generated subclasses were marked final), then you will need to change your code to call this method instead, if you want the dynamic behavior.

        Returns:
        the current gas price, determined dynamically at invocation
        Throws:
        java.io.IOException - if there's a problem communicating with the ethereum node
      • sendEIP1559

        protected TransactionReceipt sendEIP1559​(java.lang.String to,
                                                 java.lang.String data,
                                                 java.math.BigInteger value,
                                                 java.math.BigInteger gasLimit,
                                                 java.math.BigInteger gasPremium,
                                                 java.math.BigInteger feeCap)
                                          throws java.io.IOException,
                                                 TransactionException
        Throws:
        java.io.IOException
        TransactionException
      • send

        protected TransactionReceipt send​(java.lang.String to,
                                          java.lang.String data,
                                          java.math.BigInteger value,
                                          java.math.BigInteger gasPrice,
                                          java.math.BigInteger gasLimit,
                                          boolean constructor)
                                   throws java.io.IOException,
                                          TransactionException
        Throws:
        java.io.IOException
        TransactionException
      • call

        protected java.lang.String call​(java.lang.String to,
                                        java.lang.String data,
                                        DefaultBlockParameter defaultBlockParameter)
                                 throws java.io.IOException
        Throws:
        java.io.IOException