Class Utils


  • public class Utils
    extends Object
    • Constructor Detail

      • Utils

        public Utils()
    • Method Detail

      • createDryrun

        public static DryrunRequest createDryrun​(AlgodClient client,
                                                 List<SignedTransaction> txns)
                                          throws Exception
        Construct a DryrunRequest object from a set of transactions. A DryrunRequest is composed of static balance information. This function uses the ApplicationCall transaction parameters to infer what Application State and Account balance information to query using the client and adds it to the DryrunRequest object. If foreign assets are passed, it will also add the creators balance information to the DryrunRequest.
        Parameters:
        client - an Algod v2 client
        txns - the array of SignedTransactions that should be used to generate the DryrunRequest
        Returns:
        DryrunRequest to be submitted to TealDryrun endpoint
        Throws:
        Exception - if transaction is rejected or the transaction is not confirmed before wait round
      • createDryrun

        public static DryrunRequest createDryrun​(AlgodClient client,
                                                 List<SignedTransaction> txns,
                                                 String protocol_version,
                                                 Long latest_timestamp,
                                                 Long round)
                                          throws Exception
        Construct a DryrunRequest object from a set of transactions. A DryrunRequest is composed of static balance information. This function uses the ApplicationCall transaction parameters to infer what Application State and Account balance information to query using the client and adds it to the DryrunRequest object. If foreign assets are passed, it will also add the creators balance information to the DryrunRequest.
        Parameters:
        client - an Algod v2 client
        txns - the array of SignedTransactions that should be used to generate the DryrunRequest
        protocol_version - The protocol version the dryrun should include
        latest_timestamp - The latest timestamp the dryrun should include
        round - The agreement round or block height the dryrun should include
        Returns:
        DryrunRequest to be submitted to TealDryrun endpoint
        Throws:
        Exception - if transaction is rejected or the transaction is not confirmed before wait round
      • waitForConfirmation

        public static PendingTransactionResponse waitForConfirmation​(AlgodClient client,
                                                                     String txID,
                                                                     int waitRounds)
                                                              throws Exception
        Wait until a transaction has been confirmed or rejected by the network or wait until waitRound fully elapsed
        Parameters:
        client - an Algod v2 client
        txID - the transaction ID that we are waiting
        waitRounds - The maximum number of rounds to wait for.
        Returns:
        TransactionResponse of the confirmed transaction
        Throws:
        Exception - if transaction is rejected or the transaction is not confirmed before wait round