Skip to main content
Version: Next

tx.txbuilder.addrequiredtoplevelguard

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

TxBuilder.addRequiredTopLevelGuard() method​

Requires the top-level transaction of any batch carrying this sub-transaction to list credential among its guards (CIP-0118 required_top_level_guards), with data as the argument for a script guard. Sub-transactions only; refuses it.

Signature:

addRequiredTopLevelGuard(credential: Credential, data?: PlutusData): TxBuilder;

Parameters​

Parameter

Type

Description

credential

Credential

The guard the top-level transaction must carry.

data

PlutusData

(Optional) The argument for a script guard.

Returns:

TxBuilder

{TxBuilder} The same transaction builder. CIP-0118 is not live on mainnet; this API may change.