P2SH.fromScript constructor

P2SH.fromScript(
  1. Script script
)

Construct using an output script, not to be confused with the redeem script. For that use fromRedeemScript().

Implementation

P2SH.fromScript(this.script) {
  if (!template.match(script)) throw NoProgramMatch();
  _scriptHash = (script[1] as ScriptPushData).data;
}