tx.txbuilder.deployscript
Home > @blaze-cardano/tx > 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} The same transaction builder.
Example
const myScript = Script.newPlutusV2Script(new PlutusV2Script("..."));
txBuilder.deployScript(myScript);
// or
txBuilder.deployScript(myScript, someAddress);