Expand description
Script template trait and types.
This module provides the ScriptTemplate trait for creating reusable script patterns,
and the ScriptTemplateUnlock type for generating unlocking scripts.
§Example
ⓘ
use bsv_rs::script::templates::P2PKH;
use bsv_rs::script::template::ScriptTemplate;
let template = P2PKH::new();
let locking_script = template.lock(&pubkey_hash)?;Re-exports§
pub use crate::script::Script;
Structs§
- Script
Template Unlock - Return type for template unlock methods.
- Signing
Context - Context for signing a transaction input.
Enums§
- Sign
Outputs - Specifies which outputs to sign in a transaction signature.
Traits§
- Script
Template - A trait for reusable script patterns.
Functions§
- build_
p2pkh_ unlocking_ script - Helper function to build an unlocking script from signature and public key.
- compute_
sighash_ scope - Computes the sighash scope byte from options.
- create_
transaction_ signature - Helper function to create a transaction signature.