deployGenesis
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
The signer used to sign the transaction
provider
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:
- Creates a genesis transaction from the first available UTXO
- Builds and signs the contract deployment PSBT
- Broadcasts the transaction and updates UTXO state
- Returns the finalized PSBT and contract instance