Skip to main content

deploy

scrypt-ts-opcat v1.0.1


scrypt-ts-opcat / deploy

Function: deploy()

deploy(signer, provider, contract, satoshis): Promise\<ExtPsbt>

Defined in: packages/scrypt-ts-opcat/src/features/deploy.ts:24

Deploys a smart contract to the blockchain.

Parameters

signer

Signer

The signer used to sign the transaction

provider

UtxoProvider & ChainProvider

The provider for UTXO and chain operations

contract

SmartContract\<StructObject>

The smart contract instance to deploy

satoshis

number = 1

The amount of satoshis to lock in the contract (default: 1)

Returns

Promise\<ExtPsbt>

The finalized PSBT containing the deployment transaction

Remarks

This function handles the complete deployment flow:

  1. Collects UTXOs from the signer's address
  2. Creates and signs a PSBT with contract deployment output
  3. Broadcasts the transaction
  4. Manages UTXO updates (spent UTXOs and change)