Package com.algorand.algosdk.v2.client
Class Utils
- java.lang.Object
-
- com.algorand.algosdk.v2.client.Utils
-
public class Utils extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Utils.StackPrinterConfig
StackPrinterConfig contains configuration parameters for printing the trace from a DryrunTxnResult.
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
appTrace(DryrunTxnResult dtr)
static String
appTrace(DryrunTxnResult dtr, Utils.StackPrinterConfig spc)
static DryrunRequest
createDryrun(AlgodClient client, List<SignedTransaction> txns)
Construct a DryrunRequest object from a set of transactions.static DryrunRequest
createDryrun(AlgodClient client, List<SignedTransaction> txns, String protocol_version, Long latest_timestamp, Long round)
Construct a DryrunRequest object from a set of transactions.static String
lsigTrace(DryrunTxnResult dtr)
static String
lsigTrace(DryrunTxnResult dtr, Utils.StackPrinterConfig spc)
static PendingTransactionResponse
waitForConfirmation(AlgodClient client, String txID, int waitRounds)
Wait until a transaction has been confirmed or rejected by the network or wait until waitRound fully elapsed
-
-
-
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 clienttxns
- 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 clienttxns
- the array of SignedTransactions that should be used to generate the DryrunRequestprotocol_version
- The protocol version the dryrun should includelatest_timestamp
- The latest timestamp the dryrun should includeround
- 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
-
appTrace
public static String appTrace(DryrunTxnResult dtr)
-
appTrace
public static String appTrace(DryrunTxnResult dtr, Utils.StackPrinterConfig spc)
-
lsigTrace
public static String lsigTrace(DryrunTxnResult dtr)
-
lsigTrace
public static String lsigTrace(DryrunTxnResult dtr, Utils.StackPrinterConfig spc)
-
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 clienttxID
- the transaction ID that we are waitingwaitRounds
- 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
-
-