Transaction management
Transaction management is one of the core capabilities provided by AlgoKit Utils. It allows you to construct, simulate and send single, or grouped transactions with consistent and highly configurable semantics, including configurable control of transaction notes, logging, fees, multiple sender account types, and sending behaviour.
ConfirmedTransactionResult
All AlgoKit Utils functions that send a transaction will generally return a variant of the ConfirmedTransactionResult interface or some superset of that. This provides a consistent mechanism to interpret the results of a transaction send.
It consists of two properties:
transaction: Analgosdk.Transactionobject that is either ready to send or represents the transaction that was sentconfirmation: Analgosdk.modelsv2.PendingTransactionResponseobject, which is a type-safe wrapper of the return from the algod pending transaction API noting that it will only be returned if the transaction was able to be confirmed (so won’t represent a “pending” transaction)
There are various variations of the ConfirmedTransactionResult that are exposed by various functions within AlgoKit Utils, including:
ConfirmedTransactionResults- Where it’s both guaranteed that a confirmation will be returned, there is a primary driving transaction, but multiple transactions may be sent (e.g. when making an ABI app call which has dependant transactions)SendTransactionResults- Where multiple transactions are being sent (transactionsandconfirmationsare arrays that replace the singulartransactionandconfirmation)SendAtomicTransactionComposerResults- The result from sending the transactions within anAtomicTransactionComposer, it extendsSendTransactionResultsand adds a few other useful propertiesAppCallTransactionResult- Result from calling a single app call (which potentially may result in multiple other transaction calls if it was an ABI method with dependant transactions)
Further reading
To understand how to create, simulate and send transactions consult the AlgorandClient and TransactionComposer documentation.