Skip to main content
Version: Next

tx.txbuilder.usescriptsubstitutions

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

TxBuilder.useScriptSubstitutions() method

Sets script substitutions for evaluation. During script evaluation, the substitute scripts will be used in place of the original scripts (identified by hash), while the transaction structure remains unchanged.

This is useful for A/B testing scripts, providing trace-enabled scripts for debugging, or testing script upgrades against existing transactions.

Signature:

useScriptSubstitutions(subs: Map<ScriptHash, Script>): TxBuilder;

Parameters

Parameter

Type

Description

subs

Map<ScriptHash, Script>

A map from original script hashes to substitute scripts.

Returns:

TxBuilder

{TxBuilder} The same transaction builder