sdk.txbuilder.addprecompletehook
Home > @blaze-cardano/sdk > TxBuilder > addPreCompleteHook
TxBuilder.addPreCompleteHook() method
Adds a pre-complete hook to the transaction builder. This hook will be executed before the transaction is finalized.
Pre-complete hooks are useful for performing last-minute modifications or validations on the transaction before it's completed. Multiple hooks can be added, and they will be executed in the order they were added.
Signature:
addPreCompleteHook(hook: (tx: TxBuilder) => Promise<void>): TxBuilder;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| hook | (tx: TxBuilder) => Promise<void> | A function that takes the TxBuilder instance as an argument and performs some operation. The hook should be asynchronous. | 
Returns:
{TxBuilder} The same transaction builder instance for method chaining.