sdk.txbuilder.complete
Home > @blaze-cardano/sdk > 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(params?: UseCoinSelectionArgs): Promise<Transaction>;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| params | UseCoinSelectionArgs | (Optional) | 
Returns:
Promise<Transaction>
{Promise
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.