algokit_utils.transactions.transaction_composer
algokit_utils.transactions.transaction_composer
Section titled “algokit_utils.transactions.transaction_composer”Attributes
Section titled “Attributes”AppMethodCallTransactionArgument | |
|---|---|
ErrorTransformer |
Exceptions
Section titled “Exceptions”ErrorTransformerError | Raised when an error transformer throws. |
|---|---|
InvalidErrorTransformerValueError | Raised when an error transformer returns a non-error value. |
TransactionComposerError | Error raised when transaction composer fails to send transactions. |
Classes
Section titled “Classes”TransactionComposerConfig | |
|---|---|
TransactionComposerParams | |
TransactionWithSigner | |
BuiltTransactions | |
SendTransactionComposerResults | |
TransactionComposer | Light-weight transaction composer built on top of algokit_transact. |
Module Contents
Section titled “Module Contents”AppMethodCallTransactionArgument
Section titled “AppMethodCallTransactionArgument”exception ErrorTransformerError
Section titled “exception ErrorTransformerError”Bases: RuntimeError
Raised when an error transformer throws.
ErrorTransformer
Section titled “ErrorTransformer”exception InvalidErrorTransformerValueError(original_error: Exception, value: object)
Section titled “exception InvalidErrorTransformerValueError(original_error: Exception, value: object)”Bases: RuntimeError
Raised when an error transformer returns a non-error value.
exception TransactionComposerError(message: str, *, cause: Exception | None = None, traces: list[SimulateTransactionResult] | None = None, sent_transactions: list[Transaction] | None = None, simulate_response: SimulateResponse | None = None)
Section titled “exception TransactionComposerError(message: str, *, cause: Exception | None = None, traces: list[SimulateTransactionResult] | None = None, sent_transactions: list[Transaction] | None = None, simulate_response: SimulateResponse | None = None)”Bases: RuntimeError
Error raised when transaction composer fails to send transactions.
Contains detailed debugging information including simulation traces and sent transactions.
traces = None
Section titled “traces = None”sent_transactions = None
Section titled “sent_transactions = None”simulate_response = None
Section titled “simulate_response = None”class TransactionComposerConfig
Section titled “class TransactionComposerConfig”cover_app_call_inner_transaction_fees : bool = False
Section titled “cover_app_call_inner_transaction_fees : bool = False”populate_app_call_resources : bool = True
Section titled “populate_app_call_resources : bool = True”class TransactionComposerParams
Section titled “class TransactionComposerParams”algod : AlgodClient
Section titled “algod : AlgodClient”get_signer : Callable[[str], TransactionSigner]
Section titled “get_signer : Callable[[str], TransactionSigner]”get_suggested_params : Callable[[], SuggestedParams] | None = None
Section titled “get_suggested_params : Callable[[], SuggestedParams] | None = None”default_validity_window : int | None = None
Section titled “default_validity_window : int | None = None”app_manager : AppManager | None = None
Section titled “app_manager : AppManager | None = None”error_transformers : list[ErrorTransformer] | None = None
Section titled “error_transformers : list[ErrorTransformer] | None = None”composer_config : TransactionComposerConfig | None = None
Section titled “composer_config : TransactionComposerConfig | None = None”class TransactionWithSigner
Section titled “class TransactionWithSigner”txn : Transaction
Section titled “txn : Transaction”signer : TransactionSigner
Section titled “signer : TransactionSigner”method : ABIMethod | None = None
Section titled “method : ABIMethod | None = None”class BuiltTransactions
Section titled “class BuiltTransactions”transactions : list[Transaction]
Section titled “transactions : list[Transaction]”method_calls : dict[int, ABIMethod]
Section titled “method_calls : dict[int, ABIMethod]”signers : dict[int, TransactionSigner]
Section titled “signers : dict[int, TransactionSigner]”class SendTransactionComposerResults
Section titled “class SendTransactionComposerResults”tx_ids : list[str]
Section titled “tx_ids : list[str]”transactions : list[Transaction]
Section titled “transactions : list[Transaction]”confirmations : list[PendingTransactionResponse]
Section titled “confirmations : list[PendingTransactionResponse]”returns : list[ABIReturn]
Section titled “returns : list[ABIReturn]”group_id : str | None = None
Section titled “group_id : str | None = None”simulate_response : SimulateResponse | None = None
Section titled “simulate_response : SimulateResponse | None = None”class TransactionComposer(params: TransactionComposerParams)
Section titled “class TransactionComposer(params: TransactionComposerParams)”Light-weight transaction composer built on top of algokit_transact.
clone(composer_config: TransactionComposerConfig | None = None) → TransactionComposer
Section titled “clone(composer_config: TransactionComposerConfig | None = None) → TransactionComposer”Create a shallow copy of this composer, optionally overriding config flags.
register_error_transformer(transformer: ErrorTransformer) → TransactionComposer
Section titled “register_error_transformer(transformer: ErrorTransformer) → TransactionComposer”add_transaction(txn: Transaction, signer: TransactionSigner | None = None) → TransactionComposer
Section titled “add_transaction(txn: Transaction, signer: TransactionSigner | None = None) → TransactionComposer”add_payment(params: PaymentParams) → TransactionComposer
Section titled “add_payment(params: PaymentParams) → TransactionComposer”add_asset_create(params: AssetCreateParams) → TransactionComposer
Section titled “add_asset_create(params: AssetCreateParams) → TransactionComposer”add_asset_config(params: AssetConfigParams) → TransactionComposer
Section titled “add_asset_config(params: AssetConfigParams) → TransactionComposer”add_asset_freeze(params: AssetFreezeParams) → TransactionComposer
Section titled “add_asset_freeze(params: AssetFreezeParams) → TransactionComposer”add_asset_destroy(params: AssetDestroyParams) → TransactionComposer
Section titled “add_asset_destroy(params: AssetDestroyParams) → TransactionComposer”add_asset_transfer(params: AssetTransferParams) → TransactionComposer
Section titled “add_asset_transfer(params: AssetTransferParams) → TransactionComposer”add_asset_opt_in(params: AssetOptInParams) → TransactionComposer
Section titled “add_asset_opt_in(params: AssetOptInParams) → TransactionComposer”add_asset_opt_out(params: AssetOptOutParams) → TransactionComposer
Section titled “add_asset_opt_out(params: AssetOptOutParams) → TransactionComposer”add_app_create(params: AppCreateParams) → TransactionComposer
Section titled “add_app_create(params: AppCreateParams) → TransactionComposer”add_app_update(params: AppUpdateParams) → TransactionComposer
Section titled “add_app_update(params: AppUpdateParams) → TransactionComposer”add_app_delete(params: AppDeleteParams) → TransactionComposer
Section titled “add_app_delete(params: AppDeleteParams) → TransactionComposer”add_app_call(params: AppCallParams) → TransactionComposer
Section titled “add_app_call(params: AppCallParams) → TransactionComposer”add_app_create_method_call(params: AppCreateMethodCallParams) → TransactionComposer
Section titled “add_app_create_method_call(params: AppCreateMethodCallParams) → TransactionComposer”add_app_update_method_call(params: AppUpdateMethodCallParams) → TransactionComposer
Section titled “add_app_update_method_call(params: AppUpdateMethodCallParams) → TransactionComposer”add_app_delete_method_call(params: AppDeleteMethodCallParams) → TransactionComposer
Section titled “add_app_delete_method_call(params: AppDeleteMethodCallParams) → TransactionComposer”add_app_call_method_call(params: AppCallMethodCallParams) → TransactionComposer
Section titled “add_app_call_method_call(params: AppCallMethodCallParams) → TransactionComposer”add_online_key_registration(params: OnlineKeyRegistrationParams) → TransactionComposer
Section titled “add_online_key_registration(params: OnlineKeyRegistrationParams) → TransactionComposer”add_offline_key_registration(params: OfflineKeyRegistrationParams) → TransactionComposer
Section titled “add_offline_key_registration(params: OfflineKeyRegistrationParams) → TransactionComposer”count() → int
Section titled “count() → int”static arc2_note(note: Arc2TransactionNote) → bytes
Section titled “static arc2_note(note: Arc2TransactionNote) → bytes”add_transaction_composer(composer: TransactionComposer) → TransactionComposer
Section titled “add_transaction_composer(composer: TransactionComposer) → TransactionComposer”Build transactions with grouping, resource population, and fee adjustments applied.
build_transactions() → BuiltTransactions
Section titled “build_transactions() → BuiltTransactions”Build queued transactions without resource population or grouping.
Returns raw transactions, method call metadata, and any explicit signers. This does not populate unnamed resources or adjust fees, and it leaves grouping unchanged.
gather_signatures() → list[bytes]
Section titled “gather_signatures() → list[bytes]”send(params: SendParams | None = None) → SendTransactionComposerResults
Section titled “send(params: SendParams | None = None) → SendTransactionComposerResults”Compose the transaction group and send it to the network.
simulate(*, skip_signatures: bool = False, result_on_failure: bool = False, **raw_options: Any) → SendTransactionComposerResults
Section titled “simulate(*, skip_signatures: bool = False, result_on_failure: bool = False, **raw_options: Any) → SendTransactionComposerResults”Compose the transaction group and simulate execution without submitting to the network.
Args:
: skip_signatures: Whether to skip signatures for all built transactions and use an empty signer instead.
: This will set allow_empty_signatures and fix_signers when sending the request to algod.
result_on_failure: Whether to return the result on simulation failure instead of throwing an error.
: Defaults to False (throws on failure).
**raw_options: Additional options to pass to the simulate request.
Returns: : SendTransactionComposerResults containing simulation results.
set_max_fees(max_fees: dict[int, AlgoAmount]) → TransactionComposer
Section titled “set_max_fees(max_fees: dict[int, AlgoAmount]) → TransactionComposer”Override max_fee for queued transactions by index before building.