Skip to main content

deployGenesis

@opcat-labs/scrypt-ts-opcat v1.0.4


@opcat-labs/scrypt-ts-opcat / deployGenesis

Function: deployGenesis()

deployGenesis\<Contract>(signer, provider, createContract, satoshis): Promise\<{ contract: Contract; psbt: ExtPsbt; }>

Defined in: packages/scrypt-ts-opcat/src/features/deployGenesis.ts:26

Deploys a smart contract, which can be traced back to genesis, to the blockchain

Type Parameters​

• Contract extends SmartContract\<StructObject>

Parameters​

signer​

Signer

The signer used to sign the transaction

provider​

UtxoProvider & ChainProvider

The provider for chain and UTXO data

createContract​

(genesisOutpoint) => Contract

Factory function to create the contract instance with genesis outpoint

satoshis​

number = 1

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

Returns​

Promise\<{ contract: Contract; psbt: ExtPsbt; }>

Promise resolving to the PSBT and deployed contract instance

Remarks​

This function:

  1. Creates a genesis transaction from the first available UTXO
  2. Builds and signs the contract deployment PSBT
  3. Broadcasts the transaction and updates UTXO state
  4. Returns the finalized PSBT and contract instance