Skip to main content
Version: 0.13.0

tx.txbuilder.complete

Home > @blaze-cardano/tx > TxBuilder > complete

TxBuilder.complete() method

Completes the transaction by performing several key operations: - Verifies the presence of a change address. - Gathers inputs and performs coin selection if necessary. - Balances the change output. - Builds the transaction witness set. - Calculates the script data hash. - Estimates and sets the transaction fee. - Merges the fee value with the excess value and rebalances the change.

Signature:

complete({ useCoinSelection }?: UseCoinSelectionArgs): Promise<Transaction>;

Parameters

Parameter

Type

Description

{ useCoinSelection }

UseCoinSelectionArgs

(Optional)

Returns:

Promise<Transaction>

{Promise} A new Transaction object with all components set and ready for submission.

Exceptions

{Error} If the change address is not set, or if the coin selection fails to eliminate negative values, or if balancing the change output fails.