Skip to main content
Version: Next

sdk.txbuilder.deployscript

Home > @blaze-cardano/sdk > TxBuilder > deployScript

TxBuilder.deployScript() method

Deploys a script by creating a new UTxO with the script as its reference.

Signature:

deployScript(script: Script, address?: Address): TxBuilder;

Parameters

Parameter

Type

Description

script

Script

The script to be deployed.

address

Address

(Optional) The address to lock the script to. Defaults to a burn address where the UTxO will be unspendable.

Returns:

TxBuilder

{TxBuilder} The same transaction builder.

Example

const myScript = Script.newPlutusV2Script(new PlutusV2Script("..."));
txBuilder.deployScript(myScript);
// or
txBuilder.deployScript(myScript, someAddress);