Skip to main content
Version: 0.13.0

tx.txbuilder.addprecompletehook

Home > @blaze-cardano/tx > 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

{TxBuilder} The same transaction builder instance for method chaining.